From 4e703e5c6117f9502043cf659dbc03e8da9254c4 Mon Sep 17 00:00:00 2001
From: 李天宇 <876263681@qq.com>
Date: 星期六, 09 十一月 2024 10:24:07 +0800
Subject: [PATCH] #update 新增日出入库明细汇总

---
 src/main/resources/mapper/ViewWorkInMapper.xml |  109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 109 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/ViewWorkInMapper.xml b/src/main/resources/mapper/ViewWorkInMapper.xml
index e63997b..8086065 100644
--- a/src/main/resources/mapper/ViewWorkInMapper.xml
+++ b/src/main/resources/mapper/ViewWorkInMapper.xml
@@ -144,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