동적 조회조건 관련 그리드 설정 기능 수정

main
이범준 1 year ago
parent 3c841292c3
commit a4f0a7a28b

@ -4,6 +4,7 @@ import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.egovframe.rte.fdl.string.EgovStringUtil;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
@ -27,6 +28,17 @@ public class Crdn06Bean extends AbstractComponent {
* @return * @return
*/ */
public List<DataObject> getCrackdownList(CrdnQuery req) { public List<DataObject> getCrackdownList(CrdnQuery req) {
if(!isEmpty(req.getBy())) {
if(!req.getBy().startsWith("advancedOption")) {
switch (ifEmpty(req.getBy(), () -> "")) {
default:
req.setBy(EgovStringUtil.convertToUnderScore(req.getBy()).toUpperCase());
break;
}
}
}
return crdn06Mapper.selectCrackdownList(req.setOrderBy("CRDN_ID")); return crdn06Mapper.selectCrackdownList(req.setOrderBy("CRDN_ID"));
} }

@ -84,7 +84,16 @@
, A.DEL_RSN , A.DEL_RSN
FROM TB_CRDN A FROM TB_CRDN A
WHERE DEL_YN = 'N' WHERE DEL_YN = 'N'
<if test="term != null">AND A.${by} LIKE CONCAT('%', #{term}, '%')</if> <if test="by != null and by != '' and term != null">
<choose>
<when test="by == 'advancedOption1'">
AND FN_GET_CODE_NM('FIM003', A.CRDN_INPT_SE_CD) LIKE CONCAT('%', #{term}, '%')
</when>
<otherwise>
AND A.${by} LIKE CONCAT('%', #{term}, '%')
</otherwise>
</choose>
</if>
<if test="crdnId != null">AND A.CRDN_ID = #{crdnId}</if> <if test="crdnId != null">AND A.CRDN_ID = #{crdnId}</if>
<if test="taskSeCd != null">AND A.TASK_SE_CD = #{taskSeCd}</if> <if test="taskSeCd != null">AND A.TASK_SE_CD = #{taskSeCd}</if>
<if test="vhrno != null">AND A.VHRNO LIKE CONCAT('%', #{vhrno}, '%')</if> <if test="vhrno != null">AND A.VHRNO LIKE CONCAT('%', #{vhrno}, '%')</if>

@ -77,10 +77,10 @@
<div> <div>
<span class="container-page-btn"> <span class="container-page-btn">
<a href="#" class="btn btn-blue" id="btnUpdateToConfirmData--${pageName}" title="개별 확인 자료로 수정">개별 확인 자료로 수정</a>
<div id="totCnt">전체 ㅣ <span></span></div> <div id="totCnt">전체 ㅣ <span></span></div>
<span class="container-window-btn-right"> <span class="container-window-btn-right">
선택 | n건 선택 | n건
<a href="#" class="btn btn-blue" id="" title="개별 확인 자료로 수정">개별 확인 자료로 수정</a>
</span> </span>
</span> </span>
</div> </div>
@ -237,7 +237,7 @@ $(document).ready(function(){
* Grid * Grid
******************************* */ ******************************* */
thisPO.gridColumns = [ thisPO.gridColumns = [
{ header: '자료출처', name: 'CRDN_INPT_SE_CD', width: 100, className: 'text-center' }, { header: '자료출처', name: 'CRDN_INPT_SE_CD', width: 100, className: 'text-center', advancedOptionIndex : 1 },
{ header: '위반일시', name: 'CRDN_YMD_TM', width: 120, className: 'text-center' }, { header: '위반일시', name: 'CRDN_YMD_TM', width: 120, className: 'text-center' },
{ header: '차량번호', name: 'VHRNO', width: 80, className: 'text-center' }, { header: '차량번호', name: 'VHRNO', width: 80, className: 'text-center' },
{ header: '법정동', name: 'CRDN_STDG_NM', width: 80, className: 'text-center' }, { header: '법정동', name: 'CRDN_STDG_NM', width: 80, className: 'text-center' },
@ -292,13 +292,10 @@ $(document).ready(function(){
$('#btnSearch--${pageName}').on('click', () => thisPO.searchCrdnList()); $('#btnSearch--${pageName}').on('click', () => thisPO.searchCrdnList());
$('#btnMenualRegist--${pageName}').on('click', () => { $('#btnUpdateToConfirmData--${pageName}').on('click', () => {
}); });
$('#btnExtrRegist--${pageName}').on('click', () => {
});
//보안모드 //보안모드
if($("#securityMode--top").is(":checked")){ if($("#securityMode--top").is(":checked")){

@ -21,13 +21,13 @@
</div> </div>
<!-- /Search --> <!-- /Search -->
<div class="ms-2 me-2" style="min-width: max-content;"> <div class="ms-2 me-2" style="min-width: max-content;">
<select id="schOpt--top" class="form-select" title="검색구분"> <select id="by--top" class="form-select" title="검색구분">
<option value="vhrno">차량번호</option> <option value="vhrno">차량번호</option>
<option value="rtpyrNm">납부자명</option> <option value="rtpyrNm">납부자명</option>
<option value="rtpyrNo">납부자번호</option> <option value="rtpyrNo">납부자번호</option>
<option value="petitionerNm">신고인명</option> <option value="cvlcptAplcntNm">신고인명</option>
</select> </select>
<input type="text" id="schWord--top" class="form-control" title="검색어" /> <input type="text" id="term--top" class="form-control" title="검색어" />
<button type="button" id="fastSearch--top" class="btn btn-outline-dark bg-orange" title="통합조회"> <button type="button" id="fastSearch--top" class="btn btn-outline-dark bg-orange" title="통합조회">
<i class="bx bx-search"></i>통합조회 <i class="bx bx-search"></i>통합조회
</button> </button>

@ -45,8 +45,8 @@ var initGrid = (gridOptions) => {
var by = gridOptions.by; var by = gridOptions.by;
var byOutput = gridOptions.byOutput; var byOutput = gridOptions.byOutput;
if(by && byOutput){ if(by && byOutput){
titleClickEvent += `searchFromGridTitle('${by}','${byOutput}','${gName}','${gHeader}');`; titleClickEvent += `searchFromGridTitle('${by}','${byOutput}','${gName}','${gHeader}','${item.advancedOptionIndex}');`;
} }
var gHidden = item.hidden; var gHidden = item.hidden;
@ -90,7 +90,25 @@ var initGrid = (gridOptions) => {
return tableBodyTemplate; return tableBodyTemplate;
}; };
function searchFromGridTitle(byElement, byOutputElement, byValue, byOutputValue){ function searchFromGridTitle(byElement, byOutputElement, byValue, byOutputValue, advancedOptionIndex){
document.getElementById(byElement).value = byValue;
if(advancedOptionIndex > 0){
document.getElementById(byElement).value = "advancedOption" + advancedOptionIndex;
} else {
document.getElementById(byElement).value = snakeToCamel(byValue);
}
document.getElementById(byOutputElement).value = byOutputValue + " 검색"; document.getElementById(byOutputElement).value = byOutputValue + " 검색";
} }
function snakeToCamel(text){
text = text.toLowerCase();
var arrUnderbar = text.match(/\_[a-zA-Z]/g);
if(arrUnderbar){
for(var j = 0; j < arrUnderbar.length; j++) {
text = text.replace(arrUnderbar[j], arrUnderbar[j].toUpperCase().replace("_", ""));
}
}
return text;
}

Loading…
Cancel
Save