From cd12030aa805b9e269b71cf30f112d907e4b4ce9 Mon Sep 17 00:00:00 2001 From: kevin jiang Date: Thu, 14 May 2020 14:36:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E7=AB=AF-=E5=A5=BD=E5=8F=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E5=AE=A2=E6=88=B7=E6=95=B0=E5=AF=B9?= =?UTF-8?q?=E4=B8=8D=E4=B8=8A=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BC=98=E5=8C=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OpSellerCustomerRelationDOMapper.xml | 26 +++++++-------- .../mapper/StorePromotionDataDOMapper.xml | 32 ++++++++++--------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/main/resources/mapper/OpSellerCustomerRelationDOMapper.xml b/src/main/resources/mapper/OpSellerCustomerRelationDOMapper.xml index 9d6cb3a..4ff2b9b 100644 --- a/src/main/resources/mapper/OpSellerCustomerRelationDOMapper.xml +++ b/src/main/resources/mapper/OpSellerCustomerRelationDOMapper.xml @@ -37,12 +37,12 @@ CONCAT('%',#{search},'%')) - and DATE_FORMAT(t2.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{startDate},'%Y-%m-%d') + and date(t1.create_time) >= #{startDate} - and DATE_FORMAT(t2.create_time,'%Y-%m-%d') <= DATE_FORMAT(#{endDate},'%Y-%m-%d') + and date(t1.create_time <= #{endDate} - GROUP BY t4.id order by t2.create_time desc + GROUP BY t4.id order by t1.create_time desc diff --git a/src/main/resources/mapper/StorePromotionDataDOMapper.xml b/src/main/resources/mapper/StorePromotionDataDOMapper.xml index bb8fb8c..99d37d6 100644 --- a/src/main/resources/mapper/StorePromotionDataDOMapper.xml +++ b/src/main/resources/mapper/StorePromotionDataDOMapper.xml @@ -294,25 +294,25 @@ WHERE t.store_id = #{storeId} and t.customer_id = t2.id - and DATE_FORMAT(t2.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{startDate},'%Y-%m-%d') + and date(t.create_time) >= #{startDate} - and DATE_FORMAT(t2.create_time,'%Y-%m-%d') <= DATE_FORMAT(#{endDate},'%Y-%m-%d') + and date(t.create_time) <= #{endDate} group by store_id @@ -326,17 +326,18 @@ user_id AS id, count( customer_id ) AS cusNum FROM - `op_seller_customer_relation` + `op_seller_customer_relation` t,op_customer t2 WHERE - store_id = #{storeId} + t.customer_id = t2.id + and t. store_id = #{storeId} - and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{startDate},'%Y-%m-%d') + and date(t.create_time) >= #{startDate} - and DATE_FORMAT(create_time,'%Y-%m-%d') <= DATE_FORMAT(#{endDate},'%Y-%m-%d') + and date(t.create_time) <= #{endDate} GROUP BY - user_id + t.user_id