@Mapper
public interface BaseInfoMapper extends BaseMapper<BaseInfo> {
int updateBatch(@Param("list") List<BaseInfo> list);
}
<update id="updateBatch">
update base_info
<trim prefix="set" suffixOverrides=",">
<trim prefix="location_code = case " suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.locationCode != null">
when id = #{i.id}
then #{i.locationCode}
</if>
</foreach>
</trim>
<trim prefix="org_full_name = case " suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.orgFullName != null">
when id = #{i.id}
then #{i.orgFullName}
</if>
</foreach>
</trim>
<trim prefix="org_short_name = case " suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.orgShortName != null">
when id = #{i.id}
then #{i.orgShortName}
</if>
</foreach>
</trim>
<trim prefix="shop_status = case " suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.shopStatus != null">
when id = #{i.id}
then #{i.shopStatus}
</if>
</foreach>
</trim>
where id in
<foreach collection="list" item="i" open="(" separator="," close=")" index="index" >
#{i.id}
</foreach>
</update>