From 9151b2cdd2c5ea3ad606c68c35d21444e5408781 Mon Sep 17 00:00:00 2001 From: linfso Date: Tue, 6 May 2025 05:52:05 +0800 Subject: [PATCH] md --- .../resources/mapper/EmisSettleBillMapper.xml | 60 ++++++++++++++++++- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml b/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml index b501b8b6a..9b921d736 100644 --- a/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml @@ -132,6 +132,7 @@ tba.reced_money as recedMoney, tba.salesmen as salesmen, tba.payee as payee, + tba.create_time as createTime, IFNULL( tbb.recdMoneyIn, 0 ) AS recdMoneyIn, IFNULL( tbb.recdPayMoney60D, 0 ) recdPayMoney60D, IFNULL( tbb.recdPayMoneyGreat60D, 0 ) recdPayMoneyGreat60D, @@ -154,16 +155,50 @@ rec_money, reced_money, salesmen, - payee + payee, + create_time FROM emis_settle_bill a a.del_flag='0' + + and FIND_IN_SET(a.`settle_bill_no`,#{settleBillNo}) + and a.cust_no = #{custNo} and a.salesmen = #{salesmen} + and a.payee = #{payee} + and a.settle_type= #{settleType} - and a.bill_month = #{billMonth} + and FIND_IN_SET(a.`bill_month`,#{billMonth}) and a.open_bill_status = #{openBillStatus} and a.payment_status = #{paymentStatus} + + and exists ( + select 1 from emis_settle_sub_bill b + where a.settle_bill_no=b.settle_bill_no + and ( FIND_IN_SET(b.`bill_code`,#{params.billCode}) or b.bill_code like concat('%', #{params.billCode}, '%') ) + ) + + + and exists ( + select 1 from emis_settle_pay_record espr,emis_settle_pay_bill_rel espbr + where espr.del_flag='0' and espbr.del_flag='0' and a.settle_bill_no=espr.settle_bill_no and espr.pay_id = espbr.pay_id + and espr.trade_date = ]]> #{params.beginTradeDate} + ) + + + and exists ( + select 1 from emis_settle_pay_record espr,emis_settle_pay_bill_rel espbr + where espr.del_flag='0' and espbr.del_flag='0' and a.settle_bill_no=espr.settle_bill_no and espr.pay_id = espbr.pay_id + and espr.create_by = #{params.payCreateBy} + ) + + + and exists ( + select 1 from emis_settle_pay_record espr,emis_settle_pay_bill_rel espbr + where espr.del_flag='0' and espbr.del_flag='0' and a.settle_bill_no=espr.settle_bill_no and espr.pay_id = espbr.pay_id + and espr.trade_date #{params.endTradeDate} + ) + and ( a.salesmen=#{params.privEmpName} @@ -191,11 +226,30 @@ AND c.del_flag = '0' AND a.settle_bill_no = c.settle_bill_no AND b.pay_id = c.pay_id + and FIND_IN_SET(a.`settle_bill_no`,#{settleBillNo}) + and a.cust_no = #{custNo} and a.salesmen = #{salesmen} + and a.payee = #{payee} and a.settle_type= #{settleType} - and a.bill_month = #{billMonth} + and FIND_IN_SET(a.`bill_month`,#{billMonth}) and a.open_bill_status = #{openBillStatus} and a.payment_status = #{paymentStatus} + + and exists ( + select 1 from emis_settle_sub_bill b + where a.settle_bill_no=b.settle_bill_no + and ( FIND_IN_SET(b.`bill_code`,#{params.billCode}) or b.bill_code like concat('%', #{params.billCode}, '%') ) + ) + + + and b.create_by = #{params.payCreateBy} + + + and b.trade_date = ]]> #{params.beginTradeDate} + + + and b.trade_date #{params.endTradeDate} + and ( a.salesmen=#{params.privEmpName}