使用注解的方式实现批量操作 dao层 批量增加
代码语言:javascript复制@Insert("<script>"
"insert into tsturole (sid,rid) values "
"<foreach collection='集合' item='roles' separator=','> "
"#{字段},#{字段})"
"</foreach>"
"</script>")
public void saveUser(String[] roles);
批量删除
代码语言:javascript复制 @Delete("<script>"
"delete from tsturole where sid in "
"<foreach collection='集合' open='(' separator=',' close=')' item='ids'>"
" #{ids}"
"</foreach>"
"</script>")
public void del(String[] ids);