|
@@ -11,8 +11,8 @@
|
11
|
11
|
, rtn_rjct_id, rtn_rjct_rsn, rtn_req_amt, rtn_req_item_qty, rtn_whs_id, rtn_location
|
12
|
12
|
, sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
|
13
|
13
|
VALUES
|
14
|
|
- (#{entity.rtnReqUnqNo}, #{entity.storeId}, #{entity.brandId}, #{entity.rtnReqDt}, #{entity.rtnReqTm}
|
15
|
|
- , #{entity.rtnReqStCd}, #{entity.rtnReqMgrId}, #{entity.rtnReqMgrNm}, #{entity.rtnReqMgrTelNo}
|
|
14
|
+ (#{entity.rtnReqUnqNo}, #{entity.storeId}, #{entity.brandId}, case when #{entity.rtnReqStCd} = 'RR20' then date_format(now(),'%Y%m%d') else null end , #{entity.rtnReqTm}
|
|
15
|
+ , #{entity.rtnReqStCd}, #{userId}, #{entity.rtnReqMgrNm}, #{entity.rtnReqMgrTelNo}
|
16
|
16
|
, #{entity.whsDvsn}, #{entity.colReqDt}, #{entity.note}, #{entity.rtnRjctDt}, #{entity.rtnRjctNm}
|
17
|
17
|
, #{entity.rtnRjctId}, #{entity.rtnRjctRsn}, #{entity.rtnReqAmt}, #{entity.rtnReqItemQty}, #{entity.rtnWhsId}, #{entity.rtnLocation}
|
18
|
18
|
, NOW(), #{userId}, NOW(), #{userId})
|
|
@@ -21,7 +21,7 @@
|
21
|
21
|
|
22
|
22
|
<update id="updateRtnReqBaseInfo">
|
23
|
23
|
UPDATE rtn_req_base_info SET /* RtnReqMapper.updateRtnReqBaseInfo */
|
24
|
|
- rtn_req_dt = #{entity.rtnReqDt},
|
|
24
|
+ rtn_req_dt = case when #{entity.rtnReqStCd} = 'RR20' then date_format(now(),'%Y%m%d') else null end,
|
25
|
25
|
rtn_req_tm = #{entity.rtnReqTm},
|
26
|
26
|
rtn_req_st_cd = #{entity.rtnReqStCd},
|
27
|
27
|
whs_dvsn = #{entity.whsDvsn},
|
|
@@ -42,13 +42,13 @@
|
42
|
42
|
INSERT INTO rtn_req_dtl_ptcl /* RtnReqMapper.insertRtnReqDtlPtcl */
|
43
|
43
|
(rtn_req_unq_no, rtn_req_dtl_no, item_id, item_nm, unit
|
44
|
44
|
, rtn_qty, rtn_amt, rtn_dvsn, rtn_rsn
|
45
|
|
- , spply_id, unit_amt, store_unit_unq_no, brand_unit_unq_no, rtn_rsn_dvsn
|
|
45
|
+ , spply_id, unit_amt, store_unit_unq_no, brand_unit_unq_no, rtn_rsn_dvsn, unit_gubun
|
46
|
46
|
, sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
|
47
|
47
|
VALUES
|
48
|
48
|
<foreach collection="gridInsertData" item="item" separator=",">
|
49
|
49
|
(#{item.rtnReqUnqNo}, #{item.rtnReqDtlNo}, #{item.itemId}, #{item.itemNm}, #{item.unit}
|
50
|
50
|
, #{item.rtnQty}, #{item.rtnAmt}, #{item.rtnDvsn}, #{item.rtnRsn}
|
51
|
|
- , #{item.spplyId}, #{item.unitAmt}, #{item.storeUnitUnqNo}, #{item.brandUnitUnqNo}, #{item.rtnRsnDvsn}
|
|
51
|
+ , #{item.spplyId}, #{item.unitAmt}, #{item.storeUnitUnqNo}, #{item.brandUnitUnqNo}, #{item.rtnRsnDvsn}, #{unitGubun}
|
52
|
52
|
, NOW(), #{userId}, NOW(), #{userId})
|
53
|
53
|
</foreach>
|
54
|
54
|
</insert>
|
|
@@ -89,46 +89,60 @@
|
89
|
89
|
where rtn_req_unq_no = #{rtnReqUnqNo}
|
90
|
90
|
</select>
|
91
|
91
|
|
92
|
|
-<!--
|
93
|
|
- <select id="selectPchReqGridList" resultType="com.oqpo.api.entity.pomng.PchReqBaseInfoEntity">
|
94
|
|
- select /* PchReq.selectPchReqGridList */
|
95
|
|
- pch_req_unq_no, brand_id, fn_brand_nm(brand_id) as brand_nm, pch_req_nm
|
96
|
|
- ,pch_req_st_cd, fn_code_nm('PCH_REQ_ST_Cd',pch_req_st_cd) as pch_req_st_nm
|
97
|
|
- , pch_req_mgr_nm, date_format(dlv_req_dt,'%Y.%m.%d') as dlv_req_dt, pch_req_total_amt
|
98
|
|
- ,pch_req_item_qty, date_format(pch_req_rjct_dt,'%Y.%m.%d') as pch_req_rjct_dt, pch_req_rjct_nm
|
99
|
|
- ,whs_id, fn_whs_nm(brand_id, whs_id) as whs_nm
|
100
|
|
- ,location, fn_whs_location_nm(brand_id, whs_id, location) as location_nm
|
101
|
|
- ,date_format(pch_req_dt,'%Y.%m.%d') as pch_req_dt
|
102
|
|
- from pch_req_base_info
|
103
|
|
- where brand_id = #{sBrandId}
|
|
92
|
+ <select id="selectRtnReqGridList" resultType="com.oqpo.api.entity.rtnmng.RtnReqBaseInfoEntity">
|
|
93
|
+ select base.brand_id, fn_brand_nm(base.brand_id) as brand_nm
|
|
94
|
+ ,base.store_id , fn_store_nm(base.brand_id, base.store_id) as store_nm
|
|
95
|
+ , base.rtn_req_unq_no
|
|
96
|
+ , base.rtn_req_st_cd, fn_code_nm(upper('rtn_req_st_cd'), base.rtn_req_st_cd) as rtn_req_st_nm
|
|
97
|
+ , base.rtn_whs_id, base.rtn_location, fn_whs_nm(base.brand_id, base.rtn_whs_id) as rtn_whs_nm
|
|
98
|
+ , fn_whs_location_nm(base.brand_id, base.rtn_whs_id, base.rtn_location) as rtn_location_nm
|
|
99
|
+ , date_format(base.rtn_req_dt, '%Y.%m.%d') as rtn_req_dt, base.rtn_req_item_qty, base.rtn_req_amt
|
|
100
|
+ , date_format(base.col_req_dt, '%Y.%m.%d') as col_req_dt, base.rtn_req_mgr_nm, base.rtn_req_mgr_id
|
|
101
|
+ , date_format(base.rtn_rjct_dt, '%Y.%m.%d') as rtn_rjct_dt, base.rtn_rjct_nm
|
|
102
|
+ from rtn_req_base_info base
|
|
103
|
+ where 1 = 1
|
|
104
|
+ and base.brand_id = #{sBrandId}
|
|
105
|
+ and base.col_req_dt between #{fromDt} and #{toDt}
|
104
|
106
|
<if test="sStoreId != null and sStoreId != ''">
|
105
|
|
- and store_id = #{sStoreId}
|
|
107
|
+ and base.store_id = #{sStoreId}
|
106
|
108
|
</if>
|
107
|
|
- and date_format(sys_reg_dttm,'%Y%m%d') between #{fromDt} and #{toDt}
|
108
|
109
|
<if test="sWhsId != null and sWhsId != ''">
|
109
|
|
- and whs_id = #{sWhsId}
|
|
110
|
+ and base.rtn_whs_id = #{sWhsId}
|
110
|
111
|
</if>
|
111
|
|
- <if test="sPchReqStCd != null and sPchReqStCd != ''">
|
112
|
|
- and pch_req_st_cd = #{sPchReqStCd}
|
|
112
|
+ <if test="sRtnReqStCd != null and sRtnReqStCd != ''">
|
|
113
|
+ and base.rtn_req_st_cd = #{sRtnReqStCd}
|
113
|
114
|
</if>
|
114
|
115
|
<if test="sItemNm != null and sItemNm != ''">
|
115
|
|
- and pch_req_unq_no in ( select pch_req_unq_no from pch_req_dtl_ptcl
|
116
|
|
- where date_format(sys_reg_dttm,'%Y%m%d') between #{fromDt} and #{toDt})
|
117
|
|
- and item_id like concat('%',#{sItemNm},'%') or item_nm like concat('%',#{sItemNm},'%')
|
|
116
|
+ and base.rtn_req_unq_no in (select ptcl.rtn_req_unq_no
|
|
117
|
+ from rtn_req_base_info sbase,
|
|
118
|
+ rtn_req_dtl_ptcl ptcl
|
|
119
|
+ where sbase.rtn_req_unq_no = ptcl.rtn_req_unq_no
|
|
120
|
+ and sbase.brand_id = #{sBrandId}
|
|
121
|
+ and sbase.col_req_dt between #{fromDt} and #{toDt}
|
|
122
|
+ <if test="sStoreId != null and sStoreId != ''">
|
|
123
|
+ and sbase.store_id = #{sStoreId}
|
|
124
|
+ </if>
|
|
125
|
+ <if test="sWhsId != null and sWhsId != ''">
|
|
126
|
+ and sbase.rtn_whs_id = #{sWhsId}
|
|
127
|
+ </if>
|
|
128
|
+ <if test="sRtnReqStCd != null and sRtnReqStCd != ''">
|
|
129
|
+ and sbase.rtn_req_st_cd = #{sRtnReqStCd}
|
|
130
|
+ </if>
|
|
131
|
+ and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%')) )
|
118
|
132
|
</if>
|
119
|
133
|
<choose>
|
120
|
134
|
<when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
121
|
135
|
<if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
|
122
|
136
|
<if test="gridRequest.sord == 'asc'.toString()">
|
123
|
|
- order by pch_req_unq_no asc
|
|
137
|
+ order by base.rtn_req_unq_no asc
|
124
|
138
|
</if>
|
125
|
139
|
<if test="gridRequest.sord == 'desc'.toString()">
|
126
|
|
- order by pch_req_unq_no desc
|
|
140
|
+ order by base.rtn_req_unq_no desc
|
127
|
141
|
</if>
|
128
|
142
|
</if>
|
129
|
143
|
</when>
|
130
|
144
|
<otherwise>
|
131
|
|
- order by pch_req_unq_no desc
|
|
145
|
+ order by base.rtn_req_unq_no desc
|
132
|
146
|
</otherwise>
|
133
|
147
|
</choose>
|
134
|
148
|
<if test="gridRequest.pagingYn == true">
|
|
@@ -136,6 +150,73 @@
|
136
|
150
|
</if>
|
137
|
151
|
</select>
|
138
|
152
|
|
|
153
|
+ <select id="selectRtnReqGridCnt" resultType="int">
|
|
154
|
+ select count(*)
|
|
155
|
+ from rtn_req_base_info base
|
|
156
|
+ where 1 = 1
|
|
157
|
+ and base.brand_id = #{sBrandId}
|
|
158
|
+ and base.col_req_dt between #{fromDt} and #{toDt}
|
|
159
|
+ <if test="sStoreId != null and sStoreId != ''">
|
|
160
|
+ and base.store_id = #{sStoreId}
|
|
161
|
+ </if>
|
|
162
|
+ <if test="sWhsId != null and sWhsId != ''">
|
|
163
|
+ and base.rtn_whs_id = #{sWhsId}
|
|
164
|
+ </if>
|
|
165
|
+ <if test="sRtnReqStCd != null and sRtnReqStCd != ''">
|
|
166
|
+ and base.rtn_req_st_cd = #{sRtnReqStCd}
|
|
167
|
+ </if>
|
|
168
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
169
|
+ and base.rtn_req_unq_no in (select ptcl.rtn_req_unq_no
|
|
170
|
+ from rtn_req_base_info sbase,
|
|
171
|
+ rtn_req_dtl_ptcl ptcl
|
|
172
|
+ where sbase.rtn_req_unq_no = ptcl.rtn_req_unq_no
|
|
173
|
+ and sbase.brand_id = #{sBrandId}
|
|
174
|
+ and sbase.col_req_dt between #{fromDt} and #{toDt}
|
|
175
|
+ <if test="sStoreId != null and sStoreId != ''">
|
|
176
|
+ and sbase.store_id = #{sStoreId}
|
|
177
|
+ </if>
|
|
178
|
+ <if test="sWhsId != null and sWhsId != ''">
|
|
179
|
+ and sbase.rtn_whs_id = #{sWhsId}
|
|
180
|
+ </if>
|
|
181
|
+ <if test="sRtnReqStCd != null and sRtnReqStCd != ''">
|
|
182
|
+ and sbase.rtn_req_st_cd = #{sRtnReqStCd}
|
|
183
|
+ </if>
|
|
184
|
+ and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%')) )
|
|
185
|
+ </if>
|
|
186
|
+ </select>
|
|
187
|
+
|
|
188
|
+ <select id="selectRtnReqInfo" resultType="com.oqpo.api.entity.rtnmng.RtnReqBaseInfoEntity">
|
|
189
|
+ SELECT rtn_req_unq_no, brand_id, fn_brand_nm(brand_id) as brand_nm
|
|
190
|
+ , store_id, fn_store_nm(brand_id, store_id) as store_nm
|
|
191
|
+ , date_format(rtn_req_dt,'%Y.%m.%d') as rtn_req_dt, rtn_req_st_cd, fn_code_nm('RTN_REQ_ST_Cd',rtn_req_st_cd) as rtn_req_st_nm
|
|
192
|
+ , rtn_req_mgr_id, rtn_req_mgr_nm, whs_dvsn, fn_code_nm('WHS_DVSN',whs_dvsn) as whs_dvsn_nm
|
|
193
|
+ , date_format(col_req_dt,'%Y.%m.%d') as col_req_dt, note, date_format(rtn_rjct_dt,'%Y.%m.%d') as rtn_rjct_dt, rtn_rjct_nm, rtn_rjct_id
|
|
194
|
+ , rtn_rjct_rsn, rtn_req_amt, rtn_req_item_qty
|
|
195
|
+ , rtn_whs_id, fn_whs_nm(brand_id, rtn_whs_id) as rtn_whs_nm
|
|
196
|
+ , rtn_location, fn_whs_location_nm(brand_id, rtn_whs_id, rtn_location) as rtn_location_nm
|
|
197
|
+ , date_format(sys_reg_dttm,'%Y.%m.%d') AS sys_reg_dttm, sys_reg_id, date_format(sys_chg_dttm,'%Y.%m.%d') AS sys_chg_dttm, sys_chg_id
|
|
198
|
+ FROM rtn_req_base_info
|
|
199
|
+ WHERE 1=1
|
|
200
|
+ AND brand_id = #{brandId}
|
|
201
|
+ <if test="storeId != null and storeId != ''">
|
|
202
|
+ and store_id = #{storeId}
|
|
203
|
+ </if>
|
|
204
|
+ AND rtn_req_unq_no = #{rtnReqUnqNo}
|
|
205
|
+ </select>
|
|
206
|
+
|
|
207
|
+ <select id="selectRtnReqDtlList" resultType="com.oqpo.api.entity.rtnmng.RtnReqDtlPtclEntity">
|
|
208
|
+ SELECT rtn_req_unq_no, rtn_req_dtl_no, item_id, item_nm, unit
|
|
209
|
+ , rtn_qty, rtn_amt, rtn_dvsn, fn_code_nm('RTN_DVSN',rtn_dvsn) as rtn_dvsn_nm
|
|
210
|
+ , rtn_rsn, spply_id
|
|
211
|
+ , unit_amt, store_unit_unq_no, brand_unit_unq_no, rtn_rsn_dvsn, fn_code_nm('RTN_RSN_DVSN',rtn_rsn_dvsn) as rtn_rsn_dvsn_nm
|
|
212
|
+ , unit_gubun, fn_code_nm('UNIT_GUBUN',unit_gubun) as unit_gubun_nm
|
|
213
|
+ FROM rtn_req_dtl_ptcl
|
|
214
|
+ WHERE rtn_req_unq_no = #{rtnReqUnqNo}
|
|
215
|
+ </select>
|
|
216
|
+
|
|
217
|
+<!--
|
|
218
|
+
|
|
219
|
+
|
139
|
220
|
<select id="selectPchReqGridCnt" resultType="int">
|
140
|
221
|
select count(*) as cnt
|
141
|
222
|
from pch_req_base_info
|