前言
MyBatis查询in超1000解决方案
代码如下:
<if test="idList != null and idList.size != 0">
ID in
<foreach open="(" separator="," close=")" collection="idList" item="item" index="index">
<if test="index % 999 == 998 ">
NULL ) OR ID in (
</if>
#{item}
</foreach>
</if>
提示:NULL为占位符号,可根据自己实际情况替换为任意字符
END
提示: