대시보드 방문자수 바꾸기.
parent
f299c7209a
commit
425920e8e2
|
|
@ -94,17 +94,26 @@ 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));
|
||||
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));
|
||||
|
||||
|
||||
//일별 지도사용 수
|
||||
UseHistorySearchVO useHistorySearchVO = new UseHistorySearchVO();
|
||||
useHistorySearchVO.setSearchEndDate(searchVO.getSearchEndDate());
|
||||
useHistorySearchVO = new UseHistorySearchVO();
|
||||
useHistorySearchVO.setSearchEndDate(searchStartDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
useHistorySearchVO.setSearchStartDate(searchStartDate.minusDays(14).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
List<ChartVO> dayMapUseDataList = useHistoryService.selectDayMapUseData(useHistorySearchVO);
|
||||
model.addAttribute("dayMapUseDataList", dayMapUseDataList);
|
||||
|
|
|
|||
|
|
@ -15,4 +15,8 @@ public interface UseHistoryMapper {
|
|||
int selectUseHistoryCnt(UseHistorySearchVO useHistorySearchVO);
|
||||
|
||||
List<ChartVO> selectDayMapUseData(UseHistorySearchVO useHistorySearchVO);
|
||||
|
||||
|
||||
int selectUseVisit(UseHistorySearchVO useHistorySearchVO); // 방문자수
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ 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;
|
||||
|
|
@ -29,4 +30,12 @@ public class UseHistoryService {
|
|||
public List<ChartVO> selectDayMapUseData(UseHistorySearchVO useHistorySearchVO) {
|
||||
return useHistoryMapper.selectDayMapUseData(useHistorySearchVO);
|
||||
}
|
||||
|
||||
// 방문자수.
|
||||
public int selectUseVisit(UseHistorySearchVO useHistorySearchVO) {
|
||||
return useHistoryMapper.selectUseVisit(useHistorySearchVO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@ 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,18 @@
|
|||
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 <= CONCAT(#{searchEndDate}, ' 23:59:59')
|
||||
</select>
|
||||
|
||||
<select id="selectUseHistoryCnt" resultType="int" >
|
||||
SELECT
|
||||
COUNT(*)
|
||||
|
|
|
|||
|
|
@ -68,8 +68,9 @@
|
|||
</div>
|
||||
<div class="col-auto">
|
||||
<p class="mb-0 text-black-50">오늘 방문자 수</p>
|
||||
<h3><c:out value="${dayLoginCount}"/></h3>
|
||||
<h3><c:out value="${userVisitDay}"/></h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card my-2">
|
||||
|
|
@ -79,7 +80,7 @@
|
|||
</div>
|
||||
<div class="col-auto">
|
||||
<p class="mb-0 text-black-50">최근 한달 방문자 수</p>
|
||||
<h3><c:out value="${monthLoginCount}"/></h3>
|
||||
<h3><c:out value="${userVisitMonth}"/></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
<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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue