From 6797af492e55d2e63a95ed8f6d86e274f85a09c3 Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期一, 26 一月 2026 13:24:31 +0800
Subject: [PATCH] 6.8 查询所有库位状态和物料-二机床信息化数字孪生用

---
 src/main/resources/mapper/ViewStockUseMapper.xml |   75 +++++++++++++++++++++++++++++++++++++
 1 files changed, 74 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/ViewStockUseMapper.xml b/src/main/resources/mapper/ViewStockUseMapper.xml
index 5cfb94c..cf1c9e0 100644
--- a/src/main/resources/mapper/ViewStockUseMapper.xml
+++ b/src/main/resources/mapper/ViewStockUseMapper.xml
@@ -9,9 +9,20 @@
 			and row1 like '%' + #{row1} + '%'
 		</if>
 </sql>
+	<resultMap id="ViewStockUseMap" type="com.zy.asrs.entity.ViewStockUseBean">
+		<id column="row1" property="row1"/>
 
+		<result column="total_qty"  property="total_qty"/>
+		<result column="full_qty"   property="full_qty"/>
+		<result column="null_qty"   property="null_qty"/>
+		<result column="forbid_qty" property="forbid_qty"/>
+		<result column="empty_qty"  property="empty_qty"/>
+		<!--		<result column="use_qty"    property="use_qty"/>-->
+		<result column="full_rate"  property="full_rate"/>
+		<result column="occ_rate"   property="occ_rate"/>
+	</resultMap>
 <!-- 鍒嗛〉鏌ヨ鎵�鏈変俊鎭� -->
-<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 
@@ -50,5 +61,67 @@
 	]]>
 </where>
 </select>
+    <select id="selectWorkCountIn" resultType="com.zy.asrs.entity.ViewWorkCountInView">
+		SELECT *
+		FROM (
+		select
+			ROW_NUMBER() OVER(Order by a.oneday desc) as row
+		, *
+		FROM(
+		SELECT * FROM asr_wrkin_count_view
+		         WHERE
+		         1 = 1 AND
+		         (oneday > #{start}
+		         AND
+				oneday &lt; #{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 &lt; #{end})
+		<if test="matnr != null and matnr !='' ">
+			and matnr = #{matnr}
+		</if>
+	</select>
+	<select id="selectWorkCountOut" resultType="com.zy.asrs.entity.ViewWorkCountInView">
+		SELECT *
+		FROM (
+				 select
+					 ROW_NUMBER() OVER(Order by a.oneday desc) as row
+		, *
+				 FROM(
+						 SELECT * FROM asr_wrkout_count_view
+		WHERE
+		1 = 1 AND
+		(oneday > #{start}
+		AND
+		oneday &lt; #{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 &lt; #{end})
+		<if test="matnr != null and matnr !='' ">
+			and matnr = #{matnr}
+		</if>
+	</select>
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1