在前端拼接数据,直接在sql中使用 in ( + ids +)拼接字符串。
int update = ViewJDBC.update("update question set qview=? where qno in("+qnos+")",qview);
if(update>0){
return Message.success("权限修改成功");
}else{
return Message.fail("服务器繁忙,请稍后试试");
}
这里字符串的 in 不能使用 ? 代替,否则会导致错误。
成功或失败, 返回影响结果的条数。