前言
如题
实现方式
UPDATE pmi_product_type
SET
sort_index = <foreach collection="list" item="item" index="index" separator="" open="Case id" close="END"> WHEN #{item.id} THEN ${index} </foreach>
WHERE
id IN <foreach collection="list" item="item" index="index" separator="," open="(" close=")"> #{item.id} </foreach>