APP额度查询目前代偿金额取值错误问题修改

This commit is contained in:
zhangjun 2020-08-17 11:31:01 +08:00
parent aeee935a50
commit 6713fafc5b

View File

@ -214,7 +214,7 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{
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 dii.distributor_name,O.total,O.USEDLINES AS usedlines,O.RELINES AS relines,IFNULL(b.CAUTION_MONEY,0) AS surrende,IFNULL(c.CAUTION_MONEY,0)+IFNULL(d.CAUTION_MONEY,0) AS rents FROM vi_distributor_lines O LEFT JOIN (SELECT SUM(CAUTION_MONEY) AS CAUTION_MONEY,distributor_id,money_type FROM d_depositcharge_info WHERE money_type = 'bondcollect' GROUP BY distributor_id) b ON b.distributor_id = O.distributor_no LEFT JOIN (SELECT DISTRIBUTOR_ID,SUM(IFNULL(CAUTION_MONEY,0)) AS CAUTION_MONEY FROM D_DEPOSITCHARGE_INFO WHERE money_type='bondBack' GROUP BY DISTRIBUTOR_ID) c ON c.DISTRIBUTOR_ID = O.distributor_no LEFT JOIN (SELECT DISTRIBUTOR_ID,SUM(IFNULL(CAUTION_MONEY,0)) AS CAUTION_MONEY FROM D_DEPOSITRETURN_INFO WHERE money_type='bondRepay' GROUP BY DISTRIBUTOR_ID) d ON d.DISTRIBUTOR_ID = O.distributor_no LEFT JOIN distributor_info dii ON dii.distributor_no=O.distributor_no WHERE O.distributor_no=(SELECT distributor_no FROM distributor_info WHERE orgid='"+orgID+"') ";
sql = "SELECT dii.distributor_name,O.total,O.USEDLINES AS usedlines,O.RELINES AS relines,IFNULL(b.CAUTION_MONEY,0) AS surrende,IFNULL(d.CAUTION_MONEY,0)-IFNULL(c.CAUTION_MONEY,0) AS rents FROM vi_distributor_lines O LEFT JOIN (SELECT SUM(CAUTION_MONEY) AS CAUTION_MONEY,distributor_id,money_type FROM d_depositcharge_info WHERE money_type = 'bondcollect' GROUP BY distributor_id) b ON b.distributor_id = O.distributor_no LEFT JOIN (SELECT DISTRIBUTOR_ID,SUM(IFNULL(CAUTION_MONEY,0)) AS CAUTION_MONEY FROM D_DEPOSITCHARGE_INFO WHERE money_type='bondBack' GROUP BY DISTRIBUTOR_ID) c ON c.DISTRIBUTOR_ID = O.distributor_no LEFT JOIN (SELECT DISTRIBUTOR_ID,SUM(IFNULL(CAUTION_MONEY,0)) AS CAUTION_MONEY FROM D_DEPOSITRETURN_INFO WHERE money_type='bondRepay' GROUP BY DISTRIBUTOR_ID) d ON d.DISTRIBUTOR_ID = O.distributor_no LEFT JOIN distributor_info dii ON dii.distributor_no=O.distributor_no WHERE O.distributor_no=(SELECT distributor_no FROM distributor_info WHERE orgid='"+orgID+"') ";
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
if(dataList.size()>0){
Map<String, Object> body = new HashMap<String, Object>();