直接拿来就可以使用,高效的批量更新(批量修改)–mybatis springboot
dao:
/*批量更新,判断值为空null时不更新*/
int updateBatchByPrimaryKey(List<ShopGoodsDO> list);
mapper.xml:
<!--批量更新-->
<update id="updateBatchByPrimaryKey" parameterType="java.util.List">
update shop_goods
<trim prefix="set" suffixOverrides=",">
<trim prefix="shop_id =case" suffix="end,"