Selaa lähdekoodia

공지사항 api 수정

dwkim 2 vuotta sitten
vanhempi
commit
706dded95c

+ 5 - 5
src/main/java/com/oqpo/api/config/JwtTokenProvider.java

@@ -80,11 +80,6 @@ public class JwtTokenProvider { // JWT 토큰을 생성 및 검증 모듈
80 80
         return (Boolean)claims.getBody().get(ApiConstants.CLAIMS_IS_LOGIN);
81 81
     }
82 82
 
83
-    public TokenResponse getTokenInfo(String token) {
84
-        Jws<Claims> claims = Jwts.parser().setSigningKey(secretKey).parseClaimsJws(token);
85
-        return TokenResponse.toDTO(claims);
86
-    }
87
-
88 83
     // Jwt 토큰에서 소속 가맹점 타입 정보
89 84
     public String getAfflShopId(String token) {
90 85
         Jws<Claims> claims = Jwts.parser().setSigningKey(secretKey).parseClaimsJws(token);
@@ -103,6 +98,11 @@ public class JwtTokenProvider { // JWT 토큰을 생성 및 검증 모듈
103 98
         return (String)claims.getBody().get(ApiConstants.CLAIMS_AUTH_TP_NM);
104 99
     }
105 100
 
101
+    public TokenResponse getTokenInfo(String token) {
102
+        Jws<Claims> claims = Jwts.parser().setSigningKey(secretKey).parseClaimsJws(token);
103
+        return TokenResponse.toDTO(claims);
104
+    }
105
+
106 106
     // Request의 Header에서 token 파싱 : "X-AUTH-TOKEN: jwt토큰"
107 107
     public String resolveToken(HttpServletRequest req) {
108 108
         return req.getHeader(ApiConstants.AUTH_TOKEN);

+ 3 - 0
src/main/java/com/oqpo/api/entity/oper/NticeEntity.java

@@ -30,6 +30,9 @@ public class NticeEntity implements Serializable {
30 30
     private String addDt;
31 31
     private String nticeStatNm;
32 32
     private String rnum;
33
+    private String brandChk;
34
+    private String shopChk;
35
+    private String supplyChk;
33 36
 
34 37
     private NticeTargetEntity nticeTargetEntity;
35 38
 

+ 2 - 2
src/main/java/com/oqpo/api/entity/oper/NticeTargetEntity.java

@@ -13,7 +13,7 @@ public class NticeTargetEntity implements Serializable {
13 13
     private static final long serialVersionUID = -3590936033715917450L;
14 14
 
15 15
     private String nticeNo;
16
-    private String userId;
17
-    private String userNm;
16
+    private String brandId;
17
+    private String brandNm;
18 18
 
19 19
 }

+ 1 - 1
src/main/java/com/oqpo/api/mapper/oper/NticeMapper.java

@@ -28,7 +28,7 @@ public interface NticeMapper {
28 28
 
29 29
     int insertNticeTarget(@Param("userId") String userId, @Param("nticeNo") String nticeNo, List<NticeTargetEntity> gridInsertData) throws Exception;
30 30
 
31
-    int deleteNticeTarget(@Param("userId") String userId, List<NticeTargetEntity> gridDeleteData) throws Exception;
31
+    int deleteNticeTarget(@Param("nticeNo") String nticeNo, List<NticeTargetEntity> gridDeleteData) throws Exception;
32 32
     int updateNticeViewCnt(@Param("nticeNo") String nticeNo) throws Exception;
33 33
 
34 34
     List<NticeEntity> selectMNticeList(@Param("userId") String userId)throws Exception;

+ 3 - 0
src/main/java/com/oqpo/api/service/SessionService.java

@@ -53,6 +53,9 @@ public class SessionService extends CommonService {
53 53
             memberEntity.setSystemAdminYn(jwtTokenProvider.getSystemAdminYn(connKey));
54 54
             memberEntity.setAuthTpCd(jwtTokenProvider.getAuthTpCd(connKey));
55 55
             memberEntity.setAuthTpNm(jwtTokenProvider.getAuthTpNm(connKey));
56
+            //memberEntity.setAfflShopId(jwtTokenProvider.getAfflShopId(connKey));
57
+            //memberEntity.setBrandId(jwtTokenProvider.getBrandId(connKey));
58
+            //memberEntity.setAuthTpNm(jwtTokenProvider.getAuthTpNm(connKey));
56 59
 
57 60
         } catch (Exception e) {
58 61
             e.getStackTrace();

+ 0 - 3
src/main/java/com/oqpo/api/service/SigninService.java

@@ -63,9 +63,6 @@ public class SigninService implements UserDetailsService {
63 63
             SecurityContextHolder.getContext().setAuthentication(authentication);
64 64
             memberEntity = (MemberEntity) authentication.getPrincipal();
65 65
 
66
-            System.out.println("===============================");
67
-            System.out.println("==memberEntity.getAuthTpNm()=============================>>>" + memberEntity.getAuthTpNm());
68
-            System.out.println("===============================");
69 66
             connKey = jwtTokenProvider.createToken (
70 67
                     memberEntity.getUserId(),
71 68
                     memberEntity.getUserNm(),

+ 9 - 3
src/main/java/com/oqpo/api/service/oper/NticeService.java

@@ -76,7 +76,12 @@ public class NticeService extends CommonService {
76 76
             entity.setNotiStDay(saveNticeRequest.getNotiStDay().replace(".", ""));
77 77
             entity.setNotiEdDay(saveNticeRequest.getNotiEdDay().replace(".", ""));
78 78
             entity.setFileNo(saveNticeRequest.getFileNo());
79
-
79
+            entity.setBrandId(saveNticeRequest.getBrandId());
80
+            entity.setAfflShopId(saveNticeRequest.getAfflShopId());
81
+            entity.setBrandChk(saveNticeRequest.getBrandChk());
82
+            entity.setShopChk(saveNticeRequest.getShopChk());
83
+            entity.setSupplyChk(saveNticeRequest.getSupplyChk());
84
+            log.info("=============>" + entity.getBrandId() + "==" + entity.getAfflShopId() + "==" + entity.getNticeTitl() );
80 85
             if ("C".equals(saveNticeRequest.getViewCd())) {
81 86
                 // 신규 공지번호 생성
82 87
                 entity.setNticeNo(fnGetKeyNo(6));
@@ -95,6 +100,7 @@ public class NticeService extends CommonService {
95 100
 
96 101
             // 삭제건
97 102
             List<NticeTargetEntity> gridDeleteData = saveNticeRequest.toNticeTargetEntities(saveNticeRequest.getGridDeleteData());
103
+
98 104
             if (gridDeleteData.size() > 0) {
99 105
                 nticeMapper.deleteNticeTarget(entity.getNticeNo(), gridDeleteData);
100 106
             }
@@ -128,8 +134,8 @@ public class NticeService extends CommonService {
128 134
                 .map(m -> NticeTargetResponse.builder()
129 135
                         .viewCd("R")
130 136
                         .nticeNo(m.getNticeNo())
131
-                        .userId(m.getUserId())
132
-                        .userNm(m.getUserNm())
137
+                        .userId(m.getBrandId())
138
+                        .userNm(m.getBrandNm())
133 139
                         .build())
134 140
                 .collect(Collectors.toList());
135 141
         return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);

+ 0 - 1
src/main/java/com/oqpo/api/web/controller/SigninController.java

@@ -64,7 +64,6 @@ public class SigninController {
64 64
     @ApiOperation(value = "Swagger 로그인")
65 65
     @PostMapping("/sign-in-swagger")
66 66
     public ResponseEntity<JwtResponse> signinSwagger(@RequestBody @Valid SigninRequest signinRequest) throws Exception {
67
-        System.out.println("sign-in-swagger==========================" + signinRequest.getUserId() + "===" + signinRequest.getPassword() ); ;
68 67
         //log.debug("password==>>>{}", passwordEncoder.encode(password));
69 68
         return ResponseEntity.ok(signinService.signin(signinRequest.getUserId(), signinRequest.getPassword()));
70 69
     }

+ 3 - 1
src/main/java/com/oqpo/api/web/controller/oper/NticeController.java

@@ -44,6 +44,7 @@ public class NticeController {
44 44
     @ApiOperation(value = " 공지 그리드 리스트")
45 45
     @PostMapping("/detail-grid-list")
46 46
     public ResponseEntity<GridResponse> detailGridList(@ApiIgnore String afflShopId,@ApiIgnore String brandId,@ApiIgnore String authTpCd,@RequestBody @Valid NticeGridRequest nticeGridRequest) throws Exception {
47
+
47 48
         return ResponseEntity.ok(nticeService.selectNticeGridList( afflShopId, brandId, authTpCd, nticeGridRequest.getSAfflShopId(), nticeGridRequest.getSBrandId(), nticeGridRequest.getFromDt(), nticeGridRequest.getToDt(), nticeGridRequest.getSNticeTitl(),  nticeGridRequest.toDTO(nticeGridRequest)));
48 49
     }
49 50
 
@@ -61,6 +62,7 @@ public class NticeController {
61 62
     @ApiOperation(value = "공지정보 저장")
62 63
     @PostMapping("/save-ntice")
63 64
     public ResponseEntity<SaveResponse> saveUser(@ApiIgnore String userId, @RequestBody @Valid SaveNticeRequest saveNticeRequest) throws Exception {
65
+
64 66
         nticeService.saveNtice(userId, saveNticeRequest);
65 67
         return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.SAVE_OK));
66 68
     }
@@ -83,7 +85,7 @@ public class NticeController {
83 85
     }
84 86
 
85 87
     /**
86
-     * 설명 : 공지타게ㅐㅅ 그리드 리스트
88
+     * 설명 : 공지타 그리드 리스트
87 89
      *
88 90
      * @param nticeTargetGridRequest
89 91
      * @return

+ 20 - 3
src/main/java/com/oqpo/api/web/dto/request/oper/ntice/SaveNticeRequest.java

@@ -15,6 +15,14 @@ public class SaveNticeRequest {
15 15
     @ApiModelProperty(value = "CRUD")
16 16
     private String viewCd;
17 17
 
18
+    @NotBlank
19
+    @ApiModelProperty(value = "가맹점아이디")
20
+    private String afflShopId;
21
+
22
+    @NotBlank
23
+    @ApiModelProperty(value = "브랜드아이디")
24
+    private String brandId;
25
+
18 26
     @ApiModelProperty(value = "공지번호")
19 27
     private String nticeNo;
20 28
 
@@ -45,6 +53,15 @@ public class SaveNticeRequest {
45 53
     @ApiModelProperty(value = "파일번호")
46 54
     private String fileNo;
47 55
 
56
+    @ApiModelProperty(value = "브랜드대상여부")
57
+    private String brandChk;
58
+
59
+    @ApiModelProperty(value = "매장대상여부")
60
+    private String shopChk;
61
+
62
+    @ApiModelProperty(value = "공급사대상여부")
63
+    private String supplyChk;
64
+
48 65
 
49 66
     @ApiModelProperty(value = "등록상세리스트")
50 67
     private List<SaveNticeTarget> gridInsertData;
@@ -59,7 +76,7 @@ public class SaveNticeRequest {
59 76
         List<NticeTargetEntity> entities = new ArrayList<>();
60 77
         gridData.forEach(x -> {
61 78
             NticeTargetEntity entity = new NticeTargetEntity();
62
-            entity.setUserId(x.getUserId());
79
+            entity.setBrandId(x.getBrandId());
63 80
             entity.setNticeNo(x.getNticeNo());
64 81
             entities.add(entity);
65 82
         });
@@ -71,8 +88,8 @@ public class SaveNticeRequest {
71 88
     @AllArgsConstructor(access = AccessLevel.PROTECTED)
72 89
     static class SaveNticeTarget {
73 90
         @NotBlank
74
-        @ApiModelProperty(value = "사용자 ID")
75
-        private String userId;
91
+        @ApiModelProperty(value = "브랜드아이디")
92
+        private String brandId;
76 93
 
77 94
         @ApiModelProperty(value = "공지번호")
78 95
         private String nticeNo;

+ 28 - 0
src/main/java/com/oqpo/api/web/dto/response/oper/ntice/NticeResponse.java

@@ -12,6 +12,18 @@ import lombok.*;
12 12
 @JsonInclude(JsonInclude.Include.ALWAYS)
13 13
 public class NticeResponse {
14 14
 
15
+    @ApiModelProperty(value = "가맹점아이디")
16
+    private String afflShopId;
17
+
18
+    @ApiModelProperty(value = "가맹점명")
19
+    private String afflShopNm;
20
+
21
+    @ApiModelProperty(value = "브랜드아이디")
22
+    private String brandId;
23
+
24
+    @ApiModelProperty(value = "브랜드명")
25
+    private String brandNm;
26
+
15 27
     @ApiModelProperty(value = "공지번호")
16 28
     private String nticeNo;
17 29
 
@@ -42,10 +54,23 @@ public class NticeResponse {
42 54
     @ApiModelProperty(value = "파일번호")
43 55
     private String fileNo;
44 56
 
57
+    @ApiModelProperty(value = "브랜드대상여부")
58
+    private String brandChk;
59
+
60
+    @ApiModelProperty(value = "매장대상여부")
61
+    private String shopChk;
62
+
63
+    @ApiModelProperty(value = "공급사대상여부")
64
+    private String supplyChk;
65
+
45 66
     public static NticeResponse toDTO(NticeEntity entity) {
46 67
         if (entity == null) return null;
47 68
         return NticeResponse.builder()
48 69
                 .nticeNo(entity.getNticeNo())
70
+                .afflShopId(entity.getAfflShopId())
71
+                .afflShopNm(entity.getAfflShopNm())
72
+                .brandId(entity.getBrandId())
73
+                .brandNm(entity.getBrandNm())
49 74
                 .nticeTitl(entity.getNticeTitl() == null ? "" : entity.getNticeTitl())
50 75
                 .nticeDesc(entity.getNticeDesc() == null ? "" : entity.getNticeDesc())
51 76
                 .targetCd(entity.getTargetCd())
@@ -55,6 +80,9 @@ public class NticeResponse {
55 80
                 .notiEdDay(entity.getNotiEdDay())
56 81
                 .fileNo(entity.getFileNo() == null ? "" : entity.getFileNo())
57 82
                 .viewCnt(entity.getViewCnt())
83
+                .brandChk(entity.getBrandChk() == null ? "N" : entity.getBrandChk())
84
+                .shopChk(entity.getShopChk() == null ? "N" : entity.getShopChk())
85
+                .supplyChk(entity.getSupplyChk() == null ? "N" : entity.getSupplyChk())
58 86
                 .build();
59 87
     }
60 88
 }

+ 4 - 4
src/main/java/com/oqpo/api/web/dto/response/oper/ntice/NticeTargetResponse.java

@@ -16,10 +16,10 @@ public class NticeTargetResponse {
16 16
     @ApiModelProperty(value = "공지번호")
17 17
     private String nticeNo;
18 18
 
19
-    @ApiModelProperty(value = "사용자 id")
20
-    private String userId;
19
+    @ApiModelProperty(value = "브랜드아이디")
20
+    private String brandId;
21 21
 
22
-    @ApiModelProperty(value = "사용자명")
23
-    private String userNm;
22
+    @ApiModelProperty(value = "브랜드명")
23
+    private String brandNm;
24 24
 
25 25
 }

+ 15 - 0
src/main/java/com/oqpo/api/web/dto/response/token/TokenResponse.java

@@ -26,6 +26,18 @@ public class TokenResponse {
26 26
     @ApiModelProperty(value = "로그인 구별 정보")
27 27
     private Boolean isLogin;
28 28
 
29
+    @ApiModelProperty(value = "가맹점아이디")
30
+    private String afflShopId;
31
+
32
+    @ApiModelProperty(value = "브랜드아이디")
33
+    private String brandId;
34
+
35
+
36
+    @ApiModelProperty(value = "로그인회사명")
37
+    private String authTpNm;
38
+
39
+
40
+
29 41
     public static TokenResponse toDTO(Jws<Claims> claims) {
30 42
         return TokenResponse.builder()
31 43
                 .userId(claims.getBody().getSubject())
@@ -33,6 +45,9 @@ public class TokenResponse {
33 45
                 .superAdminYn((String) claims.getBody().get(ApiConstants.CLAIMS_SUPER_ADMIN_YN))
34 46
                 .authTpCd((String) claims.getBody().get(ApiConstants.CLAIMS_AUTH_TP_CD))
35 47
                 .isLogin((Boolean)claims.getBody().get(ApiConstants.CLAIMS_IS_LOGIN))
48
+                .afflShopId((String) claims.getBody().get(ApiConstants.CLAIMS_AFFL_SHOP_ID))
49
+                .brandId((String) claims.getBody().get(ApiConstants.CLAIMS_BRAND_ID))
50
+                .authTpNm((String) claims.getBody().get(ApiConstants.CLAIMS_AUTH_TP_NM))
36 51
                 .build();
37 52
     }
38 53
 }

+ 0 - 2
src/main/java/com/oqpo/api/web/interceptor/TokenCheckInterceptor.java

@@ -42,12 +42,10 @@ public class TokenCheckInterceptor extends HandlerInterceptorAdapter {
42 42
 
43 43
 
44 44
             if (!jobService.saveJob(memberEntity, path)) {
45
-                System.out.println("====================================start");
46 45
                 throw new UnauthorizedException(SystemMessageCode.NOT_AUTH.getMessage());
47 46
             }
48 47
 */
49 48
         }catch(UnauthorizedException e) {
50
-            System.out.println("====================================exception");
51 49
             e.printStackTrace();
52 50
             throw new UnauthorizedException(e.getErrorMessage());
53 51
         }

+ 12 - 5
src/main/java/com/oqpo/api/web/resolver/ArgumentResolver.java

@@ -21,6 +21,9 @@ public class ArgumentResolver implements HandlerMethodArgumentResolver {
21 21
     private final String SYSTEM_ADMIN_YN = "systemAdminYn";
22 22
     private final String SUPER_ADMIN_YN = "superAdminYn";
23 23
     private final String AUTH_TP_CD = "authTpCd";
24
+    private final String AFFL_SHOP_ID = "afflShopId";
25
+    private final String BRAND_ID = "brandId";
26
+    private final String AUTH_TP_NM = "authTpNm";
24 27
 
25 28
     @Override
26 29
     public boolean supportsParameter(MethodParameter parameter) {
@@ -32,6 +35,12 @@ public class ArgumentResolver implements HandlerMethodArgumentResolver {
32 35
             return true;
33 36
         }  else if (parameter.getParameterName().equals(AUTH_TP_CD)) {
34 37
             return true;
38
+        }  else if (parameter.getParameterName().equals(AFFL_SHOP_ID)) {
39
+            return true;
40
+        }  else if (parameter.getParameterName().equals(BRAND_ID)) {
41
+            return true;
42
+        }  else if (parameter.getParameterName().equals(AUTH_TP_NM)) {
43
+            return true;
35 44
         }  else if (parameter.getParameterType() == TokenResponse.class) {
36 45
             return true;
37 46
         }
@@ -47,15 +56,13 @@ public class ArgumentResolver implements HandlerMethodArgumentResolver {
47 56
 
48 57
             if (tokenResponse == null) return null;
49 58
 
50
-            System.out.println("parameter.getParameterName()============" + parameter.getParameterName());
51
-            System.out.println("getUserId=================>" + tokenResponse.getUserId());
52
-            System.out.println("getSystemAdminYn=================>" + tokenResponse.getSystemAdminYn());
53
-            System.out.println("getSuperAdminYn=================>" + tokenResponse.getSuperAdminYn());
54
-            System.out.println("getAuthTpCd=================>" + tokenResponse.getAuthTpCd());
55 59
             if (parameter.getParameterName().equals(USER_ID)) return tokenResponse.getUserId();
56 60
             if (parameter.getParameterName().equals(SYSTEM_ADMIN_YN)) return tokenResponse.getSystemAdminYn();
57 61
             if (parameter.getParameterName().equals(SUPER_ADMIN_YN)) return tokenResponse.getSuperAdminYn();
58 62
             if (parameter.getParameterName().equals(AUTH_TP_CD)) return tokenResponse.getAuthTpCd();
63
+            if (parameter.getParameterName().equals(AFFL_SHOP_ID)) return tokenResponse.getAuthTpCd();
64
+            if (parameter.getParameterName().equals(BRAND_ID)) return tokenResponse.getAuthTpCd();
65
+            if (parameter.getParameterName().equals(AUTH_TP_NM)) return tokenResponse.getAuthTpCd();
59 66
             return tokenResponse;
60 67
         } catch(Exception e) {
61 68
             e.printStackTrace();

+ 23 - 19
src/main/resources/mybatis/sqlmaps/oper/Ntice.xml

@@ -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