diff --git a/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml b/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml index 6f62c3eb5..471e479e0 100644 --- a/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml @@ -655,7 +655,10 @@ sum(if( tbMA.settleType=2,1, 0 ) ) AS totalMonthBillCount, sum(if( tbMA.settleType=2,tbMA.recMoney, 0 ) ) AS totalMonthRecAmount, sum(if( tbMA.settleType=2,tbMA.recdMoneyIn, 0 ) ) AS totalMonthRecdIn, - sum(if( tbMA.settleType=2,tbMA.recdPayMoney60D, 0 ) ) AS totalMonthRecd70 + sum(if( tbMA.settleType=2,tbMA.recdPayMoney60D, 0 ) ) AS totalMonthRecd70, + + ifnull(ecp.money,0) as moneyProfit, + ifnull(ecp.month_money,0) as monthProfit from ( SELECT @@ -879,7 +882,7 @@ GROUP BY a.settle_bill_no ) tbc ON tba.settle_bill_no = tbc.settle_bill_no - ) tbMA + ) tbMA left join emis_commission_profit ecp on tbMA.salesmen=ecp.emp_name and tbMA.billMonth = ecp.bill_month group by tbMA.salesmen,tbMA.billMonth