From 4dc76bea7c6d16b47897d8b74e6c1bb7cbd2456d Mon Sep 17 00:00:00 2001 From: wuwenxiong <646448316@qq.com> Date: Wed, 12 Jan 2022 12:04:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=AF=B9=E8=B4=A6=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E9=87=8D=E5=A4=8D=E7=9A=84sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stat/customer/CustomerStatService.java | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/customer/CustomerStatService.java b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/customer/CustomerStatService.java index 7997239..d461e0a 100644 --- a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/customer/CustomerStatService.java +++ b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/customer/CustomerStatService.java @@ -98,45 +98,6 @@ public class CustomerStatService { paraList.add(querytm); paraList.add(querytm); - sql = "select \n" + - " t.customer_id id,\n" + - " c.`name`,\n" + - " t.surplus,\n" + - " a.total_price,\n" + - " a.total_weight,\n" + - " a.total_cnt,\n" + - " b.amount,\n" + - " b.refund_amount,\n" + - " ifnull(p.presell_amount,0) presell_amount,\n" + - " b.amount - ifnull(a.total_price,0) - b.refund_amount - ifnull(p.presell_amount,0) then_surplus" + - " from prepay_customer t\n" + - " left join customer c on c.id= t.customer_id\n" + - " left join (\n" + tempSql + " ) a on a.customer_id = t.customer_id\n" + - " left join(\n" + - " select a.customer_id, a.amount, ifnull(b.amount, 0) refund_amount\n" + - " from(\n" + - " select t.customer_id, sum(t.amount) amount\n" + - " from prepay_detail t\n" + - " where t.state= 2\n" + - " and t.verify_time <= ?\n" + - " group by t.customer_id\n" + - " ) a\n" + - " left join(\n" + - " select t.customer_id, sum(t.amount) amount from refund_detail t\n" + - " left join (\n" + - " select max(t.change_time) confirm_time, t.refund_detail_id \n" + - " from refund_detail_state_history t \n" + - " where t.state = 3 \n" + - " group by t.refund_detail_id\n" + - " ) a on t.id = a.refund_detail_id\n" + - " where t.state = 3\n" + - " and a.confirm_time <= ?\n" + - " group by t.customer_id\n" + - " ) b on b.customer_id= a.customer_id\n" + - " ) b on b.customer_id= t.customer_id\n" + - " left join (select customer_id, ifnull(sum(presell_amount), 0) presell_amount from presell_order where del = 0 group by customer_id) p\n" + - " on p.customer_id = t.customer_id"; - if (customer_type_id != null) { // 客户对账不管临散订单 sql += " where c.customer_type_id = ? \n"; paraList.add(customer_type_id);