<mapper namespace=" " >
<update id="updateByMobile" parameterType="java.util.List">
update pb_vip_table
set integral=
<foreach collection="list" item="item" index="index"
separator=" " open="CASE mobile" close="end">
when #{item.mobile} then #{item.integral}
</foreach>
where mobile in
<foreach collection="list" index="index" item="item"
separator="," open="(" close=")">
#{item.mobile,jdbcType=BIGINT}
</foreach>
</update>
</mapper>
原生sql批量更新语句可以看我的上一篇文章,以便更好理解mybatis批量更新。
最好将原生sql语句与mybatis语句进行对比,这样就很容易理解mybatis的一些属性的含义了。
说明:
<