|
@@ -4,30 +4,46 @@
|
4
|
4
|
<mapper namespace="com.oqpo.api.mapper.oper.NticeMapper">
|
5
|
5
|
<select id="selectNticeGridList" resultType="com.oqpo.api.entity.oper.NticeEntity">
|
6
|
6
|
select /* Ntice.selectNticeGridList*/
|
|
7
|
+ A.affl_shop_id, A.brand_id, fn_affl_nm(A.affl_shop_id) as affl_shop_nm, fn_brand_nm(A.brand_id) as brand_nm,
|
7
|
8
|
A.ntice_no, A.ntice_titl, A.target_cd, fn_code_nm('TARGET_CD', A.target_cd) as target_nm
|
8
|
9
|
, case when date_format(now(),'%Y%m%d') <![CDATA[ >= ]]> A.noti_st_day and date_format(now(),'%Y%m%d') <![CDATA[ <= ]]> A.noti_ed_day then '공지중'
|
9
|
10
|
when date_format(now(),'%Y%m%d') <![CDATA[ < ]]> A.noti_st_day then '대기'
|
10
|
11
|
when date_format(now(),'%Y%m%d') <![CDATA[ > ]]> A.noti_ed_day then '공지종료' end as ntice_stat_nm
|
11
|
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
|
12
|
13
|
from np_ntice A
|
13
|
|
- <if test="schDt != null and schDt != '' ">
|
14
|
|
- left join np_ntice_target B on A.ntice_no = B.ntice_no and B.user_id = #{userId}
|
15
|
|
- </if>
|
16
|
14
|
where 1=1
|
17
|
|
- <if test="fromDt != null and fromDt != '' and toDt != null and toDt != '' ">
|
18
|
|
- and A.noti_st_day between #{fromDt} and #{toDt}
|
|
15
|
+ and A.brand_id in (select B.brand_id from np_ntice_target B where B.ntice_no = A.ntice_no )
|
|
16
|
+ <if test="authTpCd == '30'">
|
|
17
|
+ and A.affl_shop_id = #{afflShopId}
|
|
18
|
+ </if>
|
|
19
|
+ <if test="authTpCd == '40' ">
|
|
20
|
+ and A.brand_id = #{brandId}
|
|
21
|
+ and A.brand_chk = 'Y'
|
|
22
|
+ </if>
|
|
23
|
+ <if test="authTpCd == '50' ">
|
|
24
|
+ and A.brand_id = #{brandId}
|
|
25
|
+ and A.shop_chk = 'Y'
|
|
26
|
+ </if>
|
|
27
|
+ <if test="authTpCd == '60' ">
|
|
28
|
+ and A.brand_id = #{brandId}
|
|
29
|
+ and A.supply_chk = 'Y'
|
|
30
|
+ </if>
|
|
31
|
+ <if test="sAfflShopId != null and sAfflShopId != ''">
|
|
32
|
+ and affl_shop_id = #{sAfflShopId}
|
|
33
|
+ </if>
|
|
34
|
+ <if test="sBrandId != null and sBrandId != ''">
|
|
35
|
+ and brand_id = #{sBrandId}
|
19
|
36
|
</if>
|
20
|
|
- <if test="schDt != null and schDt != '' ">
|
|
37
|
+ <if test="fromDt != null and fromDt != '' and toDt != null and toDt != '' ">
|
21
|
38
|
<![CDATA[
|
22
|
|
- and A.noti_st_day <= #{schDt}
|
23
|
|
- and A.noti_ed_day >= #{schDt}
|
24
|
|
- and A.del_yn = 'N'
|
25
|
|
- and (A.target_cd = 'A' or (A.target_cd = 'T' and B.user_id is not null))
|
|
39
|
+ and A.noti_st_day >= #{fromDt}
|
|
40
|
+ and A.noti_ed_day <= #{toDt}
|
26
|
41
|
]]>
|
27
|
42
|
</if>
|
28
|
43
|
<if test="sNticeTitl != null and sNticeTitl != '' ">
|
29
|
44
|
and A.ntice_titl like concat('%', #{sNticeTitl}, '%')
|
30
|
45
|
</if>
|
|
46
|
+ and A.del_yn = 'N'
|
31
|
47
|
<choose>
|
32
|
48
|
<when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
33
|
49
|
<if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
|
|
@@ -51,24 +67,39 @@
|
51
|
67
|
<select id="selectNticeGridCnt" resultType="int">
|
52
|
68
|
select count(*) as cnt /* Ntice.selectNticeGridCnt*/
|
53
|
69
|
from np_ntice A
|
54
|
|
- <if test="schDt != null and schDt != '' ">
|
55
|
|
- left join np_ntice_target B on A.ntice_no = B.ntice_no and B.user_id = #{userId}
|
56
|
|
- </if>
|
57
|
70
|
where 1=1
|
58
|
|
- <if test="fromDt != null and fromDt != '' and toDt != null and toDt != '' ">
|
59
|
|
- and A.noti_st_day between #{fromDt} and #{toDt}
|
|
71
|
+ and A.brand_id in (select B.brand_id from np_ntice_target B where B.ntice_no = A.ntice_no )
|
|
72
|
+ <if test="authTpCd == '30'">
|
|
73
|
+ and A.affl_shop_id = #{afflShopId}
|
|
74
|
+ </if>
|
|
75
|
+ <if test="authTpCd == '40' ">
|
|
76
|
+ and A.brand_id = #{brandId}
|
|
77
|
+ and A.brand_chk = 'Y'
|
|
78
|
+ </if>
|
|
79
|
+ <if test="authTpCd == '50' ">
|
|
80
|
+ and A.brand_id = #{brandId}
|
|
81
|
+ and A.shop_chk = 'Y'
|
|
82
|
+ </if>
|
|
83
|
+ <if test="authTpCd == '60' ">
|
|
84
|
+ and A.brand_id = #{brandId}
|
|
85
|
+ and A.supply_chk = 'Y'
|
|
86
|
+ </if>
|
|
87
|
+ <if test="afflShopId != null and afflShopId != ''">
|
|
88
|
+ and affl_shop_id = #{afflShopId}
|
|
89
|
+ </if>
|
|
90
|
+ <if test="brandId != null and brandId != ''">
|
|
91
|
+ and brand_id = #{brandId}
|
60
|
92
|
</if>
|
61
|
|
- <if test="schDt != null and schDt != '' ">
|
|
93
|
+ <if test="fromDt != null and fromDt != '' and toDt != null and toDt != '' ">
|
62
|
94
|
<![CDATA[
|
63
|
|
- and A.noti_st_day <= #{schDt}
|
64
|
|
- and A.noti_ed_day >= #{schDt}
|
65
|
|
- and A.del_yn = 'N'
|
66
|
|
- and (A.target_cd = 'A' or (A.target_cd = 'T' and B.user_id is not null))
|
|
95
|
+ and A.noti_st_day >= #{fromDt}
|
|
96
|
+ and A.noti_ed_day <= #{toDt}
|
67
|
97
|
]]>
|
68
|
98
|
</if>
|
69
|
99
|
<if test="sNticeTitl != null and sNticeTitl != '' ">
|
70
|
100
|
and A.ntice_titl like concat('%', #{sNticeTitl}, '%')
|
71
|
101
|
</if>
|
|
102
|
+ and A.del_yn = 'N'
|
72
|
103
|
</select>
|
73
|
104
|
|
74
|
105
|
<select id="selectNticeInfo" resultType="com.oqpo.api.entity.oper.NticeEntity">
|