From f21530d33ca23aeeba2ef073ac6b64422e4e26ca Mon Sep 17 00:00:00 2001
From: cl <1442464845@qq.com>
Date: 星期四, 30 四月 2026 12:17:55 +0800
Subject: [PATCH] 库位编号规则和和CTU保持一致
---
rsf-server/src/main/resources/mapper/manager/LocMapper.xml | 43 +++++++++++++++++++++++++++++++++++++++----
1 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/rsf-server/src/main/resources/mapper/manager/LocMapper.xml b/rsf-server/src/main/resources/mapper/manager/LocMapper.xml
index 88ef7cd..e44f27f 100644
--- a/rsf-server/src/main/resources/mapper/manager/LocMapper.xml
+++ b/rsf-server/src/main/resources/mapper/manager/LocMapper.xml
@@ -10,7 +10,7 @@
FROM
man_loc l
INNER JOIN man_loc_item loi ON l.id = loi.loc_id
- WHERE l.deleted = 0
+ WHERE l.deleted = 0 AND loi.deleted = 0
GROUP BY
use_status
</select>
@@ -24,18 +24,53 @@
li.maktx,
li.spec,
li.batch,
- SUM( li.anfme ) anfme,
+ SUM(li.anfme) AS anfme,
li.splr_id,
li.unit,
l.update_time
FROM
man_loc l
LEFT JOIN man_loc_item li ON l.id = li.loc_id
- WHERE l.deleted = 0
+ <where>
+ l.deleted = 0 AND li.deleted = 0
+ <if test="conds != null">
+ <if test="conds.code != null and conds.code != ''">
+ AND l.code LIKE CONCAT('%', #{conds.code}, '%')
+ </if>
+ <if test="conds.barcode != null and conds.barcode != ''">
+ AND l.barcode = #{conds.barcode}
+ </if>
+ <if test="conds.warehouseId != null">
+ AND l.warehouse_id = #{conds.warehouseId}
+ </if>
+ <if test="conds.areaId != null">
+ AND l.area_id = #{conds.areaId}
+ </if>
+ <choose>
+ <when test="conds.matnrCode != null and conds.matnrCode != ''">
+ AND li.matnr_code = #{conds.matnrCode}
+ </when>
+ <when test="conds.matnr != null and conds.matnr != ''">
+ AND li.matnr_code = #{conds.matnr}
+ </when>
+ </choose>
+ <if test="conds.batch != null and conds.batch != ''">
+ AND li.batch = #{conds.batch}
+ </if>
+ </if>
+ </where>
GROUP BY
+ li.loc_code,
li.loc_id,
+ l.barcode,
+ li.matnr_code,
li.matnr_id,
- li.batch
+ li.maktx,
+ li.spec,
+ li.batch,
+ li.splr_id,
+ li.unit,
+ l.update_time
ORDER BY
l.update_time DESC
</select>
--
Gitblit v1.9.1