1
2
3
<?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.task.taskHeader.mapper.TaskHeaderMapper" >
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
<resultMap id= "BaseResultMap" type= "com.huaheng.pc.task.taskHeader.domain.TaskHeader" >
<!--@mbg.generated-->
<id column= "id" jdbcType= "INTEGER" property= "id" />
<result column= "warehouseCode" jdbcType= "VARCHAR" property= "warehouseCode" />
<result column= "companyCode" jdbcType= "VARCHAR" property= "companyCode" />
<result column= "taskType" jdbcType= "VARCHAR" property= "taskType" />
<result column= "internalTaskType" jdbcType= "VARCHAR" property= "internalTaskType" />
<result column= "referenceId" jdbcType= "INTEGER" property= "referenceId" />
<result column= "referenceCode" jdbcType= "VARCHAR" property= "referenceCode" />
<result column= "assignedUser" jdbcType= "VARCHAR" property= "assignedUser" />
<result column= "confirmedBy" jdbcType= "VARCHAR" property= "confirmedBy" />
<result column= "waveId" jdbcType= "INTEGER" property= "waveId" />
<result column= "pickingCartCode" jdbcType= "VARCHAR" property= "pickingCartCode" />
<result column= "pickingCartPos" jdbcType= "VARCHAR" property= "pickingCartPos" />
<result column= "fromLocation" jdbcType= "VARCHAR" property= "fromLocation" />
<result column= "toLocation" jdbcType= "VARCHAR" property= "toLocation" />
<result column= "containerCode" jdbcType= "VARCHAR" property= "containerCode" />
<result column= "startPickDateTime" jdbcType= "TIMESTAMP" property= "startPickDateTime" />
<result column= "endPickDateTime" jdbcType= "TIMESTAMP" property= "endPickDateTime" />
<result column= "rebatchLoc" jdbcType= "VARCHAR" property= "rebatchLoc" />
<result column= "finishRebatch" jdbcType= "INTEGER" property= "finishRebatch" />
<result column= "rebatchGroupCode" jdbcType= "VARCHAR" property= "rebatchGroupCode" />
<result column= "allowRebatch" jdbcType= "INTEGER" property= "allowRebatch" />
<result column= "taskProcessType" jdbcType= "VARCHAR" property= "taskProcessType" />
<result column= "rebinBench" jdbcType= "VARCHAR" property= "rebinBench" />
<result column= "rebined" jdbcType= "INTEGER" property= "rebined" />
<result column= "startRebinDateTime" jdbcType= "TIMESTAMP" property= "startRebinDateTime" />
<result column= "endRebinDateTime" jdbcType= "TIMESTAMP" property= "endRebinDateTime" />
<result column= "rebinedBy" jdbcType= "VARCHAR" property= "rebinedBy" />
<result column= "exceptionCode" jdbcType= "VARCHAR" property= "exceptionCode" />
<result column= "exceptionHandledBy" jdbcType= "VARCHAR" property= "exceptionHandledBy" />
<result column= "created" jdbcType= "TIMESTAMP" property= "created" />
<result column= "createdBy" jdbcType= "VARCHAR" property= "createdBy" />
<result column= "lastUpdated" jdbcType= "TIMESTAMP" property= "lastUpdated" />
<result column= "lastUpdatedBy" jdbcType= "VARCHAR" property= "lastUpdatedBy" />
<result column= "version" jdbcType= "INTEGER" property= "version" />
<result column= "userDef1" jdbcType= "VARCHAR" property= "userDef1" />
<result column= "userDef2" jdbcType= "VARCHAR" property= "userDef2" />
<result column= "userDef3" jdbcType= "VARCHAR" property= "userDef3" />
<result column= "processStamp" jdbcType= "VARCHAR" property= "processStamp" />
周鸿
authored
about a year ago
44
45
<result column= "recvDock" jdbcType= "VARCHAR" property= "recvDock" />
<result column= "containQty" jdbcType= "INTEGER" property= "containQty" />
46
47
</resultMap>
<select id= "getReceiptTask" resultType= "java.util.Map" >
周鸿
authored
about a year ago
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
SELECT rd.id receiptDetailId,
rd.receiptId,
td.taskId,
td.warehouseCode,
td.id taskDetailId,
td.status,
td.containerCode,
td.qty,
td.materialCode,
rd.totalQty,
td.materialSpec,
rd.receiptCode,
rd.inventorySts,
td.materialName,
rd.batch,
rd.lot,
rd.projectNo,
rd.manufactureDate,
rd.expirationDate
67
FROM task_detail td
周鸿
authored
about a year ago
68
69
INNER JOIN receipt_detail rd ON rd.id = td.billDetailId AND td.taskId = #{taskId,jdbcType=INTEGER}
</select>
70
71
<select id= "UncompleteCount" resultType= "java.lang.Integer" >
周鸿
authored
about a year ago
72
73
74
75
76
77
SELECT COUNT(*) AS count
FROM task_header
WHERE status
< 100
AND containerCode = #{containerCode}
AND warehouseCode=#{warehouseCode}
78
79
</select>
80
<select id= "getTasksStatus" resultType= "com.huaheng.pc.task.taskHeader.domain.TaskHeader" >
周鸿
authored
about a year ago
81
82
83
select *
FROM task_header
where lastStatus < 100
84
</select>
85
86
87
88
89
90
91
92
93
94
<sql id= "Base_Column_List" >
<!--@mbg.generated-->
id, warehouseCode, companyCode, taskType, internalTaskType, referenceId, referenceCode, fromLocation,
assignedUser, confirmedBy, waveId, pickingCartCode, pickingCartPos, containerCode, toLocation,
startPickDateTime, endPickDateTime, rebatchLoc, finishRebatch, rebatchGroupCode,
allowRebatch, taskProcessType, rebinBench, rebined, startRebinDateTime, endRebinDateTime,
rebinedBy, exceptionCode, exceptionHandledBy, created, createdBy, lastUpdated, lastUpdatedBy,
version, userDef1, userDef2, userDef3,
95
processStamp, containQty
96
97
</sql>
98
<select id= "getUnCompleteTaskList" resultType= "java.lang.Integer" parameterType= "java.lang.String" >
99
select count(*) from task_header where status < 100
100
101
102
103
104
105
106
107
<choose>
<when test= "s !=null" >
and containerCode like CONCAT(#{s},'%')
</when>
<otherwise>
and (containerCode like 'L%' or containerCode like 'B%')
</otherwise>
</choose>
108
and taskType =800
109
</select>
110
111
<select id= "autoCompleteDX" resultType= "com.huaheng.pc.task.taskHeader.domain.TaskHeader" >
周鸿
authored
about a year ago
112
113
114
115
116
select *
from task_header
where warehouseCode = 'KS0001'
and (containerCode like "X%" or containerCode like "D%")
and status < 100
117
</select>
118
119
<select id= "selectLists" resultType= "com.huaheng.pc.task.taskDetail.domain.TaskDetail" >
120
SELECT distinct r.id, r.taskId,r.companyCode,r.warehouseCode,r.referenceCode,
周鸿
authored
about a year ago
121
122
r.billCode,r.billDetailId,r.fromInventoryId,c.name companyName,
r.referenceCode,
123
124
125
126
r.materialCode, r.materialName materialName,
-- m.barCode barCode,
-- m.spec materialSpec,
-- m.userDef1 materialOldCode,
周鸿
authored
about a year ago
127
128
129
r.containerCode, r.fromLocation, r.toLocation,
r.qty, t.taskType, r.status, r.lastUpdated, r.lastUpdatedBy,
r.projectNo
130
131
132
FROM task_detail r
inner join task_header t on t.id=r.taskId
inner join company c on r.companyCode=c.code
133
-- inner join material m on m.code=r.materialCode
134
135
136
137
138
139
140
141
142
143
144
<where>
<if test= "warehouseCode != null and warehouseCode != '' " >
AND r.warehouseCode = #{warehouseCode}
</if>
<if test= "companyCodeList != null and companyCodeList.size() > 0 " >
AND r.companyCode in
<foreach collection= "companyCodeList" item= "companyCodeItem" open= "(" separator= "," close= ")" >
#{companyCodeItem}
</foreach>
</if>
145
146
and t.port = #{station} and r.containerCode like CONCAT(#{shelfNo},'%')
and SUBSTRING(r.containerCode,6,1)=#{shelf} and r.status < =10 and r.number=1
周鸿
authored
about a year ago
147
order by r.referenceCode asc
148
149
150
</where>
</select>
151
<select id= "selectList1" resultType= "com.huaheng.pc.task.taskDetail.domain.TaskDetail" >
152
SELECT distinct r.id, r.taskId,r.companyCode,r.warehouseCode,
周鸿
authored
about a year ago
153
r.referenceCode,c.name companyName,r.materialCode, r.materialName,
154
r.containerCode, r.fromLocation,
周鸿
authored
about a year ago
155
156
r.toLocation, r.qty, t.taskType, r.status,
r.lastUpdated, r.lastUpdatedBy, r.projectNo
157
158
159
FROM task_detail r
inner join task_header t on t.id=r.taskId
inner join company c on r.companyCode=c.code
160
161
162
163
164
165
166
167
168
169
170
171
<where>
<if test= "warehouseCode != null and warehouseCode != '' " >
AND r.warehouseCode = #{warehouseCode}
</if>
<if test= "companyCodeList != null and companyCodeList.size() > 0 " >
AND r.companyCode in
<foreach collection= "companyCodeList" item= "companyCodeItem" open= "(" separator= "," close= ")" >
#{companyCodeItem}
</foreach>
</if>
周鸿
authored
about a year ago
172
173
and t.port = #{station} and r.containerCode like CONCAT(#{shelfNo},'%') and r.status=10 order by
r.referenceCode asc
174
175
176
</where>
</select>
177
<select id= "selectTaskLists" resultType= "com.huaheng.pc.task.taskDetail.domain.TaskDetail" >
178
SELECT r.id, r.taskId,r.companyCode,r.warehouseCode,r.referenceCode,
周鸿
authored
about a year ago
179
180
c.name companyName,
r.materialCode, r.materialName,
181
182
-- m.barCode materialOldCode,m.spec materialSpec,
r.containerCode,
周鸿
authored
about a year ago
183
184
185
r.fromLocation, r.toLocation, r.qty, t.taskType,
r.status, r.lastUpdated, r.lastUpdatedBy, r.projectNo,
r.goodsShelfNo
186
187
188
FROM task_detail r
inner join task_header t on t.id=r.taskId
inner join company c on r.companyCode=c.code
189
-- inner join material m on m.code=r.materialCode
190
191
<where>
192
and c.warehouseCode=t.warehouseCode
193
194
195
196
<if test= "warehouseCode != null and warehouseCode != '' " >
AND r.warehouseCode = #{warehouseCode}
</if>
<if test= "station != null and station != '' " >
197
AND t.port = #{station}
198
199
200
201
202
203
204
</if>
<if test= "companyCodeList != null and companyCodeList.size() > 0 " >
AND r.companyCode in
<foreach collection= "companyCodeList" item= "companyCodeItem" open= "(" separator= "," close= ")" >
#{companyCodeItem}
</foreach>
</if>
205
and t.zoneCode='AGV' and r.status=10 order by r.referenceCode asc
206
207
</where>
</select>
208
209
<select id= "selectNofinishReceiptTaskBycontainer" resultType= "com.huaheng.pc.task.taskHeader.domain.TaskHeader" >
周鸿
authored
about a year ago
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
select *
from task_header
where taskType in (100, 200)
and warehouseCode = #{warehouseCode}
and zoneCode = "LK"
and status < 100
and containerCode = #{code}
</select>
<select id= "selectTaskInWeek" resultType= "java.util.Map" >
SELECT DATE_FORMAT(date, '%Y-%m-%d') AS date,ifnull(data.num,0) AS counts
FROM (
SELECT @days := DATE_ADD(@days, INTERVAL - 1 DAY) AS date
FROM (SELECT @days := DATE_ADD(CURDATE(), INTERVAL + 1 DAY)
FROM task_header
) day
WHERE DATE_FORMAT(@days, '%Y-%m-%d') >=
DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 6 DAY), '%Y-%m-%d')
ORDER BY date
) dates
LEFT JOIN (
SELECT COUNT(1) AS num, DATE (created) AS time
FROM task_header
WHERE warehouseCode = #{warehouseCode}
AND DATE_FORMAT(created, '%Y-%m-%d %H:%i:%S') >=
DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 7 DAY), '%Y-%m-%d %H:%i:%S')
GROUP BY DATE (created)
) data
ON DATE (time) = date
ORDER BY date
241
</select>
周鸿
authored
12 months ago
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<select id= "tvTaskHistoryDetail" resultType= "java.util.Map" >
SELECT DATE_FORMAT(lastUpdated, '%Y-%m-%d') AS days,COUNT(1) AS taskNum
FROM task_header
WHERE warehouseCode=#{warehouseCode} and zoneCode=#{zoneCode} and internalTaskType=#{internalTaskType}
<if test= "containerCode != null and containerCode != '' " >
AND containerCode like concat(#{containerCode},'%')
</if>
and ( created > = #{startTime}
AND created < = #{endTime})
group by days
</select>
<select id= "tvTaskHistoryCompleteDetail" resultType= "java.util.Map" >
SELECT DATE_FORMAT(lastUpdated, '%Y-%m-%d') AS days, COUNT(1) AS completNum
FROM task_header
WHERE warehouseCode=#{warehouseCode} and zoneCode=#{zoneCode} and `status`=100 and
internalTaskType=#{internalTaskType}
<if test= "containerCode != null and containerCode != '' " >
AND containerCode like concat(#{containerCode},'%')
</if>
and ( lastUpdated > = #{startTime}
AND lastUpdated < = #{endTime})
group by days
</select>
<select id= "tvTaskHistoryTypeDetail" resultType= "java.util.Map" >
SELECT DATE_FORMAT(lastUpdated, '%Y-%m-%d') AS days, COUNT(1) AS completNum
FROM task_header
WHERE warehouseCode=#{warehouseCode} and zoneCode=#{zoneCode}
and taskType=#{taskType}
<if test= "containerCode != null and containerCode != '' " >
AND containerCode like concat(#{containerCode},'%')
</if>
and ( lastUpdated > = #{startTime}
AND lastUpdated < = #{endTime})
group by days
</select>
<select id= "tvTaskHistoryDetailGroupType" resultType= "java.util.Map" >
SELECT count(1) taskNum,taskType
FROM task_header
WHERE warehouseCode=#{warehouseCode} and zoneCode=#{zoneCode}
<if test= "containerCode != null and containerCode != '' " >
AND containerCode like concat(#{containerCode},'%')
</if>
and created> = #{startTime} group by taskType
</select>
292
</mapper>