지도사용이력 페이지

- 테이블에 동작 컬럼 추가.
 - 반응형 기능 추가.
master
강석 최 2022-03-15 16:04:14 +09:00
parent b5368216b4
commit 0d7c3a67a5
5 changed files with 152 additions and 67 deletions

View File

@ -3,11 +3,29 @@ package com.mca.map.vo;
public class UseHistoryVO { public class UseHistoryVO {
private String logDate; private String logDate;
private String reqArea; private String reqArea;
private int client_type;
private int log_type;
// private String content; // private String content;
private String userid; private String userid;
private String name; private String name;
private String company; private String company;
public int getClient_type() {
return client_type;
}
public void setClient_type(int client_type) {
this.client_type = client_type;
}
public int getLog_type() {
return log_type;
}
public void setLog_type(int log_type) {
this.log_type = log_type;
}
public String getLogDate() { public String getLogDate() {
return logDate; return logDate;
} }

View File

@ -6,26 +6,29 @@
<select id="selectUseHistoryList" parameterType="useHistorySearchVO" resultType="useHistoryVO" > <select id="selectUseHistoryList" parameterType="useHistorySearchVO" resultType="useHistoryVO" >
SELECT SELECT
log_date AS logDate, log_date AS logDate,
req_area AS reqArea, client_type,
a.userid, log_type,
b.name, req_area AS reqArea,
b.company a.userid,
b.name,
b.company
FROM FROM
map_use_history a JOIN t_user b ON a.userid=b.userid map_use_history a JOIN t_user b ON a.userid=b.userid
WHERE 1 = '1' <where>
<if test='searchKeyword != null and searchKeyword != ""'> <if test='searchKeyword != null and searchKeyword != ""'>
<choose> <choose>
<when test='searchCondition eq "all"'> <when test='searchCondition eq "all"'>
AND (b.name LIKE CONCAT('%',#{searchKeyword},'%') AND (b.name LIKE CONCAT('%',#{searchKeyword},'%')
OR b.company LIKE CONCAT('%',#{searchKeyword},'%') OR b.company LIKE CONCAT('%',#{searchKeyword},'%')
OR a.req_area LIKE CONCAT('%',#{searchKeyword},'%')) OR a.req_area LIKE CONCAT('%',#{searchKeyword},'%'))
</when> </when>
<otherwise> <otherwise>
AND ${searchCondition} LIKE CONCAT('%',#{searchKeyword},'%') AND ${searchCondition} LIKE CONCAT('%',#{searchKeyword},'%')
</otherwise> </otherwise>
</choose> </choose>
</if> </if>
</where>
ORDER BY log_date DESC ORDER BY log_date DESC
LIMIT #{recordCountPerPage} OFFSET #{firstIndex} LIMIT #{recordCountPerPage} OFFSET #{firstIndex}
</select> </select>
@ -35,19 +38,20 @@
COUNT(*) COUNT(*)
FROM FROM
map_use_history a JOIN t_user b ON a.userid=b.userid map_use_history a JOIN t_user b ON a.userid=b.userid
WHERE 1 = 1 <where>
<if test='searchKeyword != null and searchKeyword != ""'> <if test='searchKeyword != null and searchKeyword != ""'>
<choose> <choose>
<when test='searchCondition eq "all"'> <when test='searchCondition eq "all"'>
AND (b.name LIKE CONCAT('%',#{searchKeyword},'%') AND (b.name LIKE CONCAT('%',#{searchKeyword},'%')
OR b.company LIKE CONCAT('%',#{searchKeyword},'%') OR b.company LIKE CONCAT('%',#{searchKeyword},'%')
OR a.req_area LIKE CONCAT('%',#{searchKeyword},'%')) OR a.req_area LIKE CONCAT('%',#{searchKeyword},'%'))
</when> </when>
<otherwise> <otherwise>
AND ${searchCondition} LIKE CONCAT('%',#{searchKeyword},'%') AND ${searchCondition} LIKE CONCAT('%',#{searchKeyword},'%')
</otherwise> </otherwise>
</choose> </choose>
</if> </if>
</where>
</select> </select>
<select id="selectDayMapUseData" parameterType="useHistorySearchVO" resultType="ChartVO" > <select id="selectDayMapUseData" parameterType="useHistorySearchVO" resultType="ChartVO" >

View File

@ -196,8 +196,7 @@
</div> </div>
<div class="modal fade" id="fieldViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" <div class="modal fade" id="fieldViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="fieldViewModalLabel" aria-hidden="true">
aria-labelledby="fieldViewModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl"> <div class="modal-dialog modal-xl">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">

View File

@ -15,53 +15,117 @@
<form:form commandName="UseHistorySearchVO" name="searchForm" action="/admin/history" method="get"> <form:form commandName="UseHistorySearchVO" name="searchForm" action="/admin/history" method="get">
<div class="row justify-content-end bg-white mx-3 py-2"> <div class="row justify-content-end bg-white mx-3 py-2">
<div class="col-auto row"> <div class="col-12 col-sm-4 row">
<div class="col-auto"> <div class="col-12 col-sm-4">
<select class="form-select" name="searchCondition"> <select class="form-select" name="searchCondition">
<option value="all" ${UseHistorySearchVO.searchCondition eq 'all'?'selected':''}>통합검색</option> <option value="all" ${UseHistorySearchVO.searchCondition eq 'all'?'selected':''}>통합검색</option>
<option value="name" ${UseHistorySearchVO.searchCondition eq 'name'?'selected':''}>이름</option> <option value="name" ${UseHistorySearchVO.searchCondition eq 'name'?'selected':''}>이름</option>
<option value="company" ${UseHistorySearchVO.searchCondition eq 'company'?'selected':''}>소속</option> <option value="company" ${UseHistorySearchVO.searchCondition eq 'company'?'selected':''}>소속</option>
<option value="req_area" ${UseHistorySearchVO.searchCondition eq 'req_area'?'selected':''}>위치</option> <option value="req_area" ${UseHistorySearchVO.searchCondition eq 'req_area'?'selected':''}>위치</option>
</select> </select>
</div>
<div class="col-auto">
<input type="text" class="form-control" name="searchKeyword" value="${UseHistorySearchVO.searchKeyword}"/>
</div>
<div class="col-auto">
<input class="btn btn-outline-secondary" type="submit" value="검색"/>
</div>
</div> </div>
<div class="col-8 col-sm-5">
<input type="text" class="form-control" name="searchKeyword" value="${UseHistorySearchVO.searchKeyword}"/>
</div>
<div class="col-4 col-sm-3">
<input class="btn btn-outline-secondary w-100" type="submit" value="검색"/>
</div>
</div>
</div> </div>
<div class="row m-3 p-2 bg-white"> <div class="row m-3 p-2 bg-white">
<div class="col-12 d-none d-sm-block">
<table class="table table-hover text-center"> <table class="table table-hover text-center">
<thead> <thead>
<tr>
<th>소속</th>
<th>담당자</th>
<th>동작</th>
<th>위치</th>
<th>날짜</th>
</tr>
</thead>
<tbody>
<c:if test="${count >= 1}">
<c:forEach var="item" items="${useHistoryList}">
<tr>
<td><c:out value="${item.company}"/></td>
<td><c:out value="${item.name}"/></td>
<td>
<c:choose>
<c:when test="${item.log_type eq '0'}">
<span class="status-bar status-success w-50 mx-auto">로그인</span>
</c:when>
<c:when test="${item.log_type eq '1'}">
<span class="status-bar status-danger w-50 mx-auto">로그아웃</span>
</c:when>
<c:when test="${item.log_type eq '2'}">
<span class="status-bar status-warning w-50 mx-auto">지도사용</span>
</c:when>
</c:choose>
</td>
<td><c:out value="${item.reqArea}"/></td>
<td class="td_date"><c:out value="${item.logDate}"/></td>
</tr>
</c:forEach>
</c:if>
<c:if test="${count == 0}">
<tr> <tr>
<th>위치</th> <td colspan="5">요청한 목록이 없습니다.</td>
<th>소속</th>
<th>담당자</th>
<th>날짜</th>
</tr> </tr>
</thead> </c:if>
<tbody> </tbody>
</table>
</div>
<div class="col-12 d-block d-sm-none">
<table class="table table-hover text-center">
<tbody class="border-0 border-top border-bottom border-2 border-dark">
<c:if test="${count >= 1}"> <c:if test="${count >= 1}">
<c:forEach var="item" items="${useHistoryList}"> <c:forEach var="item" items="${useHistoryList}">
<tr> <tr class="border-bottom">
<td><c:out value="${item.reqArea}"/></td> <th class="bg-secondary" style="--bs-bg-opacity: .5">소속</th>
<td><c:out value="${item.company}"/></td> <td><c:out value="${item.company}"/></td>
<td><c:out value="${item.name}"/></td> </tr>
<td class="td_date"><c:out value="${item.logDate}"/></td> <tr class="border-bottom">
</tr> <th class="bg-secondary" style="--bs-bg-opacity: .5">담당자</th>
</c:forEach> <td><c:out value="${item.name}"/></td>
</tr>
<tr class="border-bottom">
<th class="bg-secondary" style="--bs-bg-opacity: .5">동작</th>
<td>
<c:choose>
<c:when test="${item.log_type eq '0'}">
<span class="status-bar status-success">로그인</span>
</c:when>
<c:when test="${item.log_type eq '1'}">
<span class="status-bar status-danger">로그아웃</span>
</c:when>
<c:when test="${item.log_type eq '2'}">
<span class="status-bar status-warning">지도사용</span>
</c:when>
</c:choose>
</td>
</tr>
<tr class="border-bottom">
<th class="bg-secondary" style="--bs-bg-opacity: .5">위치</th>
<td><c:out value="${item.reqArea}"/></td>
</tr>
<tr class="border-0 border-bottom border-2 border-dark">
<th class="bg-secondary" style="--bs-bg-opacity: .5">날짜</th>
<td class="td_date"><c:out value="${item.logDate}"/></td>
</tr>
</c:forEach>
</c:if> </c:if>
<c:if test="${count == 0}"> <c:if test="${count == 0}">
<tr> <tr>
<td colspan="5">요청한 목록이 없습니다.</td> <td colspan="5">요청한 목록이 없습니다.</td>
</tr> </tr>
</c:if> </c:if>
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
<div class="text-page"> <div class="text-page">
<form:hidden path="pageIndex"/></form:form> <form:hidden path="pageIndex"/></form:form>

View File

@ -4,7 +4,7 @@
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %> <%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<div class="row justify-content-between bg-white mx-3 py-2"> <div class="row justify-content-between bg-white py-2">
<form:form commandName="userVO" name="updateForm" id="updateForm" action="/admin/userUpdate" method="post"> <form:form commandName="userVO" name="updateForm" id="updateForm" action="/admin/userUpdate" method="post">
<div class="section_content"> <div class="section_content">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>