|
@@ -17,8 +17,10 @@
|
17
|
17
|
, base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no as 'rtnOdrDtlInfo.rtn_podr_dtl_no'
|
18
|
18
|
, ptcl.rtn_req_unq_no as 'rtnOdrDtlInfo.rtn_req_unq_no', ptcl.rtn_req_dtl_no as 'rtnOdrDtlInfo.rtn_req_dtl_no'
|
19
|
19
|
, ptcl.item_id as 'rtnOdrDtlInfo.item_id', ptcl.item_nm as 'rtnOdrDtlInfo.item_nm'
|
20
|
|
- , base.rtn_whs_id, fn_whs_nm(base.brand_id, base.rtn_whs_id) as rtn_whs_nm, ptcl.unit_amt as 'rtnOdrDtlInfo.unit_amt'
|
21
|
|
- , ptcl.rtn_qty as 'rtnOdrDtlInfo.rtn_qty', ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.rtn_odr_qty'
|
|
20
|
+ , base.rtn_whs_id, base.rtn_location, fn_whs_nm(base.brand_id, base.rtn_whs_id) as rtn_whs_nm
|
|
21
|
+ , fn_whs_location_nm(base.brand_id, base.rtn_whs_id, base.rtn_location) as rtn_location_nm
|
|
22
|
+ , ptcl.unit_amt as 'rtnOdrDtlInfo.unit_amt'
|
|
23
|
+ , ptcl.rtn_req_qty as 'rtnOdrDtlInfo.rtn_req_qty', ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.rtn_odr_qty'
|
22
|
24
|
, date_format(base.col_req_dt,'%Y.%m.%d') as col_req_dt, ptcl.rtn_amt as 'rtnOdrDtlInfo.rtn_amt'
|
23
|
25
|
, base.whs_id, fn_whs_nm(base.brand_id, base.whs_id) as whs_nm
|
24
|
26
|
, base.location, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
|
|
@@ -84,6 +86,31 @@
|
84
|
86
|
|
85
|
87
|
</select>
|
86
|
88
|
|
|
89
|
+ <select id="selectColInstRtnGridList" resultType="com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity">
|
|
90
|
+ select base.brand_id, fn_brand_nm(base.brand_id) as brand_nm
|
|
91
|
+ , base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no as 'rtnOdrDtlInfo.rtn_podr_dtl_no'
|
|
92
|
+ , ptcl.rtn_req_unq_no as 'rtnOdrDtlInfo.rtn_req_unq_no', ptcl.rtn_req_dtl_no as 'rtnOdrDtlInfo.rtn_req_dtl_no'
|
|
93
|
+ , ptcl.item_id as 'rtnOdrDtlInfo.item_id', ptcl.item_nm as 'rtnOdrDtlInfo.item_nm'
|
|
94
|
+ , base.rtn_whs_id, base.rtn_location, fn_whs_nm(base.brand_id, base.rtn_whs_id) as rtn_whs_nm
|
|
95
|
+ , fn_whs_location_nm(base.brand_id, base.rtn_whs_id, base.rtn_location) as rtn_location_nm
|
|
96
|
+ , ptcl.unit_amt as 'rtnOdrDtlInfo.unit_amt'
|
|
97
|
+ , ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.col_qty', ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.rtn_odr_qty'
|
|
98
|
+ , date_format(base.col_req_dt,'%Y.%m.%d') as col_req_dt, ptcl.rtn_amt as 'rtnOdrDtlInfo.rtn_amt'
|
|
99
|
+ , base.whs_id, fn_whs_nm(base.brand_id, base.whs_id) as whs_nm
|
|
100
|
+ , base.location, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
|
|
101
|
+ , base.store_id
|
|
102
|
+ from rtn_odr_base_info base
|
|
103
|
+ , rtn_odr_dtl_ptcl ptcl
|
|
104
|
+ where 1=1
|
|
105
|
+ and base.rtn_podr_unq_no = ptcl.rtn_podr_unq_no
|
|
106
|
+ and base.brand_id = #{brandId}
|
|
107
|
+ and concat(base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no) in
|
|
108
|
+ <foreach collection="gridUpdateData" item="item" separator="," open="(" close=")">
|
|
109
|
+ concat(#{item.rtnPodrUnqNo},#{item.rtnPodrDtlNo})
|
|
110
|
+ </foreach>
|
|
111
|
+ </select>
|
|
112
|
+
|
|
113
|
+
|
87
|
114
|
<select id="selectPickJobDataList" resultType="com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity">
|
88
|
115
|
select base.brand_id,base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no as 'rtnOdrDtlInfo.rtn_podr_dtl_no'
|
89
|
116
|
,ptcl.item_id as 'rtnOdrDtlInfo.item_id' , ptcl.item_nm as 'rtnOdrDtlInfo.item_nm', base.whs_id
|
|
@@ -95,9 +122,9 @@
|
95
|
122
|
, date_format(base.rtn_odr_reg_dt,'%Y%m%d') as rtn_odr_req_dt
|
96
|
123
|
, base.spply_id, fn_spply_nm(base.spply_id) as spply_nm
|
97
|
124
|
, ptcl.rtn_rsn_dvsn as 'rtnOdrDtlInfo.rtn_rsn_dvsn', ptcl.rtn_rsn as 'rtnOdrDtlInfo.rtn_rsn'
|
98
|
|
- , base.col_dvsn
|
|
125
|
+ , base.col_dvsn, ptcl.unit as 'rtnOdrDtlInfo.unit'
|
99
|
126
|
from rtn_odr_base_info base
|
100
|
|
- join rtn_odr_dtl_ptcl ptcl on base.rtn_podr_unq_no = ptcl.rtn_podr_unq_no and ptcl.rodr_dtl_st_cd = 'ROD0'
|
|
127
|
+ join rtn_odr_dtl_ptcl ptcl on base.rtn_podr_unq_no = ptcl.rtn_podr_unq_no and ptcl.rodr_dtl_st_cd = 'ROD1'
|
101
|
128
|
join item_base_info itm on ptcl.item_id = itm.item_id
|
102
|
129
|
and base.brand_id = #{brandId}
|
103
|
130
|
and concat(base.rtn_podr_unq_no,ptcl.rtn_podr_dtl_no) in
|
|
@@ -117,7 +144,7 @@
|
117
|
144
|
, sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
|
118
|
145
|
values
|
119
|
146
|
(#{entity.colCmdUnqNo}, date_format(now(),'%Y%m%d'), #{entity.brandId}, #{entity.whsId}, #{entity.location}
|
120
|
|
- , #{entity.storeId}, #{entity.itemQty}, #{entity.colTotalAmt}, #{entity.colReqDt}, #{entity.colReqDt}, #{entity.colDvsn}
|
|
147
|
+ , #{entity.storeId}, #{entity.itemQty}, #{entity.colTotalAmt}, #{entity.colReqDt}, #{entity.colDvsn}
|
121
|
148
|
, #{entity.colCmdStCd}, #{entity.colReqMgrNm}, #{entity.colReqMgrId}, #{entity.colDt}, #{entity.colCnfmNm}
|
122
|
149
|
, #{entity.colCnfmId}, #{entity.colMgrNm}, #{entity.colMgrTelNo}, #{entity.colMgrEmal}, #{entity.colMgrMblNo}
|
123
|
150
|
, #{entity.rtnWhsId}, #{entity.rtnLocation}, #{entity.spplyId}, #{entity.spplyNm}, #{entity.colPickUnqNo}
|
|
@@ -145,13 +172,13 @@
|
145
|
172
|
(col_pick_unq_no, spply_id, spply_nm, store_id, col_reg_dt
|
146
|
173
|
, col_tot_amt, pick_mgr_nm, pick_mgr_tel_no, pick_mgr_emal, pick_mgr_mbl_no
|
147
|
174
|
, pndr_tel_no, pick_st_cd, rodr_reg_dt, col_req_dt, col_sch_dt
|
148
|
|
- , col_cmplt_dt, whs_id, location, whs_dvsn, brand_id, col_desc
|
|
175
|
+ , col_cmplt_dt, whs_id, location, whs_dvsn, brand_id, col_desc, col_dvsn
|
149
|
176
|
, sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
|
150
|
177
|
values
|
151
|
178
|
(#{entity.colPickUnqNo}, #{entity.spplyId}, #{entity.spplyNm}, #{entity.storeId}, date_format(now(),'%Y%m%d')
|
152
|
179
|
, #{entity.colTotAmt}, #{entity.pickMgrNm}, #{entity.pickMgrTelNo}, #{entity.pickMgrEmal}, #{entity.pickMgrMblNo}
|
153
|
180
|
, #{entity.pndrTelNo}, #{entity.pickStCd}, date_format(now(),'%Y%m%d'), #{entity.colReqDt}, #{entity.colSchDt}
|
154
|
|
- , #{entity.colCmpltDt}, #{entity.whsId}, #{entity.location}, #{entity.whsDvsn}, #{entity.brandId}, #{entity.colDesc}
|
|
181
|
+ , #{entity.colCmpltDt}, #{entity.whsId}, #{entity.location}, #{entity.whsDvsn}, #{entity.brandId}, #{entity.colDesc}, #{entity.colDvsn}
|
155
|
182
|
, now(), #{userId}, now(), #{userId})
|
156
|
183
|
</insert>
|
157
|
184
|
|
|
@@ -160,15 +187,15 @@
|
160
|
187
|
(col_pick_unq_no, col_pick_dtl_no, rtn_podr_unq_no, rtn_podr_dtl_no, rtn_req_unq_no
|
161
|
188
|
, rtn_req_dtl_no, col_cmd_unq_no, col_cmd_dtl_no, pick_dtl_st_cd, item_id
|
162
|
189
|
, item_nm, unit, unit_amt, price_unit, rodr_qty
|
163
|
|
- , col_qty, col_amt, delay_yn, delay_rsn
|
|
190
|
+ , col_req_qty, col_req_amt, delay_yn, delay_rsn
|
164
|
191
|
, sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
|
165
|
192
|
values
|
166
|
193
|
<foreach collection="gridInsertData" item="item" separator=",">
|
167
|
194
|
(#{item.colPickUnqNo}, #{item.colPickDtlNo}, #{item.rtnPodrUnqNo}, #{item.rtnPodrDtlNo}, #{item.rtnReqUnqNo}
|
168
|
195
|
, #{item.rtnReqDtlNo}, #{item.colCmdUnqNo}, #{item.colCmdDtlNo}, 'PICKD0', #{item.itemId}
|
169
|
196
|
, #{item.itemNm}, #{item.unit}, #{item.unitAmt}, #{item.priceUnit}, #{item.rodrQty}
|
170
|
|
- , #{item.colQty}, #{item.colAmt}, #{item.delayYn}, #{item.delayRsn}
|
171
|
|
- , now(), #{item.sysRegId}, now(), #{item.sysChgId})
|
|
197
|
+ , #{item.colReqQty}, #{item.colReqAmt}, #{item.delayYn}, #{item.delayRsn}
|
|
198
|
+ , now(), #{userId}, now(), #{userId})
|
172
|
199
|
</foreach>
|
173
|
200
|
</insert>
|
174
|
201
|
|
|
@@ -247,24 +274,7 @@
|
247
|
274
|
<if test="sItemNm != null and sItemNm != ''">
|
248
|
275
|
and ( ptcl.item_id like concat('%',#{sItemNm},'%') or ptcl_item_nm like concat('%',#{sItemNm},'%') )
|
249
|
276
|
</if>
|
250
|
|
- <choose>
|
251
|
|
- <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
252
|
|
- <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
|
253
|
|
- <if test="gridRequest.sord == 'asc'.toString()">
|
254
|
|
- order by base.col_cmd_unq_no asc , ptcl.col_cmd_dtl_no asc
|
255
|
|
- </if>
|
256
|
|
- <if test="gridRequest.sord == 'desc'.toString()">
|
257
|
|
- order by base.col_cmd_unq_no desc , ptcl.col_cmd_dtl_no asc
|
258
|
|
- </if>
|
259
|
|
- </if>
|
260
|
|
- </when>
|
261
|
|
- <otherwise>
|
262
|
|
- order by base.col_cmd_unq_no desc , ptcl.col_cmd_dtl_no asc
|
263
|
|
- </otherwise>
|
264
|
|
- </choose>
|
265
|
|
- <if test="gridRequest.pagingYn == true">
|
266
|
|
- limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
|
267
|
|
- </if>
|
|
277
|
+
|
268
|
278
|
</select>
|
269
|
279
|
|
270
|
280
|
<select id="selectPickInfo" resultType="com.oqpo.api.entity.inoutmng.PickInfoMgntEntity">
|
|
@@ -287,11 +297,11 @@
|
287
|
297
|
, ptcl.rtn_req_dtl_no, ptcl.col_cmd_unq_no, ptcl.col_cmd_dtl_no
|
288
|
298
|
, ptcl.pick_dtl_st_cd, fn_code_nm('PICK_DTL_ST_CD',ptcl.pick_dtl_st_cd) as pick_dtl_st_nm, ptcl.item_id
|
289
|
299
|
, ptcl.item_nm, ptcl.unit, ptcl.unit_amt, ptcl.price_unit, ptcl.rodr_qty
|
290
|
|
- , ptcl.col_qty, ptcl.col_amt, ptcl.delay_yn, ptcl.delay_rsn
|
|
300
|
+ , ptcl.col_req_qty, ptcl.col_req_amt, ptcl.delay_yn, ptcl.delay_rsn
|
291
|
301
|
, rptcl.rtn_rsn_dvsn, fn_code_nm('RTN_RSN_DVSN', rptcl.rtn_rsn_dvsn ) as rtn_rsn_dvsn_nm
|
292
|
302
|
, rptcl.rtn_rsn
|
293
|
303
|
from pick_info_mgnt base, pick_dtl_ptcl ptcl
|
294
|
|
- , rtn_dor_dtl_ptcl rptcl
|
|
304
|
+ , rtn_odr_dtl_ptcl rptcl
|
295
|
305
|
where base.col_pick_unq_no = ptcl.col_pick_unq_no
|
296
|
306
|
and ptcl.rtn_podr_unq_no = rptcl.rtn_podr_unq_no
|
297
|
307
|
and ptcl.rtn_podr_dtl_no = rptcl.rtn_podr_dtl_no
|
|
@@ -304,12 +314,14 @@
|
304
|
314
|
, base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no as 'rtnOdrDtlInfo.rtn_podr_dtl_no'
|
305
|
315
|
, ptcl.rtn_req_unq_no as 'rtnOdrDtlInfo.rtn_req_unq_no', ptcl.rtn_req_dtl_no as 'rtnOdrDtlInfo.rtn_req_dtl_no'
|
306
|
316
|
, ptcl.item_id as 'rtnOdrDtlInfo.item_id', ptcl.item_nm as 'rtnOdrDtlInfo.item_nm'
|
307
|
|
- , base.rtn_whs_id, fn_whs_nm(base.brand_id, base.rtn_whs_id) as rtn_whs_nm, ptcl.unit_amt as 'rtnOdrDtlInfo.unit_amt'
|
308
|
|
- , ptcl.rtn_qty as 'rtnOdrDtlInfo.rtn_qty', ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.rtn_odr_qty'
|
|
317
|
+ , base.rtn_whs_id, fn_whs_nm(base.brand_id, base.rtn_whs_id) as rtn_whs_nm
|
|
318
|
+ , base.rtn_location, fn_whs_location_nm(base.brand_id, base.rtn_whs_id, base.rtn_location) as rtn_location_nm
|
|
319
|
+ , ptcl.unit_amt as 'rtnOdrDtlInfo.unit_amt'
|
|
320
|
+ , ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.rtn_odr_qty'
|
309
|
321
|
, date_format(base.col_req_dt,'%Y.%m.%d') as col_req_dt, ptcl.rtn_amt as 'rtnOdrDtlInfo.rtn_amt'
|
310
|
322
|
, base.whs_id, fn_whs_nm(base.brand_id, base.whs_id) as whs_nm
|
311
|
323
|
, base.location, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
|
312
|
|
- , base.store_id
|
|
324
|
+ , base.store_id, ptcl.rtn_odr_amt as 'rtnOdrDtlInfo.rtn_odr_amt'
|
313
|
325
|
from rtn_odr_base_info base
|
314
|
326
|
, rtn_odr_dtl_ptcl ptcl
|
315
|
327
|
where 1=1
|
|
@@ -318,13 +330,13 @@
|
318
|
330
|
and base.spply_id = #{sSpplyId}
|
319
|
331
|
and base.col_req_dt between #{fromDt} and #{toDt}
|
320
|
332
|
and base.rtn_odr_st_cd = 'RO20'
|
321
|
|
- and ptcl.rodr_dtl_st_cd = 'ROD0'
|
|
333
|
+ and ptcl.rodr_dtl_st_cd = 'ROD1'
|
322
|
334
|
and base.col_dvsn = 'C002'
|
323
|
335
|
<if test="sRtnWhsId != null and sRtnWhsId != ''">
|
324
|
336
|
and base.rtn_whs_id = #{sRtnWhsId}
|
325
|
337
|
</if>
|
326
|
338
|
<if test="sItemNm != null and sItemNm != ''">
|
327
|
|
- and (ptcl.item_id like concat('%', '', '%') or ptcl.item_nm like concat('%', '', '%'))
|
|
339
|
+ and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
|
328
|
340
|
</if>
|
329
|
341
|
<choose>
|
330
|
342
|
<when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
|
@@ -356,32 +368,15 @@
|
356
|
368
|
and base.spply_id = #{sSpplyId}
|
357
|
369
|
and base.col_req_dt between #{fromDt} and #{toDt}
|
358
|
370
|
and base.rtn_odr_st_cd = 'RO20'
|
359
|
|
- and ptcl.rodr_dtl_st_cd = 'ROD0'
|
|
371
|
+ and ptcl.rodr_dtl_st_cd = 'ROD1'
|
360
|
372
|
and base.col_dvsn = 'C002'
|
361
|
373
|
<if test="sRtnWhsId != null and sRtnWhsId != ''">
|
362
|
374
|
and base.rtn_whs_id = #{sRtnWhsId}
|
363
|
375
|
</if>
|
364
|
376
|
<if test="sItemNm != null and sItemNm != ''">
|
365
|
|
- and (ptcl.item_id like concat('%', '', '%') or ptcl.item_nm like concat('%', '', '%'))
|
366
|
|
- </if>
|
367
|
|
- <choose>
|
368
|
|
- <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
369
|
|
- <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
|
370
|
|
- <if test="gridRequest.sord == 'asc'.toString()">
|
371
|
|
- order by base.rtn_podr_unq_no asc , ptcl.rtn_podr_dtl_no asc
|
372
|
|
- </if>
|
373
|
|
- <if test="gridRequest.sord == 'desc'.toString()">
|
374
|
|
- order by base.rtn_podr_unq_no desc , ptcl.rtn_podr_dtl_no asc
|
375
|
|
- </if>
|
376
|
|
- </if>
|
377
|
|
- </when>
|
378
|
|
- <otherwise>
|
379
|
|
- order by base.rtn_podr_unq_no asc , ptcl.rtn_podr_dtl_no asc
|
380
|
|
- </otherwise>
|
381
|
|
- </choose>
|
382
|
|
- <if test="gridRequest.pagingYn == true">
|
383
|
|
- limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
|
|
377
|
+ and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
|
384
|
378
|
</if>
|
|
379
|
+
|
385
|
380
|
</select>
|
386
|
381
|
|
387
|
382
|
|
|
@@ -390,7 +385,7 @@
|
390
|
385
|
, (select sum(rtn_amt) from rtn_odr_dtl_ptcl where rtn_podr_unq_no = #{rtnPodrUnqNo} and rodr_dtl_st_cd = 'ROD1' ) as rtn_dodr_total_amt
|
391
|
386
|
, base.rtn_whs_id, fn_whs_nm(base.brand_id, base.rtn_whs_id) as rtn_whs_nm
|
392
|
387
|
, base.rtn_location, fn_whs_location_nm(brand_id, base.rtn_whs_id, base.rtn_location) as rtn_location_nm
|
393
|
|
- , fn_get_telno((select tel_no from store_base_info where store_id = base.store_id )) as rtn_tel_no
|
|
388
|
+ , fn_get_telno((select tel_no from store_base_info where store_id = base.store_id )) as pick_tel_no
|
394
|
389
|
from rtn_odr_base_info base
|
395
|
390
|
where 1=1
|
396
|
391
|
and base.brand_id = #{brandId}
|
|
@@ -400,12 +395,12 @@
|
400
|
395
|
</select>
|
401
|
396
|
|
402
|
397
|
<select id="selectSpplyColRtnList" resultType="com.oqpo.api.entity.rtnmng.RtnOdrDtlPtclEntity">
|
403
|
|
- select ptcl.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no, ptcl.item_id, ptcl.item_nm, ptcl.unit, ptcl.rtn_qty, ptcl.rtn_qty as colt_qty
|
|
398
|
+ select ptcl.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no, ptcl.item_id, ptcl.item_nm, ptcl.unit, ptcl.rtn_odr_qty, ptcl.rtn_odr_qty as col_qty
|
404
|
399
|
, ptcl.unit_amt
|
405
|
400
|
, ptcl.rtn_rsn_dvsn, rtn_rsn
|
406
|
401
|
from rtn_odr_dtl_ptcl ptcl
|
407
|
402
|
where ptcl.rtn_podr_unq_no = #{rtnPodrUnqNo}
|
408
|
|
- and ptcl.rtn_dtl_st_cd = 'ROD1'
|
|
403
|
+ and ptcl.rodr_dtl_st_cd = 'ROD1'
|
409
|
404
|
</select>
|
410
|
405
|
|
411
|
406
|
<!-- 어디에 쓰는 쿼리인지 찿을 필요 있음
|
|
@@ -480,20 +475,13 @@
|
480
|
475
|
-->
|
481
|
476
|
|
482
|
477
|
|
483
|
|
-
|
484
|
|
-
|
485
|
|
-
|
486
|
|
-
|
487
|
|
-
|
488
|
|
-
|
489
|
|
-
|
490
|
478
|
<select id="selectColSpplyPickGridList" resultType="com.oqpo.api.entity.inoutmng.PickInfoMgntEntity">
|
491
|
479
|
select pmgnt.brand_id, fn_brand_nm(pmgnt.brand_id) as brand_nm
|
492
|
480
|
, pmgnt.col_pick_unq_no , pmgnt.pick_st_cd, fn_code_nm('PICK_ST_CD',pmgnt.pick_st_cd) as pick_st_nm
|
493
|
481
|
, date_format(pmgnt.col_reg_dt, '%Y.%m.%d') as col_reg_dt , date_format(pmgnt.col_req_dt, '%Y.%m.%d') as col_req_dt
|
494
|
482
|
, date_format(pmgnt.col_sch_dt, '%Y.%m.%d') as col_sch_dt , date_format(pmgnt.col_cmplt_dt, '%Y.%m.%d') as col_cmplt_dt
|
495
|
|
- , pptcl.item_id as 'pickDtlInfo.item_id' , pptcl.item_nm as 'pickDtlInfo.item_nm', pptcl.col_qty as 'pickDtlInfo.col_qty'
|
496
|
|
- , pptcl.col_amt as 'pickDtlInfo.col_amt' , pptcl.unit_amt as 'pickDtlInfo.unit_amt', ptcl.rtn_rsn_dvsn as 'pickDtlInfo.rtn_rsn_dvsn'
|
|
483
|
+ , pptcl.item_id as 'pickDtlInfo.item_id' , pptcl.item_nm as 'pickDtlInfo.item_nm', pptcl.col_req_qty as 'pickDtlInfo.col_req_qty'
|
|
484
|
+ , pptcl.col_req_amt as 'pickDtlInfo.col_req_amt' , pptcl.unit_amt as 'pickDtlInfo.unit_amt', ptcl.rtn_rsn_dvsn as 'pickDtlInfo.rtn_rsn_dvsn'
|
497
|
485
|
, fn_code_nm('RTN_RSN_DVSN', ptcl.rtn_rsn_dvsn) as 'pickDtlInfo.rtn_rsn_dvsn_nm', pmgnt.whs_id, pmgnt.location
|
498
|
486
|
, fn_whs_nm(pmgnt.brand_id, pmgnt.whs_id) as whs_nm, fn_whs_location_nm(pmgnt.brand_id, pmgnt.whs_id, pmgnt.location) as location_nm
|
499
|
487
|
, pmgnt.pick_mgr_nm, fn_get_telno(pmgnt.pick_mgr_tel_no) as pick_mgr_tel_no
|
|
@@ -561,12 +549,13 @@
|
561
|
549
|
,mgnt.col_pick_unq_no, dtl.col_pick_dtl_no as 'pickDtlInfo.col_pick_dtl_no'
|
562
|
550
|
, dtl.rtn_podr_unq_no as 'pickDtlInfo.rtn_podr_unq_no' , dtl.rtn_podr_dtl_no as 'pickDtlInfo.rtn_podr_dtl_no'
|
563
|
551
|
,dtl.item_id as 'pickDtlInfo.item_id', dtl.item_nm as 'pickDtlInfo.item_nm'
|
564
|
|
- , dtl.col_req_qty as 'pickDtlInfo.col_qty' , dtl.col_req_qty as 'pickDtlInfo.col_req_qty'
|
565
|
|
- , dtl.col_amt as 'pickDtlInfo.col_amt', mgnt.whs_id, mgnt.location
|
566
|
|
- , fn_whs_nm(mgnt.brand_id, mgnt.whs_id) as rtn_whs_nm, fn_whs_location_nm(mgnt.brand_id, mgnt.whs_id, mgnt.location) as rtn_location_nm
|
|
552
|
+ , dtl.rodr_qty as 'pickDtlInfo.rodr_qty' , dtl.col_req_qty as 'pickDtlInfo.col_req_qty'
|
|
553
|
+ , dtl.col_req_qty as 'pickDtlInfo.col_qty', dtl.col_amt as 'pickDtlInfo.col_amt'
|
567
|
554
|
, date_format(mgnt.col_sch_dt,'%Y.%m.%d') as col_sch_dt, mgnt.pick_mgr_nm, fn_get_telno(mgnt.pick_mgr_tel_no) as pick_mgr_tel_no
|
|
555
|
+ , mgnt.whs_id as rtn_whs_id , mgnt.location as rtn_location
|
|
556
|
+ , fn_whs_nm(mgnt.brand_id, mgnt.whs_id) as rtn_whs_nm, fn_whs_location_nm(mgnt.brand_id, mgnt.whs_id, mgnt.location) as rtn_location_nm
|
568
|
557
|
, base.whs_id, base.location
|
569
|
|
- , fn_whs_nm(mgnt.brand_id, base.whs_id) as whs_nm, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
|
|
558
|
+ , fn_whs_nm(base.brand_id, base.whs_id) as whs_nm, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
|
570
|
559
|
, mgnt.spply_id, fn_spply_nm(mgnt.spply_id) as spply_nm
|
571
|
560
|
from pick_info_mgnt mgnt
|
572
|
561
|
,pick_dtl_ptcl dtl
|
|
@@ -577,13 +566,16 @@
|
577
|
566
|
and dtl.rtn_podr_dtl_no = ptcl.rtn_podr_dtl_no
|
578
|
567
|
and ptcl.rtn_podr_unq_no = base.rtn_podr_unq_no
|
579
|
568
|
and mgnt.brand_id = #{sBrandId}
|
580
|
|
- and mgnt.store_id = #{sStoreId}
|
581
|
569
|
and mgnt.col_sch_dt between #{fromDt} and #{toDt}
|
|
570
|
+ and mgnt.pick_st_cd = 'PICK0'
|
|
571
|
+ <if test="sStoreId != null and sStoreId != ''">
|
|
572
|
+ and mgnt.store_id = #{sStoreId}
|
|
573
|
+ </if>
|
582
|
574
|
<if test="sRtnWhsId != null and sRtnWhsId != ''">
|
583
|
575
|
and base.whs_id = #{sRtnWhsId}
|
584
|
576
|
</if>
|
585
|
|
- <if test="spplyId != null and spplyId != ''">
|
586
|
|
- and mgnt.spply_id = #{spplyId}
|
|
577
|
+ <if test="sSpplyId != null and sSpplyId != ''">
|
|
578
|
+ and mgnt.spply_id = #{sSpplyId}
|
587
|
579
|
</if>
|
588
|
580
|
<if test="sWhsId != null and sWhsId != ''">
|
589
|
581
|
and dtl.whs_id = #{sWhsId}
|
|
@@ -622,13 +614,16 @@
|
622
|
614
|
and dtl.rtn_podr_dtl_no = ptcl.rtn_podr_dtl_no
|
623
|
615
|
and ptcl.rtn_podr_unq_no = base.rtn_podr_unq_no
|
624
|
616
|
and mgnt.brand_id = #{sBrandId}
|
625
|
|
- and mgnt.store_id = #{sStoreId}
|
626
|
617
|
and mgnt.col_sch_dt between #{fromDt} and #{toDt}
|
|
618
|
+ and mgnt.pick_st_cd = 'PICK0'
|
|
619
|
+ <if test="sStoreId != null and sStoreId != ''">
|
|
620
|
+ and mgnt.store_id = #{sStoreId}
|
|
621
|
+ </if>
|
627
|
622
|
<if test="sRtnWhsId != null and sRtnWhsId != ''">
|
628
|
623
|
and base.whs_id = #{sRtnWhsId}
|
629
|
624
|
</if>
|
630
|
|
- <if test="spplyId != null and spplyId != ''">
|
631
|
|
- and mgnt.spply_id = #{spplyId}
|
|
625
|
+ <if test="sSpplyId != null and sSpplyId != ''">
|
|
626
|
+ and mgnt.spply_id = #{sSpplyId}
|
632
|
627
|
</if>
|
633
|
628
|
<if test="sWhsId != null and sWhsId != ''">
|
634
|
629
|
and dtl.whs_id = #{sWhsId}
|
|
@@ -636,24 +631,7 @@
|
636
|
631
|
<if test="sItemNm != null and sItemNm != ''">
|
637
|
632
|
and (mgnt.col_pick_unq_no like concat('%',#{sItemNm},'%') or dtl.item_id like concat('%',#{sItemNm},'%') or dtl.item_nm like concat('%',#{sItemNm},'%') )
|
638
|
633
|
</if>
|
639
|
|
- <choose>
|
640
|
|
- <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
641
|
|
- <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
|
642
|
|
- <if test="gridRequest.sord == 'asc'.toString()">
|
643
|
|
- order by mgnt.col_pick_unq_no asc
|
644
|
|
- </if>
|
645
|
|
- <if test="gridRequest.sord == 'desc'.toString()">
|
646
|
|
- order by mgnt.col_pick_unq_no desc
|
647
|
|
- </if>
|
648
|
|
- </if>
|
649
|
|
- </when>
|
650
|
|
- <otherwise>
|
651
|
|
- order by mgnt.col_pick_unq_no desc
|
652
|
|
- </otherwise>
|
653
|
|
- </choose>
|
654
|
|
- <if test="gridRequest.pagingYn == true">
|
655
|
|
- limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
|
656
|
|
- </if>
|
|
634
|
+
|
657
|
635
|
</select>
|
658
|
636
|
|
659
|
637
|
<insert id="insertRtnProcInfoPtcl">
|
|
@@ -678,4 +656,99 @@
|
678
|
656
|
, now(), #{userId}, now(), #{userId})
|
679
|
657
|
</foreach>
|
680
|
658
|
</insert>
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+ <select id="selectColRtnInstResultGridList" resultType="com.oqpo.api.entity.inoutmng.PickInfoMgntEntity">
|
|
662
|
+ select mgnt.brand_id, fn_brand_nm(mgnt.brand_id) as brand_nm
|
|
663
|
+ ,mgnt.col_pick_unq_no, dtl.col_pick_dtl_no as 'pickDtlInfo.col_pick_dtl_no'
|
|
664
|
+ , dtl.rtn_podr_unq_no as 'pickDtlInfo.rtn_podr_unq_no' , dtl.rtn_podr_dtl_no as 'pickDtlInfo.rtn_podr_dtl_no'
|
|
665
|
+ ,dtl.item_id as 'pickDtlInfo.item_id', dtl.item_nm as 'pickDtlInfo.item_nm'
|
|
666
|
+ , dtl.rodr_qty as 'pickDtlInfo.rodr_qty' , dtl.col_req_qty as 'pickDtlInfo.col_req_qty'
|
|
667
|
+ , dtl.col_qty as 'pickDtlInfo.col_qty', dtl.col_amt as 'pickDtlInfo.col_amt'
|
|
668
|
+ , date_format(mgnt.col_sch_dt,'%Y.%m.%d') as col_sch_dt, date_format(mgnt.col_cmplt_dt,'%Y.%m.%d') as col_cmplt_dt
|
|
669
|
+ , mgnt.pick_mgr_nm, fn_get_telno(mgnt.pick_mgr_tel_no) as pick_mgr_tel_no
|
|
670
|
+ , mgnt.whs_id as rtn_whs_id , mgnt.location as rtn_location
|
|
671
|
+ , fn_whs_nm(mgnt.brand_id, mgnt.whs_id) as rtn_whs_nm, fn_whs_location_nm(mgnt.brand_id, mgnt.whs_id, mgnt.location) as rtn_location_nm
|
|
672
|
+ , base.whs_id, base.location
|
|
673
|
+ , fn_whs_nm(base.brand_id, base.whs_id) as whs_nm, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
|
|
674
|
+ , mgnt.spply_id, fn_spply_nm(mgnt.spply_id) as spply_nm
|
|
675
|
+ , dtl.pick_dtl_st_cd as 'pickDtlInfo.pick_dtl_st_cd'
|
|
676
|
+ , fn_code_nm('PICK_DTL_ST_CD', dtl.pick_dtl_st_cd) as 'pickDtlInfo.pick_dtl_st_nm'
|
|
677
|
+ from pick_info_mgnt mgnt
|
|
678
|
+ ,pick_dtl_ptcl dtl
|
|
679
|
+ ,rtn_odr_dtl_ptcl ptcl
|
|
680
|
+ ,rtn_odr_base_info base
|
|
681
|
+ where mgnt.col_pick_unq_no = dtl.col_pick_unq_no
|
|
682
|
+ and dtl.rtn_podr_unq_no = ptcl.rtn_podr_unq_no
|
|
683
|
+ and dtl.rtn_podr_dtl_no = ptcl.rtn_podr_dtl_no
|
|
684
|
+ and ptcl.rtn_podr_unq_no = base.rtn_podr_unq_no
|
|
685
|
+ and mgnt.brand_id = #{sBrandId}
|
|
686
|
+ and mgnt.col_cmplt_dt between #{fromDt} and #{toDt}
|
|
687
|
+ <if test="sStoreId != null and sStoreId != ''">
|
|
688
|
+ and mgnt.store_id = #{sStoreId}
|
|
689
|
+ </if>
|
|
690
|
+ <if test="sRtnWhsId != null and sRtnWhsId != ''">
|
|
691
|
+ and base.whs_id = #{sRtnWhsId}
|
|
692
|
+ </if>
|
|
693
|
+ <if test="sSpplyId != null and sSpplyId != ''">
|
|
694
|
+ and mgnt.spply_id = #{sSpplyId}
|
|
695
|
+ </if>
|
|
696
|
+ <if test="sWhsId != null and sWhsId != ''">
|
|
697
|
+ and dtl.whs_id = #{sWhsId}
|
|
698
|
+ </if>
|
|
699
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
700
|
+ and (mgnt.col_pick_unq_no like concat('%',#{sItemNm},'%') or dtl.item_id like concat('%',#{sItemNm},'%') or dtl.item_nm like concat('%',#{sItemNm},'%') )
|
|
701
|
+ </if>
|
|
702
|
+ <choose>
|
|
703
|
+ <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
|
704
|
+ <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
|
|
705
|
+ <if test="gridRequest.sord == 'asc'.toString()">
|
|
706
|
+ order by mgnt.col_pick_unq_no asc
|
|
707
|
+ </if>
|
|
708
|
+ <if test="gridRequest.sord == 'desc'.toString()">
|
|
709
|
+ order by mgnt.col_pick_unq_no desc
|
|
710
|
+ </if>
|
|
711
|
+ </if>
|
|
712
|
+ </when>
|
|
713
|
+ <otherwise>
|
|
714
|
+ order by mgnt.col_pick_unq_no desc
|
|
715
|
+ </otherwise>
|
|
716
|
+ </choose>
|
|
717
|
+ <if test="gridRequest.pagingYn == true">
|
|
718
|
+ limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
|
|
719
|
+ </if>
|
|
720
|
+ </select>
|
|
721
|
+
|
|
722
|
+ <select id="selectColRtnInstResultGridCnt" resultType="int">
|
|
723
|
+ select count(*) as cnt
|
|
724
|
+ from pick_info_mgnt mgnt
|
|
725
|
+ ,pick_dtl_ptcl dtl
|
|
726
|
+ ,rtn_odr_dtl_ptcl ptcl
|
|
727
|
+ ,rtn_odr_base_info base
|
|
728
|
+ where mgnt.col_pick_unq_no = dtl.col_pick_unq_no
|
|
729
|
+ and dtl.rtn_podr_unq_no = ptcl.rtn_podr_unq_no
|
|
730
|
+ and dtl.rtn_podr_dtl_no = ptcl.rtn_podr_dtl_no
|
|
731
|
+ and ptcl.rtn_podr_unq_no = base.rtn_podr_unq_no
|
|
732
|
+ and mgnt.brand_id = #{sBrandId}
|
|
733
|
+ and mgnt.col_cmplt_dt between #{fromDt} and #{toDt}
|
|
734
|
+ <if test="sStoreId != null and sStoreId != ''">
|
|
735
|
+ and mgnt.store_id = #{sStoreId}
|
|
736
|
+ </if>
|
|
737
|
+ <if test="sRtnWhsId != null and sRtnWhsId != ''">
|
|
738
|
+ and base.whs_id = #{sRtnWhsId}
|
|
739
|
+ </if>
|
|
740
|
+ <if test="sSpplyId != null and sSpplyId != ''">
|
|
741
|
+ and mgnt.spply_id = #{sSpplyId}
|
|
742
|
+ </if>
|
|
743
|
+ <if test="sWhsId != null and sWhsId != ''">
|
|
744
|
+ and dtl.whs_id = #{sWhsId}
|
|
745
|
+ </if>
|
|
746
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
747
|
+ and (mgnt.col_pick_unq_no like concat('%',#{sItemNm},'%') or dtl.item_id like concat('%',#{sItemNm},'%') or dtl.item_nm like concat('%',#{sItemNm},'%') )
|
|
748
|
+ </if>
|
|
749
|
+
|
|
750
|
+ </select>
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
|
681
|
754
|
</mapper>
|