공지사항 관리 수정

main
이범준 9 months ago
parent 3e958de36e
commit b9886d1971

@ -10,6 +10,7 @@ import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.mngt.Ntc; import cokr.xit.fims.mngt.Ntc;
import cokr.xit.fims.mngt.NtcQuery; import cokr.xit.fims.mngt.NtcQuery;
import cokr.xit.fims.mngt.dao.FactionMapper;
import cokr.xit.fims.mngt.service.NtcService; import cokr.xit.fims.mngt.service.NtcService;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@ -35,6 +36,9 @@ public class Mngt01Controller extends ApplicationController {
@Resource(name="ntcService") @Resource(name="ntcService")
private NtcService ntcService; private NtcService ntcService;
@Resource(name = "factionMapper")
private FactionMapper factionMapper;
/** . /** .
* @return fims/mngt/mngt01010-main * @return fims/mngt/mngt01010-main
*/ */
@ -84,6 +88,10 @@ public class Mngt01Controller extends ApplicationController {
info = null; info = null;
} }
mav.addObject("ntcInfo", json ? info : toJson(info)); mav.addObject("ntcInfo", json ? info : toJson(info));
List<DataObject> allSggList = factionMapper.selectAllSggList();
mav.addObject("sggList", allSggList);
return mav; return mav;
} }

@ -25,6 +25,10 @@
<sql id="select"> <sql id="select">
SELECT A.NTC_ID <!-- 공지 ID --> SELECT A.NTC_ID <!-- 공지 ID -->
, A.SGG_CD <!-- 시군구 코드 --> , A.SGG_CD <!-- 시군구 코드 -->
, (CASE
WHEN (SELECT SGG_NM FROM TB_SGG WHERE SGG_CD = A.SGG_CD) IS NOT NULL
THEN (SELECT SGG_NM FROM TB_SGG WHERE SGG_CD = A.SGG_CD)
ELSE '전체' END) AS SGG_NM
, A.NTC_TTL <!-- 공지 제목 --> , A.NTC_TTL <!-- 공지 제목 -->
, A.NTC_CN <!-- 공지 내용 --> , A.NTC_CN <!-- 공지 내용 -->
, A.DEL_YN <!-- 삭제 여부 --> , A.DEL_YN <!-- 삭제 여부 -->
@ -43,9 +47,9 @@ SELECT A.NTC_ID <!-- 공지 ID -->
<include refid="utility.paging-prefix" /> <include refid="utility.paging-prefix" />
<include refid="select" /> <include refid="select" />
WHERE A.DEL_YN = 'N' WHERE A.DEL_YN = 'N'
<if test="sggCd != null"> <if test="sggCd != null and sggCd != ''">
AND A.SGG_CD = #{sggCd} AND (A.SGG_CD = #{sggCd} OR A.SGG_CD = '' OR A.SGG_CD IS NULL)
</if> </if>
<if test="by != null and by != '' and term != null"> <if test="by != null and by != '' and term != null">
AND A.${by} LIKE CONCAT('%',#{term},'%') AND A.${by} LIKE CONCAT('%',#{term},'%')
</if> </if>

@ -59,6 +59,7 @@
<thead class="sticky-thead"> <thead class="sticky-thead">
<tr id="ntcThead--${pageName}"> <tr id="ntcThead--${pageName}">
<th style="width: 80px;" class="cmn">No.</th> <th style="width: 80px;" class="cmn">No.</th>
<th style="width: 180px;">시군구명</th>
<th style="width: 800px;">제목</th> <th style="width: 800px;">제목</th>
<th style="width: 180px;">작성일시</th> <th style="width: 180px;">작성일시</th>
<th class="dummy-th"></th> <th class="dummy-th"></th>
@ -69,6 +70,7 @@
<template id="ntcRow--${pageName}"> <template id="ntcRow--${pageName}">
<tr data-key="{NTC_ID}"> <tr data-key="{NTC_ID}">
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{ROW_NUM}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{ROW_NUM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{SGG_NM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{NTC_TTL}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{NTC_TTL}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{REG_DT}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{REG_DT}</td>
<td class="dummy-td"></td> <td class="dummy-td"></td>
@ -76,7 +78,7 @@
</template> </template>
<template id="ntcNotFound--${pageName}"> <template id="ntcNotFound--${pageName}">
<tr> <tr>
<td valign="top" colspan="4" class="dataTables_empty text-center"> <td valign="top" colspan="5" class="dataTables_empty text-center">
공지사항 정보를 찾지 못했습니다. 공지사항 정보를 찾지 못했습니다.
</td> </td>
</tr> </tr>

@ -6,11 +6,24 @@
<div class="card"> <div class="card">
<form id="frmEdit--${pageName}" name="frmEdit"> <form id="frmEdit--${pageName}" name="frmEdit">
<input type="text" id="sggCd--${pageName}" name="sggCd" data-map="SGG_CD" hidden />
<input type="text" id="ntcId--${pageName}" name="ntcId" data-map="NTC_ID" hidden />
<div class="row g-1"> <input type="text" id="ntcId--${pageName}" name="ntcId" data-map="NTC_ID" hidden />
<div class="row g-1">
<div class="col-md-12">
<label for="sggCd--${pageName}"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">
시군구
</label>
<select id="sggCd--${pageName}" name="sggCd" data-map="SGG_CD" class="form-select">
<option value="">전체</option>
<c:forEach items="${sggList}" var="item">
<c:if test="${item.SGG_CD ne 'default'}">
<option value="${item.SGG_CD}">${item.SGG_NM}</option>
</c:if>
</c:forEach>
</select>
</div>
<div class="col-md-12"> <div class="col-md-12">
<label for="ntcTtl--${pageName}" <label for="ntcTtl--${pageName}"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end required"> class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end required">
@ -150,18 +163,21 @@ $(document).ready(function(){
* 초기화 * 초기화
**************************************************************************/ **************************************************************************/
var ntcInfo = ${ntcInfo}; var ntcInfo = ${ntcInfo};
if(ntcInfo != null){
$P.ntcControl.dataset.setData([ntcInfo]);
} else {
$P.ntcControl.dataset.setData([]);
$("#sggCd--${pageName}").val(MY_INFO.info.sggCd);
$("#btnRemove--${pageName}").attr("hidden","hidden");
}
if(MY_INFO.institute != "default"){ if(ntcInfo == null){
$("#btnSave--${pageName}").attr("hidden","hidden"); $P.ntcControl.dataset.setData([]);
$("#btnRemove--${pageName}").attr("hidden","hidden"); $("#btnRemove--${pageName}").attr("hidden","hidden");
} else {
$P.ntcControl.dataset.setData([ntcInfo]);
$("#sggCd--${pageName}").attr("disabled","disabled");
if(MY_INFO.institute != "default"){
$("#btnSave--${pageName}").attr("hidden","hidden");
$("#btnRemove--${pageName}").attr("hidden","hidden");
}
} }
}); });
</script> </script>
Loading…
Cancel
Save