From 8e36d6e7a2837df41b35ca46bd3678cc1a8d0533 Mon Sep 17 00:00:00 2001
From: Administrator <876263681@qq.com>
Date: 星期一, 30 十二月 2024 08:06:15 +0800
Subject: [PATCH] #导出优化,低库位满时,低库位的货往高库位寻找

---
 src/main/resources/mapper/ViewWorkInMapper.xml |  117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 114 insertions(+), 3 deletions(-)

diff --git a/src/main/resources/mapper/ViewWorkInMapper.xml b/src/main/resources/mapper/ViewWorkInMapper.xml
index 703625f..8086065 100644
--- a/src/main/resources/mapper/ViewWorkInMapper.xml
+++ b/src/main/resources/mapper/ViewWorkInMapper.xml
@@ -99,11 +99,13 @@
 
 <!-- 涓嶅垎椤垫煡璇㈡墍鏈変俊鎭紝鐢ㄤ簬excel瀵煎嚭 -->
 <select id="getViewWorkInAll" parameterType="com.zy.asrs.entity.ViewWorkInBean" resultType="com.zy.asrs.entity.ViewWorkInBean">
-	select count(1)
-	from asr_wrkin_view a
+<!--	select count(1)-->
+<!--	from asr_wrkin_view a-->
+<!--	where 1=1-->
+<!--	<include refid="viewWorkInConditionSql"></include>-->
+	select * from asr_wrkin_view
 	where 1=1
 	<include refid="viewWorkInConditionSql"></include>
-	order by io_time desc
 </select>
 
 <!-- 鍑哄簱缁熻 -->
@@ -142,5 +144,114 @@
 	<include refid="viewWorkInConditionSql"></include>
 	Order by a.io_time desc
 </select>
+<sql id="viewWorkInTtlConditionSql">
 
+	<if test="matnr!=null and matnr!='' ">
+		and matnr like '%' + #{matnr} + '%'
+	</if>
+	<if test="maktx!=null and maktx!='' ">
+		and (maktx like '%' + #{maktx} + '%'
+		or matnr like '%' + #{maktx} + '%'
+		or maktx like '%' + #{maktx} + '%'
+		or specs like '%' + #{maktx} + '%'
+		or anfme like '%' + #{maktx} + '%'
+		or batch like '%' + #{maktx} + '%'
+		or brand like '%' + #{maktx} + '%'
+		or unit like '%' + #{maktx} + '%'
+		)
+	</if>
+	<if test="begin_date!=null and begin_date!='' ">
+		<![CDATA[
+		and io_date >= #{begin_date}
+		]]>
+	</if>
+	<if test="end_date!=null and end_date!='' ">
+		<![CDATA[
+		and io_date <= #{end_date}
+		]]>
+	</if>
+</sql>
+<sql id="viewWorkOutTtlConditionSql">
+
+	<if test="matnr!=null and matnr!='' ">
+		and matnr like '%' + #{matnr} + '%'
+	</if>
+	<if test="maktx!=null and maktx!='' ">
+		and (maktx like '%' + #{maktx} + '%'
+		or matnr like '%' + #{maktx} + '%'
+		or maktx like '%' + #{maktx} + '%'
+		or specs like '%' + #{maktx} + '%'
+		or anfme like '%' + #{maktx} + '%'
+		or batch like '%' + #{maktx} + '%'
+		or brand like '%' + #{maktx} + '%'
+		or unit like '%' + #{maktx} + '%'
+		)
+	</if>
+	<if test="begin_date!=null and begin_date!='' ">
+		<![CDATA[
+		and io_date >= #{begin_date}
+		]]>
+	</if>
+	<if test="end_date!=null and end_date!='' ">
+		<![CDATA[
+		and io_date <= #{end_date}
+		]]>
+	</if>
+</sql>
+<select id="queryViewWorkInTtlList" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="com.zy.asrs.entity.ViewWorkInAllBean">
+	select
+	*
+	from (
+	select
+	ROW_NUMBER() OVER(Order by t.io_date desc) as row
+	, *
+	from (
+	select *
+	from asr_wrkin_ttl_view
+	where 1=1
+	<include refid="viewWorkInTtlConditionSql"></include>
+	) t
+	) a where 1=1 and a.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
+</select>
+
+<select id="getViewWorkInTtlCount" parameterType="com.zy.asrs.entity.ViewWorkInAllBean"	resultType="Integer">
+	select count(1)
+	from asr_wrkin_ttl_view a
+	where 1=1
+	<include refid="viewWorkInTtlConditionSql"></include>
+</select>
+<select id="getViewWorkInTtlAll" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="com.zy.asrs.entity.ViewWorkInAllBean">
+	select * from asr_wrkin_ttl_view
+	where 1=1
+	<include refid="viewWorkInTtlConditionSql"></include>
+</select>
+
+<select id="queryViewWorkOutTtlList" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="com.zy.asrs.entity.ViewWorkInAllBean">
+	select
+	*
+	from (
+	select
+	ROW_NUMBER() OVER(Order by t.io_date desc) as row
+	, *
+	from (
+	select *
+	from asr_wrkout_ttl_view
+	where 1=1
+	<include refid="viewWorkInTtlConditionSql"></include>
+	) t
+	) a where 1=1 and a.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
+</select>
+<select id="getViewWorkOutTtlCount" parameterType="com.zy.asrs.entity.ViewWorkInAllBean"	resultType="Integer">
+	select count(1)
+	from asr_wrkout_ttl_view a
+	where 1=1
+	<include refid="viewWorkInTtlConditionSql"></include>
+</select>
+<select id="getViewWorkOutTtlAll" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="com.zy.asrs.entity.ViewWorkInAllBean">
+	select *
+	from asr_wrkout_ttl_view a
+	where 1=1
+	<include refid="viewWorkInTtlConditionSql"></include>
+	Order by a.io_date desc
+</select>
 </mapper>

--
Gitblit v1.9.1