<?xml version="1.0" encoding="UTF-8"?>
|
<!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">
|
|
<!-- mapper不支持sql语句嵌套时,采用sql片段包含方式,解决xml标签问题 -->
|
<sql id="viewStockUseConditionSql">
|
<if test="row1!=null and row1!='' ">
|
and row1 like '%' + #{row1} + '%'
|
</if>
|
</sql>
|
|
<!-- 分页查询所有信息 -->
|
<select id="queryViewStockUseList" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultType="com.zy.asrs.entity.ViewStockUseBean">
|
select top (#{pageSize}) * from asr_stk_use_view
|
<where>
|
row1 not in (select top ((#{pageNumber}-1)*#{pageSize}) row1 from asr_stk_use_view
|
<where>
|
1=1
|
<include refid="viewStockUseConditionSql"></include>
|
</where>
|
order by row1 asc)
|
<include refid="viewStockUseConditionSql"></include>
|
<![CDATA[
|
order by row1 asc
|
]]>
|
</where>
|
</select>
|
|
<select id="getViewStockUseCount" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultType="Integer">
|
select count(1) from asr_stk_use_view
|
<where>
|
<![CDATA[
|
1=1
|
]]>
|
<include refid="viewStockUseConditionSql"></include>
|
</where>
|
</select>
|
|
<!-- 不分页查询所有信息,用于excel导出 -->
|
<select id="getViewStockUseAll" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultType="com.zy.asrs.entity.ViewStockUseBean">
|
select * from asr_stk_use_view
|
<where>
|
<![CDATA[
|
1=1
|
]]>
|
<include refid="viewStockUseConditionSql"></include>
|
<![CDATA[
|
order by row1 asc
|
]]>
|
</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 < #{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 *
|
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 < #{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>
|