From c26197080f275f5103c13976c2f8ad4fb2964091 Mon Sep 17 00:00:00 2001
From: aike <17730485278@139.com>
Date: Mon, 9 Jun 2025 18:22:20 +0800
Subject: [PATCH] =?UTF-8?q?demand:TMS=E7=B3=BB=E7=BB=9F-=E8=88=AA=E4=BF=A1?=
=?UTF-8?q?=E5=BC=80=E7=A5=A8=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2/?=
=?UTF-8?q?=E5=AF=BC=E5=87=BA/=E5=AE=9A=E5=88=B6=E5=AF=BC=E5=87=BA?=
=?UTF-8?q?=E6=94=AF=E6=8C=81=E6=8C=89=E6=94=B6=E6=AC=BE=E7=8A=B6=E6=80=81?=
=?UTF-8?q?=E3=80=81=E8=B4=A6=E5=8D=95=E6=9C=88=E4=BB=BD=E3=80=81=E6=9C=88?=
=?UTF-8?q?=E7=BB=93=E5=AE=A2=E6=88=B7=E3=80=81=E9=94=80=E5=94=AE=E8=81=94?=
=?UTF-8?q?=E7=B3=BB=E4=BA=BA=E3=80=81=E5=9B=9E=E6=AC=BE=E8=81=94=E7=B3=BB?=
=?UTF-8?q?=E4=BA=BA=E6=9F=A5=E8=AF=A2=E3=80=81=E5=AF=BC=E5=87=BA=20commit?=
=?UTF-8?q?ter:=20heyu?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../domain/EmisSettleInvoiceChRecord.java | 6 ++
.../EmisSettleInvoiceChRecordMapper.xml | 100 ++++++++++++++++++
2 files changed, 106 insertions(+)
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/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