From 98f59cd9e85f512639f81ec8c18d1f75a77ff9db Mon Sep 17 00:00:00 2001 From: wuwenxiong <646448316@qq.com> Date: Tue, 19 Oct 2021 09:57:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=84=E7=A0=82=E7=AB=99=E8=BF=90=E8=BE=93?= =?UTF-8?q?=E9=87=8F=E7=BB=9F=E8=AE=A1=E8=A1=A8=E8=B0=83=E6=95=B4-?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=9F=B3=E7=95=88=E7=A0=82=E7=AB=99=E8=99=9A?= =?UTF-8?q?=E6=8B=9F=E7=AB=99-2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ssjygl/stat/sale/OrderStatService.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/sale/OrderStatService.java b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/sale/OrderStatService.java index cbd6543..02db808 100644 --- a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/sale/OrderStatService.java +++ b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/sale/OrderStatService.java @@ -2164,7 +2164,20 @@ public class OrderStatService { paramsSql = "and t.invoice_type = ? \n"; } - String sql_union = "union select\n" + + String union_4 = "union select\n" + + " ifnull(t.customer_id, 0) customer_id,\n" + + " t.supermarket_id,\n" + + " ifnull(sum(t.weight), 0) weight,\n" + + " ifnull(sum(t.total_price), 0) total_price\n" + + " from order_temp t\n" + + " where t.state = 5\n" + + " and t.supermarket_id = 4" + + " and (t.create_time < '2021-09-08 00:00:00' \n" + + " or t.create_time > '2021-10-15 23:59:59')\n" + + paramsSql + + " group by t.customer_id\n"; + + String union_99 = "union select\n" + " ifnull(t.customer_id, 0) customer_id,\n" + " 99 supermarket_id,\n" + " ifnull(sum(t.weight), 0) weight,\n" + @@ -2205,11 +2218,12 @@ public class OrderStatService { " ifnull(sum(t.total_price), 0) total_price\n" + " from order_temp t\n" + " where t.state = 5\n" + + " and t.supermarket_id != 4\n" + " and t.create_time>= ? \n" + " and t.create_time<= ?\n" + paramsSql + " group by t.customer_id, t.supermarket_id\n" + - sql_union + + union_4 + union_99 + " ) g\n" + " group by g.customer_id\n";