From 5f73eb1fb9d04040fe6ba377d5ae582024429f2f Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期日, 20 九月 2026 14:15:02 +0800
Subject: [PATCH] feat(sales): 添加客户交易详情中的付款金额字段

---
 src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml b/src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
index f1a87ca..138e882 100644
--- a/src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
+++ b/src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
@@ -20,12 +20,19 @@
             t2.tax_exclusive_total_price,
             t3.inbound_num as quantityStock
         from  purchase_ledger t1
-        left join sales_ledger_product t2 on t1.id = t2.sales_ledger_id and slp.type = 2
+        left join sales_ledger_product t2 on t1.id = t2.sales_ledger_id and t2.type = 2
         left join procurement_record_storage t3 on t2.id = t3.sales_ledger_product_id
-        where t1.purchase_contract_number = #{req.purchaseContractNumber}
-        <if test="req.id != null and req.id != ''">
-            and t3.id = #{req.id}
-        </if>
+        <where>
+            <if test="req.purchaseLedgerId != null">
+                and t1.id = #{req.purchaseLedgerId}
+            </if>
+            <if test="req.purchaseContractNumber != null and req.purchaseContractNumber != ''">
+                and t1.purchase_contract_number = #{req.purchaseContractNumber}
+            </if>
+            <if test="req.id != null and req.id != ''">
+                and t3.id = #{req.id}
+            </if>
+        </where>
         group by t2.id
     </select>
     <select id="listPage" resultType="com.ruoyi.procurementrecord.bean.dto.ProcurementPageDto">

--
Gitblit v1.9.3