<if test="newsIds != null and newsIds.size() > 0">
and (id in
<trim suffixOverrides=" OR id IN()"> <!-- 表示删除最后一个条件 -->
<foreach collection="newsIds" item="id" index="index" open="(" close=")">
<if test="index != 0">
<choose>
<when test="index % 1000 == 999">) OR id IN (</when>
<otherwise>,</otherwise>
</choose>
</if>
#{id}
</foreach>
</trim>
)
</if>
mybatis解决in超过1000的问题解决
最新推荐文章于 2024-03-11 14:21:56 发布