From cd2ed591a01abcaef8dac4cc5ad3b398abacbaef Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期五, 28 八月 2026 11:13:41 +0800
Subject: [PATCH] feat: 环境配置

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

diff --git a/src/main/resources/mapper/sales/SalesLedgerMapper.xml b/src/main/resources/mapper/sales/SalesLedgerMapper.xml
index c145e0a..1cd1c37 100644
--- a/src/main/resources/mapper/sales/SalesLedgerMapper.xml
+++ b/src/main/resources/mapper/sales/SalesLedgerMapper.xml
@@ -19,6 +19,16 @@
         T1.sales_contract_no,
         T1.customer_contract_no,
         T1.project_name,
+        T1.project_id,
+        T1.year,
+        T1.signing_unit_id,
+        T1.office_id,
+        T1.group_leader_id,
+        T1.is_invoice,
+        T1.bid_price,
+        T1.is_bid,
+        T1.unbid_reason,
+        T1.contract_original_return_date,
         T1.entry_date,
         T1.salesman,
         T1.customer_id,
@@ -37,7 +47,10 @@
         LEFT JOIN sys_user T2 ON T1.entry_person = T2.user_id
         <where>
             <if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' ">
-                T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%')
+                AND T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%')
+            </if>
+            <if test="salesLedgerDto.projectId != null">
+                AND T1.project_id = #{salesLedgerDto.projectId}
             </if>
         </where>
     </select>
@@ -47,6 +60,16 @@
         T1.sales_contract_no,
         T1.customer_contract_no,
         T1.project_name,
+        T1.project_id,
+        T1.year,
+        T1.signing_unit_id,
+        T1.office_id,
+        T1.group_leader_id,
+        T1.is_invoice,
+        T1.bid_price,
+        T1.is_bid,
+        T1.unbid_reason,
+        T1.contract_original_return_date,
         T1.entry_date,
         T1.salesman,
         T1.customer_id,
@@ -56,6 +79,7 @@
         T1.attachment_materials,
         T1.tenant_id,
         T1.contract_amount,
+        T1.net_contract_amount,
         T1.contract_amount AS noInvoiceAmountTotal,
         T1.execution_date,
         T2.nick_name AS entry_person_name,
@@ -78,6 +102,9 @@
         <where>
             <if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' ">
                 AND T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%')
+            </if>
+            <if test="salesLedgerDto.projectId != null">
+                AND T1.project_id = #{salesLedgerDto.projectId}
             </if>
             <if test="salesLedgerDto.customerContractNo != null and salesLedgerDto.customerContractNo !='' ">
                 AND T1.customer_contract_no LIKE CONCAT('%',#{salesLedgerDto.customerContractNo},'%')
@@ -132,10 +159,12 @@
         from sales_ledger sl
         left join purchase_ledger pl on sl.id = pl.sales_ledger_id
         left join customer c on sl.customer_id = c.id
-        where 1=1
-        <if test="customerName != null and customerName != '' ">
-            and c.customer_name like concat('%',#{customerName},'%')
-        </if>
+        <where>
+            <if test="customerName != null and customerName != '' ">
+                and c.customer_name like concat('%',#{customerName},'%')
+            </if>
+        </where>
+        order by sl.entry_date desc
     </select>
 
 </mapper>

--
Gitblit v1.9.3