From 71dda4d73cf891ef83759925855c3a88fa4fc6b8 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期二, 12 五月 2026 10:05:10 +0800
Subject: [PATCH] 解决user不存在问题

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

diff --git a/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml b/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
index e0f219f..7f11d07 100644
--- a/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
+++ b/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
@@ -14,7 +14,10 @@
         END as has_sufficient_stock
         FROM
         sales_ledger_product T1
-        LEFT JOIN stock_inventory t2 ON T1.product_model_id = t2.product_model_id
+        LEFT JOIN (
+        select product_model_id,SUM(qualitity) as qualitity,sum(locked_quantity) as locked_quantity from stock_inventory
+        group by product_model_id
+        )  t2 ON T1.product_model_id = t2.product_model_id
         LEFT JOIN product_model T3 ON T1.product_model_id = T3.id
         <where>
             <if test="salesLedgerProduct.salesLedgerId != null">

--
Gitblit v1.9.3