update 批量更新
Posted g-yang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了update 批量更新相关的知识,希望对你有一定的参考价值。
update
tb_order
<trim prefix="set" suffixOverrides=",">
<trim prefix="logistics_name =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.logistics_name!=null">
when order_id=#{i.order_id} then #{i.logistics_name}
</if>
</foreach>
</trim>
<trim prefix=" logistics_code =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.logistics_code!=null">
when order_id=#{i.order_id} then #{i.logistics_code}
</if>
</foreach>
</trim>
<trim prefix="order_status =case" suffix="end," >
<foreach collection="list" item="i" index="index">
<if test="i.order_status!=null">
when order_id=#{i.order_id} then #{i.order_status}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="i" index="index" >
order_id=#{i.order_id}
</foreach>
以上是关于update 批量更新的主要内容,如果未能解决你的问题,请参考以下文章