공통게시판 수정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()); publicBoard.setDownOrganCdList(loginUser.getDownOrganCdList());
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList()); mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
} }
publicBoard.setUpOrganCdList(loginUser.getUpOrganCdList());
mav.addObject("qnaList", publicBoardService.selectContentList(publicBoard)); mav.addObject("qnaList", publicBoardService.selectContentList(publicBoard));
publicBoard.setContentCnt(publicBoardService.selectContentListCnt(publicBoard)); publicBoard.setContentCnt(publicBoardService.selectContentListCnt(publicBoard));
publicBoard.setPaginationInfo(); publicBoard.setPaginationInfo();

View File

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

View File

@ -9,12 +9,16 @@
<if test='publicType != null and publicType != ""'> <if test='publicType != null and publicType != ""'>
and a.public_type = #{publicType} and a.public_type = #{publicType}
</if> </if>
<if test="title != null and title != ''">
AND a.title LIKE CONCAT('%', #{title}, '%')
</if>
<if test='startDate != null and startDate != ""'> <if test='startDate != null and startDate != ""'>
and a.wrt_dt >= #{startDate}::date and a.wrt_dt >= #{startDate}::date
</if> </if>
<if test='endDate != null and endDate != ""'> <if test='endDate != null and endDate != ""'>
and a.wrt_dt &lt;= #{endDate}::date and a.wrt_dt &lt;= #{endDate}::date
</if> </if>
<if test="downOrganCdList != null or upOrganCdList != null">
and a.public_key in ( and a.public_key in (
<if test="downOrganCdList != null"> <if test="downOrganCdList != null">
select public_key from public_board where wrt_organ in select public_key from public_board where wrt_organ in
@ -32,6 +36,7 @@
</foreach> </foreach>
</if> </if>
) )
</if>
</where> </where>
</sql> </sql>
<select id="selectContentList" resultType="PublicBoard" parameterType="PublicBoard"> <select id="selectContentList" resultType="PublicBoard" parameterType="PublicBoard">

View File

@ -1,5 +1,12 @@
let files = []; let files = [];
$(function(){
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko"
});
})
$(document).on('click', '#addNoticeBtn', function (){ $(document).on('click', '#addNoticeBtn', function (){
getEditModal(null, "PLB001") 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 (){ $(document).on('click', '.childCommentBtn', function (){
const childCommentDiv = $(this).parents(".commentRow").find(".childCommentDiv") const childCommentDiv = $(this).parents(".commentRow").find(".childCommentDiv")
childCommentDiv.show(); childCommentDiv.show();

View File

@ -15,7 +15,7 @@
<div class="row mx-0"> <div class="row mx-0">
<div class="col-12 card text-center"> <div class="col-12 card text-center">
<div class="card-body"> <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}"> <input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between pe-3 py-1"> <div class="row justify-content-between pe-3 py-1">
<div class="col-auto"> <div class="col-auto">

View File

@ -6,6 +6,7 @@
<th:block layout:fragment="script"> <th:block layout:fragment="script">
<script type="text/javascript" th:src="@{/js/publicBoard/publicBoard.js}"></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/publicBoard/qna.js}"></script>
<script type="text/javascript" th:src="@{/js/common.js}"></script>
</th:block> </th:block>
<div layout:fragment="content"> <div layout:fragment="content">
<main class="pt-3"> <main class="pt-3">
@ -15,7 +16,7 @@
<div class="row mx-0"> <div class="row mx-0">
<div class="col-12 card text-center"> <div class="col-12 card text-center">
<div class="card-body"> <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}"> <input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between pe-3 py-1"> <div class="row justify-content-between pe-3 py-1">
<div class="col-auto"> <div class="col-auto">
@ -116,7 +117,7 @@
</nav> </nav>
</div> </div>
<div class="col-auto"> <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> </div>
</div> </div>