mybatis for 循环 中oracle in 条件后 多余1000条处理

     select
            <include refid="WorkOrderSection_Column_List" />
        from swo_work_order_section
        where is_del = 0
        <if test="list != null and list.size > 0">
            AND  (start_code, finish_code) IN
            <foreach collection="list" item="item" index="index" open="(" close=")">
                <if test="index != 0">
                    <choose>
                        <when test="index % 1000 == 999"> ) OR (start_code, finish_code) IN ( </when>
                        <otherwise>,</otherwise>
                    </choose>
                </if>
                (
                #{item.startCode,jdbcType=VARCHAR},
                #{item.finishCode,jdbcType=VARCHAR}
                )
            </foreach>
        </if>

 

posted @ 2020-09-10 17:08  正宗老菜鸟  阅读(503)  评论(0编辑  收藏  举报