From 7a58bc3ae9cccf4ee69821a3c7e45f98f1b41114 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 12 十月 2026 13:09:04 +0800
Subject: [PATCH] feat(stock): 出库批次下拉增加客户与合同号信息展示

---
 src/main/resources/mapper/stock/StockInventoryMapper.xml |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/stock/StockInventoryMapper.xml b/src/main/resources/mapper/stock/StockInventoryMapper.xml
index 82709f5..54bc56b 100644
--- a/src/main/resources/mapper/stock/StockInventoryMapper.xml
+++ b/src/main/resources/mapper/stock/StockInventoryMapper.xml
@@ -736,6 +736,16 @@
         order by sir.id desc
         limit 1
         ) as oil_product,
+        <!-- 鎵规鏉ユ簮鐨勫悎鍚岋細鍏ュ簱璁板綍缁戝畾鐨勯攢鍞彴璐︼紙sales_ledger_id锛夊悎鍚屽彿锛涘鎴峰悕绉颁笂鏂� customer_name 宸插甫鍑� -->
+        (
+        select sl.sales_contract_no
+        from stock_in_record sir
+        inner join sales_ledger sl on sl.id = sir.sales_ledger_id
+        where sir.product_model_id = combined.product_model_id
+        and (sir.batch_no = combined.batch_no or (combined.batch_no is null and sir.batch_no is null))
+        order by sir.id desc
+        limit 1
+        ) as sales_contract_no,
         (
         select sir.tank_inspection_status
         from stock_in_record sir

--
Gitblit v1.9.3