From ebd793bbc910b095aaa15d9e733324bbeb8b94a9 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期一, 12 一月 2026 08:13:08 +0800
Subject: [PATCH] 1

---
 src/main/resources/mapper/LocDetlMapper.xml |  121 ++++++++++++++++++++++++++++++++++++++--
 1 files changed, 115 insertions(+), 6 deletions(-)

diff --git a/src/main/resources/mapper/LocDetlMapper.xml b/src/main/resources/mapper/LocDetlMapper.xml
index 5ea709d..ad33ebc 100644
--- a/src/main/resources/mapper/LocDetlMapper.xml
+++ b/src/main/resources/mapper/LocDetlMapper.xml
@@ -44,6 +44,7 @@
         <result column="appe_user" property="appeUser" />
         <result column="appe_time" property="appeTime" />
         <result column="memo" property="memo" />
+        <result column="owner" property="owner" />
     </resultMap>
 
     <sql id="batchSeq">
@@ -108,8 +109,17 @@
         <if test="manu!=null and manu!='' ">
             and a.manu like '%' + #{manu} + '%'
         </if>
+        <if test="batch!=null and batch!='' ">
+            and a.batch like '%' + #{batch} + '%'
+        </if>
+        <if test="owner!=null and owner!='' ">
+            and a.owner = #{owner}
+        </if>
         <if test="startTime!=null and endTime!=null">
             and a.modi_time between #{startTime} and #{endTime}
+        </if>
+        <if test="locType2!=null and locType2!='' ">
+            and b.loc_type2 = #{locType2}
         </if>
     </sql>
 
@@ -182,6 +192,42 @@
         ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
     </select>
 
