diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisSettleInvoiceChRecord.java b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisSettleInvoiceChRecord.java
index 6bfd67e06..69fa7c63c 100644
--- a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisSettleInvoiceChRecord.java
+++ b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisSettleInvoiceChRecord.java
@@ -121,6 +121,10 @@ public class EmisSettleInvoiceChRecord extends BaseEntity
private String billCode;
// 销售员
private String salesmen;
+ // 回款联系人
+ private String payee;
+ // 收款状态
+ private String paymentStatus;
// 申请人
private String applyManName;
// 申请备注
@@ -128,6 +132,8 @@ public class EmisSettleInvoiceChRecord extends BaseEntity
// 发送月份
private String sendMonth;
+ // 月结客户
+ private String custNo;
// 结算类型
private String settleType;
// 开票备注
diff --git a/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml b/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml
index 27c7d9cf4..417c7f556 100644
--- a/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml
+++ b/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml
@@ -140,7 +140,7 @@
tba.settle_day as settleDay,
tba.send_piece_sum as sendPieceSum,
tba.credit_period as creditPeriod,
- tba.payment_due_date as paymentDueDate,
+ DATE(tba.payment_due_date) as paymentDueDate,
tba.rec_money as recMoney,
tba.reced_money as recedMoney,
tba.salesmen as salesmen,
diff --git a/emis-biz/src/main/resources/mapper/EmisSettleInvoiceChRecordMapper.xml b/emis-biz/src/main/resources/mapper/EmisSettleInvoiceChRecordMapper.xml
index ab35e5737..9b4df11a7 100644
--- a/emis-biz/src/main/resources/mapper/EmisSettleInvoiceChRecordMapper.xml
+++ b/emis-biz/src/main/resources/mapper/EmisSettleInvoiceChRecordMapper.xml
@@ -168,6 +168,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and create_time #{params.endCreateTime}
+
+
+ and EXISTS (
+ select 1 from emis_settle_invoice_rel ir
+ inner join emis_waybill w on w.bill_code = ir.bill_no and w.del_flag = '0'
+ where ir.del_flag = '0' and a.apply_seq_no = ir.apply_seq_no
+ and w.cust_no = #{custNo}
+ )
+
+
+
+
+ and EXISTS (
+ select 1 from emis_settle_invoice_bill_rel ibr
+ inner join emis_settle_bill b on b.settle_bill_no = ibr.settle_bill_no and b.del_flag = '0'
+ where ibr.del_flag = '0' and a.apply_seq_no = ibr.apply_seq_no
+ and b.payee = #{payee}
+ )
+
+
+
+
+ and EXISTS (
+ select 1 from emis_settle_invoice_bill_rel ibr
+ inner join emis_settle_bill b on b.settle_bill_no = ibr.settle_bill_no and b.del_flag = '0'
+ where ibr.del_flag = '0' and a.apply_seq_no = ibr.apply_seq_no
+ and b.salesmen = #{salesmen}
+ )
+
+
+
+
+ and EXISTS (
+ select 1 from emis_settle_invoice_bill_rel ibr
+ inner join emis_settle_bill b on b.settle_bill_no = ibr.settle_bill_no and b.del_flag = '0'
+ where ibr.del_flag = '0' and a.apply_seq_no = ibr.apply_seq_no
+ and b.bill_month = #{billMonth}
+ )
+
+
+
+
+ and EXISTS (
+ select 1 from emis_settle_invoice_bill_rel ibr
+ inner join emis_settle_pay_bill_rel pbr on pbr.settle_bill_no = ibr.settle_bill_no
+ inner join emis_settle_pay_record pr on pr.pay_id = pbr.pay_id
+ where ibr.del_flag = '0' and a.apply_seq_no = ibr.apply_seq_no
+ and pr.pay_status = #{paymentStatus}
+ )
+
and EXISTS(
@@ -458,6 +508,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
)
+
+
+ and EXISTS (
+ select 1 from emis_settle_invoice_rel ir
+ inner join emis_waybill w on w.bill_code = ir.bill_no and w.del_flag = '0'
+ where ir.del_flag = '0' and a.apply_seq_no = ir.apply_seq_no
+ and w.cust_no = #{custNo}
+ )
+
+
+
+
+ and EXISTS (
+ select 1 from emis_settle_invoice_bill_rel ibr
+ inner join emis_settle_bill b on b.settle_bill_no = ibr.settle_bill_no and b.del_flag = '0'
+ where ibr.del_flag = '0' and a.apply_seq_no = ibr.apply_seq_no
+ and b.payee = #{payee}
+ )
+
+
+
+
+ and EXISTS (
+ select 1 from emis_settle_invoice_bill_rel ibr
+ inner join emis_settle_bill b on b.settle_bill_no = ibr.settle_bill_no and b.del_flag = '0'
+ where ibr.del_flag = '0' and a.apply_seq_no = ibr.apply_seq_no
+ and b.salesmen = #{salesmen}
+ )
+
+
+
+
+ and EXISTS (
+ select 1 from emis_settle_invoice_bill_rel ibr
+ inner join emis_settle_bill b on b.settle_bill_no = ibr.settle_bill_no and b.del_flag = '0'
+ where ibr.del_flag = '0' and a.apply_seq_no = ibr.apply_seq_no
+ and b.bill_month = #{billMonth}
+ )
+
+
+
+
+ and EXISTS (
+ select 1 from emis_settle_invoice_bill_rel ibr
+ inner join emis_settle_pay_bill_rel pbr on pbr.settle_bill_no = ibr.settle_bill_no
+ inner join emis_settle_pay_record pr on pr.pay_id = pbr.pay_id
+ where ibr.del_flag = '0' and a.apply_seq_no = ibr.apply_seq_no
+ and pr.pay_status = #{paymentStatus}
+ )
+
group by a.id
ORDER BY a.create_time DESC