diff --git a/emis-biz/src/main/resources/mapper/EmisSettleInvoiceRecordMapper.xml b/emis-biz/src/main/resources/mapper/EmisSettleInvoiceRecordMapper.xml index 2a19f69ad..ac6c55926 100644 --- a/emis-biz/src/main/resources/mapper/EmisSettleInvoiceRecordMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisSettleInvoiceRecordMapper.xml @@ -74,7 +74,7 @@ and apply_site_code = #{applySiteCode} and customer_code = #{customerCode} and customer_name like concat('%', #{customerName}, '%') - and settle_bill_no = #{settleBillNo} + and FIND_IN_SET(#{settleBillNo},settle_bill_no) and settle_bill_name like concat('%', #{settleBillName}, '%') and apply_money = #{applyMoney} and invoice_type = #{invoiceType} @@ -115,6 +115,25 @@ and create_site like concat('%', #{createSite}, '%') and update_site like concat('%', #{updateSite}, '%') + + + AND apply_seq_no IN ( + SELECT x1.apply_seq_no FROM + emis_settle_invoice_record x1, + emis_settle_bill x2 + WHERE + x1.del_flag = '0' + AND x2.del_flag = '0' + AND FIND_IN_SET( x2.settle_bill_no, x1.settle_bill_no ) + AND exists ( + select 1 from emis_settle_sub_bill b + where x2.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 apply_seq_no IN (