|
@@ -11,8 +11,8 @@
|
11
|
11
|
when date_format(now(),'%Y%m%d') <![CDATA[ > ]]> A.noti_ed_day then '공지종료' end as ntice_stat_nm
|
12
|
12
|
,date_format(A.noti_st_day ,'%Y.%m.%d') as noti_st_day, date_format(A.add_dt ,'%Y.%m.%d') as add_dt
|
13
|
13
|
from np_ntice A
|
|
14
|
+ left outer join np_ntice_target B on B.ntice_no = A.ntice_no and B.brand_id = A.brand_id
|
14
|
15
|
where 1=1
|
15
|
|
- and A.brand_id in (select B.brand_id from np_ntice_target B where B.ntice_no = A.ntice_no )
|
16
|
16
|
<if test="authTpCd == '30'">
|
17
|
17
|
and A.affl_shop_id = #{afflShopId}
|
18
|
18
|
</if>
|
|
@@ -29,10 +29,10 @@
|
29
|
29
|
and A.supply_chk = 'Y'
|
30
|
30
|
</if>
|
31
|
31
|
<if test="sAfflShopId != null and sAfflShopId != ''">
|
32
|
|
- and affl_shop_id = #{sAfflShopId}
|
|
32
|
+ and A.affl_shop_id = #{sAfflShopId}
|
33
|
33
|
</if>
|
34
|
34
|
<if test="sBrandId != null and sBrandId != ''">
|
35
|
|
- and brand_id = #{sBrandId}
|
|
35
|
+ and A.brand_id = #{sBrandId}
|
36
|
36
|
</if>
|
37
|
37
|
<if test="fromDt != null and fromDt != '' and toDt != null and toDt != '' ">
|
38
|
38
|
<![CDATA[
|
|
@@ -84,11 +84,11 @@
|
84
|
84
|
and A.brand_id = #{brandId}
|
85
|
85
|
and A.supply_chk = 'Y'
|
86
|
86
|
</if>
|
87
|
|
- <if test="afflShopId != null and afflShopId != ''">
|
88
|
|
- and affl_shop_id = #{afflShopId}
|
|
87
|
+ <if test="sAfflShopId != null and sAfflShopId != ''">
|
|
88
|
+ and A.affl_shop_id = #{sAfflShopId}
|
89
|
89
|
</if>
|
90
|
|
- <if test="brandId != null and brandId != ''">
|
91
|
|
- and brand_id = #{brandId}
|
|
90
|
+ <if test="sBrandId != null and sBrandId != ''">
|
|
91
|
+ and A.brand_id = #{sBrandId}
|
92
|
92
|
</if>
|
93
|
93
|
<if test="fromDt != null and fromDt != '' and toDt != null and toDt != '' ">
|
94
|
94
|
<![CDATA[
|
|
@@ -106,7 +106,8 @@
|
106
|
106
|
select /* ntice.selectnticeinfo */
|
107
|
107
|
ntice_no, target_cd, ntice_titl, ntice_desc, del_yn , fn_code_nm('TARGET_CD', target_cd) as target_nm
|
108
|
108
|
, date_format(noti_st_day ,'%Y.%m.%d') as noti_st_day, date_format(noti_ed_day ,'%Y.%m.%d') as noti_ed_day
|
109
|
|
- , view_cnt, file_no
|
|
109
|
+ , view_cnt, file_no, affl_shop_id, brand_id, fn_affl_nm(affl_shop_id) as affl_shop_nm, fn_brand_nm(brand_id) as brand_nm
|
|
110
|
+ , brand_chk, shop_chk, supply_chk
|
110
|
111
|
from np_ntice
|
111
|
112
|
where ntice_no = #{nticeNo}
|
112
|
113
|
</select>
|
|
@@ -114,23 +115,23 @@
|
114
|
115
|
|
115
|
116
|
<select id="selectNticeTargetGridList" resultType="com.oqpo.api.entity.oper.NticeTargetEntity">
|
116
|
117
|
select /* ntice.selectNticeTargetGridList*/
|
117
|
|
- ntarget.ntice_no, ntarget.user_id , uinfo.user_nm
|
|
118
|
+ ntarget.ntice_no, ntarget.brand_id , binfo.brand_nm
|
118
|
119
|
from np_ntice_target ntarget
|
119
|
|
- join np_user_info uinfo on uinfo.user_id = ntarget.user_id
|
|
120
|
+ join brand_base_info binfo on binfo.brand_id = ntarget.brand_id
|
120
|
121
|
where ntarget.ntice_no = #{nticeNo}
|
121
|
122
|
<choose>
|
122
|
123
|
<when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
123
|
124
|
<if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
|
124
|
125
|
<if test="gridRequest.sord == 'asc'.toString()">
|
125
|
|
- order by uinfo.user_nm asc
|
|
126
|
+ order by binfo.brand_nm asc
|
126
|
127
|
</if>
|
127
|
128
|
<if test="gridRequest.sord == 'desc'.toString()">
|
128
|
|
- order by uinfo.user_nm desc
|
|
129
|
+ order by binfo.brand_nm desc
|
129
|
130
|
</if>
|
130
|
131
|
</if>
|
131
|
132
|
</when>
|
132
|
133
|
<otherwise>
|
133
|
|
- order by uinfo.user_nm asc
|
|
134
|
+ order by binfo.brand_nm asc
|
134
|
135
|
</otherwise>
|
135
|
136
|
</choose>
|
136
|
137
|
<if test="gridRequest.pagingYn == true">
|
|
@@ -147,10 +148,10 @@
|
147
|
148
|
<insert id="insertNticeInfo" >
|
148
|
149
|
insert into np_ntice /* ntice.insertNticeInfo*/
|
149
|
150
|
(ntice_no, target_cd, ntice_titl, ntice_desc, del_yn, noti_st_day, noti_ed_day
|
150
|
|
- , file_no, add_dt, add_id, chg_dt, chg_id)
|
|
151
|
+ , file_no, add_dt, add_id, chg_dt, chg_id, affl_shop_id, brand_id, brand_chk, shop_chk, supply_chk)
|
151
|
152
|
values
|
152
|
153
|
(#{entity.nticeNo}, #{entity.targetCd}, #{entity.nticeTitl} , #{entity.nticeDesc} , #{entity.delYn} , #{entity.notiStDay} , #{entity.notiEdDay}
|
153
|
|
- , #{entity.fileNo} , now(), #{userId}, now(), #{userId})
|
|
154
|
+ , #{entity.fileNo} , now(), #{userId}, now(), #{userId}, #{entity.afflShopId}, #{entity.brandId}, #{entity.brandChk}, #{entity.shopChk}, #{entity.supplyChk})
|
154
|
155
|
</insert>
|
155
|
156
|
|
156
|
157
|
<update id="updateNticeInfo">
|
|
@@ -164,24 +165,27 @@
|
164
|
165
|
,noti_st_day = #{entity.notiStDay}
|
165
|
166
|
,noti_ed_day = #{entity.notiEdDay}
|
166
|
167
|
,file_no = #{entity.fileNo}
|
|
168
|
+ ,brand_chk = #{entity.brandChk}
|
|
169
|
+ ,shop_chk = #{entity.shopChk}
|
|
170
|
+ ,supply_chk = #{entity.supplyChk}
|
167
|
171
|
where ntice_no = #{entity.nticeNo}
|
168
|
172
|
</update>
|
169
|
173
|
|
170
|
174
|
<insert id="insertNticeTarget" >
|
171
|
175
|
insert into np_ntice_target /* ntice.insertNticeTarget*/
|
172
|
|
- (ntice_no, user_id, add_dt, add_id)
|
|
176
|
+ (ntice_no, brand_id, add_dt, add_id)
|
173
|
177
|
values
|
174
|
178
|
<foreach collection="gridInsertData" item="item" separator=",">
|
175
|
|
- ( #{nticeNo},#{item.userId}, now(), #{userId})
|
|
179
|
+ ( #{nticeNo},#{item.brandId}, now(), #{userId})
|
176
|
180
|
</foreach>
|
177
|
181
|
</insert>
|
178
|
182
|
|
179
|
183
|
<delete id="deleteNticeTarget">
|
180
|
184
|
delete from np_ntice_target /* ntice.deleteNticeTarget*/
|
181
|
185
|
where ntice_no = #{nticeNo}
|
182
|
|
- and user_id in
|
|
186
|
+ and brand_id in
|
183
|
187
|
<foreach collection="gridDeleteData" item="item" separator="," open="(" close=")">
|
184
|
|
- #{item.userId}
|
|
188
|
+ #{item.brandId}
|
185
|
189
|
</foreach>
|
186
|
190
|
</delete>
|
187
|
191
|
|