myBatis批量修改数据
<update id="batchUpdateSiteBox" parameterType="java.util.List">
update ns_box
<trim prefix="set" suffixOverrides=",">
<trim prefix="cur_state = case" suffix="end,">
<foreach collection="list" item="item" index="index" separator=" ">
<if test="item.cur_state !=null and item.cur_state != -1">
when box_id=#{item.box_id} then #{item.cur_state}
</if>
</foreach>
</trim>
</trim>
where box_id in
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
#{item.box_id,jdbcType=BIGINT}
</foreach>
</update>