공지사항 조회 수정

main
이범준 2 months ago
parent 442bd11df5
commit cab971245c

@ -28,4 +28,8 @@ public class FimsSigungu extends Sigungu {
*/ */
private String logoFilename; private String logoFilename;
/**
*
*/
private String upSggCd;
} }

@ -106,6 +106,7 @@ public interface OgdpMapper extends AbstractMapper {
+SQLUtil.now +SQLUtil.now
+""" +"""
, MDFR = #{sgg.modifiedBy} , MDFR = #{sgg.modifiedBy}
, UP_SGG_CD = #{sgg.upSggCd}
<if test="sgg.symbolFilepath != null"> <if test="sgg.symbolFilepath != null">
, SYMBOL_FILE_PATH = #{sgg.symbolFilepath} <!-- --> , SYMBOL_FILE_PATH = #{sgg.symbolFilepath} <!-- -->
, SYMBOL_FILE_NM = #{sgg.symbolFilename} <!-- --> , SYMBOL_FILE_NM = #{sgg.symbolFilename} <!-- -->
@ -161,6 +162,7 @@ public interface OgdpMapper extends AbstractMapper {
, S.LOGO_FILE_NM <!-- --> , S.LOGO_FILE_NM <!-- -->
, S.OFFCS_FILE_PATH <!-- --> , S.OFFCS_FILE_PATH <!-- -->
, S.OFFCS_FILE_NM <!-- --> , S.OFFCS_FILE_NM <!-- -->
, S.UP_SGG_CD <!-- -->
FROM TB_SGG S FROM TB_SGG S
<where> <where>
<if test="sggCd != null"> <if test="sggCd != null">

@ -16,4 +16,36 @@ public class NtcQuery extends CmmnQuery {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String cntnSeCd;
private String userSggCd;
private String userCntnSeCd;
public String getCntnSeCd() {
return ifEmpty(cntnSeCd, () -> null);
}
public <T extends NtcQuery> T setCntnSeCd(String cntnSeCd) {
this.cntnSeCd = cntnSeCd;
return self();
}
public String getUserSggCd() {
return ifEmpty(userSggCd, () -> null);
}
public <T extends NtcQuery> T setUserSggCd(String userSggCd) {
this.userSggCd = userSggCd;
return self();
}
public String getUserCntnSeCd() {
return ifEmpty(userCntnSeCd, () -> null);
}
public <T extends NtcQuery> T setUserCntnSeCd(String userCntnSeCd) {
this.userCntnSeCd = userCntnSeCd;
return self();
}
} }

@ -54,6 +54,9 @@ public class Mngt01Controller extends ApplicationController {
mav.setViewName("fims/mngt/mngt01010-main"); mav.setViewName("fims/mngt/mngt01010-main");
mav.addObject("pageName", "mngt01010"); mav.addObject("pageName", "mngt01010");
List<DataObject> allSggList = sggDeptService.getSigunguList(new SigunguQuery());
mav.addObject("sggList", allSggList);
return mav; return mav;
} }
@ -74,10 +77,16 @@ public class Mngt01Controller extends ApplicationController {
setFetchSize(req); setFetchSize(req);
FimsUser currentUser = (FimsUser) currentUser().getUser(); 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<DataObject> list = ntcService.getNtcList(req); List<DataObject> list = ntcService.getNtcList(req);
return setPagingInfo(mav, list, ""); return setPagingInfo(mav, list, "");
} }
/** .<br /> /** .<br />

@ -24,6 +24,8 @@
<sql id="select"> <sql id="select">
SELECT A.NTC_ID <!-- 공지 ID --> SELECT A.NTC_ID <!-- 공지 ID -->
, A.CNTN_SE_CD
, GET_CODE_NM('CMN009', A.CNTN_SE_CD) AS CNTN_SE_NM
, A.SGG_CD <!-- 시군구 코드 --> , A.SGG_CD <!-- 시군구 코드 -->
, (CASE , (CASE
WHEN (SELECT SGG_NM FROM TB_SGG WHERE SGG_CD = A.SGG_CD) IS NOT NULL WHEN (SELECT SGG_NM FROM TB_SGG WHERE SGG_CD = A.SGG_CD) IS NOT NULL
@ -53,6 +55,22 @@ SELECT A.NTC_ID <!-- 공지 ID -->
<if test="@org.egovframe.rte.fdl.string.EgovStringUtil@isNotEmpty(by) and @org.egovframe.rte.fdl.string.EgovStringUtil@isNotEmpty(term)"> <if test="@org.egovframe.rte.fdl.string.EgovStringUtil@isNotEmpty(by) and @org.egovframe.rte.fdl.string.EgovStringUtil@isNotEmpty(term)">
AND A.${by} LIKE CONCAT('%',#{term},'%') AND A.${by} LIKE CONCAT('%',#{term},'%')
</if> </if>
<if test="@org.egovframe.rte.fdl.string.EgovStringUtil@isNotEmpty(cntnSeCd)">
AND A.CNTN_SE_CD = #{cntnSeCd}
</if>
<if test="@org.egovframe.rte.fdl.string.EgovStringUtil@isNotEmpty(userSggCd)">
<if test="userCntnSeCd == '01'">
AND (
(A.SGG_CD IS NULL OR A.SGG_CD = '')
OR
(GET_SGG_RELATION(A.SGG_CD,#{userSggCd}) IN ('SF','CP','PC'))
)
</if>
<if test="userCntnSeCd == '02'">
AND A.CNTN_SE_CD = '02'
AND GET_SGG_RELATION(A.SGG_CD,#{userSggCd}) IN ('SF','CP')
</if>
</if>
<include refid="utility.orderBy" /> <include refid="utility.orderBy" />
<include refid="utility.paging-suffix" /> <include refid="utility.paging-suffix" />
</select> </select>
@ -76,6 +94,7 @@ WHERE A.DEL_YN = 'N'
INSERT INSERT
INTO TB_NOTICE ( INTO TB_NOTICE (
NTC_ID <!-- 공지 ID --> NTC_ID <!-- 공지 ID -->
, CNTN_SE_CD
, SGG_CD <!-- 시군구 코드 --> , SGG_CD <!-- 시군구 코드 -->
, NTC_TTL <!-- 공지 제목 --> , NTC_TTL <!-- 공지 제목 -->
, NTC_CN <!-- 공지 내용 --> , NTC_CN <!-- 공지 내용 -->
@ -86,6 +105,7 @@ INSERT
, MDFR <!-- 수정자 --> , MDFR <!-- 수정자 -->
) VALUES ( ) VALUES (
#{ntc.ntcId} <!-- 공지 ID --> #{ntc.ntcId} <!-- 공지 ID -->
, #{ntc.cntnSeCd}
, #{ntc.sggCd} <!-- 시군구 코드 --> , #{ntc.sggCd} <!-- 시군구 코드 -->
, #{ntc.ntcTtl} <!-- 공지 제목 --> , #{ntc.ntcTtl} <!-- 공지 제목 -->
, #{ntc.ntcCn} <!-- 공지 내용 --> , #{ntc.ntcCn} <!-- 공지 내용 -->

Loading…
Cancel
Save