From 81e3a9603003a5f4b2ca6320493d4918aaa9ae49 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期四, 10 八月 2023 13:17:02 +0800
Subject: [PATCH] #BUG修复
---
src/main/resources/mapper/LocDetlMapper.xml | 89 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 88 insertions(+), 1 deletions(-)
diff --git a/src/main/resources/mapper/LocDetlMapper.xml b/src/main/resources/mapper/LocDetlMapper.xml
index 08dbbe2..82b0450 100644
--- a/src/main/resources/mapper/LocDetlMapper.xml
+++ b/src/main/resources/mapper/LocDetlMapper.xml
@@ -443,7 +443,7 @@
</choose>
order by
- DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time), a.anfme
+ a.manu,DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time), a.anfme
desc,
NEWID(),
case
@@ -499,6 +499,93 @@
end
desc
</select>
+ <sql id="selectAllSql">
+ <if test="locNo!=null and locNo!='' ">
+ and t.loc_no like '%' + #{locNo} + '%'
+ </if>
+ <if test="matnr != null and matnr !='' ">
+ and t.matnr like '%' + #{matnr} + '%'
+ </if>
+ <if test="owner != null and owner !='' ">
+ and t.owner like '%' + #{owner} + '%'
+ </if>
+ <if test="payment != null and payment !='' ">
+ and t.payment = #{payment}
+ </if>
+
+ </sql>
+ <select id="selectAllOwner" resultType="com.zy.asrs.entity.result.LocDetlAll" parameterType="com.zy.asrs.entity.result.LocDetlDTO">
+ SELECT * FROM (
+ SELECT ROW_NUMBER() over(order by matnr) as row,* FROM (
+ SELECT * FROM asr_loc_detl_all
+ ) t
+ WHERE 1=1
+ <include refid="selectAllSql"></include>
+ ) a
+ WHERE a.row BETWEEN ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
+ </select>
+ <select id="selectAllCount" resultType="java.lang.Integer" parameterType="com.zy.asrs.entity.result.LocDetlDTO">
+ SELECT count(*) FROM (
+ SELECT ROW_NUMBER() over(order by matnr) as row,* FROM (
+ SELECT * FROM asr_loc_detl_all
+ ) t
+ WHERE 1=1
+ <include refid="selectAllSql"></include>
+ ) a
+
+ </select>
+ <select id="selectAllPyment" resultType="com.zy.asrs.entity.result.LocDetlAll" parameterType="com.zy.asrs.entity.result.LocDetlDTO">
+ SELECT * FROM (
+ SELECT ROW_NUMBER() over(order by matnr) as row,* FROM (
+ SELECT * FROM asr_loc_detl_all
+ ) t
+ WHERE 1=1
+ <include refid="selectAllSql"></include>
+ ) a
+ WHERE a.row BETWEEN ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
+ </select>
+
+
+
+ <select id="selectAllPymentcount" resultType="java.lang.Integer" parameterType="com.zy.asrs.entity.result.LocDetlDTO">
+ SELECT count(*) FROM (
+ SELECT ROW_NUMBER() over(order by matnr) as row,* FROM (
+ SELECT * FROM asr_loc_detl_all
+ ) t
+ WHERE 1=1
+ <include refid="selectAllSql"></include>
+ ) a
+
+ </select>
+ <select id="getStockStatisAll" resultType="com.zy.asrs.entity.result.LocDetlAll">
+ 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_all 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="getStockStatisCountAll" parameterType="java.util.Map" resultType="java.lang.Integer">
+ select count(1) as count from
+ (
+ select
+ a.matnr
+ from asr_loc_detl_all a
+ where 1=1
+ <include refid="stockOutCondition"></include>
+ group by a.matnr
+ ) b
+ </select>
+
+ <select id="sumAll" resultType="java.lang.Double">
+ SELECT SUM(anfme) FROM asr_loc_detl_all
+ </select>
</mapper>
--
Gitblit v1.9.1