diff --git a/src/main/java/cokr/xit/fims/base/FimsSigungu.java b/src/main/java/cokr/xit/fims/base/FimsSigungu.java index c0494685..4f0db02d 100644 --- a/src/main/java/cokr/xit/fims/base/FimsSigungu.java +++ b/src/main/java/cokr/xit/fims/base/FimsSigungu.java @@ -28,4 +28,8 @@ public class FimsSigungu extends Sigungu { */ private String logoFilename; + /** + * 상위시군구코드 + */ + private String upSggCd; } diff --git a/src/main/java/cokr/xit/fims/base/dao/OgdpMapper.java b/src/main/java/cokr/xit/fims/base/dao/OgdpMapper.java index 9c53f502..e4c5e6c4 100644 --- a/src/main/java/cokr/xit/fims/base/dao/OgdpMapper.java +++ b/src/main/java/cokr/xit/fims/base/dao/OgdpMapper.java @@ -106,6 +106,7 @@ public interface OgdpMapper extends AbstractMapper { +SQLUtil.now +""" , MDFR = #{sgg.modifiedBy} + , UP_SGG_CD = #{sgg.upSggCd} , SYMBOL_FILE_PATH = #{sgg.symbolFilepath} , SYMBOL_FILE_NM = #{sgg.symbolFilename} @@ -161,6 +162,7 @@ public interface OgdpMapper extends AbstractMapper { , S.LOGO_FILE_NM , S.OFFCS_FILE_PATH , S.OFFCS_FILE_NM + , S.UP_SGG_CD FROM TB_SGG S diff --git a/src/main/java/cokr/xit/fims/mngt/NtcQuery.java b/src/main/java/cokr/xit/fims/mngt/NtcQuery.java index 14dc1d43..e1a3fa8e 100644 --- a/src/main/java/cokr/xit/fims/mngt/NtcQuery.java +++ b/src/main/java/cokr/xit/fims/mngt/NtcQuery.java @@ -16,4 +16,36 @@ public class NtcQuery extends CmmnQuery { private static final long serialVersionUID = 1L; + private String cntnSeCd; + + private String userSggCd; + + private String userCntnSeCd; + + public String getCntnSeCd() { + return ifEmpty(cntnSeCd, () -> null); + } + + public T setCntnSeCd(String cntnSeCd) { + this.cntnSeCd = cntnSeCd; + return self(); + } + + public String getUserSggCd() { + return ifEmpty(userSggCd, () -> null); + } + + public T setUserSggCd(String userSggCd) { + this.userSggCd = userSggCd; + return self(); + } + + public String getUserCntnSeCd() { + return ifEmpty(userCntnSeCd, () -> null); + } + + public T setUserCntnSeCd(String userCntnSeCd) { + this.userCntnSeCd = userCntnSeCd; + return self(); + } } diff --git a/src/main/java/cokr/xit/fims/mngt/web/Mngt01Controller.java b/src/main/java/cokr/xit/fims/mngt/web/Mngt01Controller.java index e0efd851..8fe3da7f 100644 --- a/src/main/java/cokr/xit/fims/mngt/web/Mngt01Controller.java +++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt01Controller.java @@ -54,6 +54,9 @@ public class Mngt01Controller extends ApplicationController { mav.setViewName("fims/mngt/mngt01010-main"); mav.addObject("pageName", "mngt01010"); + List allSggList = sggDeptService.getSigunguList(new SigunguQuery()); + mav.addObject("sggList", allSggList); + return mav; } @@ -74,10 +77,16 @@ public class Mngt01Controller extends ApplicationController { setFetchSize(req); FimsUser currentUser = (FimsUser) currentUser().getUser(); - String sggCd = currentUser.getOrgID(); - req.setSggCd(sggCd); + + if(!currentUser.getOrgID().equals("ADMIN")) { + req.setUserSggCd(currentUser.getOrgID()); + req.setUserCntnSeCd(currentUser.getCntnSeCd()); + } List list = ntcService.getNtcList(req); + return setPagingInfo(mav, list, ""); + + } /**공지사항 상세 내용을 조회하여 반환한다.
diff --git a/src/main/resources/sql/mapper/fims/mngt/ntc-mapper.xml b/src/main/resources/sql/mapper/fims/mngt/ntc-mapper.xml index ce73ad87..66ed0c4e 100644 --- a/src/main/resources/sql/mapper/fims/mngt/ntc-mapper.xml +++ b/src/main/resources/sql/mapper/fims/mngt/ntc-mapper.xml @@ -24,6 +24,8 @@ SELECT A.NTC_ID + , A.CNTN_SE_CD + , GET_CODE_NM('CMN009', A.CNTN_SE_CD) AS CNTN_SE_NM , A.SGG_CD , (CASE WHEN (SELECT SGG_NM FROM TB_SGG WHERE SGG_CD = A.SGG_CD) IS NOT NULL @@ -53,6 +55,22 @@ SELECT A.NTC_ID AND A.${by} LIKE CONCAT('%',#{term},'%') + + AND A.CNTN_SE_CD = #{cntnSeCd} + + + + AND ( + (A.SGG_CD IS NULL OR A.SGG_CD = '') + OR + (GET_SGG_RELATION(A.SGG_CD,#{userSggCd}) IN ('SF','CP','PC')) + ) + + + AND A.CNTN_SE_CD = '02' + AND GET_SGG_RELATION(A.SGG_CD,#{userSggCd}) IN ('SF','CP') + + @@ -76,6 +94,7 @@ WHERE A.DEL_YN = 'N' INSERT INTO TB_NOTICE ( NTC_ID + , CNTN_SE_CD , SGG_CD , NTC_TTL , NTC_CN @@ -86,6 +105,7 @@ INSERT , MDFR ) VALUES ( #{ntc.ntcId} + , #{ntc.cntnSeCd} , #{ntc.sggCd} , #{ntc.ntcTtl} , #{ntc.ntcCn}