Compare commits

..

No commits in common. "ee1f36f2637eb2fcca0f20f7bbf361ab61e344ca" and "0b037c1a75c927f0f11e20aaac1f498ca141888c" have entirely different histories.

7 changed files with 107 additions and 86 deletions

View File

@ -94,26 +94,17 @@ public class AdminController {
model.addAttribute("standFieldData", standFieldData);
// 일, 월 방문자 수
/*BaseSearchVO searchVO = new BaseSearchVO();
BaseSearchVO searchVO = new BaseSearchVO();
LocalDate searchStartDate = LocalDate.now();
searchVO.setSearchStartDate(searchStartDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
searchVO.setSearchEndDate(searchStartDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
model.addAttribute("dayLoginCount", logService.selectLoginCnt(searchVO));
searchVO.setSearchStartDate(searchStartDate.minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
model.addAttribute("monthLoginCount", logService.selectLoginCnt(searchVO));*/
UseHistorySearchVO useHistorySearchVO = new UseHistorySearchVO();
LocalDate searchStartDate = LocalDate.now();
useHistorySearchVO.setSearchStartDate(searchStartDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
useHistorySearchVO.setSearchEndDate(searchStartDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
model.addAttribute("userVisitDay", useHistoryService.selectUseVisit(useHistorySearchVO));
useHistorySearchVO.setSearchStartDate(searchStartDate.minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
model.addAttribute("userVisitMonth", useHistoryService.selectUseVisit(useHistorySearchVO));
model.addAttribute("monthLoginCount", logService.selectLoginCnt(searchVO));
//일별 지도사용 수
useHistorySearchVO = new UseHistorySearchVO();
useHistorySearchVO.setSearchEndDate(searchStartDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
UseHistorySearchVO useHistorySearchVO = new UseHistorySearchVO();
useHistorySearchVO.setSearchEndDate(searchVO.getSearchEndDate());
useHistorySearchVO.setSearchStartDate(searchStartDate.minusDays(14).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
List<ChartVO> dayMapUseDataList = useHistoryService.selectDayMapUseData(useHistorySearchVO);
model.addAttribute("dayMapUseDataList", dayMapUseDataList);

View File

@ -15,8 +15,4 @@ public interface UseHistoryMapper {
int selectUseHistoryCnt(UseHistorySearchVO useHistorySearchVO);
List<ChartVO> selectDayMapUseData(UseHistorySearchVO useHistorySearchVO);
int selectUseVisit(UseHistorySearchVO useHistorySearchVO); // 방문자수
}

View File

@ -4,7 +4,6 @@ import java.util.List;
import javax.annotation.Resource;
import com.mca.cmmn.vo.BaseSearchVO;
import com.mca.map.vo.ChartVO;
import org.springframework.stereotype.Service;
import com.mca.map.mapper.UseHistoryMapper;
@ -30,12 +29,4 @@ public class UseHistoryService {
public List<ChartVO> selectDayMapUseData(UseHistorySearchVO useHistorySearchVO) {
return useHistoryMapper.selectDayMapUseData(useHistorySearchVO);
}
// 방문자수.
public int selectUseVisit(UseHistorySearchVO useHistorySearchVO) {
return useHistoryMapper.selectUseVisit(useHistorySearchVO);
}
}

View File

@ -8,13 +8,6 @@ public class UseHistorySearchVO extends BaseSearchVO{
private String company;
private String area;
private int useVisit;
public int getUseVisit() {
return useVisit;
}
public void setUseVisit(int useVisit) { this.useVisit = useVisit; }
public String getUserid() {
return userid;
}

View File

@ -33,18 +33,6 @@
LIMIT #{recordCountPerPage} OFFSET #{firstIndex}
</select>
<!-- 방문자수-->
<select id="selectUseVisit" parameterType="useHistorySearchVO" resultType="int">
SELECT
COUNT(*)
FROM
map_use_history
WHERE
log_type = '0'
AND log_date >= CONCAT(#{searchStartDate}, ' 00:00:00')
AND log_date &lt;= CONCAT(#{searchEndDate}, ' 23:59:59')
</select>
<select id="selectUseHistoryCnt" resultType="int" >
SELECT
COUNT(*)

View File

@ -68,9 +68,8 @@
</div>
<div class="col-auto">
<p class="mb-0 text-black-50">오늘 방문자 수</p>
<h3><c:out value="${userVisitDay}"/></h3>
<h3><c:out value="${dayLoginCount}"/></h3>
</div>
</div>
</div>
<div class="card my-2">
@ -80,7 +79,7 @@
</div>
<div class="col-auto">
<p class="mb-0 text-black-50">최근 한달 방문자 수</p>
<h3><c:out value="${userVisitMonth}"/></h3>
<h3><c:out value="${monthLoginCount}"/></h3>
</div>
</div>
</div>

View File

@ -15,54 +15,117 @@
<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="col-auto row">
<div class="col-auto">
<select class="form-select" name="searchCondition">
<option value="all" ${UseHistorySearchVO.searchCondition eq 'all'?'selected':''}>통합검색</option>
<option value="name" ${UseHistorySearchVO.searchCondition eq 'name'?'selected':''}>이름</option>
<option value="company" ${UseHistorySearchVO.searchCondition eq 'company'?'selected':''}>소속</option>
<option value="req_area" ${UseHistorySearchVO.searchCondition eq 'req_area'?'selected':''}>위치</option>
</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 class="col-12 col-sm-4 row">
<div class="col-12 col-sm-4">
<select class="form-select" name="searchCondition">
<option value="all" ${UseHistorySearchVO.searchCondition eq 'all'?'selected':''}>통합검색</option>
<option value="name" ${UseHistorySearchVO.searchCondition eq 'name'?'selected':''}>이름</option>
<option value="company" ${UseHistorySearchVO.searchCondition eq 'company'?'selected':''}>소속</option>
<option value="req_area" ${UseHistorySearchVO.searchCondition eq 'req_area'?'selected':''}>위치</option>
</select>
</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 class="row m-3 p-2 bg-white">
<div class="col-12 d-none d-sm-block">
<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>
<th>위치</th>
<th>소속</th>
<th>담당자</th>
<th>날짜</th>
<td colspan="5">요청한 목록이 없습니다.</td>
</tr>
</thead>
<tbody>
</c:if>
</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:forEach var="item" items="${useHistoryList}">
<tr>
<td><c:out value="${item.reqArea}"/></td>
<td><c:out value="${useVisit}"/></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>
</tr>
</c:forEach>
<c:forEach var="item" items="${useHistoryList}">
<tr class="border-bottom">
<th class="bg-secondary" style="--bs-bg-opacity: .5">소속</th>
<td><c:out value="${item.company}"/></td>
</tr>
<tr class="border-bottom">
<th class="bg-secondary" style="--bs-bg-opacity: .5">담당자</th>
<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 test="${count == 0}">
<tr>
<td colspan="5">요청한 목록이 없습니다.</td>
</tr>
<tr>
<td colspan="5">요청한 목록이 없습니다.</td>
</tr>
</c:if>
</tbody>
</tbody>
</table>
</div>
</div>
<div class="text-page">
<form:hidden path="pageIndex"/></form:form>