在網上找了好長時間,試過好幾個,可是都不行,下面這個也是我在網上找的,發現能夠用,附原文連接:java
http://ljhzzyx.blog.163.com/blog/static/38380312201482434852742/blog
<update id="updatelist" parameterType="java.util.List">it
update items set
NAME=
<foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
when '${item.id}' then '${item.Name}'
</foreach>
where ID in
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
'${item.id}'
</foreach>
</update> io