mapper 文件
<update id
="updateByTransportOrderDetailById">
UPDATE transport_order_detail
<trim prefix
="set" suffixOverrides
=",">
<trim prefix
="share_logistics_fee = case" suffix
="end,">
<foreach collection
="allTransportOrderDetailPO" item
="i" index
="index">
<if test
="i.shareLogisticsFee!=null">
when id
= #
{i
.id
} then #
{i
.shareLogisticsFee
}
</if>
</foreach
>
</trim
>
<trim prefix
="total_miscellaneous_fee = case" suffix
="end,">
<foreach collection
="allTransportOrderDetailPO" item
="i" index
="index">
<if test
="i.totalMiscellaneousFee!=null">
when id
= #
{i
.id
} then #
{i
.totalMiscellaneousFee
}
</if>
</foreach
>
</trim
>
</trim
>
where
<foreach collection
="allTransportOrderDetailPO" separator
="or" item
="i" index
="index">
id
= #
{i
.id
}
</foreach
>
</update
>
UPDATE transport_order_detail
SET share_logistics_fee
=
CASE
WHEN id
= 15 THEN
888
WHEN id
= 16 THEN
999
END,
total_miscellaneous_fee
=
CASE
WHEN id
= 15 THEN
111
WHEN id
= 16 THEN
111
END
WHERE
id
= 15
OR id
= 16
标签的使用 链接: link.
转载请注明原文地址: https://lol.8miu.com/read-34722.html