From ef75cf1b5e6f23f5ec039946ebaeb9e71ac864fc Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期二, 10 二月 2026 16:43:02 +0800
Subject: [PATCH] 生成缺勤记录

---
 src/main/resources/mapper/sales/SalesLedgerProductMapper.xml |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml b/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
index 01f0e89..d8655c9 100644
--- a/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
+++ b/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
@@ -8,7 +8,7 @@
         SELECT
         T1.*,
         CASE
-        WHEN t2.qualitity > T1.quantity THEN 1
+        WHEN t2.qualitity-t2.locked_quantity >= T1.quantity THEN 1
         ELSE 0
         END as has_sufficient_stock
         FROM
@@ -31,7 +31,7 @@
                  left join production_product_main ppm on qi.product_main_id = ppm.id
                  left join product_work_order pwo on ppm.work_order_id = pwo.id
                  left join product_order po on pwo.product_order_id = po.id
-                 left join sales_ledger_product slp on po.product_model_id = slp.id
+                 left join sales_ledger_product slp on po.sale_ledger_product_id = slp.id
         where qi.product_main_id = #{productMainId}
 
 
@@ -97,7 +97,7 @@
                 AND slp.product_category like concat('%',#{req.productCategory},'%')
             </if>
             <if test="req.status != null and req.status ">
-                AND slp.pending_invoice_total &gt; 0
+                AND slp.pending_tickets_total &gt; 0
             </if>
         </where>
         order by slp.register_date desc

--
Gitblit v1.9.3