+    <select id="getStockStatisDate" resultType="com.zy.asrs.entity.LocDetl">
+        select * from
+        (
+        select
+        ROW_NUMBER() over (order by a.anfme,a.batch desc) as row
+        , a.matnr
+        , a.loc_no as locNo
+        , a.batch
+        , a.anfme
+        , a.modi_time as modiTime
+        from asr_loc_detl a
+        where 1=1
+        <include refid="stockOutCondition"></include>
+        group by a.matnr,a.batch,a.anfme, a.loc_no, a.modi_time
+        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
+    </select>
+
+    <select id="getStockStatisOut" resultType="com.zy.asrs.entity.LocDetl">
+        select * from
+        (
+        select
+        ROW_NUMBER() over (order by sum(a.anfme) desc) as row
+        , a.matnr
+        , sum(a.anfme) as anfme
+        from asr_loc_detl a
+        left join man_mat m
+        on m.matnr = a.matnr
+        where 1=1
+        <include refid="stockOutCondition"></include>
+        <if test="matType !=null and matType !='' ">
+            and m.mat_type = #{matType}
+        </if>
+        group by a.matnr
+        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
+    </select>
+
     <select id="getStockStatisCount" parameterType="java.util.Map" resultType="java.lang.Integer">
      select count(1) as count from
         (
@@ -192,6 +238,35 @@
         <include refid="stockOutCondition"></include>
         group by a.matnr
      ) b
+    </select>
+
+    <select id="getStockStatisDateCount" parameterType="java.util.Map" resultType="java.lang.Integer">
+        select count(1) as count from
+        (
+        select
+        a.matnr
+        from asr_loc_detl a
+        where 1=1
+        <include refid="stockOutCondition"></include>
+        group by a.matnr
+        ) b
+    </select>
+
+    <select id="getStockStatisOutCount" parameterType="java.util.Map" resultType="java.lang.Integer">
+        select count(1) as count from
+        (
+        select
+        a.matnr
+        from asr_loc_detl a
+        left join man_mat m
+        on m.matnr = a.matnr
+        where 1=1
+        <include refid="stockOutCondition"></include>
+        <if test="matType !=null and matType !='' ">
+            and m.mat_type = #{matType}
+        </if>
+        group by a.matnr
+        ) b
     </select>
 
     <select id="getStockStatisExcel" resultType="com.zy.asrs.entity.LocDetl">
@@ -249,7 +324,6 @@
             left join asr_loc_mast b on a.loc_no = b.loc_no
             where 1=1
             and b.loc_sts = 'F' and b.frozen != 1
-            and a.manu is null
             and a.matnr = #{matnr}
             <choose>
                 <when test="batch != null and batch != ''">
@@ -272,7 +346,6 @@
             left join asr_loc_mast b on a.loc_no = b.loc_no
             where 1=1
             and b.loc_sts = 'F' and b.frozen != 1
-            and a.manu is null
             and a.matnr = #{matnr}
             <choose>
                 <when test="batch != null and batch != ''">
@@ -295,7 +368,6 @@
             left join asr_loc_mast b on a.loc_no = b.loc_no
             where 1=1
             and b.loc_sts = 'F' and b.frozen != 1
-            and a.manu is null
             and a.matnr = #{matnr}
             <choose>
                 <when test="batch != null and batch != ''">
@@ -318,7 +390,6 @@
             left join asr_loc_mast b on a.loc_no = b.loc_no
             where 1=1
             and b.loc_sts = 'F' and b.frozen != 1
-            and a.manu is null
             and a.matnr = #{matnr}
             <choose>
                 <when test="batch != null and batch != ''">
@@ -341,7 +412,6 @@
             left join asr_loc_mast b on a.loc_no = b.loc_no
             where 1=1
             and b.loc_sts = 'F' and b.frozen != 1
-            and a.manu is null
             and a.matnr = #{matnr}
             <choose>
                 <when test="batch != null and batch != ''">
@@ -364,7 +434,6 @@
             left join asr_loc_mast b on a.loc_no = b.loc_no
             where 1=1
             and b.loc_sts = 'F' and b.frozen != 1
-            and a.manu is null
             and a.matnr = #{matnr}
             <choose>
                 <when test="batch != null and batch != ''">
@@ -509,9 +578,49 @@
         SELECT  *  FROM [dbo].[asr_loc_detl_group] WHERE 1 = 1
         <include refid="groupListCondition"></include>
     </select>
+
     <select id="selectByLocNo" resultMap="BaseResultMap">
         SELECT * FROM asr_loc_detl WHERE loc_no = #{locNo}
+    </select>
 
+    <select id="selectByLocNosAndMatnr" resultMap="BaseResultMap">
+        SELECT * FROM asr_loc_detl WHERE loc_no in
+        <foreach item="item" collection="locNos" index="index"  separator="," open="(" close=")">
+            #{item}
+        </foreach>
+        and matnr = #{matnr}
+    </select>
+
+    <select id="searchByLike" resultMap="BaseResultMap">
+        select *
+        from asr_loc_detl
+        where
+        1 = 1
+        <if test="orderNo != null and orderNo != ''">
+            and order_no like '%' + #{orderNo} + '%'
+        </if>
+        <if test="locNo != null and locNo != ''">
+            and loc_no like '%' + #{locNo} + '%'
+        </if>
+        <if test="specs != null and specs != ''">
+            and specs like '%' + #{specs} + '%'
+        </if>
+        <if test="matnr != null and matnr != ''">
+            and matnr like '%' + #{matnr} + '%'
+        </if>
+        <if test="maktx != null and maktx != ''">
+            and maktx like '%' + #{maktx} + '%';
+        </if>
+    </select>
+
+    <select id="findAreaByMatnr" resultMap="BaseResultMap">
+        select * from asr_loc_detl ld
+        left join asr_loc_mast lm
+        on lm.loc_no = ld.loc_no
+        where matnr = #{matnr}
+        and loc_type2 = #{locType2}
+        and loc_sts = 'F'
+        order by row1,bay1,lev1,ld.appe_time
     </select>
 
 </mapper>

--
Gitblit v1.9.1