oracle in 超过1000
拼接效果为 where ( id in ([0-999]) or id in ([1000-1999]) )
亲测好用
<where>
<if test="list != null and list.size > 0">
(id IN
<!-- 处理in的集合超过1000条时Oracle不支持的情况 -->
<trim suffixOverrides=" OR id IN()">
<foreach collection="list " 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>
)