From ce6b5be6c0e1544bcc66f9fce9efec3ced724d95 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期六, 11 七月 2020 15:46:29 +0800
Subject: [PATCH] #

---
 src/main/resources/mapper/LocDetlMapper.xml |   45 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/LocDetlMapper.xml b/src/main/resources/mapper/LocDetlMapper.xml
index ec9b6e1..89e1c85 100644
--- a/src/main/resources/mapper/LocDetlMapper.xml
+++ b/src/main/resources/mapper/LocDetlMapper.xml
@@ -21,7 +21,50 @@
         <result column="modi_time" property="modiTime" />
         <result column="appe_user" property="appeUser" />
         <result column="appe_time" property="appeTime" />
-
     </resultMap>
 
+    <sql id="stockOutCondition">
+        <if test="loc_no!=null and loc_no!='' ">
+            and a.loc_no like '%' + #{loc_no} + '%'
+        </if>
+        <if test="matnr!=null and matnr!='' ">
+            and a.matnr like '%' + #{matnr} + '%'
+        </if>
+        <if test="maktx!=null and maktx!='' ">
+            and a.maktx like '%' + #{maktx} + '%'
+        </if>
+        <if test="anfme!=null and anfme!='' ">
+            and a.anfme like '%' + #{anfme} + '%'
+        </if>
+        <if test="altme!=null and altme!='' ">
+            and a.altme like '%' + #{altme} + '%'
+        </if>
+        <if test="startTime!=null and endTime!=null">
+            and a.modi_time between #{startTime} and #{endTime}
+        </if>
+    </sql>
+
+    <select id="getStockOutPage" resultMap="BaseResultMap">
+        select * from
+        (
+            select
+            ROW_NUMBER() over (order by a.appe_time,a.matnr,a.loc_no) as row,
+            a.*
+            from asr_loc_detl a
+            left join asr_loc_mast b on a.loc_no = b.loc_no
+            where 1=1
+            and b.loc_type = 'F'
+            <include refid="stockOutCondition"></include>
+        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
+    </select>
+
+    <select id="getStockOutPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
+        select
+        count(1)
+        from asr_loc_detl a
+        left join asr_loc_mast b on a.loc_no = b.loc_no
+        where 1=1
+        and b.loc_type = 'F'
+        <include refid="stockOutCondition"></include>
+    </select>
 </mapper>

--
Gitblit v1.9.1