处理mysql中in条件大于1000条的问题

WHERE xsfnsrsbh IN
<foreach collection="param.nsrsbhList" index="index" item="nsrsbh" open="("  close=")">
         <if test="index >0 ">
            <choose>
               <when test="(index % 1000) == 999">
                  ) or xsfnsrsbh in (
               </when>
               <otherwise>,</otherwise>
            </choose>
         </if>
         #{nsrsbh}
</foreach>

 

posted @ 2023-11-06 13:06  yshy  阅读(275)  评论(0编辑  收藏  举报