解决mybatis in 查询 超过 一千的问题
原来代码:
<if test="sessionIdList!= null and sessionIdList.size > 0">
and a.robot_id in
<foreach collection="sessionIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
改动代码:
<if test="sessionIdList != null and sessionIdList.size > 0">
and a.session_id in
<foreach collection="sessionIdList" index="index" item="item" open="(" separator="," close=")">
<if test="(index % 999) == 998"> NULL ) OR a.session_id IN (</if>#{item}
</foreach>
</if>