From b828ed3e35d0b7b878583e0feab8980e9cc1342e Mon Sep 17 00:00:00 2001 From: zhangjun Date: Sun, 19 Jul 2020 09:41:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9app=E9=A2=9D=E5=BA=A6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=87=91=E9=A2=9D=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../change/center/service/impl/ApplyArchiveServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src_app_fresh/apx/com/amarsoft/als/user/change/center/service/impl/ApplyArchiveServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/user/change/center/service/impl/ApplyArchiveServiceImpl.java index a87f9f937..a8a468f57 100644 --- a/src_app_fresh/apx/com/amarsoft/als/user/change/center/service/impl/ApplyArchiveServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/user/change/center/service/impl/ApplyArchiveServiceImpl.java @@ -212,7 +212,8 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{ String userId = fieldMap.get("belongorg") == null ? "" : fieldMap.get("belongorg").toString(); String sql = ""; //sql = "select o.distributor_no,ifnull(b.caution_money,0) as bcaution_money,ifnull(t.caution_money,0) as tcaution_money,ifnull(sum(b.caution_money),0) - ifnull(sum(t.caution_money),0) as surrende,o.total,o.usedlines,o.relines from vi_distributor_lines o left join d_depositcharge_info b on b.distributor_id = o.distributor_no and b.money_type = 'bondcollect' left join d_depositreturn_info t on t.distributor_id = o.distributor_no and t.money_type = 'bondreturn' group by o.distributor_no"; - sql = "SELECT o.distributor_no,IFNULL(b.caution_money,0) AS bcaution_money,IFNULL(t.caution_money,0) AS tcaution_money,IFNULL(SUM(b.caution_money),0) - IFNULL(SUM(t.caution_money),0) AS surrende,o.total,o.usedlines,o.relines FROM vi_distributor_lines o LEFT JOIN d_depositcharge_info b ON b.distributor_id = o.distributor_no AND b.money_type = 'bondcollect' LEFT JOIN d_depositreturn_info t ON t.distributor_id = o.distributor_no AND t.money_type = 'bondreturn' WHERE o.distributor_no=(SELECT distributor_no FROM distributor_info WHERE orgid='"+userId+"') "; + //sql = "SELECT o.distributor_no,IFNULL(b.caution_money,0) AS bcaution_money,IFNULL(t.caution_money,0) AS tcaution_money,IFNULL(SUM(b.caution_money),0) - IFNULL(SUM(t.caution_money),0) AS surrende,o.total,o.usedlines,o.relines FROM vi_distributor_lines o LEFT JOIN d_depositcharge_info b ON b.distributor_id = o.distributor_no AND b.money_type = 'bondcollect' LEFT JOIN d_depositreturn_info t ON t.distributor_id = o.distributor_no AND t.money_type = 'bondreturn' WHERE o.distributor_no=(SELECT distributor_no FROM distributor_info WHERE orgid='"+userId+"') "; + sql = "SELECT o.distributor_no,IFNULL(b.caution_money,0) AS bcaution_money,IFNULL(t.caution_money,0) AS tcaution_money,IFNULL(SUM(b.caution_money),0) - IFNULL(SUM(t.caution_money),0) AS surrende,o.total,IFNULL(lccs.fact_money,0) AS usedlines,ROUND(IFNULL(o.total,0)-(IFNULL(vlrp.corpus_over,0)),2) AS relines FROM vi_distributor_lines o LEFT JOIN d_depositcharge_info b ON b.distributor_id = o.distributor_no AND b.money_type = 'bondcollect' LEFT JOIN d_depositreturn_info t ON t.distributor_id = o.distributor_no AND t.money_type = 'bondreturn' LEFT JOIN (SELECT SUM(vlrp.corpus_over) corpus_over,di.distributor_no FROM vi_lc_rent_plan11 vlrp LEFT JOIN lb_contract_info lci ON vlrp.contract_id = lci.id LEFT JOIN distributor_info di ON lci.distributor_id = di.distributor_no GROUP BY di.distributor_no) vlrp ON vlrp.distributor_no=o.distributor_no LEFT JOIN (SELECT lci.distributor_id,SUM(lcc.clean_lease_money) fact_money FROM lc_calc_condition lcc LEFT JOIN lb_contract_info lci ON lci.id=lcc.contract_id WHERE (lci.CONTRACT_STATUS BETWEEN 31 AND 100 OR lci.CONTRACT_STATUS='103' OR lci.CONTRACT_STATUS='105') GROUP BY lci.distributor_id) lccs ON lccs.distributor_id=o.distributor_no WHERE o.distributor_no=(SELECT distributor_no FROM distributor_info WHERE orgid='"+userId+"') "; List> dataList = DataOperatorUtil.getDataBySql(sql); if(dataList.size()>0){ Map body = new HashMap();