|
|
|
@@ -684,15 +684,15 @@ |
|
|
|
update wx_coupon SET remain_inventory = remain_inventory + #{number} where id = #{id} and tenant_id =#{tenantId} and remain_inventory + #{number} <= inventory |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="offExpiriedCouponByValidDate"> |
|
|
|
<update id="offExpiriedCouponByValidDate" parameterType="String"> |
|
|
|
update wx_coupon SET status = 1, update_date = now() |
|
|
|
where status = 0 and valid_type = 1 and valid_end_date < now() |
|
|
|
where status = 0 and tenant_id =#{tenantId} and valid_type = 1 and valid_end_date < now() |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="offExpiriedCouponByMerchantStatus"> |
|
|
|
<update id="offExpiriedCouponByMerchantStatus" parameterType="String"> |
|
|
|
update wx_coupon c |
|
|
|
SET c.status = 1, c.update_date = now() |
|
|
|
where c.status = 0 and |
|
|
|
where c.status = 0 and c.tenant_id =#{tenantId} and |
|
|
|
(select count(*) from wx_coupon_merchant cm, wx_merchant m |
|
|
|
where m.id = cm.merchant_id |
|
|
|
and c.id = cm.product_id |
|
|
|
|