법정동 다중 선택 기능 추가: checkbox UI 적용 및 관련 검색 로직, 쿼리, VO 수정

dev
박성영 1 month ago
parent 72557d1c20
commit c960c5dccf

@ -6,6 +6,7 @@ import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.List;
/**
* packageName : go.kr.project.crdn.crndRegistAndView.model
@ -193,20 +194,26 @@ public class CrdnRegistAndViewVO extends PagingVO {
/** 검색 조건 - 단속 번호 */
private String schCrdnNo;
/** 검색 조건 - 법정동 읍면동 코드 */
private String schStdgEmdCd;
/** 검색 조건 - 법정동 읍면동 코드 (다중 선택) */
private List<String> schStdgEmdCd;
/** 검색 조건 - 지역 구분 코드 */
private String schRgnSeCd;
/** 검색 조건 - 적발 방법 코드 */
private String schDsclMthdCd;
/** 검색 조건 - 조사원 */
private String schExmnr;
/** 검색 조건 - 진행단계 코드 */
private String schCrdnPrcsSttsCd;
/** 검색 조건 - 진행단계 시작 일자 */
private String schPrcsSttsStartDt;
/** 검색 조건 - 진행단계 종료 일자 */
private String schPrcsSttsEndDt;
/** 검색 조건 - 가중 부과 대상 여부 */
private String schAgrvtnLevyTrgtYn;

