검색, 페이지네이션

master
DESKTOP-V7KL26R\DBNT 2022-02-18 14:01:33 +09:00
parent e968c3312a
commit 99cd88b4ac
7 changed files with 146 additions and 105 deletions

View File

@ -52,12 +52,20 @@ public class ImgPaginationRenderer extends AbstractPaginationRenderer implements
*/
public void initVariables() {
firstPageLabel = "<a href=\"#\" onclick=\"{0}({1}); return false;\">" + "<image src='" + servletContext.getContextPath() + "/images/egovframework/cmmn/btn_page_pre10.gif' border=0/></a>&#160;";
previousPageLabel = "<a href=\"#\" onclick=\"{0}({1}); return false;\">" + "<image src='" + servletContext.getContextPath() + "/images/egovframework/cmmn/btn_page_pre1.gif' border=0/></a>&#160;";
currentPageLabel = "<strong>{0}</strong>&#160;";
otherPageLabel = "<a href=\"#\" onclick=\"{0}({1}); return false;\">{2}</a>&#160;";
nextPageLabel = "<a href=\"#\" onclick=\"{0}({1}); return false;\">" + "<image src='" + servletContext.getContextPath() + "/images/egovframework/cmmn/btn_page_next1.gif' border=0/></a>&#160;";
lastPageLabel = "<a href=\"#\" onclick=\"{0}({1}); return false;\">" + "<image src='" + servletContext.getContextPath() + "/images/egovframework/cmmn/btn_page_next10.gif' border=0/></a>&#160;";
firstPageLabel = "";//""<a href=\"#\" onclick=\"{0}({1}); return false;\">" + "<image src='" + servletContext.getContextPath() + "/images/egovframework/cmmn/btn_page_pre10.gif' border=0/></a>&#160;";
previousPageLabel = "<li>\n" +
"\t\t\t\t\t <a href=\"#\" aria-label=\"Previous\">\n" +
"\t\t\t\t\t\t<span aria-hidden=\"true\">&laquo;</span>\n" +
"\t\t\t\t\t </a>\n" +
"\t\t\t\t\t</li>";
currentPageLabel = "<li class = \"active\"><a href=\"#\">{0}</a></li>";
otherPageLabel = "<li><a href=\"#\" onclick=\"{0}({1}); return false;\">{2}</a></li>";
nextPageLabel = "<li>\n" +
"\t\t\t\t\t <a href=\"#\" aria-label=\"Next\">\n" +
"\t\t\t\t\t\t<span aria-hidden=\"true\">&raquo;</span>\n" +
"\t\t\t\t\t </a>\n" +
"\t\t\t\t\t</li>";
lastPageLabel = "";//""<a href=\"#\" onclick=\"{0}({1}); return false;\">" + "<image src='" + servletContext.getContextPath() + "/images/egovframework/cmmn/btn_page_next10.gif' border=0/></a>&#160;";
}
@Override

View File

