From f3d56ce25e6080e3e530a6ef2ba6ce7a5cbc34e3 Mon Sep 17 00:00:00 2001 From: zhangjun Date: Tue, 7 Jul 2020 16:27:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BD=93=E5=89=8D=E7=BB=8F?= =?UTF-8?q?=E9=94=80=E5=95=86=E4=B8=8B=E9=80=BE=E6=9C=9F=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../change/center/service/impl/ApplyArchiveServiceImpl.java | 4 +++- 1 file changed, 3 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 2ea54726a..8db0b3a25 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 @@ -229,9 +229,11 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{ fieldMap = (Map) testMap.get("fieldMap"); String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString(); String contractid = fieldMap.get("contractid") == null ? "" : fieldMap.get("contractid").toString(); + String distributor = fieldMap.get("distributor_no") == null ? "" : fieldMap.get("distributor_no").toString(); String sql = ""; //sql = "select O.FULLNAME,O.mobile,O.SEX,O.WORKCORP,O.WORKADD,ca.fulladdress,O.EMERGENCY_CONTACT_PERSON from CUSTOMER_PERSON_TEMP O left join CUSTOMER_ADDRESS_TEMP ca on O.customerid=ca.customerid and O.flowunid=ca.flowunid where O.flowunid='"+flowunid+"' "; - sql = "select t.FULLNAME,t.mobile,t.SEX,t.WORKCORP,t.WORKADD,t.fulladdress,t.EMERGENCY_CONTACT_PERSON,t.plan_date,sum(t.residue_rent) as residue_rent from (select cp.FULLNAME,cp.mobile,cp.SEX,cp.WORKCORP,cp.WORKADD,ca.fulladdress,cp.EMERGENCY_CONTACT_PERSON,lrp.plan_date,ifnull(sum(lrp.rent),0) - ifnull(sum(lri.rent),0) as residue_rent from lc_rent_plan lrp left join lc_rent_income lri on lri.plan_id=lrp.id left join lb_union_lessee lul on lul.CONTRACT_ID=lrp.CONTRACT_ID left join CUSTOMER_PERSON cp on cp.customerid=lul.CUSTOMER_ID left join CUSTOMER_ADDRESS ca on ca.customerid=cp.customerid WHERE lrp.plan_date =0 group by t.plan_date"; + //sql = "select t.FULLNAME,t.mobile,t.SEX,t.WORKCORP,t.WORKADD,t.fulladdress,t.EMERGENCY_CONTACT_PERSON,t.plan_date,sum(t.residue_rent) as residue_rent from (select cp.FULLNAME,cp.mobile,cp.SEX,cp.WORKCORP,cp.WORKADD,ca.fulladdress,cp.EMERGENCY_CONTACT_PERSON,lrp.plan_date,ifnull(sum(lrp.rent),0) - ifnull(sum(lri.rent),0) as residue_rent from lc_rent_plan lrp left join lc_rent_income lri on lri.plan_id=lrp.id left join lb_union_lessee lul on lul.CONTRACT_ID=lrp.CONTRACT_ID left join CUSTOMER_PERSON cp on cp.customerid=lul.CUSTOMER_ID left join CUSTOMER_ADDRESS ca on ca.customerid=cp.customerid WHERE lrp.plan_date =0 group by t.plan_date"; + sql = "SELECT t.FULLNAME,t.mobile,t.SEX,t.WORKCORP,t.WORKADD,t.fulladdress,t.EMERGENCY_CONTACT_PERSON,t.plan_date,t.residue_rent AS residue_rent FROM (SELECT cp.FULLNAME,cp.mobile,cp.SEX,cp.WORKCORP,cp.WORKADD,ca.fulladdress,cp.EMERGENCY_CONTACT_PERSON,lrp.plan_date,IFNULL(lrp.rent, 0) - SUM(IFNULL(lri.rent, 0)) AS residue_rent FROM lc_rent_plan lrp LEFT JOIN lc_rent_income lri ON lri.plan_id = lrp.id LEFT JOIN lb_contract_info lci ON lrp.contract_id=lci.id LEFT JOIN lb_union_lessee lul ON lul.CONTRACT_ID = lrp.CONTRACT_ID LEFT JOIN CUSTOMER_PERSON cp ON cp.customerid = lul.CUSTOMER_ID LEFT JOIN CUSTOMER_ADDRESS ca ON ca.customerid = cp.customerid WHERE lrp.plan_date < NOW() AND lci.distributor_id='"+distributor+"' GROUP BY lrp.id) t WHERE t.residue_rent > 0 "; List> dataList = DataOperatorUtil.getDataBySql(sql); Map body = new HashMap();