From 89073cf8f60c3e5c3bf1869b148e0b20a9cb269e Mon Sep 17 00:00:00 2001 From: gongbiao Date: Mon, 15 Jul 2019 14:03:26 +0800 Subject: [PATCH] =?UTF-8?q?[SQL][=E4=BF=AE=E6=94=B9][=E4=B8=BAwx=5Fshop?= =?UTF-8?q?=E8=A1=A8=E6=B7=BB=E5=8A=A0=E7=B4=A2=E5=BC=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V201907151402__G_ALTER_SHOP.sql | 1 + mallinkService/src/main/resources/mapper/WxShopMapper.xml | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201907151402__G_ALTER_SHOP.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V201907151402__G_ALTER_SHOP.sql b/mallinkAdmin/src/main/resources/db/migration/V201907151402__G_ALTER_SHOP.sql new file mode 100644 index 000000000..8c8140a9b --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201907151402__G_ALTER_SHOP.sql @@ -0,0 +1 @@ +alter table wx_shop add index b_f(building,floor); diff --git a/mallinkService/src/main/resources/mapper/WxShopMapper.xml b/mallinkService/src/main/resources/mapper/WxShopMapper.xml index 1f905f1f7..5165550af 100644 --- a/mallinkService/src/main/resources/mapper/WxShopMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxShopMapper.xml @@ -572,9 +572,15 @@ DATE_FORMAT(w.create_date,'%Y/%m') xTime ,count(distinct w.shop_id) xCount - from wx_merchant_shop w + from wx_merchant_shop w left join wx_shop s on w.shop_id=s.id where w.is_del=0 and w.tenant_id = #{tenantId} + + and s.building=#{building} + + + and s.floor=#{floor} + group by xTime order by xTime