From b831382b711c42c6e3d507caa1ff0f3de121bcc3 Mon Sep 17 00:00:00 2001 From: hupeng Date: Mon, 24 Dec 2018 19:30:06 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8D=A1=E5=88=B8][=E4=BF=AE=E5=A4=8D]:?= =?UTF-8?q?=E5=A4=9A=E5=95=86=E6=88=B7=E9=80=9A=E7=94=A8=E5=88=B8=E5=95=86?= =?UTF-8?q?=E6=88=B7=E5=85=A8=E9=83=A8=E7=A6=81=E7=94=A8=E5=90=8E=E4=BD=9C?= =?UTF-8?q?=E5=BA=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/WxCouponMapper.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 9ea0e5bd3..e3869d40a 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -204,8 +204,14 @@ - update wx_coupon c, wx_merchant m SET c.status = 1, c.update_date = now() - where c.status = 0 and m.status = 0 and m.id = c.merchant_id + update wx_coupon c + SET c.status = 1, c.update_date = now() + where c.status = 0 and + (select count(*) from wx_coupon_merchant cm, wx_merchant m + where m.id = cm.merchant_id + and c.id = cm.product_id + and cm.status = 0 + and m.status = 1) = 0