|
|
@@ -13,15 +13,37 @@
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertOrUpdateBusinessGoodsSkuRate">
|
|
|
- insert into
|
|
|
- user_distribute_business_rate(`business_id`,`goods_id`,`sku_id`,`first_order_rate`,`renew_order_rate`,`created_time`,`update_time`)
|
|
|
+ insert into user_distribute_business_rate
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ `business_id`,`goods_id`,`sku_id`,
|
|
|
+ <if test="firstOrderRate != null">
|
|
|
+ `first_order_rate`,
|
|
|
+ </if>
|
|
|
+ <if test="renewOrderRate != null">
|
|
|
+ `renew_order_rate`,
|
|
|
+ </if>
|
|
|
+ `created_time`,`update_time`
|
|
|
+ </trim>
|
|
|
values
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
- (#{item},#{goodsId},#{skuId},#{firstOrderRate},#{renewOrderRate},now(),now())
|
|
|
+ (#{item},#{goodsId},#{skuId},
|
|
|
+ <if test="firstOrderRate != null">
|
|
|
+ #{firstOrderRate},
|
|
|
+ </if>
|
|
|
+ <if test="renewOrderRate != null">
|
|
|
+ #{renewOrderRate},
|
|
|
+ </if>
|
|
|
+ now(),now())
|
|
|
</foreach>
|
|
|
ON DUPLICATE KEY UPDATE
|
|
|
- first_order_rate = VALUES(first_order_rate),
|
|
|
- renew_order_rate = VALUES(renew_order_rate)
|
|
|
+ <trim suffixOverrides=",">
|
|
|
+ <if test="firstOrderRate != null">
|
|
|
+ first_order_rate = VALUES(first_order_rate),
|
|
|
+ </if>
|
|
|
+ <if test="renewOrderRate != null">
|
|
|
+ renew_order_rate = VALUES(renew_order_rate)
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<select id="selectNoThisGoodsDistribute" resultType="java.lang.Long">
|