From 684e4306a08feeae188070f264148e6765da8dcf Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期日, 20 九月 2026 19:25:15 +0800
Subject: [PATCH] feat(account): 更新往来付款回款流水表及接口
---
src/main/resources/mapper/basic/CustomerMapper.xml | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/resources/mapper/basic/CustomerMapper.xml b/src/main/resources/mapper/basic/CustomerMapper.xml
index 2f3e800..e1df0a6 100644
--- a/src/main/resources/mapper/basic/CustomerMapper.xml
+++ b/src/main/resources/mapper/basic/CustomerMapper.xml
@@ -128,12 +128,12 @@
c.customer_name,
T1.contractAmounts AS contractAmounts,
IFNULL(T2.receiptPaymentAmount, 0) AS receiptPaymentAmount,
- IFNULL(T5.paymentAmount, 0) AS paymentAmount,
+ IFNULL(T5.receiptRecordAmount, 0) AS receiptRecordAmount,
T1.contractAmounts - IFNULL(T2.receiptPaymentAmount, 0) - IFNULL(T4.returnAmount, 0) AS receiptableAmount,
IFNULL(T4.returnAmount, 0) AS returnAmount
from (select customer_id, sum(contract_amount) as contractAmounts from sales_ledger group by customer_id) T1
left join (select customer_id, sum(collection_amount) as receiptPaymentAmount from account_sales_collection group by customer_id) T2 on T1.customer_id = T2.customer_id
- left join (select party_id, sum(amount) as paymentAmount from payment_record where party_type = 1 and direction = 1 group by party_id) T5 on T5.party_id = T1.customer_id
+ left join (select party_id, sum(amount) as receiptRecordAmount from payment_record where party_type = 1 and direction = 1 group by party_id) T5 on T5.party_id = T1.customer_id
left join (
select
sl.customer_id,
@@ -159,7 +159,7 @@
sl.execution_date,
sl.contract_amount AS contract_amount,
IFNULL(T1.receiptPaymentAmount, 0) AS receiptPaymentAmount,
- IFNULL(T5.paymentAmount, 0) AS paymentAmount,
+ IFNULL(T5.receiptRecordAmount, 0) AS receiptRecordAmount,
sl.contract_amount - IFNULL(T1.receiptPaymentAmount, 0) - IFNULL(T3.returnAmount, 0) AS receiptableAmount,
IFNULL(T3.returnAmount, 0) AS returnAmount
from sales_ledger sl
@@ -185,7 +185,7 @@
group by sl.id
)T3 on T3.id = sl.id
left join (
- select party_id, sum(amount) as paymentAmount
+ select party_id, sum(amount) as receiptRecordAmount
from payment_record
where party_type = 1 and direction = 1
group by party_id
--
Gitblit v1.9.3