InMatDetailMapper.xml
2.3 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?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.InMatDetailDao">
<select id="listAll" parameterType="HashMap"
resultType="com.eport.rest.entity.report.InMatDetailEntity">
SELECT
d.BOOK_NO AS "bookNo",
d.TRADE_MODE AS "tradeMode",
c.c_entryId AS "entryId",
c.c_preEntryId AS "preEntryId",
c.c_iEFlag AS "iEFlag",
c.c_dDate AS "dDate",
c.c_copGNo AS "copGNo",
c.c_gNo2 AS "gNo2",
c.c_gName AS "gName",
c.c_gQty AS "gQty",
c.c_unit1 AS "unit1",
c.c_declPrice AS "declPrice"
FROM
(SELECT
b.BOOK_ID AS "c_bookId",
a.ENTRY_ID AS "c_entryId",
b.PRE_ENTRY_ID AS "c_preEntryId",
b.I_E_FLAG AS "c_iEFlag",
b.D_DATE AS "c_dDate",
a.COP_G_NO AS "c_copGNo",
a.G_NO2 AS "c_gNo2",
a.G_NAME AS "c_gName",
a.G_QTY AS "c_gQty",
a.UNIT_1 AS "c_unit1",
a.DECL_PRICE AS "c_declPrice"
FROM ept_entry_body a INNER JOIN ept_entry_head b ON b.ENTRY_ID = a.ENTRY_ID
WHERE 1=1
<if test="gName != null and gName !=''">
AND a.G_NAME LIKE CONCAT(CONCAT('%',#{gName}),'%')
</if>
<if test="entryId !=null and entryId !=''">
AND a.ENTRY_ID LIKE CONCAT(CONCAT('%',#{entryId}),'%')
</if>
<if test="copGNo != null and copGNo !=''">
AND a.COP_G_NO LIKE CONCAT(CONCAT('%',#{copGNo}),'%')
</if>
<if test="gNo2 != null and gNo2 !=''">
AND a.G_NO2 = #{gNo2}
</if>
<if test="startTime !=null and startTime!=''">
AND b.D_DATE >=#{startTime}
</if>
<if test="endTime !=null and endTime!=''">
AND b.D_DATE <=#{endTime}
</if>
) c
INNER JOIN ept_book d ON c.c_bookId = d.ID
WHERE 1=1
<if test="bookId != null">
AND d.ID = #{bookId}
</if>
<if test="tradeMode!=null and tradeMode != ''">
AND d.TRADE_MODE = #{tradeMode}
</if>
</select>
<!--<select id="pageAll" parameterType="HashMap"-->
<!--resultType="com.eport.rest.entity.report.InMatDetailEntity">-->
<!--</select>-->
</mapper>