|
@@ -95,13 +95,13 @@
|
95
|
95
|
insert into shmt_odr_dtl_ptcl
|
96
|
96
|
(shmt_req_unq_no, shmt_req_dtl_no, item_id, item_nm, unit_amt
|
97
|
97
|
, unit, podr_qty, podr_amt, shmt_qty, shmt_amt, expry_date
|
98
|
|
- , pch_podr_unq_no, pch_podr_dtl_no, pch_req_unq_no, pch_req_dtl_no
|
|
98
|
+ , pch_podr_unq_no, pch_podr_dtl_no, pch_req_unq_no, pch_req_dtl_no, shmt_dtl_st_cd
|
99
|
99
|
, sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
|
100
|
100
|
values
|
101
|
101
|
<foreach collection="gridInsertData" item="item" separator=",">
|
102
|
102
|
(#{item.shmtReqUnqNo}, #{item.shmtReqDtlNo}, #{item.itemId}, #{item.itemNm}, #{item.unitAmt}
|
103
|
103
|
, #{item.unit}, #{item.podrQty}, #{item.podrAmt}, #{item.shmtQty}, #{item.shmtAmt}, #{item.expryDate}
|
104
|
|
- , #{item.pchPodrUnqNo}, #{item.pchPodrDtlNo}, #{item.pchReqUnqNo}, #{item.pchReqDtlNo}
|
|
104
|
+ , #{item.pchPodrUnqNo}, #{item.pchPodrDtlNo}, #{item.pchReqUnqNo}, #{item.pchReqDtlNo}, 'SHMD1'
|
105
|
105
|
, NOW(), #{userId}, NOW(), #{userId})
|
106
|
106
|
</foreach>
|
107
|
107
|
</insert>
|
|
@@ -622,6 +622,7 @@
|
622
|
622
|
, ptcl.pch_podr_unq_no as 'deliDtlMgntInfo.pch_podr_unq_no', ptcl.pch_podr_dtl_no as 'deliDtlMgntInfo.pch_podr_dtl_no'
|
623
|
623
|
, ptcl.pch_req_unq_no as 'deliDtlMgntInfo.pch_req_unq_no', ptcl.pch_req_dtl_no as 'deliDtlMgntInfo.pch_req_dlt_no'
|
624
|
624
|
, ptcl.shmt_req_unq_no as 'deliDtlMgntInfo.shmt_req_unq_no' , ptcl.shmt_req_dtl_no as 'deliDtlMgntInfo.shmt_req_dtl_no'
|
|
625
|
+ , ptcl.podr_amt as 'deliDtlMgntInfo.podr_amt'
|
625
|
626
|
from deli_info_mgnt info
|
626
|
627
|
join deli_dtl_ptcl ptcl on info.dlv_sttmt_unq_no = ptcl.dlv_sttmt_unq_no
|
627
|
628
|
and concat(ptcl.dlv_sttmt_unq_no, ptcl.dlv_sttmt_dtl_no) in
|
|
@@ -635,4 +636,106 @@
|
635
|
636
|
and info.whs_id = #{whsId}
|
636
|
637
|
</select>
|
637
|
638
|
|
|
639
|
+
|
|
640
|
+ <update id="updateDeliDtlStCd" >
|
|
641
|
+ /* updateDeliDtlStCd */
|
|
642
|
+ <foreach collection="gridUpdateData" item="item" separator=";">
|
|
643
|
+ UPDATE deli_dtl_ptcl SET
|
|
644
|
+ dlv_dtl_st_cd = #{item.dlvDtlStCd}, /* 상태처리 */
|
|
645
|
+ sys_chg_dttm = NOW(),
|
|
646
|
+ sys_chg_id = #{userId}
|
|
647
|
+ WHERE dlv_sttmt_unq_no = #{item.dlvSttmtUnqNo}
|
|
648
|
+ AND dlv_sttmt_dtl_no = #{item.dlvSttmtDtlNo}
|
|
649
|
+ </foreach>
|
|
650
|
+ </update>
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+ <select id="selectDeliInfoStList" resultType="com.oqpo.api.entity.inoutmng.DeliInfoMgntEntity">
|
|
654
|
+ select gdlv.dlv_sttmt_unq_no
|
|
655
|
+ , case when gdlv.dlv0 > 0 then 'DLV0'
|
|
656
|
+ when gdlv.dlv0 = 0 and gdlv.dlv1 > 0 then 'DLV1'
|
|
657
|
+ when gdlv.dlv0 = 0 and gdlv.dlv1 = 0 then 'DLV2'
|
|
658
|
+ else '' end as dlv_st_cd
|
|
659
|
+ from (
|
|
660
|
+ select dlv_sttmt_unq_no
|
|
661
|
+ , sum(case when dlv_dtl_st_cd = 'DLD0' then 1 else 0 end) as dlv0
|
|
662
|
+ , sum(case when dlv_dtl_st_cd = 'DLD1' then 1 else 0 end) as dlv1
|
|
663
|
+ , sum(case when dlv_dtl_st_cd = 'DLD2' then 1 else 0 end) as dlv2
|
|
664
|
+ from deli_dtl_ptcl
|
|
665
|
+ where dlv_sttmt_unq_no in
|
|
666
|
+ <foreach collection="gridUpdateData" item="item" separator="," open="(" close=")">
|
|
667
|
+ #{item.dlvSttmtUnqNo}
|
|
668
|
+ </foreach>
|
|
669
|
+ group by dlv_sttmt_unq_no
|
|
670
|
+ ) gdlv
|
|
671
|
+ </select>
|
|
672
|
+
|
|
673
|
+ <update id="updateDeliInfoStCd" >
|
|
674
|
+ /* updateDeliInfoStCd */
|
|
675
|
+ <foreach collection="gridUpdateData" item="item" separator=";">
|
|
676
|
+ UPDATE deli_info_mgnt SET
|
|
677
|
+ dlv_st_cd = #{item.dlvStCd}, /* 상태처리 */
|
|
678
|
+ sys_chg_dttm = NOW(),
|
|
679
|
+ sys_chg_id = #{userId}
|
|
680
|
+ WHERE dlv_sttmt_unq_no = #{item.dlvSttmtUnqNo}
|
|
681
|
+ </foreach>
|
|
682
|
+ </update>
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+ <update id="updateShmtDtlStCd" >
|
|
686
|
+ /* updateShmtDtlStCd */
|
|
687
|
+ <foreach collection="gridUpdateData" item="item" separator=";">
|
|
688
|
+ UPDATE shmt_odr_dtl_ptcl SET
|
|
689
|
+ shmt_dtl_st_cd = #{item.shmtDtlStCd}, /* 상태처리 */
|
|
690
|
+ sys_chg_dttm = NOW(),
|
|
691
|
+ sys_chg_id = #{userId}
|
|
692
|
+ WHERE shmt_req_unq_no = #{item.shmtReqUnqNo}
|
|
693
|
+ AND shmt_req_dtl_no = #{item.shmtReqDtlNo}
|
|
694
|
+ </foreach>
|
|
695
|
+ </update>
|
|
696
|
+
|
|
697
|
+ <select id="selectShmtInfoStList" resultType="com.oqpo.api.entity.inoutmng.ShmtOdrDtlEntity">
|
|
698
|
+ select gdlv.shmt_req_unq_no
|
|
699
|
+ , case when gdlv.shmd1 > 0 then 'SHM1'
|
|
700
|
+ when gdlv.shmd1 = 0 and gdlv.shmd2 > 0 then 'SHM2'
|
|
701
|
+ when gdlv.shmd1 = 0 and gdlv.shmd2 = 0 then 'SHM3'
|
|
702
|
+ else '' end as shmt_req_st_cd
|
|
703
|
+ from (
|
|
704
|
+ select shmt_req_unq_no
|
|
705
|
+ , sum(case when shmt_dtl_st_cd = 'SHMD1' then 1 else 0 end) as shmd1
|
|
706
|
+ , sum(case when shmt_dtl_st_cd = 'SHMD2' then 1 else 0 end) as shmd2
|
|
707
|
+ , sum(case when shmt_dtl_st_cd = 'SHMD3' then 1 else 0 end) as shmd3
|
|
708
|
+ from shmt_odr_dtl_ptcl
|
|
709
|
+ where shmt_req_unq_no in
|
|
710
|
+ <foreach collection="gridUpdateData" item="item" separator="," open="(" close=")">
|
|
711
|
+ #{item.shmtReqUnqNo}
|
|
712
|
+ </foreach>
|
|
713
|
+ group by shmt_req_unq_no
|
|
714
|
+ ) gdlv
|
|
715
|
+
|
|
716
|
+ </select>
|
|
717
|
+
|
|
718
|
+ <update id="updateShmtInfoStCd" >
|
|
719
|
+ /* updateShmtInfoStCd */
|
|
720
|
+ <foreach collection="gridUpdateData" item="item" separator=";">
|
|
721
|
+ UPDATE shmt_odr_base_info SET
|
|
722
|
+ shmt_req_st_cd = #{item.shmtReqStCd}, /* 상태처리 */
|
|
723
|
+ sys_chg_dttm = NOW(),
|
|
724
|
+ sys_chg_id = #{userId}
|
|
725
|
+ WHERE shmt_odr_unq_no = #{item.shmtReqUnqNo}
|
|
726
|
+ </foreach>
|
|
727
|
+ </update>
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+ <update id="updatePchPodrDtlStCd" >
|
|
731
|
+ /* updatePchPodrDtlStCd */
|
|
732
|
+ <foreach collection="gridUpdateData" item="item" separator=";">
|
|
733
|
+ UPDATE pch_odr_dtl_ptcl SET
|
|
734
|
+ podr_dtl_st_cd = #{item.podrDtlStCd}, /* 상태처리 */
|
|
735
|
+ sys_chg_dttm = NOW(),
|
|
736
|
+ sys_chg_id = #{userId}
|
|
737
|
+ WHERE pch_podr_unq_no = #{item.pchPodrUnqNo}
|
|
738
|
+ AND pch_podr_dlt_no = #{item.pchPodrDtlNo}
|
|
739
|
+ </foreach>
|
|
740
|
+ </update>
|
638
|
741
|
</mapper>
|