fix: 검색조건에 따른 처리 fix

main
minuk926 2 years ago
parent 05525926d6
commit 9ead480855

@ -28,15 +28,11 @@
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(sbscrbSttus)"> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(sbscrbSttus)">
AND xui.user_sttus_code = #{sbscrbSttus} AND xui.user_sttus_code = #{sbscrbSttus}
</if> </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(searchKeyword)"> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(userId)">
<choose> AND INSTR(xui.user_id, #{userId}) > 0
<when test="searchCondition eq 'userId'"> </if>
AND INSTR(xui.user_id, #{searchKeyword}) > 0 <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(userNm)">
</when> AND INSTR(xui.user_nm, #{userNm}) > 0
<when test="searchCondition eq 'userNm'">
AND INSTR(xui.user_nm, #{searchKeyword}) > 0
</when>
</choose>
</if> </if>
</where> </where>
ORDER BY sbscrb_de DESC ORDER BY sbscrb_de DESC

@ -16,7 +16,7 @@
</colgroup> </colgroup>
<tbody> <tbody>
<tr> <tr>
<td style=""> <td>
<label for="clCode">분류코드</label> <label for="clCode">분류코드</label>
<input name="clCode" title="분류코드" type="text" size="15" maxlength="15" id="clCode"> <input name="clCode" title="분류코드" type="text" size="15" maxlength="15" id="clCode">
</td> </td>

@ -175,9 +175,8 @@
readData: { readData: {
url: '<c:url value="/framework/biz/mng/code/findZipCodes.do"/>' url: '<c:url value="/framework/biz/mng/code/findZipCodes.do"/>'
,serializer: (params) => { ,serializer: (params) => {
const schVal = $('#searchKeyword').val();
const schKey = $('#searchCondition').val(); const schKey = $('#searchCondition').val();
if(schVal && schKey) return getPageParam({[schKey]: schVal}, params); if(schKey) return getPageParam({[schKey]: $('#searchKeyword').val()}, params);
return getPageParam(null, params); return getPageParam(null, params);
} }
} }

@ -2,13 +2,13 @@
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp"%> <%@ include file="/WEB-INF/jsp/framework/taglibs.jsp"%>
<form name="frmSearch" id="frmSearch" method="post"> <form name="frmSearch" id="frmSearch" method="post">
<div class="search"> <div class="search r2">
<table> <table>
<caption>검색조건</caption> <caption>검색조건</caption>
<colgroup> <colgroup>
<col style="width: 8%;"/> <col style="width: 400px;"/>
<col style="width: 30%;"/> <col/>
<col/> <col/>
<col/> <col/>
<col/> <col/>
@ -17,16 +17,16 @@
</colgroup> </colgroup>
<tbody> <tbody>
<tr> <tr>
<td colspan="6"> <td>
<code:select id="sbscrbSttus" name="sbscrbSttus" codeId="XIT013" title="사용자상태" cls="selectBox" alt="selectBox tag"/> <code:select id="sbscrbSttus" name="sbscrbSttus" codeId="XIT013" title="사용자상태" cls="selectBox" alt="selectBox tag"/>
<select name="searchCondition" id="searchCondition" title="검색구분" class="selectBox"> <select name="searchCondition" id="searchCondition" title="검색구분" class="selectBox">
<option value="userId">사용자ID</option> <option value="userId">사용자ID</option>
<option value="userNm">이름</option> <option value="userNm">이름</option>
</select> </select>
<input name="searchKeyword" title="검색어" type="text"/> <input name="searchKeyword" id="searchKeyword" title="검색어" type="text"/>
</td> </td>
<td> <td colspan="6">
<input type="button" id="btnSearch" class="btnSearch" title="검색" value="검색"/> <input type="button" id="btnSearch" class="btn_search" title="검색" value="검색"/>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -185,7 +185,11 @@
api: { api: {
readData: { readData: {
url: '<c:url value="/framework/biz/mng/usr/findUsers.do"/>' url: '<c:url value="/framework/biz/mng/usr/findUsers.do"/>'
,serializer: (params) => fnAddPageInfo(document.frmSearch, params) ,serializer: (params) => {
const schKey = $('#searchCondition').val();
if(schKey) return getPageParam({[schKey]: $('#searchKeyword').val(), sbscrbSttus: $('#sbscrbSttus').val()}, params);
return getPageParam({sbscrbSttus: $('#sbscrbSttus').val()}, params);
}
} }
} }
}; };

Loading…
Cancel
Save