修改app额度查询金额错误问题

This commit is contained in:
zhangjun 2020-07-19 09:41:56 +08:00
parent 1ab9ab153b
commit b828ed3e35

View File

@ -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<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
if(dataList.size()>0){
Map<String, Object> body = new HashMap<String, Object>();