공통게시판 수정1

Hyung Geun 2022-09-27 17:57:27 +09:00
parent 04d9e4695d
commit 78bc358c87
7 changed files with 41 additions and 21 deletions

View File

@ -83,7 +83,6 @@ public class PublicBoardController {
publicBoard.setDownOrganCdList(loginUser.getDownOrganCdList());
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
}
publicBoard.setUpOrganCdList(loginUser.getUpOrganCdList());
mav.addObject("qnaList", publicBoardService.selectContentList(publicBoard));
publicBoard.setContentCnt(publicBoardService.selectContentListCnt(publicBoard));
publicBoard.setPaginationInfo();

View File

@ -8,6 +8,7 @@ import java.util.List;
@Mapper
public interface PublicBoardMapper {
List<PublicBoard> selectContentList(PublicBoard publicBoard);
List<PublicBoard> selectContentListWhere(PublicBoard publicBoard);
Integer selectContentListCnt(PublicBoard publicBoard);
}

View File

@ -9,29 +9,34 @@
<if test='publicType != null and publicType != ""'>
and a.public_type = #{publicType}
</if>
<if test="title != null and title != ''">
AND a.title LIKE CONCAT('%', #{title}, '%')
</if>
<if test='startDate != null and startDate != ""'>
and a.wrt_dt >= #{startDate}::date
</if>
<if test='endDate != null and endDate != ""'>
and a.wrt_dt &lt;= #{endDate}::date
</if>
and a.public_key in (
<if test="downOrganCdList != null">
select public_key from public_board where wrt_organ in
<foreach collection="downOrganCdList" item="organCd" separator="," open="(" close=")">
#{organCd}
</foreach>
</if>
<if test="downOrganCdList != null and upOrganCdList != null">
union all
</if>
<if test="upOrganCdList != null">
select public_key from public_board where organ_chk = 'F' and wrt_organ in
<foreach collection="upOrganCdList" item="organCd" separator="," open="(" close=")">
#{organCd}
</foreach>
</if>
)
<if test="downOrganCdList != null or upOrganCdList != null">
and a.public_key in (
<if test="downOrganCdList != null">
select public_key from public_board where wrt_organ in
<foreach collection="downOrganCdList" item="organCd" separator="," open="(" close=")">
#{organCd}
</foreach>
</if>
<if test="downOrganCdList != null and upOrganCdList != null">
union all
</if>
<if test="upOrganCdList != null">
select public_key from public_board where organ_chk = 'F' and wrt_organ in
<foreach collection="upOrganCdList" item="organCd" separator="," open="(" close=")">
#{organCd}
</foreach>
</if>
)
</if>
</where>
</sql>
<select id="selectContentList" resultType="PublicBoard" parameterType="PublicBoard">

View File

@ -1,5 +1,12 @@
let files = [];
$(function(){
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko"
});
})
$(document).on('click', '#addNoticeBtn', function (){
getEditModal(null, "PLB001")
})

View File

@ -35,6 +35,13 @@ $(document).on('click', '#commentSaveBtn', function (){
}
})
$(function(){
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko"
});
})
$(document).on('click', '.childCommentBtn', function (){
const childCommentDiv = $(this).parents(".commentRow").find(".childCommentDiv")
childCommentDiv.show();

View File

@ -15,7 +15,7 @@
<div class="row mx-0">
<div class="col-12 card text-center">
<div class="card-body">
<form method="get" th:action="@{/affairPlan/monthPlanPage}">
<form method="get" th:action="@{/publicBoard/noticePage}">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between pe-3 py-1">
<div class="col-auto">

View File

@ -6,6 +6,7 @@
<th:block layout:fragment="script">
<script type="text/javascript" th:src="@{/js/publicBoard/publicBoard.js}"></script>
<script type="text/javascript" th:src="@{/js/publicBoard/qna.js}"></script>
<script type="text/javascript" th:src="@{/js/common.js}"></script>
</th:block>
<div layout:fragment="content">
<main class="pt-3">
@ -15,7 +16,7 @@
<div class="row mx-0">
<div class="col-12 card text-center">
<div class="card-body">
<form method="get" th:action="@{/affairPlan/monthPlanPage}">
<form method="get" th:action="@{/publicBoard/qnaPage}">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between pe-3 py-1">
<div class="col-auto">
@ -116,7 +117,7 @@
</nav>
</div>
<div class="col-auto">
<input type="button" class="btn btn-success" value="등록" id="addQnaBtn" sec:authorize="hasRole('ROLE_SUB_ADMIN')">
<input type="button" class="btn btn-success" value="등록" id="addQnaBtn">
</div>
</div>
</div>