RtInventoryMapper.xml
1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?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.eport.rest.dao.report.RtInventoryDao">
<sql id="Columns">
a.IN_TIME AS "inTime"
,a.COP_G_NO AS "copGNo"
,a.G_NO AS "gNo"
,SUM(a.NUM_VAL) as "numVal"
,SUM(a.OUT_VAL) as "outVal"
</sql>
<select id="findItemMat" parameterType="HashMap"
resultType="com.eport.rest.entity.report.RtInventoryEntity">
SELECT
<include refid="Columns"/>
FROM ept_in_storage a
WHERE 1=1
AND a.COP_G_NO = ''
<if test="gNo != null">
AND a.G_NO = #{gNo}
</if>
<if test="startTime !=null and startTime!=''">
AND a.IN_TIME >=#{startTime}
</if>
<if test="endTime !=null and endTime!=''">
AND a.IN_TIME <=#{endTime}
</if>
GROUP BY a.IN_TIME,a.G_NO,a.COP_G_NO
ORDER BY a.IN_TIME ASC
</select>
<select id="findMat" parameterType="HashMap"
resultType="com.eport.rest.entity.report.RtInventoryEntity">
SELECT
<include refid="Columns"/>
FROM ept_in_storage a
WHERE 1=1
<if test="copGNo != null">
AND a.COP_G_NO = #{copGNo}
</if>
<if test="gNo != null">
AND a.G_NO = #{gNo}
</if>
<if test="startTime !=null and startTime!=''">
AND a.IN_TIME >=#{startTime}
</if>
<if test="endTime !=null and endTime!=''">
AND a.IN_TIME <=#{endTime}
</if>
GROUP BY a.IN_TIME,a.G_NO,a.COP_G_NO
ORDER BY a.IN_TIME ASC
</select>
</mapper>