From 5deaede4715d2703aadcd33f94256b339b9e9140 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 14 四月 2026 10:09:08 +0800
Subject: [PATCH] feat(sales): 添加发票和销售台账查询过滤功能

---
 src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml b/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
index f501849..51b81fd 100644
--- a/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
+++ b/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
@@ -30,7 +30,8 @@
         sm.is_white,
         pl.approval_status,
         pl.payment_method,
-        pl.remarks
+        pl.remarks,
+        pl.status
         FROM purchase_ledger pl
         LEFT JOIN (
         SELECT
@@ -41,6 +42,9 @@
         ) tr_sum ON pl.id = tr_sum.purchase_ledger_id
         LEFT JOIN supplier_manage sm ON pl.supplier_id = sm.id
         <where>
+            <if test="c.status != null">
+                and pl.status = #{c.status}
+            </if>
             <if test="c.purchaseContractNumber != null and c.purchaseContractNumber != ''">
                 AND pl.purchase_contract_number LIKE CONCAT('%', #{c.purchaseContractNumber}, '%')
             </if>
@@ -62,6 +66,12 @@
             <if test="c.entryDateEnd != null and c.entryDateEnd != ''">
                 AND pl.entry_date &lt;= #{c.entryDateEnd}
             </if>
+            <if test="c.supplierId != null">
+                AND pl.supplier_id = #{c.supplierId}
+            </if>
+            <if test="c.approvalStatus != null">
+                AND pl.approval_status = #{c.approvalStatus}
+            </if>
         </where>
         ORDER BY pl.entry_date DESC
     </select>

--
Gitblit v1.9.3