#解决sql in 函数长度超过1000引起的错误
<where>
<if test="实体类参数字段!=null and 实体类参数字段!=''">
and (数据库字段 in
<foreach collection="实体类参数字段.split(',')" item="item" index="index" open="(" close=")">
<if test="index > 0">
<choose>
<!-- 每1000个拆分出一个or -->
<when test="(index % 1000) == 999">) OR 数据库字段 in (</when>
<otherwise>,</otherwise>
</choose>
</if>
#{item}
</foreach>
)
</if>
<where>