目录
Mybatis批量更新三种方式的实现
推荐方式chat gpt生成
<update id="batchUpdateProducts" parameterType="java.util.List">
<foreach collection="list" item="product" index="index" separator=";">
UPDATE product_table
<set>
<if test="product.name != null">
name = #{product.name},
</if>
<if test="product.price != null">
price = #{product.price},
</if>
<if test="product.stock != null">
stock = #{product.stock},
</if>
&