From 3474015be8b444e9ff62c9ecbf4c9c2578a0f93d Mon Sep 17 00:00:00 2001 From: "lisai17@sina.com" Date: Fri, 17 Sep 2021 09:47:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=84=E7=A0=82=E7=AB=99?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cowr/ssjygl/stat/sale/OrderStatService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 bd942af..6df7af9 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 @@ -2013,10 +2013,15 @@ public class OrderStatService { } List ids = new ArrayList<>(); + String cidsql = ""; for (Record r : customer_sale_list) { ids.add(r.getStr("customer_id")); } + if(!ids.isEmpty()){ + cidsql = " c.id in(" + StrKit.join(ids, ",") + ") or "; + } + List customer_pre_list = Db.find("select\n" + " a.customer_id,\n" + " tp.id customer_type_id,\n" + @@ -2034,7 +2039,7 @@ public class OrderStatService { " ) a on c.id = a.customer_id \n" + " left join customer_type tp on tp.id = c.customer_type_id\n" + " left join prepay_customer p on p.customer_id = c.id\n" + - " where c.id in(" + StrKit.join(ids, ",") + ") or a.customer_id is not null \n" + // 查询时间段内有购砂、起始时间年内有充值的 + " where " + cidsql + " a.customer_id is not null \n" + // 查询时间段内有购砂、起始时间年内有充值的 " union\n" + " select 0 customer_id, 99 customer_type_id, '零散' customer_type_name, '零散客户' customer_name, '零散客户' name, null prepay_total_amount, null prepay_surplus", tm);