공지사항 관리 수정

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

@ -25,6 +25,10 @@
<sql id="select">
SELECT A.NTC_ID <!-- 공지 ID -->
, 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_CN <!-- 공지 내용 -->
, A.DEL_YN <!-- 삭제 여부 -->
@ -43,8 +47,8 @@ SELECT A.NTC_ID <!-- 공지 ID -->
<include refid="utility.paging-prefix" />
<include refid="select" />
WHERE A.DEL_YN = 'N'
<if test="sggCd != null">
AND A.SGG_CD = #{sggCd}
<if test="sggCd != null and sggCd != ''">
AND (A.SGG_CD = #{sggCd} OR A.SGG_CD = '' OR A.SGG_CD IS NULL)
</if>
<if test="by != null and by != '' and term != null">
AND A.${by} LIKE CONCAT('%',#{term},'%')

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

@ -6,11 +6,24 @@
<div class="card">
<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">
<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">
<label for="ntcTtl--${pageName}"
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};
if(ntcInfo != null){
$P.ntcControl.dataset.setData([ntcInfo]);
} else {
if(ntcInfo == null){
$P.ntcControl.dataset.setData([]);
$("#sggCd--${pageName}").val(MY_INFO.info.sggCd);
$("#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>
Loading…
Cancel
Save