|
@@ -12,4 +12,166 @@
|
12
|
12
|
and ptcl.rtn_podr_unq_no = #{rtnPodrUnqNo}
|
13
|
13
|
</select>
|
14
|
14
|
|
|
15
|
+ <select id="selectColTargetRtnGridList" resultType="com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity">
|
|
16
|
+ select base.brand_id, fn_brand_nm(base.brand_id) as brand_nm
|
|
17
|
+ , base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no as 'rtnOdrDtlInfo.rtn_podr_dtl_no'
|
|
18
|
+ , ptcl.rtn_req_unq_no as 'rtnOdrDtlInfo.rtn_req_unq_no', ptcl.rtn_req_dtl_no as 'rtnOdrDtlInfo.rtn_req_dtl_no'
|
|
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'
|
|
22
|
+ , date_format(base.col_req_dt,'%Y.%m.%d') as col_req_dt, ptcl.rtn_amt as 'rtnOdrDtlInfo.rtn_amt'
|
|
23
|
+ , base.whs_id, fn_whs_nm(base.brand_id, base.whs_id) as whs_nm
|
|
24
|
+ , base.location, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
|
|
25
|
+ , base.store_id
|
|
26
|
+ from rtn_odr_base_info base
|
|
27
|
+ , rtn_odr_dtl_ptcl ptcl
|
|
28
|
+ where 1=1
|
|
29
|
+ and base.rtn_podr_unq_no = ptcl.rtn_podr_unq_no
|
|
30
|
+ and base.brand_id = #{sBrandId}
|
|
31
|
+ and base.col_req_dt between #{fromDt} and #{toDt}
|
|
32
|
+ and base.rtn_odr_st_cd = 'RO20'
|
|
33
|
+ and ptcl.rodr_dtl_st_cd = 'ROD0'
|
|
34
|
+ and base.col_dvsn = 'C001'
|
|
35
|
+ <if test="sWhsId != null and sWhsId != ''">
|
|
36
|
+ and base.whs_id = #{sWhsId}
|
|
37
|
+ </if>
|
|
38
|
+ <if test="sRtnWhsId != null and sRtnWhsId != ''">
|
|
39
|
+ and base.rtn_whs_id = #{sRtnWhsId}
|
|
40
|
+ </if>
|
|
41
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
42
|
+ and (ptcl.item_id like concat('%', '', '%') or ptcl.item_nm like concat('%', '', '%'))
|
|
43
|
+ </if>
|
|
44
|
+ <choose>
|
|
45
|
+ <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
|
46
|
+ <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
|
|
47
|
+ <if test="gridRequest.sord == 'asc'.toString()">
|
|
48
|
+ order by base.rtn_podr_unq_no as , ptcl.rtn_podr_dtl_no asc
|
|
49
|
+ </if>
|
|
50
|
+ <if test="gridRequest.sord == 'desc'.toString()">
|
|
51
|
+ order by base.rtn_podr_unq_no desc , ptcl.rtn_podr_dtl_no asc
|
|
52
|
+ </if>
|
|
53
|
+ </if>
|
|
54
|
+ </when>
|
|
55
|
+ <otherwise>
|
|
56
|
+ order by base.rtn_podr_unq_no as , ptcl.rtn_podr_dtl_no asc
|
|
57
|
+ </otherwise>
|
|
58
|
+ </choose>
|
|
59
|
+ <if test="gridRequest.pagingYn == true">
|
|
60
|
+ limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
|
|
61
|
+ </if>
|
|
62
|
+ </select>
|
|
63
|
+
|
|
64
|
+ <select id="selectColTargetRtnGridCnt" resultType="int">
|
|
65
|
+ select count(*) as cnt
|
|
66
|
+ from rtn_odr_base_info base
|
|
67
|
+ , rtn_odr_dtl_ptcl ptcl
|
|
68
|
+ where 1=1
|
|
69
|
+ and base.rtn_podr_unq_no = ptcl.rtn_podr_unq_no
|
|
70
|
+ and base.brand_id = #{sBrandId}
|
|
71
|
+ and base.col_req_dt between #{fromDt} and #{toDt}
|
|
72
|
+ and base.rtn_odr_st_cd = 'RO20'
|
|
73
|
+ and ptcl.rodr_dtl_st_cd = 'ROD0'
|
|
74
|
+ and base.col_dvsn = 'C001'
|
|
75
|
+ <if test="sWhsId != null and sWhsId != ''">
|
|
76
|
+ and base.whs_id = #{sWhsId}
|
|
77
|
+ </if>
|
|
78
|
+ <if test="sRtnWhsId != null and sRtnWhsId != ''">
|
|
79
|
+ and base.rtn_whs_id = #{sRtnWhsId}
|
|
80
|
+ </if>
|
|
81
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
82
|
+ and (ptcl.item_id like concat('%', '', '%') or ptcl.item_nm like concat('%', '', '%'))
|
|
83
|
+ </if>
|
|
84
|
+
|
|
85
|
+ </select>
|
|
86
|
+
|
|
87
|
+ <select id="selectPickJobDataList" resultType="com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity">
|
|
88
|
+ select base.brand_id,base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no as 'rtnOdrDtlInfo.rtn_podr_dtl_no'
|
|
89
|
+ ,ptcl.item_id as 'rtnOdrDtlInfo.item_id' , ptcl.item_nm as 'rtnOdrDtlInfo.item_nm', base.whs_id
|
|
90
|
+ ,base.location, ptcl.unit_amt as 'rtnOdrDtlInfo.unit_amt', ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.rtn_odr_qty'
|
|
91
|
+ ,ptcl.rtn_odr_amt as 'rtnOdrDtlInfo.rtn_odr_amt', date_format(base.col_req_dt,'%Y.%m.%d') as col_req_dt
|
|
92
|
+ , base.rtn_whs_id, base.rtn_location, ptcl.rtn_req_unq_no as 'rtnOdrDtlInfo.rtn_req_unq_no' , ptcl.rtn_req_dtl_no as 'rtnOdrDtlInfo.rtn_req_dtl_no'
|
|
93
|
+ , base.store_id , base.rtn_mgr_nm , base.rtn_mgr_tel_no, base.rtn_mgr_id
|
|
94
|
+ , nvl(fn_get_telno((select mgr_tel_no from whs_mgnt_base_info where brand_id = base.brand_id and whs_id = base.rtn_whs_id)),' ') as pick_tel_no
|
|
95
|
+ , date_format(base.rtn_odr_reg_dt,'%Y%m%d') as rtn_odr_req_dt
|
|
96
|
+ , base.spply_id, fn_spply_nm(base.spply_id) as spply_nm
|
|
97
|
+ , ptcl.rtn_rsn_dvsn as 'rtnOdrDtlInfo.rtn_rsn_dvsn', ptcl.rtn_rsn as 'rtnOdrDtlInfo.rtn_rsn'
|
|
98
|
+ from rtn_odr_base_info base
|
|
99
|
+ join rtn_odr_dtl_ptcl ptcl on base.rtn_podr_unq_no = ptcl.rtn_podr_unq_no and ptcl.rodr_dtl_st_cd = 'ROD0'
|
|
100
|
+ join item_base_info itm on ptcl.item_id = itm.item_id
|
|
101
|
+ and base.brand_id = #{brandId}
|
|
102
|
+ and concat(base.rtn_podr_unq_no,ptcl.rtn_podr_dtl_no) in
|
|
103
|
+ <foreach collection="gridInsertData" item="item" separator="," open="(" close=")">
|
|
104
|
+ concat(#{item.rtnPodrUnqNo},#{item.rtnPodrDtlNo})
|
|
105
|
+ </foreach>
|
|
106
|
+ order by base.brand_id, base.whs_id, base.location, base.rtn_whs_id,base.rtn_location
|
|
107
|
+ </select>
|
|
108
|
+
|
|
109
|
+ <insert id="insertColOdrBase">
|
|
110
|
+ insert into col_odr_base_info /* ColOdr.insertColOdrBase*/
|
|
111
|
+ (col_cmd_unq_no, col_reg_dt, brand_id, whs_id, location
|
|
112
|
+ , store_id, item_qty, col_total_amt, col_req_dt, col_dvsn
|
|
113
|
+ , col_cmd_st_cd, col_req_mgr_nm, col_req_mgr_id, col_dt, col_cnfm_nm
|
|
114
|
+ , col_cnfm_id, col_mgr_nm, col_mgr_tel_no, col_mgr_emal, col_mgr_mbl_no
|
|
115
|
+ , rtn_whs_id, rtn_location, spply_id, spply_nm
|
|
116
|
+ , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
|
|
117
|
+ values
|
|
118
|
+
|
|
119
|
+ (#{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}
|
|
121
|
+ , #{entity.colCmdStCd}, #{entity.colReqMgrNm}, #{entity.colReqMgrId}, #{entity.colDt}, #{entity.colCnfmNm}
|
|
122
|
+ , #{entity.colCnfmId}, #{entity.colMgrNm}, #{entity.colMgrTelNo}, #{entity.colMgrEmal}, #{entity.colMgrMblNo}
|
|
123
|
+ , #{entity.rtnWhsId}, #{entity.rtnLocation}, #{entity.spplyId}, #{entity.spplyNm}
|
|
124
|
+ , now(), #{userId}, now(), #{userId})
|
|
125
|
+
|
|
126
|
+ </insert>
|
|
127
|
+
|
|
128
|
+ <insert id="insertColOdrDtl">
|
|
129
|
+ insert into col_odr_dtl_ptcl /* ColOdr.insertColOdrDtl*/
|
|
130
|
+ (col_cmd_unq_no, col_cmd_dtl_no, item_id, item_nm, unit_amt
|
|
131
|
+ , col_qty, col_amt, rtn_qty, rtn_amt, rtn_rsn_dvsn
|
|
132
|
+ , rtn_rsn, rtn_podr_unq_no, rtn_podr_dtl_no, rtn_req_dtl_no, rtn_req_unq_no, col_cmd_dtl_st_cd
|
|
133
|
+ , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
|
|
134
|
+ values
|
|
135
|
+ <foreach collection="gridInsertData" item="item" separator=",">
|
|
136
|
+ (#{item.colCmdUnqNo}, #{item.colCmdDtlNo}, #{item.itemId}, #{item.itemNm}, #{item.unitAmt}
|
|
137
|
+ , #{item.colQty}, #{item.colAmt}, #{item.rtnQty}, #{item.rtnAmt}, #{item.rtnRsnDvsn}
|
|
138
|
+ , #{item.rtnRsn}, #{item.rtnPodrUnqNo}, #{item.rtnPodrDtlNo}, #{item.rtnReqDtlNo}, #{item.rtnReqUnqNo}, 'CDLD1'
|
|
139
|
+ , now(), #{userId}, now(), #{userId})
|
|
140
|
+ </foreach>
|
|
141
|
+ </insert>
|
|
142
|
+
|
|
143
|
+ <insert id="insertPickMgntBase">
|
|
144
|
+ insert into pick_info_mgnt /* ColOdr.insertPickMgntBase */
|
|
145
|
+ (col_pick_unq_no, spply_id, spply_nm, store_id, col_reg_dt
|
|
146
|
+ , col_tot_amt, pick_mgr_nm, pick_mgr_tel_no, pick_mgr_emal, pick_mgr_mbl_no
|
|
147
|
+ , 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
|
|
149
|
+ , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
|
|
150
|
+ values
|
|
151
|
+ (#{entity.colPickUnqNo}, #{entity.spplyId}, #{entity.spplyNm}, #{entity.storeId}, #{entity.colRegDt}
|
|
152
|
+ , #{entity.colTotAmt}, #{entity.pickMgrNm}, #{entity.pickMgrTelNo}, #{entity.pickMgrEmal}, #{entity.pickMgrMblNo}
|
|
153
|
+ , #{entity.pndrTelNo}, #{entity.pickStCd}, #{entity.rodrRegDt}, #{entity.colReqDt}, #{entity.colSchDt}
|
|
154
|
+ , #{entity.colCmpltDt}, #{entity.whsId}, #{entity.location}, #{entity.whsDvsn}, #{entity.brandId}, #{entity.colDesc}
|
|
155
|
+ , now(), #{userId}, now(), #{userId})
|
|
156
|
+ </insert>
|
|
157
|
+
|
|
158
|
+ <insert id="insertPickDtlPtcl">
|
|
159
|
+ insert into pick_dtl_ptcl /* ColOdr.insertPickDtlPtcl */
|
|
160
|
+ (col_pick_unq_no, col_pick_dtl_no, rtn_podr_unq_no, rtn_podr_dtl_no, rtn_req_unq_no
|
|
161
|
+ , rtn_req_dtl_no, col_cmd_unq_no, col_cmd_dtl_no, pick_dtl_st_cd, item_id
|
|
162
|
+ , item_nm, unit, unit_amt, price_unit, rodr_qty
|
|
163
|
+ , col_qty, col_amt, delay_yn, delay_rsn
|
|
164
|
+ , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
|
|
165
|
+ values
|
|
166
|
+ <foreach collection="gridInsertData" item="item" separator=",">
|
|
167
|
+ (#{item.colPickUnqNo}, #{item.colPickDtlNo}, #{item.rtnPodrUnqNo}, #{item.rtnPodrDtlNo}, #{item.rtnReqUnqNo}
|
|
168
|
+ , #{item.rtnReqDtlNo}, #{item.colCmdUnqNo}, #{item.colCmdDtlNo}, 'PICKD0', #{item.itemId}
|
|
169
|
+ , #{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})
|
|
172
|
+ </foreach>
|
|
173
|
+ </insert>
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
15
|
177
|
</mapper>
|