mybatis 处理in 1000以上sql

发布时间 2023-06-14 18:53:09作者: HeavenTang

展开查看

点击查看代码
 update  T_XSGL_XSXX_XJXX xjxx set xjxx.XWZSBH = null, xjxx.ZHXGR = #{userId}, xjxx.ZHXGSJ = sysdate
        where exists(select 1 from T_BYGL_XSBYJG byjg where byjg.GDMC is null and byjg.XS_ID = xjxx.XS_ID )
        and
        ( xjxx.XS_ID in
        <foreach collection="studentIds" item="val" open="(" close=")" separator="," index="index">
            <if test="(index % 999) == 998"> #{val,jdbcType=VARCHAR} ) OR XS_ID in (</if>#{val,jdbcType=VARCHAR}
        </foreach>
        )