mybatis的oracle的in超过1000的写法

<if test="preIds != null and preIds.size() > 0">
AND PRE_ID IN
<trim suffixOverrides=" OR PRE_ID IN ()">
<foreach collection='preIds' open='(' close=')' index='index' item='item'>
<if test="index != 0">
<choose>
<when test="index % 1000 == 999">) OR PRE_ID IN (</when>
<otherwise>,</otherwise>
</choose>
</if>
#{item}
</foreach>
</trim>
</if>

posted on 2018-04-16 09:56  小甜瓜安东泥  阅读(1686)  评论(0编辑  收藏  举报