TaskHeaderMapper.xml
9.6 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
<?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">
<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="position" jdbcType="VARCHAR" property="position"/>
<result column="stack" jdbcType="VARCHAR" property="stack"/>
<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"/>
<result column="recvDock" jdbcType="VARCHAR" property="recvDock" />
<result column="containQty" jdbcType="INTEGER" property="containQty" />
</resultMap>
<select id="getReceiptTask" resultType="java.util.Map">
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
FROM task_detail td
INNER JOIN receipt_detail rd ON rd.id = td.billDetailId AND td.taskId = #{taskId,jdbcType=INTEGER}
</select>
<select id="UncompleteCount" resultType="java.lang.Integer">
SELECT COUNT(*) AS count FROM task_header WHERE status < 10 AND containerCode = #{containerCode} AND warehouseCode=#{warehouseCode}
</select>
<select id="getTasksStatus" resultType="com.huaheng.pc.task.taskHeader.domain.TaskHeader">
select *
FROM task_header
where lastStatus < 100
</select>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, warehouseCode, companyCode, taskType, internalTaskType, referenceId, referenceCode, fromLocation,`position`,stack,
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,
processStamp, containQty,stockId
</sql>
<select id="getTodayTask" resultType="integer">
SELECT count(1) FROM task_header
where TO_DAYS(created)=TO_DAYS(now())
</select>
<select id="getTaskCompleted" resultType="integer">
SELECT count(1) FROM task_header
where TO_DAYS(created)=TO_DAYS(now())
and status>=100
</select>
<select id="getIncompleteTask" resultType="integer">
SELECT count(1) FROM task_header
where TO_DAYS(created)=TO_DAYS(now())
and status<![CDATA[ < ]]>100
</select>
<select id="getDestackingData" resultType="com.huaheng.api.tv.domain.ProjectBean">
select "P3053" as name,if(sum(taskQty)is null,0,sum(taskQty)) as nums
FROM task_header
where port='P3053' and TO_DAYS(created)=TO_DAYS(now())
union
select "P3054" as name,if(sum(taskQty)is null,0,sum(taskQty)) as nums
FROM task_header
where port='P3054' and TO_DAYS(created)=TO_DAYS(now())
union
select "P3055" as name,if(sum(taskQty)is null,0,sum(taskQty)) as nums
FROM task_header
where port='P3055' and TO_DAYS(created)=TO_DAYS(now())
union
select "P3056" as name,if(sum(taskQty)is null,0,sum(taskQty)) as nums
FROM task_header
where port='P3056' and TO_DAYS(created)=TO_DAYS(now())
union
select "P3057" as name,if(sum(taskQty)is null,0,sum(taskQty)) as nums
FROM task_header
where port='P3057' and TO_DAYS(created)=TO_DAYS(now())
union
select "P3058" as name,if(sum(taskQty)is null,0,sum(taskQty)) as nums
FROM task_header
where port='P3058' and TO_DAYS(created)=TO_DAYS(now())
</select>
<select id="getPalletizingData" resultType="com.huaheng.api.tv.domain.ProjectBean">
select "P4035" as name,if(sum(taskQty)is null,0,sum(taskQty)) as nums
FROM task_header
where port='P4035' and TO_DAYS(created)=TO_DAYS(now())
union
select "P4031" as name,if(sum(taskQty)is null,0,sum(taskQty)) as nums
FROM task_header
where port='P4031' and TO_DAYS(created)=TO_DAYS(now())
union
select "P4027" as name,if(sum(taskQty)is null,0,sum(taskQty)) as nums
FROM task_header
where port='P4027' and TO_DAYS(created)=TO_DAYS(now())
union
select "P4023" as name,if(sum(taskQty)is null,0,sum(taskQty)) as nums
FROM task_header
where port='P4023' and TO_DAYS(created)=TO_DAYS(now())
union
select "P4019" as name,if(sum(taskQty)is null,0,sum(taskQty)) as nums
FROM task_header
where port='P4019' and TO_DAYS(created)=TO_DAYS(now())
union
select "P4015" as name,if(sum(taskQty)is null,0,sum(taskQty)) as nums
FROM task_header
where port='P4015' and TO_DAYS(created)=TO_DAYS(now())
</select>
<select id="getOrdersBeingPicked" resultType="com.huaheng.api.tv.domain.PickOrder">
select if(sh.referCode is null, '', sh.referCode) as code,
if(rs.car_number is null,'', rs.car_number) as carNumber,
if(sh.customerName is null,'', sh.customerName) as customerName,
th.port as port,th.taskQty as taskQty,th.qty as qty
from task_header th
left join shipment_header sh
on th.shipmentCode=sh.code
left join reservation_submission rs
on rs.order_number=sh.referCode
where th.port in('P3053','P3054','P3055','P3056','P3057','P3058')
and code!='' and rs.car_number!='' and th.status<![CDATA[ < ]]> 100
</select>
<select id="getOrdersWaitingPalletized" resultType="com.huaheng.api.tv.domain.PickOrder">
select if(sh.referCode is null, '', sh.referCode) as code,
if(rs.car_number is null,'', rs.car_number) as carNumber,
if(sh.customerName is null,'', sh.customerName) as customerName,
th.port as port,th.sequenceNumber as taskQty,th.sequence as qty
from task_header th
left join shipment_header sh
on th.shipmentCode=sh.code
left join reservation_submission rs
on rs.order_number=sh.referCode
where th.port in('P4035','P4031','P4027','P4023','P4019','P4015')
and th.status <![CDATA[ < ]]> 100
GROUP BY code
</select>
</mapper>