<update id="updateGroupBuyInfoSalesVolumeDay" parameterType = "java.util.List">
UPDATE hotel_group_buy SET sales_volume = sales_volume + CASE
<foreach collection="list" item="item" index="index" open="" close="" separator="">
<if test = "item != null">
WHEN hotel_product_id = #{item.productId} THEN #{item.hotelNum}
</if>
</foreach>
END WHERE hotel_product_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
<if test = "item != null">
#{item.productId}
</if>
</foreach>
</update>
mybatis批量执行mysql的update操作
最新推荐文章于 2023-07-23 15:06:51 发布