|
@@ -71,55 +71,37 @@
|
71
|
71
|
INSERT INTO pch_odr_dtl_ptcl
|
72
|
72
|
(pch_podr_unq_no, pch_podr_dtl_no, pch_req_unq_no, pch_req_dtl_no, item_id
|
73
|
73
|
, item_nm, podr_qty, podr_amt, curr, unit
|
74
|
|
- , price_unit, dlv_req_dt, unit_amt, dlv_sch_dt, shmt_pssbl_qty
|
|
74
|
+ , unit_amt, dlv_sch_dt
|
75
|
75
|
, sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
|
76
|
76
|
VALUES
|
77
|
77
|
<foreach collection="gridInsertData" item="item" separator=",">
|
78
|
78
|
(#{entity.pchPodrUnqNo}, #{entity.pchPodrDtlNo}, #{entity.pchReqUnqNo}, #{entity.pchReqDtlNo}, #{entity.itemId}
|
79
|
79
|
, #{entity.itemNm}, #{entity.podrQty}, #{entity.podrAmt}, #{entity.curr}, #{entity.unit}
|
80
|
|
- , #{entity.priceUnit}, #{entity.dlvReqDt}, #{entity.unitAmt}, #{entity.dlvSchDt}, #{entity.shmtPssblQty}
|
|
80
|
+ , #{entity.unitAmt}, #{entity.dlvSchDt}
|
81
|
81
|
, NOW(), #{userId}, NOW(), #{userId})
|
82
|
82
|
</foreach>
|
83
|
83
|
</insert>
|
84
|
84
|
|
85
|
85
|
|
86
|
|
-
|
87
|
|
- <select id="selectPoPchSaveInfo" resultType="com.oqpo.api.entity.pomng.PchOdrBaseInfoEntity">
|
88
|
|
- SELECT distinct base.BRAND_ID, FN_BRAND_NM(base.brand_id) AS brand_nm
|
89
|
|
- , date_format(now() ,'%Y.%m.%d') as podr_dt
|
90
|
|
- , base.whs_id, base.location
|
91
|
|
- , concat(FN_WHS_NM(base.brand_id, base.whs_id) ,'-',FN_WHS_LOCATION_NM(base.brand_id, base.whs_id, base.location)) as dlv_place
|
92
|
|
- , case when base.store_id is null or base.store_id = '' then 'DL02' else 'DL01' end as dlv_dvsn
|
93
|
|
- , fn_code_nm('DLV_DVSN',case when base.store_id is null or base.store_id = '' then 'DL02' else 'DL01' end) as dlv_dvsn_nm
|
94
|
|
- , base.store_id
|
95
|
|
- FROM pch_req_base_info base
|
96
|
|
- , pch_req_dtl_ptcl ptcl
|
97
|
|
- WHERE 1 = 1
|
98
|
|
- and base.brand_id = #{brandId}
|
99
|
|
- AND base.PCH_REQ_UNQ_NO = ptcl.PCH_REQ_UNQ_NO
|
100
|
|
- AND base.PCH_REQ_ST_CD = 'PR20'
|
101
|
|
- AND concat(base.PCH_REQ_UNQ_NO, ptcl.PCH_REQ_DTL_NO) IN
|
102
|
|
- <foreach collection="gridUpdateData" item="item" separator="," open="(" close=")">
|
103
|
|
- concat(#{item.pchReqUnqNo},#{{item.pchReqDtlNo})
|
104
|
|
- </foreach>
|
|
86
|
+ <select id="selectPoPchDtlSaveInfo" resultType="com.oqpo.api.entity.pomng.PchOdrDtlPtclEntity">
|
|
87
|
+ select ptcl.item_id, ptcl.item_nm, ptcl.unit, ptcl.unit_amt
|
|
88
|
+ from pch_req_dtl_ptcl ptcl
|
|
89
|
+ join pch_req_base_info base on ptcl.pch_req_unq_no = base.pch_req_unq_no
|
|
90
|
+ where 1=1
|
|
91
|
+ and base.pch_req_unq_no = #{pchReqUnqNo}
|
|
92
|
+ and ptcl.pch_req_dtl_no = #{pchReqDtlNo}
|
105
|
93
|
</select>
|
106
|
94
|
|
107
|
|
- <select id="selectPoPchDtlSaveInfo" resultType="com.oqpo.api.entity.pomng.PchOdrDtlPtclEntity">
|
108
|
|
- select base.pch_req_unq_no , ptcl.pch_req_dtl_no
|
109
|
|
- , ptcl.item_id , ptcl.item_nm , ptcl.unit_amt , ptcl.unit
|
110
|
|
- , ptcl.pch_req_qty, ptcl.pch_req_qty as podr_qty, ptcl.pch_req_amt , base.dlv_req_dt
|
111
|
|
- , 0 as whs_pass_qty, bunit.spply_id, fn_spply_nm(bunit.spply_id) as spply_nm
|
112
|
|
- from pch_req_base_info base
|
113
|
|
- , pch_req_dtl_ptcl ptcl
|
114
|
|
- , brand_item_unit_info bunit
|
115
|
|
- where 1 = 1
|
116
|
|
- and base.brand_id = #{brandId}
|
117
|
|
- and base.pch_req_unq_no = ptcl.pch_req_unq_no
|
118
|
|
- and ptcl.brand_unit_unq_no = bunit.brand_unit_unq_no
|
119
|
|
- and base.pch_req_st_cd = 'PR20'
|
120
|
|
- and concat(base.pch_req_unq_no, ptcl.pch_req_dtl_no) in
|
121
|
|
- <foreach collection="gridUpdateData" item="item" separator="," open="(" close=")">
|
122
|
|
- concat(#{item.pchReqUnqNo},#{{item.pchReqDtlNo})
|
123
|
|
- </foreach>
|
|
95
|
+
|
|
96
|
+ <select id="selectPoItemDtlSaveInfo" resultType="com.oqpo.api.entity.pomng.PchOdrDtlPtclEntity">
|
|
97
|
+ select item_id, item_nm, unit, unit_amt
|
|
98
|
+ from brand_item_unit_info
|
|
99
|
+ where 1=1
|
|
100
|
+ and brand_id = #{brandId}
|
|
101
|
+ and item_id = #{itemId}
|
|
102
|
+ and date_format(now(), '%Y%m%d') between cont_stt_dt and cont_end_dt
|
124
|
103
|
</select>
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
125
|
107
|
</mapper>
|