From 23f8b9beca05dd2d90bc2a16635f5fcc1754d8c1 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <xltys1995>
Date: 星期五, 02 四月 2021 20:33:10 +0800
Subject: [PATCH] #
---
src/main/resources/mapper/LocDetlMapper.xml | 69 ++++++++++++++++++++++++++++++++++
1 files changed, 69 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/LocDetlMapper.xml b/src/main/resources/mapper/LocDetlMapper.xml
index 27026b9..3bf1b0d 100644
--- a/src/main/resources/mapper/LocDetlMapper.xml
+++ b/src/main/resources/mapper/LocDetlMapper.xml
@@ -130,4 +130,73 @@
order by mp.prio desc, mld.create_time asc
</select>
+ <select id="getLocDetlStatis" resultMap="BaseResultMap">
+ select
+ ROW_NUMBER() over (order by sum(a.anfme) desc) as row
+ , a.matnr
+ , sum(a.anfme) as anfme
+ from man_loc_detl a
+ where 1=1
+ group by a.matnr
+ </select>
+
+ <select id="selectByNodeUuid" resultMap="BaseResultMap">
+ select * from man_loc_detl mld left join man_node mn on mld.node_id = mn.id
+ where 1=1
+ and mn.uuid = #{uuid}
+ and mld.status = 1
+ order by mld.create_time
+ </select>
+
+ <select id="getStockStatis" resultMap="BaseResultMap">
+ select * from
+ (
+ select
+ ROW_NUMBER() over (order by sum(a.anfme) desc) as row
+ , a.matnr
+ , sum(a.anfme) as anfme
+ from man_loc_detl a
+ where 1=1
+ <include refid="stockOutCondition"></include>
+ 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
+ (
+ select
+ a.matnr
+ from man_loc_detl a
+ where 1=1
+ <include refid="stockOutCondition"></include>
+ group by a.matnr
+ ) b
+ </select>
+
+ <sql id="stockOutCondition">
+ <if test="node_id!=null and node_id!='' ">
+ and a.node_id like '%' + #{node_id} + '%'
+ </if>
+ <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>
+ </sql>
+
+ <select id="getStockStatisExcel" resultMap="BaseResultMap">
+ select
+ ROW_NUMBER() over (order by sum(a.anfme) desc) as row
+ , a.matnr
+ , sum(a.anfme) as anfme
+ from man_loc_detl a
+ where 1=1
+ group by a.matnr
+ </select>
+
</mapper>
--
Gitblit v1.9.1