From fb57e7836338304b16c09fec4fb5c68fb688c39e Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期二, 28 四月 2026 14:03:24 +0800
Subject: [PATCH] 1.新增分区查询 2.任务档新增分区字段

---
 src/main/resources/mapper/ManLocDetlMapper.xml |   45 ++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/mapper/ManLocDetlMapper.xml b/src/main/resources/mapper/ManLocDetlMapper.xml
index 77652f4..cd6c105 100644
--- a/src/main/resources/mapper/ManLocDetlMapper.xml
+++ b/src/main/resources/mapper/ManLocDetlMapper.xml
@@ -38,10 +38,24 @@
             and mld.host_id = #{host_id}
         </if>
         <if test="loc_no != null and loc_no != ''">
-            and mld.loc_no like concat('%',#{loc_no},'%')
+            and (
+                mld.loc_no like concat('%',#{loc_no},'%')
+                or exists (
+                    select 1 from asr_loc_mast alm
+                    where alm.loc_no = mld.loc_no
+                    and alm.loc_alias like concat('%',#{loc_no},'%')
+                )
+            )
         </if>
         <if test="locNo != null and locNo != ''">
-            and mld.loc_no like concat('%',#{loc_no},'%')
+            and (
+                mld.loc_no like concat('%',#{locNo},'%')
+                or exists (
+                    select 1 from asr_loc_mast alm
+                    where alm.loc_no = mld.loc_no
+                    and alm.loc_alias like concat('%',#{locNo},'%')
+                )
+            )
         </if>
         <if test="matnr != null and matnr != ''">
             and mld.matnr like concat('%',#{matnr},'%')
@@ -58,10 +72,24 @@
             and v.host_id = #{host_id}
         </if>
         <if test="loc_no != null and loc_no != ''">
-            and v.loc_no like concat('%',#{loc_no},'%')
+            and (
+                v.loc_no like concat('%',#{loc_no},'%')
+                or exists (
+                    select 1 from asr_loc_mast alm
+                    where alm.loc_no = v.loc_no
+                    and alm.loc_alias like concat('%',#{loc_no},'%')
+                )
+            )
         </if>
         <if test="locNo != null and locNo != ''">
-            and v.loc_no like concat('%',#{loc_no},'%')
+            and (
+                v.loc_no like concat('%',#{locNo},'%')
+                or exists (
+                    select 1 from asr_loc_mast alm
+                    where alm.loc_no = v.loc_no
+                    and alm.loc_alias like concat('%',#{locNo},'%')
+                )
+            )
         </if>
         <if test="matnr != null and matnr != ''">
             and v.matnr like concat('%',#{matnr},'%')
@@ -220,7 +248,14 @@
             and a.node_id like '%' + #{node_id} + '%'
         </if>
         <if test="loc_no!=null and loc_no!='' ">
-            and a.loc_no like '%' + #{loc_no} + '%'
+            and (
+                a.loc_no like '%' + #{loc_no} + '%'
+                or exists (
+                    select 1 from asr_loc_mast alm
+                    where alm.loc_no = a.loc_no
+                    and alm.loc_alias like '%' + #{loc_no} + '%'
+                )
+            )
         </if>
         <if test="matnr!=null and matnr!='' ">
             and a.matnr like '%' + #{matnr} + '%'

--
Gitblit v1.9.1