mybatis批量更新

  • A+
所属分类:mybatis
<update id="updateStatusBatch" parameterType="java.util.List">
    <foreach collection="taskDetails" item="item" index="index" open="" close="" separator=";">
        update xxxxx
        <set>
            <if test="item.wxStatus !=null">
                TITLE = #{item.wxStatus}
            </if>
        </set>
        where user_id = #{userId} and is_delete = 0 and task_id = #{taskId}
    </foreach>
</update>

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: