From 18fa07479d3c7f5a9b683ab0f698528d9bd2a9ec Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 21 四月 2026 11:23:53 +0800
Subject: [PATCH] feat: 入库管理、出库台账增加合同号字段;支持合同模糊查询

---
 src/main/resources/mapper/sales/SalesLedgerMapper.xml |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/sales/SalesLedgerMapper.xml b/src/main/resources/mapper/sales/SalesLedgerMapper.xml
index e8c6788..99f36e8 100644
--- a/src/main/resources/mapper/sales/SalesLedgerMapper.xml
+++ b/src/main/resources/mapper/sales/SalesLedgerMapper.xml
@@ -55,6 +55,7 @@
         T1.customer_name,
         T1.entry_person,
         T1.remarks,
+        T1.customer_remarks,
         T1.attachment_materials,
         T1.tenant_id,
         T1.contract_amount,
@@ -94,8 +95,22 @@
             <if test="salesLedgerDto.stockStatus != null">
                 AND T1.stock_status = #{salesLedgerDto.stockStatus}
             </if>
+            <if test="salesLedgerDto.width != null or salesLedgerDto.height != null">
+                AND EXISTS (
+                SELECT 1
+                FROM sales_ledger_product SLP
+                WHERE SLP.sales_ledger_id = T1.id
+                AND SLP.type = 1
+                <if test="salesLedgerDto.width != null">
+                    AND SLP.width = #{salesLedgerDto.width}
+                </if>
+                <if test="salesLedgerDto.height != null">
+                    AND SLP.height = #{salesLedgerDto.height}
+                </if>
+                )
+            </if>
         </where>
-        ORDER BY T1.entry_date DESC
+        ORDER BY T1.entry_date DESC,T1.id DESC
     </select>
 
     <select id="selectIncomeStats" resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto">

--
Gitblit v1.9.3