From 828641ce9d4178bbff9030ad19ce93d0267f185c Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期三, 17 九月 2025 08:36:42 +0800
Subject: [PATCH] no message

---
 zy-asrs-wms/src/main/resources/mapper/asrs/ViewLocDetlMapper.xml |   54 ++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/zy-asrs-wms/src/main/resources/mapper/asrs/ViewLocDetlMapper.xml b/zy-asrs-wms/src/main/resources/mapper/asrs/ViewLocDetlMapper.xml
index 05e8e9e..c55097b 100644
--- a/zy-asrs-wms/src/main/resources/mapper/asrs/ViewLocDetlMapper.xml
+++ b/zy-asrs-wms/src/main/resources/mapper/asrs/ViewLocDetlMapper.xml
@@ -3,24 +3,26 @@
 <mapper namespace="com.zy.asrs.wms.asrs.mapper.ViewLocDetlMapper">
 
     <select id="queryStock" resultType="map">
-        select * from view_man_loc_detl ld
-        where matnr = #{matnr}
-        and freeze = 0
-        <if test="batch!=null">
-            and batch = #{batch}
+        SELECT * FROM
+        (
+        SELECT id, loc_id, loc_no, mat_id, IFNULL(type_id, 4) AS type_id, work_qty, matnr, order_no, batch, anfme, host_id, memo,deleted,create_time, freeze
+        FROM
+        view_man_loc_detl
+        ) t
+        WHERE t.deleted = 0 AND t.freeze = 0 AND type_id = #{type}
+        <if test="matnr != null and matnr != ''">
+            AND t.matnr = #{matnr}
         </if>
-        <if test="param!=null and param.size()>0">
-            <foreach item="item" collection="param" index="index">
-                <if test="item.value!=null">
-                    and ${item.name} = #{item.value}
-                </if>
-            </foreach>
+        <if test="batch != null">
+            AND t.batch = #{batch}
         </if>
         <if test="sortParam!=null and sortParam.size()>0">
             <foreach collection="sortParam" item="item" open="order by " separator="," close="  ">
-                ${item.name} ${item.value}
+                ${item.name}  ${item.value}
             </foreach>
         </if>
+        ORDER BY
+        t.create_time ASC
     </select>
 
     <select id="getList" resultType="map">
@@ -31,7 +33,7 @@
         </if>
         <if test="param!=null and param.size()>0">
             <foreach item="item" collection="param" index="index">
-                <if test="item.value!=null">
+                <if test="item.value !=null and item.value != ''">
                     and ${item.name} = #{item.value}
                 </if>
             </foreach>
@@ -63,7 +65,6 @@
     </select>
 
 
-
     <select id="listSuitableMat" resultType="map">
         select * from view_man_loc_detl ld
         where 1=1
@@ -78,4 +79,29 @@
             </foreach>
         </if>
     </select>
+    <select id="queryFlatStock" resultType="map">
+        SELECT * FROM
+        (
+        SELECT id, loc_id, loc_no, mat_id, type_id, work_qty, matnr, order_no, batch, anfme, host_id, memo,create_time,  freeze
+        FROM
+        view_man_loc_detl
+        WHERE
+        deleted = 0
+        AND type_id IN ( SELECT id FROM man_loc_area_type WHERE parent_id = #{typeId} OR id = #{typeId} )
+        ) t
+        WHERE 1 = 1
+        <if test="matnr != null and matnr != ''">
+            AND t.matnr = #{matnr}
+        </if>
+        <if test="batch != null">
+            AND t.batch = #{batch}
+        </if>
+        <!--        <if test="params != null and params.size() > 0">-->
+        <!--            <foreach collection="params" item="item" open="in " separator="," close="  ">-->
+        <!--                ${item.name} #{item.value}-->
+        <!--            </foreach>-->
+        <!--        </if>-->
+        ORDER BY
+        t.create_time ASC
+    </select>
 </mapper>

--
Gitblit v1.9.1