1 关于批量更新中sql in的使用
updae ** set ** = ** where ** in ()
括号中的内容:
String字符串,例:String str = 1,2,3
使用方法: in (${str}) 这里注意需要使用$符号,#会报错,$会sql注入,杜绝使用
List集合,例:List<Long> list = new ArrayList<Long>;
list.add(1);
list.add(2);
list.add(3);
使用方法:<foreach collection="list" item="item" separator="," open="(" close=")" index="">
#{item,jdbcType=BIGINT}
</foreach>