@ -35,6 +35,21 @@
FROM
map_field_data a LEFT JOIN t_user b ON a.userid=b.userid
WHERE 1=1
<if test='searchKeyword != null and searchKeyword != ""'>
<choose>
<when test='searchCondition eq "all"'>
AND (a.region LIKE CONCAT('%',#{searchKeyword},'%')
OR b.name LIKE CONCAT('%',#{searchKeyword},'%')
OR b.company LIKE CONCAT('%',#{searchKeyword},'%'))
</when>
<otherwise>
AND ${searchCondition} LIKE CONCAT('%',#{searchKeyword},'%')
</otherwise>
</choose>
</if>
ORDER BY id DESC
LIMIT #{recordCountPerPage} OFFSET #{firstIndex}
</select>

View File

@ -7,20 +7,19 @@
SELECT
log_date AS logDate,
req_area AS reqArea,
-- content,
a.userid,
b.name,
b.company
FROM
map_use_history a JOIN t_user b ON a.userid=b.userid
WHERE 1 = 1
WHERE 1 = '1'
<if test='searchKeyword != null and searchKeyword != ""'>
<choose>
<when test='searchCondition eq "all"'>
AND (content LIKE CONCAT('%',#{searchKeyword},'%')
OR b.name LIKE CONCAT('%',#{searchKeyword},'%')
AND (b.name LIKE CONCAT('%',#{searchKeyword},'%')
OR b.company LIKE CONCAT('%',#{searchKeyword},'%')
OR a.area LIKE CONCAT('%',#{searchKeyword},'%'))
OR a.req_area LIKE CONCAT('%',#{searchKeyword},'%'))
</when>
<otherwise>
AND ${searchCondition} LIKE CONCAT('%',#{searchKeyword},'%')
@ -40,10 +39,9 @@
<if test='searchKeyword != null and searchKeyword != ""'>
<choose>
<when test='searchCondition eq "all"'>
AND (content LIKE CONCAT('%',#{searchKeyword},'%')
OR b.name LIKE CONCAT('%',#{searchKeyword},'%')
OR b.company LIKE CONCAT('%',#{searchKeyword},'%'))
OR a.area LIKE CONCAT('%',#{searchKeyword},'%'))
AND (b.name LIKE CONCAT('%',#{searchKeyword},'%')
OR b.company LIKE CONCAT('%',#{searchKeyword},'%')
OR a.req_area LIKE CONCAT('%',#{searchKeyword},'%'))
</when>
<otherwise>
AND ${searchCondition} LIKE CONCAT('%',#{searchKeyword},'%')

View File

@ -42,10 +42,9 @@
<div class="search_keyword">
<select class="form-control search_selectbox" name="searchCondition">
<option <c:if test="${fieldDataSearchVO.searchCondition eq 'all'}"><c:out value="selected" /></c:if> value="all">통합검색</option>
<option <c:if test="${fieldDataSearchVO.searchCondition eq 'content'}"><c:out value="selected" /></c:if> value="content">작업내용</option>
<option <c:if test="${fieldDataSearchVO.searchCondition eq 'name'}"><c:out value="selected" /></c:if> value="name">이름</option>
<option <c:if test="${fieldDataSearchVO.searchCondition eq 'company'}"><c:out value="selected" /></c:if> value="company">소속</option>
<option <c:if test="${fieldDataSearchVO.searchCondition eq 'area'}"><c:out value="selected" /></c:if> value="area">위치</option>
<option <c:if test="${fieldDataSearchVO.searchCondition eq 'region'}"><c:out value="selected" /></c:if> value="region">위치</option>
</select>
<input type="text" class="form-control search_inputbox" name="searchKeyword" value="<c:out value="${fieldDataSearchVO.searchKeyword}" />" />
<input class="btn btn-default" type="submit" value="검색" />
@ -90,12 +89,16 @@
</c:if>
</tbody>
</table>
<div id="paging" style="width: 100%;">
<ui:pagination paginationInfo="${paginationInfo}" type="image" jsFunction="fn_link_page" />
<form:hidden path="pageIndex" />
<div class="text-center">
<nav aria-label="Page navigation">
<ul class="pagination">
<ui:pagination paginationInfo="${paginationInfo}" type="image" jsFunction="fn_link_page" />
<form:hidden path="pageIndex" />
</form:form>
</ul>
</nav>
</div>
</form:form>
</div>
</section>
</body>

View File

@ -20,6 +20,13 @@
<link href="<c:out value="/css/style.css" />" rel="stylesheet">
</head>
<script>
function fn_link_page(pageNo) {
document.searchForm.pageIndex.value = pageNo;
document.searchForm.action = "<c:url value='/admin/history' />";
document.searchForm.submit();
}
</script>
<body>
<%@ include file="../include/header.jsp"%>
@ -34,10 +41,9 @@
<div class="search_keyword">
<select class="form-control search_selectbox" name="searchCondition">
<option <c:if test="${UseHistorySearchVO.searchCondition eq 'all'}"><c:out value="selected" /></c:if> value="all">통합검색</option>
<option <c:if test="${UseHistorySearchVO.searchCondition eq 'content'}"><c:out value="selected" /></c:if> value="content">작업내용</option>
<option <c:if test="${UseHistorySearchVO.searchCondition eq 'name'}"><c:out value="selected" /></c:if> value="name">이름</option>
<option <c:if test="${UseHistorySearchVO.searchCondition eq 'company'}"><c:out value="selected" /></c:if> value="company">소속</option>
<option <c:if test="${UseHistorySearchVO.searchCondition eq 'area'}"><c:out value="selected" /></c:if> value="area">위치</option>
<option <c:if test="${UseHistorySearchVO.searchCondition eq 'req_area'}"><c:out value="selected" /></c:if> value="req_area">위치</option>
</select>
<input type="text" class="form-control search_inputbox" name="searchKeyword" value="<c:out value='${UseHistorySearchVO.searchKeyword}' />" />
<input class="btn btn-default" type="submit" value="검색" />
@ -50,7 +56,6 @@
<tr><th colspan="5">지도사용 이력</th></tr>
<tr>
<th>위치</th>
<th>작업내용</th>
<th>소속</th>
<th>담당자</th>
<th>날짜</th>
@ -61,7 +66,6 @@
<c:forEach var="item" items="${useHistoryList}">
<tr>
<td><c:out value="${item.reqArea}" /></td>
<td><%--<c:out value="${item.content}" />--%></td>
<td><c:out value="${item.company}" /></td>
<td><c:out value="${item.name}" /></td>
<td class="td_date"><c:out value="${item.logDate}" /></td>
@ -73,12 +77,16 @@
</c:if>
</tbody>
</table>
<div id="paging" style="width: 100%;">
<div class="text-center">
<nav aria-label="Page navigation">
<ul class="pagination">
<ui:pagination paginationInfo="${paginationInfo}" type="image" jsFunction="fn_link_page" />
<form:hidden path="pageIndex" />
</div>
</form:form>
</form:form>
</ul>
</nav>
</div>
</div>
</section>
</body>

View File

@ -28,79 +28,84 @@
<body>
<%@ include file="../include/header.jsp"%>
<section class="section">
<div class="section_content">
<form:form commandName="useRequestSearchVO" name="searchForm" action="/admin/request" method="get">
<input type="hidden" name="status" value="<c:out value="${useRequestSearchVO.status}" />" />
<div class="search_div">
<div class="search_menu">
<ul class="nav nav-pills" role="tablist">
<li role="presentation" <c:if test="${empty useRequestSearchVO.status}">class="active"</c:if>><a href="/admin/request">전체</a></li>
<li role="presentation" <c:if test="${useRequestSearchVO.status eq '0'}">class="active"</c:if>><a href="/admin/request?status=0">승인</a></li>
<li role="presentation" <c:if test="${useRequestSearchVO.status eq '-1'}">class="active"</c:if>><a href="/admin/request?status=-1">반려</a></li>
<li role="presentation" <c:if test="${useRequestSearchVO.status eq '99'}">class="active"</c:if>><a href="/admin/request?status=99">승인대기<span class="badge"><c:out value="${statusCnt}" /></span></a></li>
</ul>
</div>
<div class="search_keyword">
<select class="form-control search_selectbox" name="searchCondition">
<option <c:if test="${useRequestSearchVO.searchCondition eq 'all'}"><c:out value="selected" /></c:if> value="all">통합검색</option>
<option <c:if test="${useRequestSearchVO.searchCondition eq 'title'}"><c:out value="selected" /></c:if> value="title">작업명</option>
<option <c:if test="${useRequestSearchVO.searchCondition eq 'name'}"><c:out value="selected" /></c:if> value="name">이름</option>
<option <c:if test="${useRequestSearchVO.searchCondition eq 'company'}"><c:out value="selected" /></c:if> value="company">소속</option>
</select>
<input type="text" class="form-control search_inputbox" name="searchKeyword" value="<c:out value='${useRequestSearchVO.searchKeyword}' />" />
<input class="btn btn-default" type="submit" value="검색" />
</div>
</div>
<table class="list-table">
<thead>
<tr><th colspan="6">지도사용 요청</th></tr>
<tr>
<th>번호</th>
<th>작업명</th>
<th>소속</th>
<th>담당자</th>
<th>날짜</th>
<th>상태</th>
</tr>
</thead>
<tbody>
<c:if test="${count >= 1}">
<c:forEach var="item" items="${useRequestList}" varStatus="idx">
<tr>
<td><c:out value="${item.idx}" /></td>
<td class="title-td"><a href="/admin/request/<c:out value='${item.idx}' />"><c:out value="${item.title}" /></a></td>
<td><c:out value="${item.company}" /></td>
<td><c:out value="${item.name}" /></td>
<td class="td_date"><c:out value="${item.r_date}" /></td>
<td>
<c:choose>
<c:when test="${item.status eq '99'}"><span class="label label-warning"><c:out value='승인대기' /></span></c:when>
<c:when test="${item.status eq '0'}"><span class="label label-success"><c:out value='승인' /></span></c:when>
<c:when test="${item.status eq '-1'}"><span class="label label-default"><c:out value='반려' /></span></c:when>
</c:choose>
</td>
</tr>
</c:forEach>
</c:if>
<c:if test="${count == 0}">
<tr><td colspan="6">요청한 목록이 없습니다.</td></tr>
</c:if>
</tbody>
</table>
<div class="text-center">
<nav aria-label="Page navigation">
<ul class="pagination">
<ui:pagination paginationInfo="${paginationInfo}" type="image" jsFunction="fn_link_page" />
<form:hidden path="pageIndex" />
</form:form>
</ul>
</nav>
</div>
</div>
<div class="section_title">
<!-- <p>현장 지원 시스템</p> -->
</div>
<div class="section_content">
<form:form commandName="useRequestSearchVO" name="searchForm" action="/admin/request" method="get">
<input type="hidden" name="status" value="<c:out value="${useRequestSearchVO.status}" />" />
<div class="search_div">
<div class="search_menu">
<ul class="nav nav-pills" role="tablist">
<li role="presentation" <c:if test="${empty useRequestSearchVO.status}">class="active"</c:if>><a href="/admin/request">전체</a></li>
<li role="presentation" <c:if test="${useRequestSearchVO.status eq '0'}">class="active"</c:if>><a href="/admin/request?status=0">승인</a></li>
<li role="presentation" <c:if test="${useRequestSearchVO.status eq '-1'}">class="active"</c:if>><a href="/admin/request?status=-1">반려</a></li>
<li role="presentation" <c:if test="${useRequestSearchVO.status eq '99'}">class="active"</c:if>><a href="/admin/request?status=99">승인대기<span class="badge"><c:out value="${statusCnt}" /></span></a></li>
</ul>
</div>
<div class="search_keyword">
<select class="form-control search_selectbox" name="searchCondition">
<option <c:if test="${useRequestSearchVO.searchCondition eq 'all'}"><c:out value="selected" /></c:if> value="all">통합검색</option>
<option <c:if test="${useRequestSearchVO.searchCondition eq 'title'}"><c:out value="selected" /></c:if> value="title">작업명</option>
<option <c:if test="${useRequestSearchVO.searchCondition eq 'name'}"><c:out value="selected" /></c:if> value="name">이름</option>
<option <c:if test="${useRequestSearchVO.searchCondition eq 'company'}"><c:out value="selected" /></c:if> value="company">소속</option>
</select>
<input type="text" class="form-control search_inputbox" name="searchKeyword" value="<c:out value='${useRequestSearchVO.searchKeyword}' />" />
<input class="btn btn-default" type="submit" value="검색" />
</div>
</div>
<table class="list-table">
<thead>
<tr><th colspan="6">지도사용 요청</th></tr>
<tr>
<th>번호</th>
<th>작업명</th>
<th>소속</th>
<th>담당자</th>
<th>날짜</th>
<th>상태</th>
</tr>
</thead>
<tbody>
<c:if test="${count >= 1}">
<c:forEach var="item" items="${useRequestList}" varStatus="idx">
<tr>
<td><c:out value="${item.idx}" /></td>
<td class="title-td"><a href="/admin/request/<c:out value='${item.idx}' />"><c:out value="${item.title}" /></a></td>
<td><c:out value="${item.company}" /></td>
<td><c:out value="${item.name}" /></td>
<td class="td_date"><c:out value="${item.r_date}" /></td>
<td>
<c:choose>
<c:when test="${item.status eq '99'}"><span class="label label-warning"><c:out value='승인대기' /></span></c:when>
<c:when test="${item.status eq '0'}"><span class="label label-success"><c:out value='승인' /></span></c:when>
<c:when test="${item.status eq '-1'}"><span class="label label-default"><c:out value='반려' /></span></c:when>
</c:choose>
</td>
</tr>
</c:forEach>
</c:if>
<c:if test="${count == 0}">
<tr><td colspan="6">요청한 목록이 없습니다.</td></tr>
</c:if>
</tbody>
</table>
<div id="paging" style="width: 100%;">
<ui:pagination paginationInfo="${paginationInfo}" type="image" jsFunction="fn_link_page" />
<form:hidden path="pageIndex" />
</div>
</form:form>
</div>
</section>
</body>
</html>

View File

@ -110,12 +110,16 @@
</c:if>
</tbody>
</table>
<div id="paging" style="width: 100%;">
<ui:pagination paginationInfo="${paginationInfo}" type="image" jsFunction="fn_link_page" />
<form:hidden path="pageIndex" />
<div class="text-center">
<nav aria-label="Page navigation">
<ul class="pagination">
<ui:pagination paginationInfo="${paginationInfo}" type="image" jsFunction="fn_link_page" />
<form:hidden path="pageIndex" />
</form:form>
</ul>
</nav>
</div>
</form:form>
<form:form commandName="userVO" id="updateFrm" method="post" action="/admin/userSign">
<input type="hidden" id="userid" name="userid" />