From d1fac30e634e33edd29e3440de1f91da84c150c1 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 05 六月 2026 15:38:39 +0800
Subject: [PATCH] feat(account): 新增付款状态管理功能并优化生产任务查询

---
 src/main/resources/mapper/account/purchase/AccountPaymentApplicationMapper.xml |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/account/purchase/AccountPaymentApplicationMapper.xml b/src/main/resources/mapper/account/purchase/AccountPaymentApplicationMapper.xml
index 8f180a4..f7a6936 100644
--- a/src/main/resources/mapper/account/purchase/AccountPaymentApplicationMapper.xml
+++ b/src/main/resources/mapper/account/purchase/AccountPaymentApplicationMapper.xml
@@ -18,6 +18,7 @@
         <result column="apply_date" property="applyDate" />
         <result column="remark" property="remark" />
         <result column="status" property="status" />
+        <result column="payment_status" property="paymentStatus" />
         <result column="payment_amount" property="paymentAmount" />
     </resultMap>
      <select
@@ -25,7 +26,8 @@
          resultType="com.ruoyi.account.bean.vo.purchase.AccountPaymentApplicationVo">
         select * from (select apa.*,
                sm.supplier_name,
-               GROUP_CONCAT(sir.inbound_batches SEPARATOR ',') AS inboundBatches
+               GROUP_CONCAT(sir.inbound_batches SEPARATOR ',') AS inboundBatches,
+               IFNULL((SELECT SUM(app.payment_amount) FROM account_purchase_payment app WHERE app.account_payment_application_id = apa.id), 0) AS paidAmount
         from account_payment_application apa
         left join supplier_manage sm on apa.supplier_id = sm.id
         left join stock_in_record sir on FIND_IN_SET(sir.id, apa.stock_in_record_ids) > 0
@@ -40,6 +42,9 @@
              <if test="req.status != null">
                  AND A.status = #{req.status}
             </if>
+            <if test="req.paymentStatus != null">
+                 AND A.payment_status = #{req.paymentStatus}
+            </if>
             <if test="req.startDate != null and req.endDate != null">
                 AND A.apply_date BETWEEN #{req.startDate} AND #{req.endDate}
             </if>

--
Gitblit v1.9.3