From 9609e2b096fac01efaa56958042b4175bbc25d5b Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期二, 18 十一月 2025 14:36:45 +0800
Subject: [PATCH] 1
---
src/main/resources/mapper/ViewStockUseMapper.xml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 48 insertions(+), 4 deletions(-)
diff --git a/src/main/resources/mapper/ViewStockUseMapper.xml b/src/main/resources/mapper/ViewStockUseMapper.xml
index 7f04cf5..4fa8d30 100644
--- a/src/main/resources/mapper/ViewStockUseMapper.xml
+++ b/src/main/resources/mapper/ViewStockUseMapper.xml
@@ -2,7 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zy.asrs.mapper.ReportQueryMapper">
-
+ <resultMap id="ViewStockUseMap" type="com.zy.asrs.entity.ViewStockUseBean">
+ <result property="row1" column="row1"/>
+ <result property="total_qty" column="total_qty"/>
+ <result property="full_qty" column="full_qty"/>
+ <result property="null_qty" column="null_qty"/>
+ <result property="forbid_qty" column="forbid_qty"/>
+ <result property="empty_qty" column="empty_qty"/>
+ <result property="full_rate" column="full_rate"/>
+ <result property="occ_rate" column="occ_rate"/>
+ </resultMap>
<!-- mapper涓嶆敮鎸乻ql璇彞宓屽鏃讹紝閲囩敤sql鐗囨鍖呭惈鏂瑰紡锛岃В鍐硏ml鏍囩闂 -->
<sql id="viewStockUseConditionSql">
<if test="row1!=null and row1!='' ">
@@ -11,7 +20,7 @@
</sql>
<!-- 鍒嗛〉鏌ヨ鎵�鏈変俊鎭� -->
-<select id="queryViewStockUseList" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultType="com.zy.asrs.entity.ViewStockUseBean">
+<select id="queryViewStockUseList" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultMap="ViewStockUseMap">
select top (#{pageSize}) * from asr_stk_use_view
<where>
row1 not in (select top ((#{pageNumber}-1)*#{pageSize}) row1 from asr_stk_use_view
@@ -57,12 +66,30 @@
ROW_NUMBER() OVER(Order by a.oneday desc) as row
, *
FROM(
- SELECT * FROM asr_wrkin_count_view) a ) b
+ SELECT * FROM asr_wrkin_count_view
+ WHERE
+ 1 = 1 AND
+ (oneday > #{start}
+ AND
+ oneday < #{end})
+
+ <if test="matnr != null and matnr !=''">
+ and matnr = #{matnr}
+ </if>
+
+ ) a ) b
WHERE 1=1 and b.row between ((#{curr}-1)*#{limit}+1) and (#{curr}*#{limit})
</select>
<select id="selectWorkCountInTotal" resultType="java.lang.Integer">
SELECT COUNT(*) FROM asr_wrkin_count_view
+ WHERE 1= 1 AND
+ (oneday > #{start}
+ AND
+ oneday < #{end})
+ <if test="matnr != null and matnr !='' ">
+ and matnr = #{matnr}
+ </if>
</select>
<select id="selectWorkCountOut" resultType="com.zy.asrs.entity.ViewWorkCountInView">
SELECT *
@@ -71,11 +98,28 @@
ROW_NUMBER() OVER(Order by a.oneday desc) as row
, *
FROM(
- SELECT * FROM asr_wrkout_count_view) a ) b
+ SELECT * FROM asr_wrkout_count_view
+ WHERE
+ 1 = 1 AND
+ (oneday > #{start}
+ AND
+ oneday < #{end})
+
+ <if test="matnr != null and matnr !=''">
+ and matnr = #{matnr}
+ </if>
+ ) a ) b
WHERE 1=1 and b.row between ((#{curr}-1)*#{limit}+1) and (#{curr}*#{limit})
</select>
<select id="selectWorkCountOutTotal" resultType="java.lang.Integer">
SELECT COUNT(*) FROM asr_wrkout_count_view
+ WHERE 1= 1 AND
+ (oneday > #{start}
+ AND
+ oneday < #{end})
+ <if test="matnr != null and matnr !='' ">
+ and matnr = #{matnr}
+ </if>
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1