|
@@ -7,13 +7,13 @@
|
7
|
7
|
select /*selectItemUnitGridList*/
|
8
|
8
|
iunit.brand_unit_unq_no, iunit.brand_id, iunit.item_id, iunit.item_nm, iunit.spply_id,
|
9
|
9
|
iunit.spply_nm, date_format(iunit.cont_stt_dt,'%Y.%m.%d') as cont_stt_dt, date_format(iunit.cont_end_dt,'%Y.%m.%d') as cont_end_dt,
|
10
|
|
- iunit.curr, fn_code_nm('CURR', iunit.curr) as curr_nm, iunit.unit, fn_code_nm('DSTRBT_COST_UNIT', iunit.unit) as unit,
|
|
10
|
+ iunit.curr, fn_code_nm('CURR', iunit.curr) as curr_nm, iunit.unit, fn_code_nm('DSTRBT_COST_UNIT', iunit.unit) as unit_nm,
|
11
|
11
|
iunit.unit_amt, iunit.lead_time, iunit.spply_item_id,
|
12
|
|
- iunit.unit_st_cd, fn_code_nm('UNIT_ST_CD', iunit.unit_st_cd) as unit_st_nm, iunit.stdd_qyt
|
|
12
|
+ iunit.unit_st_cd, fn_code_nm('UNIT_ST_CD', iunit.unit_st_cd) as unit_st_nm, iunit.stdd_qty
|
13
|
13
|
from brand_item_unit_info iunit
|
14
|
14
|
join item_base_info item on iunit.brand_id = item.brand_id and iunit.item_id = item.item_id
|
15
|
15
|
left outer join item_class_ptcl iclas on item.item_id = iclas.item_id
|
16
|
|
- join item_class_mgnt mclas on iclas.item_class_mgnt_no = mclas.item_class_mgnt_no
|
|
16
|
+ left outer join item_class_mgnt mclas on iclas.item_class_mgnt_no = mclas.item_class_mgnt_no
|
17
|
17
|
where iunit.brand_id = #{sBrandId}
|
18
|
18
|
<if test="fromDt != null and fromDt != '' and toDt != null and toDt != ''">
|
19
|
19
|
and iunit.cont_stt_dt <![CDATA[ >= ]]> #{fromDt}
|
|
@@ -22,7 +22,7 @@
|
22
|
22
|
<if test="sUnitStCd != null and sUnitStCd != ''">
|
23
|
23
|
and iunit.unit_st_cd = #{sUnitStCd}
|
24
|
24
|
</if>
|
25
|
|
- <if test="sBrandNm != null and sSpplyId != ''">
|
|
25
|
+ <if test="sSpplyId != null and sSpplyId != ''">
|
26
|
26
|
and iunit.spply_id = #{sSpplyId}
|
27
|
27
|
</if>
|
28
|
28
|
<if test="sClass1 != null and sClass1 != ''">
|
|
@@ -66,7 +66,7 @@
|
66
|
66
|
from brand_item_unit_info iunit
|
67
|
67
|
join item_base_info item on iunit.brand_id = item.brand_id and iunit.item_id = item.item_id
|
68
|
68
|
left outer join item_class_ptcl iclas on item.item_id = iclas.item_id
|
69
|
|
- join item_class_mgnt mclas on iclas.item_class_mgnt_no = mclas.item_class_mgnt_no
|
|
69
|
+ left outer join item_class_mgnt mclas on iclas.item_class_mgnt_no = mclas.item_class_mgnt_no
|
70
|
70
|
where iunit.brand_id = #{sBrandId}
|
71
|
71
|
<if test="fromDt != null and fromDt != '' and toDt != null and toDt != ''">
|
72
|
72
|
and iunit.cont_stt_dt <![CDATA[ >= ]]> #{fromDt}
|
|
@@ -75,7 +75,7 @@
|
75
|
75
|
<if test="sUnitStCd != null and sUnitStCd != ''">
|
76
|
76
|
and iunit.unit_st_cd = #{sUnitStCd}
|
77
|
77
|
</if>
|
78
|
|
- <if test="sBrandNm != null and sSpplyId != ''">
|
|
78
|
+ <if test="sSpplyId != null and sSpplyId != ''">
|
79
|
79
|
and iunit.spply_id = #{sSpplyId}
|
80
|
80
|
</if>
|
81
|
81
|
<if test="sClass1 != null and sClass1 != ''">
|
|
@@ -102,9 +102,9 @@
|
102
|
102
|
iunit.curr, fn_code_nm('CURR', iunit.curr) as curr_nm, iunit.unit, fn_code_nm('DSTRBT_COST_UNIT', iunit.unit) as unit,
|
103
|
103
|
iunit.unit_amt, iunit.lead_time, iunit.spply_item_id,
|
104
|
104
|
iunit.dlv_cndt, fn_code_nm('DLV_CNDT', iunit.dlv_cndt) as dlv_cndt_nm,
|
105
|
|
- iunit.unit_st_cd, fn_code_nm('UNIT_ST_CD', iunit.unit_st_cd) as unit_st_nm, iunit.stdd_qyt,
|
106
|
|
- iunit.store_sale_stdd_qty, iunit.store_sale_unit_amt, iunit.short_cont_file_no
|
107
|
|
- date_format(iunit.sys_reg_dttm,'%Y.%m.%d %H:%i:%s') as sys_reg_dttm. iunit.sys_reg_id, date_format(iunit.sys_chg_dttm,'%Y.%m.%d %H:%i:%s') as sys_chg_dttm, iunit.sys_chg_id
|
|
105
|
+ iunit.unit_st_cd, fn_code_nm('UNIT_ST_CD', iunit.unit_st_cd) as unit_st_nm, iunit.stdd_qty,
|
|
106
|
+ iunit.store_sale_stdd_qty, iunit.store_sale_unit_amt, iunit.short_cont_file_no,
|
|
107
|
+ date_format(iunit.sys_reg_dttm,'%Y.%m.%d %H:%i:%s') as sys_reg_dttm, iunit.sys_reg_id, date_format(iunit.sys_chg_dttm,'%Y.%m.%d %H:%i:%s') as sys_chg_dttm, iunit.sys_chg_id
|
108
|
108
|
from brand_item_unit_info iunit
|
109
|
109
|
where iunit.brand_unit_unq_no = #{brandUnitUnqNo}
|
110
|
110
|
and iunit.brand_id = #{brandId}
|
|
@@ -113,7 +113,7 @@
|
113
|
113
|
<select id="selectItemUnitDupContInfoNo" resultType="com.oqpo.api.entity.stinfo.StoreItemUnitEntity">
|
114
|
114
|
select /* selectItemUnitDupContInfoNo */
|
115
|
115
|
brand_unit_unq_no
|
116
|
|
- from store_item_unit_info
|
|
116
|
+ from brand_item_unit_info
|
117
|
117
|
where brand_id = #{brandId}
|
118
|
118
|
and spply_id = #{spplyId}
|
119
|
119
|
and item_id = #{itemId}
|
|
@@ -122,7 +122,7 @@
|
122
|
122
|
|
123
|
123
|
<update id="updateItemUnitContEnd" >
|
124
|
124
|
update /* updateItemUnitContEnd */
|
125
|
|
- store_item_unit_info
|
|
125
|
+ brand_item_unit_info
|
126
|
126
|
set cont_end_dt = DATE_SUB(date_format(#{contEndDt},'%Y%m%d'), INTERVAL 1 DAY)
|
127
|
127
|
where brand_id = #{brandId}
|
128
|
128
|
and brand_unit_unq_no = #{brandUnitUnqNo}
|
|
@@ -136,18 +136,18 @@
|
136
|
136
|
(brand_unit_unq_no, brand_id, item_id, item_nm, spply_id,
|
137
|
137
|
spply_nm, cont_stt_dt, cont_end_dt, curr, unit,
|
138
|
138
|
unit_amt, lead_time, dlv_cndt, short_cont_file_no, spply_item_id,
|
139
|
|
- unit_st_cd, stdd_qyt, store_sale_stdd_qty, store_sale_unit_amt,
|
|
139
|
+ unit_st_cd, stdd_qty, store_sale_stdd_qty, store_sale_unit_amt,
|
140
|
140
|
sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
|
141
|
141
|
values
|
142
|
142
|
( fn_get_dealno(33,''), #{entity.brandId}, #{entity.itemId}, #{entity.itemNm}, #{entity.spplyId},
|
143
|
143
|
#{entity.spplyNm}, #{entity.contSttDt}, #{entity.contEndDt}, #{entity.curr}, #{entity.unit},
|
144
|
144
|
#{entity.unitAmt}, #{entity.leadTime}, #{entity.dlvCndt}, #{entity.shortContFileNo}, #{entity.spplyItemId},
|
145
|
|
- #{entity.unitStCd}, #{entity.stddQyt}, #{entity.storeSaleStddQty}, #{entity.storeSaleUnitAmt},
|
|
145
|
+ #{entity.unitStCd}, #{entity.stddQty}, #{entity.storeSaleStddQty}, #{entity.storeSaleUnitAmt},
|
146
|
146
|
now(), #{userId}, now(), #{userId})
|
147
|
147
|
on duplicate key
|
148
|
148
|
update
|
149
|
|
- sys_chg_dttm = now(),
|
150
|
|
- ,sys_chg_id = #{userId},
|
|
149
|
+ sys_chg_dttm = now()
|
|
150
|
+ ,sys_chg_id = #{userId}
|
151
|
151
|
,cont_stt_dt = VALUES(cont_stt_dt)
|
152
|
152
|
,cont_end_dt = VALUES(cont_end_dt)
|
153
|
153
|
,curr = VALUES(curr)
|
|
@@ -157,7 +157,7 @@
|
157
|
157
|
,dlv_cndt = VALUES(dlv_cndt)
|
158
|
158
|
,short_cont_file_no = VALUES(short_cont_file_no)
|
159
|
159
|
,unit_st_cd = VALUES(unit_st_cd)
|
160
|
|
- ,stdd_qyt = VALUES(stdd_qyt)
|
|
160
|
+ ,stdd_qty = VALUES(stdd_qty)
|
161
|
161
|
,store_sale_stdd_qty =VALUES(store_sale_stdd_qty)
|
162
|
162
|
,store_sale_unit_amt = VALUES(store_sale_unit_amt)
|
163
|
163
|
</insert>
|