MyBatis传入参数为数组、list的写法

<update id="disableUsers">
    UPDATE t_user
    SET disable_flag = #{disable}
    WHERE 1 = 1
    <if test="userIds != null and userIds.size > 0">
        AND id IN
        <foreach collection="item" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
    </if>
</update>

  

posted @ 2023-05-26 14:20  ZZZZZZa  阅读(90)  评论(0编辑  收藏  举报