@ -101,8 +101,11 @@
<if test='schCrdnNo != null and schCrdnNo != ""'>
AND c.CRDN_NO LIKE CONCAT('%', #{schCrdnNo}, '%')
</if>
<if test='schStdgEmdCd != null and schStdgEmdCd != ""'>
AND p.STDG_EMD_CD = #{schStdgEmdCd}
<if test='schStdgEmdCd != null and schStdgEmdCd.size() > 0'>
AND p.STDG_EMD_CD IN
<foreach collection="schStdgEmdCd" item="emdCd" open="(" separator="," close=")">
#{emdCd}
</foreach>
</if>
<if test='schRgnSeCd != null and schRgnSeCd != ""'>
AND c.RGN_SE_CD = #{schRgnSeCd}
@ -181,8 +184,11 @@
<if test='schCrdnNo != null and schCrdnNo != ""'>
AND c.CRDN_NO LIKE CONCAT('%', #{schCrdnNo}, '%')
</if>
<if test='schStdgEmdCd != null and schStdgEmdCd != ""'>
AND p.STDG_EMD_CD = #{schStdgEmdCd}
<if test='schStdgEmdCd != null and schStdgEmdCd.size() > 0'>
AND p.STDG_EMD_CD IN
<foreach collection="schStdgEmdCd" item="emdCd" open="(" separator="," close=")">
#{emdCd}
</foreach>
</if>
<if test='schRgnSeCd != null and schRgnSeCd != ""'>
AND c.RGN_SE_CD = #{schRgnSeCd}
@ -645,8 +651,11 @@
<if test='schCrdnNo != null and schCrdnNo != ""'>
AND c.CRDN_NO LIKE CONCAT('%', #{schCrdnNo}, '%')
</if>
<if test='schStdgEmdCd != null and schStdgEmdCd != ""'>
AND p.STDG_EMD_CD = #{schStdgEmdCd}
<if test='schStdgEmdCd != null and schStdgEmdCd.size() > 0'>
AND p.STDG_EMD_CD IN
<foreach collection="schStdgEmdCd" item="emdCd" open="(" separator="," close=")">
#{emdCd}
</foreach>
</if>
<if test='schRgnSeCd != null and schRgnSeCd != ""'>
AND c.RGN_SE_CD = #{schRgnSeCd}
@ -660,6 +669,12 @@
<if test='schCrdnPrcsSttsCd != null and schCrdnPrcsSttsCd != ""'>
AND c.CRDN_PRCS_STTS_CD = #{schCrdnPrcsSttsCd}
</if>
<if test='schPrcsSttsStartDt != null and schPrcsSttsStartDt != ""'>
AND c.CRDN_PRCS_YMD &gt;= #{schPrcsSttsStartDt}
</if>
<if test='schPrcsSttsEndDt != null and schPrcsSttsEndDt != ""'>
AND c.CRDN_PRCS_YMD &lt;= #{schPrcsSttsEndDt}
</if>
<if test='schAgrvtnLevyTrgtYn != null and schAgrvtnLevyTrgtYn != ""'>
AND c.AGRVTN_LEVY_TRGT_YN = #{schAgrvtnLevyTrgtYn}
</if>

@ -45,7 +45,7 @@
</c:choose>
</td>
</tr>
<tr>
<tr style="display: none;">
<th class="th"><span class="required">*</span> 지역구분</th>
<td colspan="3">
<select id="rgnSeCd" name="rgnSeCd" class="input" validation-check="required">
@ -74,7 +74,7 @@
<button id="btnExmnrSelect" class="newbtn bg1 smallb-2" type="button">조사원 선택</button>
</td>
</tr>
<tr>
<tr style="display: none;">
<th class="th"><span class="required">*</span> 재부과여부</th>
<td colspan="3">
<select id="relevyYn" name="relevyYn" class="input" validation-check="required">

@ -29,15 +29,7 @@
<li>
<input type="text" id="schCrdnNo" name="schCrdnNo" maxlength="6" class="input" style="width: 100px;" value="${empty param.schCrdnNo ? '':param.schCrdnNo}" autocomplete="off"/>
</li>
<li class="th">법정동</li>
<li>
<select id="schStdgEmdCd" name="schStdgEmdCd" class="input" style="width: 120px;">
<option value="">전체</option>
<c:forEach var="code" items="${stdgEmdCdList}">
<option value="${code.cdId}" <c:if test="${param.schStdgEmdCd eq code.cdId}">selected</c:if>>${code.cdNm}</option>
</c:forEach>
</select>
</li>
<%--
<li class="th">지역 구분</li>
<li>
<select id="schRgnSeCd" name="schRgnSeCd" class="input" style="width: 120px;">
@ -64,6 +56,7 @@
<li>
<input type="text" id="schExmnr" name="schExmnr" maxlength="50" class="input" style="width: 150px;" autocomplete="off"/>
</li>
--%>
<li class="th">진행단계</li>
<li>
<select id="schCrdnPrcsSttsCd" name="schCrdnPrcsSttsCd" class="input" style="width: 120px;">
@ -75,6 +68,11 @@
</c:forEach>
</select>
</li>
<li class="th">진행단계 일자</li>
<li>
<input type="text" id="schPrcsSttsStartDt" name="schPrcsSttsStartDt" class="input calender datepicker" style="width: 120px;" autocomplete="off" value=""/> ~
<input type="text" id="schPrcsSttsEndDt" name="schPrcsSttsEndDt" class="input calender datepicker" style="width: 120px;" autocomplete="off" value=""/>
</li>
<%--
<li class="th">가중 부과 대상</li>
<li>
@ -110,6 +108,16 @@
<button class="newbtnss bg1" type="button" id="btnAddrSearch">주소 찾기</button>
</li>
</ul>
<ul class="lef2">
<li class="th">법정동</li>
<li>
<c:forEach var="code" items="${stdgEmdCdList}" varStatus="status">
<label style="margin-right: 10px;">
<input type="checkbox" name="schStdgEmdCd" value="${code.cdId}"/> ${code.cdNm}
</label>
</c:forEach>
</li>
</ul>
</div>
<div class="gs_booking">
<div class="row">
@ -168,11 +176,19 @@
var setSearchCond = function() {
var schCrdnYr = $.trim(nvl($("#schCrdnYr").val(), ""));
var schCrdnNo = $.trim(nvl($("#schCrdnNo").val(), ""));
var schStdgEmdCd = $.trim(nvl($("#schStdgEmdCd").val(), ""));
// 법정동 checkbox 배열로 수집
var schStdgEmdCd = [];
$("input[name='schStdgEmdCd']:checked").each(function() {
schStdgEmdCd.push($(this).val());
});
var schRgnSeCd = $.trim(nvl($("#schRgnSeCd").val(), ""));
var schDsclMthdCd = $.trim(nvl($("#schDsclMthdCd").val(), ""));
var schExmnr = $.trim(nvl($("#schExmnr").val(), ""));
var schCrdnPrcsSttsCd = $.trim(nvl($("#schCrdnPrcsSttsCd").val(), ""));
var schPrcsSttsStartDt = $.trim(nvl($("#schPrcsSttsStartDt").val(), ""));
var schPrcsSttsEndDt = $.trim(nvl($("#schPrcsSttsEndDt").val(), ""));
var schAgrvtnLevyTrgtYn = $.trim(nvl($("#schAgrvtnLevyTrgtYn").val(), ""));
var schActCmpltCd = $.trim(nvl($("#schActCmpltCd").val(), ""));
var schZip = $.trim(nvl($("#schZip").val(), ""));
@ -188,6 +204,8 @@
SEARCH_COND.schDsclMthdCd = schDsclMthdCd;
SEARCH_COND.schExmnr = schExmnr;
SEARCH_COND.schCrdnPrcsSttsCd = schCrdnPrcsSttsCd;
SEARCH_COND.schPrcsSttsStartDt = schPrcsSttsStartDt;
SEARCH_COND.schPrcsSttsEndDt = schPrcsSttsEndDt;
SEARCH_COND.schAgrvtnLevyTrgtYn = schAgrvtnLevyTrgtYn;
SEARCH_COND.schActCmpltCd = schActCmpltCd;
SEARCH_COND.schZip = schZip;
@ -538,14 +556,14 @@
*/
openRegisterPopup: function() {
var url = '<c:url value="/crdn/crndRegistAndView/crdnRegistPopup.do"/>?mode=C';
openPopup(url, 800, 700, 'crdnRegistAndViewView');
openPopup(url, 800, 650, 'crdnRegistAndViewView');
},
openViewPopup: function(crdnYr, crdnNo) {
var url = '<c:url value="/crdn/crndRegistAndView/crdnRegistPopup.do"/>?mode=V&crdnYr=' +
encodeURIComponent(crdnYr) + '&crdnNo=' +
encodeURIComponent(crdnNo);
openPopup(url, 800, 700, 'crdnRegistAndViewView');
openPopup(url, 800, 650, 'crdnRegistAndViewView');
},
/**
@ -803,11 +821,13 @@
// 모든 검색 조건 초기화
$("#schCrdnYr").val("${dateUtil:getCurrentDateTime('yyyy')}"); // 현재 년도로 초기화
$("#schCrdnNo").val("");
$("#schStdgEmdCd").val("");
$("input[name='schStdgEmdCd']").prop("checked", false); // 법정동 checkbox 해제
$("#schRgnSeCd").val("");
$("#schDsclMthdCd").val("");
$("#schExmnr").val("");
$("#schCrdnPrcsSttsCd").val("");
$("#schPrcsSttsStartDt").val(""); // 진행단계 시작일자 초기화
$("#schPrcsSttsEndDt").val(""); // 진행단계 종료일자 초기화
$("#schAgrvtnLevyTrgtYn").val("");
$("#schActCmpltCd").val("");
$("#schZip").val("");
@ -826,10 +846,10 @@
var params = '?callback=searchAddrCallback';
// 중요로직: 법정동이 선택된 경우 동 이름을 검색어로 전달
var selectedEmd = $('#schStdgEmdCd').val();
if (selectedEmd) {
var selectedEmdText = $('#schStdgEmdCd option:selected').text();
if (selectedEmdText && selectedEmdText !== '전체') {
var selectedEmdCheckbox = $("input[name='schStdgEmdCd']:checked").first();
if (selectedEmdCheckbox.length > 0) {
var selectedEmdText = selectedEmdCheckbox.parent().text().trim();
if (selectedEmdText) {
params += '&keyword=' + encodeURIComponent( '${sessionScope.sessionVO.user.orgCdNm} ' + selectedEmdText + ' ');
}
}else{

Loading…
Cancel
Save