mybaits批量更新数据

  在网上找了好长时间,试过好几个,可是都不行,下面这个也是我在网上找的,发现能够用,附原文连接: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