|
@@ -362,6 +362,7 @@
|
362
|
362
|
, fn_whs_location_nm(info.brand_id, info.whs_id, info.location) as location_nm
|
363
|
363
|
, date_format(info.podr_reg_dt, '%Y.%m.%d') as podr_reg_dt, date_format(info.dlv_req_dt, '%y.%m.%d') as dlv_req_dt
|
364
|
364
|
, date_format(info.dlv_reg_dt, '%Y.%m.%d') as dlv_req_dt, date_format(info.dlv_sch_dt, '%y.%m.%d') as dlv_sch_dt
|
|
365
|
+ , date_format(info.dlv_cmplt_dt, '%y.%m.%d') as dlv_cmplt_dt
|
365
|
366
|
, ptcl.item_id as 'deliDtlMgntInfo.item_id', ptcl.item_nm as 'deliDtlMgntInfo.item_nm'
|
366
|
367
|
, ptcl.podr_qty as 'deliDtlMgntInfo.podr_qty', ptcl.dlv_qty as 'deliDtlMgntInfo.dlv_qty'
|
367
|
368
|
, ptcl.unit as 'deliDtlMgntInfo.unit', ptcl.unit_amt as 'deliDtlMgntInfo.unit_amt'
|
|
@@ -378,7 +379,10 @@
|
378
|
379
|
and info.dlv_req_dt between #{fromDt} and #{toDt} -- 2인경우 납품요청일로 조회
|
379
|
380
|
</if>
|
380
|
381
|
<if test="dtGubun eq '3'.toString()">
|
381
|
|
- and info.dlv_reg_dt between #{fromDt} and #{toDt} -- 3인경우 납품생성일로 조회
|
|
382
|
+ and info.dlv_sch_dt between #{fromDt} and #{toDt} -- 3인경우 납품예정일로 조회
|
|
383
|
+ </if>
|
|
384
|
+ <if test="dtGubun eq '4'.toString()">
|
|
385
|
+ and info.dlv_cmplt_dt between #{fromDt} and #{toDt} -- 3인경우 납품완료일 조회
|
382
|
386
|
</if>
|
383
|
387
|
<if test="sDlvStCd != null and sDlvStCd != ''">
|
384
|
388
|
and info.dlv_st_cd = #{sDlvStCd} -- 납품상태
|
|
@@ -426,7 +430,10 @@
|
426
|
430
|
and info.dlv_req_dt between #{fromDt} and #{toDt} -- 2인경우 납품요청일로 조회
|
427
|
431
|
</if>
|
428
|
432
|
<if test="dtGubun eq '3'.toString()">
|
429
|
|
- and info.dlv_reg_dt between #{fromDt} and #{toDt} -- 3인경우 납품생성일로 조회
|
|
433
|
+ and info.dlv_sch_dt between #{fromDt} and #{toDt} -- 3인경우 납품예정일로 조회
|
|
434
|
+ </if>
|
|
435
|
+ <if test="dtGubun eq '4'.toString()">
|
|
436
|
+ and info.dlv_cmplt_dt between #{fromDt} and #{toDt} -- 3인경우 납품완료일 조회
|
430
|
437
|
</if>
|
431
|
438
|
<if test="sDlvStCd != null and sDlvStCd != ''">
|
432
|
439
|
and info.dlv_st_cd = #{sDlvStCd} -- 납품상태
|
|
@@ -442,4 +449,142 @@
|
442
|
449
|
</if>
|
443
|
450
|
</select>
|
444
|
451
|
|
|
452
|
+ <select id="selectSpplyDeliGridList" resultType="com.oqpo.api.entity.inoutmng.DeliInfoMgntEntity">
|
|
453
|
+ select info.brand_id, fn_brand_nm(info.brand_id) as brand_nm, info.dlv_sttmt_unq_no
|
|
454
|
+ , info.spply_id, info.spply_nm, info.dlv_st_cd, fn_code_nm(upper('dlv_st_cd'), info.dlv_st_cd) as dlv_st_nm
|
|
455
|
+ , info.whs_id, info.location, fn_whs_nm(info.brand_id, info.whs_id) as whs_nm
|
|
456
|
+ , fn_whs_location_nm(info.brand_id, info.whs_id, info.location) as location_nm
|
|
457
|
+ , date_format(info.podr_reg_dt, '%Y.%m.%d') as podr_reg_dt, date_format(info.dlv_req_dt, '%y.%m.%d') as dlv_req_dt
|
|
458
|
+ , date_format(info.dlv_reg_dt, '%Y.%m.%d') as dlv_req_dt, date_format(info.dlv_sch_dt, '%y.%m.%d') as dlv_sch_dt
|
|
459
|
+ , date_format(info.dlv_cmplt_dt, '%y.%m.%d') as dlv_cmplt_dt
|
|
460
|
+ , ptcl.item_id as 'deliDtlMgntInfo.item_id', ptcl.item_nm as 'deliDtlMgntInfo.item_nm'
|
|
461
|
+ , ptcl.podr_qty as 'deliDtlMgntInfo.podr_qty', ptcl.dlv_qty as 'deliDtlMgntInfo.dlv_qty'
|
|
462
|
+ , ptcl.unit as 'deliDtlMgntInfo.unit', ptcl.unit_amt as 'deliDtlMgntInfo.unit_amt'
|
|
463
|
+ , info.dlv_mgr_nm , info.dlv_mgr_mbl_no
|
|
464
|
+ from deli_info_mgnt info
|
|
465
|
+ , deli_dtl_ptcl ptcl
|
|
466
|
+ where 1 = 1
|
|
467
|
+ and info.dlv_sttmt_unq_no = ptcl.dlv_sttmt_unq_no
|
|
468
|
+ and info.brand_id = #{sBrandId}
|
|
469
|
+ and info.spply_id = #{sSpplyId}
|
|
470
|
+ and info.dlv_sch_dt between #{fromDt} and #{toDt} -- 납품 예정일
|
|
471
|
+ <if test="sWhsId != null and sWhsId != ''">
|
|
472
|
+ and info.whs_id = #{sWhsId}
|
|
473
|
+ </if>
|
|
474
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
475
|
+ and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
|
|
476
|
+ </if>
|
|
477
|
+ <choose>
|
|
478
|
+ <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
|
479
|
+ <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
|
|
480
|
+ <if test="gridRequest.sord == 'asc'.toString()">
|
|
481
|
+ order by pch_req_unq_no asc
|
|
482
|
+ </if>
|
|
483
|
+ <if test="gridRequest.sord == 'desc'.toString()">
|
|
484
|
+ order by pch_req_unq_no desc
|
|
485
|
+ </if>
|
|
486
|
+ </if>
|
|
487
|
+ </when>
|
|
488
|
+ <otherwise>
|
|
489
|
+ order by pch_req_unq_no desc
|
|
490
|
+ </otherwise>
|
|
491
|
+ </choose>
|
|
492
|
+ <if test="gridRequest.pagingYn == true">
|
|
493
|
+ limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
|
|
494
|
+ </if>
|
|
495
|
+ </select>
|
|
496
|
+
|
|
497
|
+ <select id="selectSpplyDeliGridCnt" resultType="int">
|
|
498
|
+ select count(*)
|
|
499
|
+ from deli_info_mgnt info
|
|
500
|
+ , deli_dtl_ptcl ptcl
|
|
501
|
+ where 1 = 1
|
|
502
|
+ and info.dlv_sttmt_unq_no = ptcl.dlv_sttmt_unq_no
|
|
503
|
+ and info.brand_id = #{sBrandId}
|
|
504
|
+ and info.spply_id = #{sSpplyId}
|
|
505
|
+ and info.dlv_sch_dt between #{fromDt} and #{toDt} -- 납품 예정일
|
|
506
|
+ <if test="sWhsId != null and sWhsId != ''">
|
|
507
|
+ and info.whs_id = #{sWhsId}
|
|
508
|
+ </if>
|
|
509
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
510
|
+ and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
|
|
511
|
+ </if>
|
|
512
|
+ </select>
|
|
513
|
+
|
|
514
|
+ <select id="selectWarehouseTargetGridList" resultType="com.oqpo.api.entity.inoutmng.DeliInfoMgntEntity">
|
|
515
|
+ select info.brand_id, fn_brand_nm(info.brand_id) as brand_nm
|
|
516
|
+ , info.dlv_sttmt_unq_no, ptcl.dlv_sttmt_dtl_no as 'deliDtlMgntInfo.dlv_sttmt_dtl_no'
|
|
517
|
+ , ptcl.item_id as 'deliDtlMgntInfo.item_id' , ptcl.item_nm as 'deliDtlMgntInfo.item_nm'
|
|
518
|
+ , ptcl.podr_qty as 'deliDtlMgntInfo.podr_qty', ptcl.dlv_qty as 'deliDtlMgntInfo.dlv_qty'
|
|
519
|
+ , ptcl.dlv_qty as 'deliDtlMgntInfo.whs_qty' , ptcl.dlv_qty * ptcl.unit_amt as 'deliDtlMgntInfo.whs_amt'
|
|
520
|
+ , ptcl.unit_amt as 'deliDtlMgntInfo.unit_amt'
|
|
521
|
+ , info.whs_id, info.location, fn_whs_nm(info.brand_id, info.whs_id) as whs_nm
|
|
522
|
+ , fn_whs_location_nm(info.brand_id, info.whs_id, info.location) as location_nm
|
|
523
|
+ , date_format(info.dlv_sch_dt, '%Y.%m.%d %H:%i:%s') as dlv_sch_dt
|
|
524
|
+ , date_format(info.dlv_req_dt, '%Y.%m.%d %H:%i:%s') as dlv_req_dt
|
|
525
|
+ , info.dlv_mgr_nm, info.dlv_mgr_mbl_no, fn_get_telno(info.dlv_mgr_tel_no) AS dlv_mgr_tel_no
|
|
526
|
+ , ptcl.pch_podr_unq_no as 'deliDtlMgntInfo.pch_podr_unq_no', ptcl.pch_podr_dtl_no as 'deliDtlMgntInfo.pch_podr_dtl_no'
|
|
527
|
+ , ptcl.pch_req_unq_no as 'deliDtlMgntInfo.pch_req_unq_no', ptcl.pch_req_dtl_no as 'deliDtlMgntInfo.pch_req_dlt_no'
|
|
528
|
+ , ptcl.unit as 'deliDtlMgntInfo.unit', info.dlv_cmplt_dt as 'deliDtlMgntInfo.dlv_cmplt_dt'
|
|
529
|
+ , info.spply_id as 'deliDtlMgntInfo.spply_id', info.spply_nm as 'deliDtlMgntInfo.spply_nm'
|
|
530
|
+ from deli_info_mgnt info
|
|
531
|
+ , deli_dtl_ptcl ptcl
|
|
532
|
+ where 1 = 1
|
|
533
|
+ and info.dlv_sttmt_unq_no = ptcl.dlv_sttmt_unq_no
|
|
534
|
+ and info.brand_id = #{sBrandId}
|
|
535
|
+ and info.dlv_sch_dt between #{fromDt} and #{endDt}
|
|
536
|
+ and info.dlv_st_cd = 'DLV0'
|
|
537
|
+ and info.whs_id = #{sWhsId}
|
|
538
|
+ <if test="sSpplyId != null and sSpplyId != ''">
|
|
539
|
+ and info.spply_id = #{sSpplyId}
|
|
540
|
+ </if>
|
|
541
|
+ <if test="sDlvSttmtUnqNo != null and sDlvSttmtUnqNo != ''">
|
|
542
|
+ and info.dlv_sttmt_unq_no like concat('%',#{sDlvSttmtUnqNo},'%')
|
|
543
|
+ </if>
|
|
544
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
545
|
+ and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
|
|
546
|
+ </if>
|
|
547
|
+ <choose>
|
|
548
|
+ <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
|
549
|
+ <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
|
|
550
|
+ <if test="gridRequest.sord == 'asc'.toString()">
|
|
551
|
+ order by pch_req_unq_no asc
|
|
552
|
+ </if>
|
|
553
|
+ <if test="gridRequest.sord == 'desc'.toString()">
|
|
554
|
+ order by pch_req_unq_no desc
|
|
555
|
+ </if>
|
|
556
|
+ </if>
|
|
557
|
+ </when>
|
|
558
|
+ <otherwise>
|
|
559
|
+ order by pch_req_unq_no desc
|
|
560
|
+ </otherwise>
|
|
561
|
+ </choose>
|
|
562
|
+ <if test="gridRequest.pagingYn == true">
|
|
563
|
+ limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
|
|
564
|
+ </if>
|
|
565
|
+ </select>
|
|
566
|
+
|
|
567
|
+ <select id="selectWarehouseTargetGridCnt" resultType="int">
|
|
568
|
+ select count(*)
|
|
569
|
+ from deli_info_mgnt info
|
|
570
|
+ , deli_dtl_ptcl ptcl
|
|
571
|
+ where 1 = 1
|
|
572
|
+ and info.dlv_sttmt_unq_no = ptcl.dlv_sttmt_unq_no
|
|
573
|
+ and info.brand_id = #{sBrandId}
|
|
574
|
+ and info.dlv_sch_dt between #{fromDt} and #{endDt}
|
|
575
|
+ and info.dlv_st_cd = 'DLV0'
|
|
576
|
+ and info.whs_id = #{whsId}
|
|
577
|
+ <if test="sSpplyId != null and sSpplyId != ''">
|
|
578
|
+ and info.spply_id = #{sSpplyId}
|
|
579
|
+ </if>
|
|
580
|
+ <if test="sDlvSttmtUnqNo != null and sDlvSttmtUnqNo != ''">
|
|
581
|
+ and info.dlv_sttmt_unq_no like concat('%',#{sDlvSttmtUnqNo},'%')
|
|
582
|
+ </if>
|
|
583
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
584
|
+ and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
|
|
585
|
+ </if>
|
|
586
|
+ </select>
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
|
445
|
590
|
</mapper>
|