ShipmentContainerHeaderMapper.xml
7.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<?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.huaheng.pc.shipment.shipmentContainerHeader.mapper.ShipmentContainerHeaderMapper">
<select id="getShipmentContainerMaxAndMinStatusByShipmentID" resultType="java.util.Map">
SELECT MAX(`status`) maxStatus , MIN(`status`) minStatus from shipment_container_header t join shipment_container_detail b on t.id = b.headerId
WHERE b.shipmentHeaderId = #{shipmentId}
</select>
<select id="getShipmentContainerHeaderByContainerCode"
resultType="com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader">
SELECT * from shipment_container_header where shipmentContainerCode = #{containerCode} and `status` < 30 limit 1
</select>
<select id="listShipmentHeaders" resultType="com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader">
SELECT id, code, warehouseId, warehouseCode, companyId, companyCode, sourceCode, sourcePlatform, type, shipTo,
priority, station, totalQty, totalLines, remark, uploadremark, uploadTime, appointmentTime, firstStatus,
lastStatus, uploadStatus, created, createdBy, lastUpdated, lastUpdatedBy, enable, userDef1, userDef2, userDef3
FROM shipment_header
<where>
<if test="id != null">
AND id = #{id}
</if>
<if test="code != null">
AND code = #{code}
</if>
<if test="warehouseId != null">
AND warehouseId = #{warehouseId}
</if>
<if test="warehouseCode != null">
AND warehouseCode = #{warehouseCode}
</if>
<if test="companyId != null">
AND companyId = #{companyId}
</if>
<if test="companyCode != null">
AND companyCode = #{companyCode}
</if>
<if test="sourceCode != null">
AND sourceCode = #{sourceCode}
</if>
<if test="sourcePlatform != null">
AND sourcePlatform = #{sourcePlatform}
</if>
<if test="type != null">
AND type = #{type}
</if>
<if test="shipTo != null">
AND shipTo = #{shipTo}
</if>
<if test="priority != null">
AND priority = #{priority}
</if>
<if test="station != null">
AND station = #{station}
</if>
<if test="totalQty != null">
AND totalQty = #{totalQty}
</if>
<if test="totalLines != null">
AND totalLines = #{totalLines}
</if>
<if test="remark != null">
AND remark = #{remark}
</if>
<if test="uploadremark != null">
AND uploadremark = #{uploadremark}
</if>
<if test="uploadTime != null">
AND uploadTime = #{uploadTime}
</if>
<if test="appointmentTime != null">
AND appointmentTime = #{appointmentTime}
</if>
<if test="firstStatus != null">
AND firstStatus <= #{firstStatus}
</if>
<if test="lastStatus != null">
AND lastStatus >= #{lastStatus}
</if>
<if test="uploadStatus != null">
AND uploadStatus = #{uploadStatus}
</if>
<if test="created != null">
AND created = #{created}
</if>
<if test="createdBy != null">
AND createdBy = #{createdBy}
</if>
<if test="lastUpdated != null">
AND lastUpdated = #{lastUpdated}
</if>
<if test="lastUpdatedBy != null">
AND lastUpdatedBy = #{lastUpdatedBy}
</if>
<if test="enable != null">
AND enable = #{enable}
</if>
<if test="userDef1 != null">
AND userDef1 = #{userDef1}
</if>
<if test="userDef2 != null">
AND userDef2 = #{userDef2}
</if>
<if test="userDef3 != null">
AND userDef3 = #{userDef3}
</if>
<if test="sectionStartTime != null">
AND created >= #{sectionStartTime}
</if>
<if test="sectionEndTime != null">
AND created <= #{sectionEndTime}
</if>
</where>
</select>
<select id="getShipmentContainerHeaders" resultType="com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader">
SELECT id, shipmentContainerCode, warehouseId, warehouseCode, taskType, status, created, createdBy
FROM shipment_container_header
<where>
<if test="id != null">
AND id = #{id}
</if>
<if test="shipmentContainerCode != null">
AND shipmentContainerCode = #{shipmentContainerCode}
</if>
<if test="warehouseId != null">
AND warehouseId = #{warehouseId}
</if>
<if test="warehouseCode != null">
AND warehouseCode = #{warehouseCode}
</if>
<if test="taskType != null">
AND taskType = #{taskType}
</if>
<if test="status != null">
AND status = #{status}
</if>
<if test="created != null">
AND created = #{created}
</if>
<if test="createdBy != null">
AND createdBy = #{createdBy}
</if>
<if test="sectionStartTime != null">
AND created >= #{sectionStartTime}
</if>
<if test="sectionEndTime != null">
AND created <= #{sectionEndTime}
</if>
</where>
</select>
<select id="selectUnCompletedShipmentContainer" resultType="com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader">
SELECT id, shipmentContainerCode, warehouseId, warehouseCode, taskType, status, created, createdBy
FROM shipment_container_header
<where>
AND status < 20
<if test="id != null ">
AND id = #{id}
</if>
<if test="shipmentContainerCode != null and shipmentContainerCode != ''">
<bind name="shipmentContainerCodePattern" value="'%' + shipmentContainerCode + '%'" />
AND shipmentContainerCode like #{shipmentContainerCodePattern}
</if>
<if test="warehouseId != null ">
AND warehouseId = #{warehouseId}
</if>
<if test="warehouseCode != null and warehouseCode != ''">
<bind name="warehouseCodePattern" value="'%' + warehouseCode + '%'" />
AND warehouseCode like #{warehouseCodePattern}
</if>
<if test="taskType != null ">
AND taskType = #{taskType}
</if>
<if test="params != null and params.createdBegin != null and params.createdBegin != ''">
AND created >= #{params.createdBegin}
</if>
<if test="params != null and params.createdEnd != null and params.createdEnd != ''">
AND created <= #{params.createdEnd}
</if>
<if test="createdBy != null and createdBy != ''">
<bind name="createdByPattern" value="'%' + createdBy + '%'" />
AND createdBy like #{createdByPattern}
</if>
</where>
</select>
</mapper>