dao
int updateBatch(List
<Bean
> beanList
);
mapper
<update id
="updateBatch" parameterType
="java.util.List">
update mydata_table
<trim prefix
="set" suffixOverrides
=",">
<trim prefix
="status =case" suffix
="end,">
<foreach collection
="list" item
="item" index
="index">
when id
=#
{item
.id
} then #
{item
.status
}
</foreach>
</trim
>
</trim
>
where id
in
<foreach collection
="list" index
="index" item
="item" separator
="," open
="(" close
=")">
#{item.id,jdbcType=BIGINT}
</foreach>
</update
>
转载请注明原文地址: https://lol.8miu.com/read-2608.html