|
@@ -262,6 +262,73 @@
|
262
|
262
|
</if>
|
263
|
263
|
</select>
|
264
|
264
|
|
|
265
|
+
|
|
266
|
+ <select id="selectPopNewItemBrandUnitGridList" resultType="com.oqpo.api.entity.stinfo.ItemUnitEntity">
|
|
267
|
+ select /* selectPopNewItemBrandUnitGridList */
|
|
268
|
+ iInfo.item_id,iInfo.item_nm,iInfo.podr_pssbl_dvsn, fn_code_nm('PODR_PSSBL_DVSN',iInfo.podr_pssbl_dvsn) AS podr_pssbl_dvsn_nm
|
|
269
|
+ ,iInfo.unit, fn_code_nm('DSTRBT_COST_UNIT', iInfo.unit) as unit_nm, bInfo.stdd_qty, bInfo.unit_amt, bInfo.brand_unit_unq_no
|
|
270
|
+ ,'B' as unit_gubun, bInfo.spply_id
|
|
271
|
+ <if test="sWhsId == null or sWhsId == '' or sLocation = null or sLocation == ''">
|
|
272
|
+ ,0 as whs_pass_qty
|
|
273
|
+ </if>
|
|
274
|
+ <if test="sWhsId != null and sWhsId != '' and sLocation != null and sLocation != ''">
|
|
275
|
+ , nvl((stck.stck_qty - stck.wait_qty),0) as whs_pass_qty
|
|
276
|
+ </if>
|
|
277
|
+ from item_base_info iInfo
|
|
278
|
+ left outer join brand_item_unit_info bInfo on iInfo.brand_id = bInfo.brand_id and iInfo.item_id = bInfo.item_id and date_format(now(),'%Y%m%d') between bInfo.cont_stt_dt and bInfo.cont_end_dt
|
|
279
|
+ <if test="sSpplyId != null and sSpplyId != '' ">
|
|
280
|
+ and bInfo.spply_id = #{sSpplyId}
|
|
281
|
+ </if>
|
|
282
|
+
|
|
283
|
+ <if test="sWhsId != null and sWhsId != '' and sLocation != null and sLocation != ''">
|
|
284
|
+ left outer join stck_mgnt_base_info stck on stck.brand_id = iInfo.brand_id and stck.item_id = iInfo.item_id and whs_id = #{sWhsId} and location = #{sLocation}
|
|
285
|
+ </if>
|
|
286
|
+ where iInfo.brand_id = #{sBrandId}
|
|
287
|
+ AND iInfo.item_st_cd = 'IS00'
|
|
288
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
289
|
+ and (iInfo.item_nm like concat('%',#{sItemNm},'%') or iInfo.item_id like concat('%',#{sItemNm},'%'))
|
|
290
|
+ </if>
|
|
291
|
+ <if test="sPodrPssblDvsn != null and sPodrPssblDvsn != ''">
|
|
292
|
+ and iInfo.podr_pssbl_dvsn = #{sPodrPssblDvsn}
|
|
293
|
+ </if>
|
|
294
|
+ <choose>
|
|
295
|
+ <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
|
296
|
+ <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
|
|
297
|
+ <if test="gridRequest.sord == 'asc'.toString()">
|
|
298
|
+ order by iInfo.item_nm asc
|
|
299
|
+ </if>
|
|
300
|
+ <if test="gridRequest.sord == 'desc'.toString()">
|
|
301
|
+ order by iInfo.item_nm desc
|
|
302
|
+ </if>
|
|
303
|
+ </if>
|
|
304
|
+ </when>
|
|
305
|
+ <otherwise>
|
|
306
|
+ order by iInfo.item_nm asc
|
|
307
|
+ </otherwise>
|
|
308
|
+ </choose>
|
|
309
|
+ <if test="gridRequest.pagingYn == true">
|
|
310
|
+ limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
|
|
311
|
+ </if>
|
|
312
|
+ </select>
|
|
313
|
+
|
|
314
|
+ <select id="selectPopNewItemBrandUnitGridCnt" resultType="int">
|
|
315
|
+ select /* selectPopNewItemBrandUnitGridCnt */
|
|
316
|
+ count(*)
|
|
317
|
+ from item_base_info iInfo
|
|
318
|
+ left outer join brand_item_unit_info bInfo on iInfo.brand_id = bInfo.brand_id and iInfo.item_id = bInfo.item_id and date_format(now(),'%Y%m%d') between bInfo.cont_stt_dt and bInfo.cont_end_dt
|
|
319
|
+ <if test="sSpplyId != null and sSpplyId != '' ">
|
|
320
|
+ and bInfo.spply_id = #{sSpplyId}
|
|
321
|
+ </if>
|
|
322
|
+ where iInfo.brand_id = #{sBrandId}
|
|
323
|
+ AND iInfo.item_st_cd = 'IS00'
|
|
324
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
325
|
+ and (iInfo.item_nm like concat('%',#{sItemNm},'%') or iInfo.item_id like concat('%',#{sItemNm},'%'))
|
|
326
|
+ </if>
|
|
327
|
+ <if test="sPodrPssblDvsn != null and sPodrPssblDvsn != ''">
|
|
328
|
+ and iInfo.podr_pssbl_dvsn = #{sPodrPssblDvsn}
|
|
329
|
+ </if>
|
|
330
|
+ </select>
|
|
331
|
+
|
265
|
332
|
<select id="selectPopItemStoreUnitGridList" resultType="com.oqpo.api.entity.stinfo.ItemUnitEntity">
|
266
|
333
|
select /* selectPopItemStoreUnitGridList */
|
267
|
334
|
iInfo.item_id,iInfo.item_nm,iInfo.podr_pssbl_dvsn, fn_code_nm('PODR_PSSBL_DVSN',iInfo.podr_pssbl_dvsn) AS podr_pssbl_dvsn_nm
|
|
@@ -319,4 +386,61 @@
|
319
|
386
|
</if>
|
320
|
387
|
</select>
|
321
|
388
|
|
|
389
|
+ <select id="selectPopNewItemStoreUnitGridList" resultType="com.oqpo.api.entity.stinfo.ItemUnitEntity">
|
|
390
|
+ select /* selectPopNewItemStoreUnitGridList */
|
|
391
|
+ iInfo.item_id,iInfo.item_nm,iInfo.podr_pssbl_dvsn, fn_code_nm('PODR_PSSBL_DVSN',iInfo.podr_pssbl_dvsn) AS podr_pssbl_dvsn_nm
|
|
392
|
+ ,iInfo.unit, fn_code_nm('DSTRBT_COST_UNIT', iInfo.unit) as unit_nm, sInfo.stdd_qty, sInfo.unit_amt, sInfo.store_unit_unq_no
|
|
393
|
+ ,'S' as unit_gubun, sInfo.brand_unit_unq_no
|
|
394
|
+ , 0 as whs_pass_qty, '' as spply_id
|
|
395
|
+ from item_base_info iInfo
|
|
396
|
+ join store_base_info store on iInfo.brand_id = store.brand_id and store.store_id = #{sStoreId}
|
|
397
|
+ join store_item_unit_info sInfo on iInfo.brand_id = sInfo.brand_id and iInfo.item_id = sInfo.item_id and sInfo.unit_target_cd = 'Y'
|
|
398
|
+ and store.store_id = sInfo.store_id and sInfo.store_id = #{sStoreId}
|
|
399
|
+ and date_format(now(),'%Y%m%d') between sInfo.cont_stt_dt and sInfo.cont_end_dt
|
|
400
|
+ where iInfo.brand_id = #{sBrandId}
|
|
401
|
+ AND iInfo.item_st_cd = 'IS00'
|
|
402
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
403
|
+ and (iInfo.item_nm like concat('%',#{sItemNm},'%') or iInfo.item_id like concat('%',#{sItemNm},'%'))
|
|
404
|
+ </if>
|
|
405
|
+ <if test="sPodrPssblDvsn != null and sPodrPssblDvsn != ''">
|
|
406
|
+ and iInfo.podr_pssbl_dvsn = #{sPodrPssblDvsn}
|
|
407
|
+ </if>
|
|
408
|
+ <choose>
|
|
409
|
+ <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
|
410
|
+ <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
|
|
411
|
+ <if test="gridRequest.sord == 'asc'.toString()">
|
|
412
|
+ order by iInfo.item_nm asc
|
|
413
|
+ </if>
|
|
414
|
+ <if test="gridRequest.sord == 'desc'.toString()">
|
|
415
|
+ order by iInfo.item_nm desc
|
|
416
|
+ </if>
|
|
417
|
+ </if>
|
|
418
|
+ </when>
|
|
419
|
+ <otherwise>
|
|
420
|
+ order by iInfo.item_nm asc
|
|
421
|
+ </otherwise>
|
|
422
|
+ </choose>
|
|
423
|
+ <if test="gridRequest.pagingYn == true">
|
|
424
|
+ limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
|
|
425
|
+ </if>
|
|
426
|
+ </select>
|
|
427
|
+
|
|
428
|
+ <select id="selectPopNewItemStoreUnitGridCnt" resultType="int">
|
|
429
|
+ select /* selectPopNewItemStoreUnitGridCnt */
|
|
430
|
+ count(*)
|
|
431
|
+ from item_base_info iInfo
|
|
432
|
+ join store_base_info store on iInfo.brand_id = store.brand_id and store.store_id = #{sStoreId}
|
|
433
|
+ join store_item_unit_info sInfo on iInfo.brand_id = sInfo.brand_id and iInfo.item_id = sInfo.item_id and sInfo.unit_target_cd = 'Y'
|
|
434
|
+ and store.store_id = sInfo.store_id and sInfo.store_id = #{sStoreId}
|
|
435
|
+ and date_format(now(),'%Y%m%d') between sInfo.cont_stt_dt and sInfo.cont_end_dt
|
|
436
|
+ where iInfo.brand_id = #{sBrandId}
|
|
437
|
+ AND iInfo.item_st_cd = 'IS00'
|
|
438
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
439
|
+ and (iInfo.item_nm like concat('%',#{sItemNm},'%') or iInfo.item_id like concat('%',#{sItemNm},'%'))
|
|
440
|
+ </if>
|
|
441
|
+ <if test="sPodrPssblDvsn != null and sPodrPssblDvsn != ''">
|
|
442
|
+ and iInfo.podr_pssbl_dvsn = #{sPodrPssblDvsn}
|
|
443
|
+ </if>
|
|
444
|
+ </select>
|
|
445
|
+
|
322
|
446
|
</mapper>
|