<update id="updateBatch">
UPDATE cms_student_outline set version_id = case chapter_id
<foreach collection="list" item="item" separator="">
when #{item.chapterId} then #{item.versionId}
</foreach>
END
WHERE id IN
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item.id}
</foreach>
</update>
mybatis批量修改(使用case when构建批量更新)
最新推荐文章于 2023-11-30 09:26:02 发布