From 72655546081fbf12dde625ee5d8d3933a26a2f0c Mon Sep 17 00:00:00 2001 From: ronger Date: Wed, 15 Jan 2020 10:27:23 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=AE=8C=E5=96=84=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=8F=8A=E9=94=99=E8=AF=AF=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rymcu/vertical/dto/admin/Dashboard.java | 2 +- .../vertical/mapper/DashboardMapper.java | 22 +++++++++++++++++++ .../service/impl/DashboardServiceImpl.java | 5 ++--- src/main/java/mapper/DashboardMapper.xml | 7 ++++++ 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rymcu/vertical/dto/admin/Dashboard.java b/src/main/java/com/rymcu/vertical/dto/admin/Dashboard.java index d754087..4a9ba87 100644 --- a/src/main/java/com/rymcu/vertical/dto/admin/Dashboard.java +++ b/src/main/java/com/rymcu/vertical/dto/admin/Dashboard.java @@ -18,5 +18,5 @@ public class Dashboard { private Integer countViewNum; - private Integer toadyViewNum; + private Integer todayViewNum; } diff --git a/src/main/java/com/rymcu/vertical/mapper/DashboardMapper.java b/src/main/java/com/rymcu/vertical/mapper/DashboardMapper.java index 398afe9..c837d3f 100644 --- a/src/main/java/com/rymcu/vertical/mapper/DashboardMapper.java +++ b/src/main/java/com/rymcu/vertical/mapper/DashboardMapper.java @@ -1,5 +1,7 @@ package com.rymcu.vertical.mapper; +import org.apache.ibatis.annotations.Param; + /** * @author ronger */ @@ -16,7 +18,27 @@ public interface DashboardMapper { * */ Integer selectNewUserCount(); + /** + * 获取文章总数 + * @return + */ Integer selectArticleCount(); + /** + * 获取今日发布文章总数 + * @return + */ Integer selectNewArticleCount(); + + /** + * 获取浏览量总数 + * @return + */ + Integer selectCountViewNum(); + + /** + * 获取今日浏览总数 + * @return + */ + Integer selectTodayViewNum(); } diff --git a/src/main/java/com/rymcu/vertical/service/impl/DashboardServiceImpl.java b/src/main/java/com/rymcu/vertical/service/impl/DashboardServiceImpl.java index 985c64a..67921dd 100644 --- a/src/main/java/com/rymcu/vertical/service/impl/DashboardServiceImpl.java +++ b/src/main/java/com/rymcu/vertical/service/impl/DashboardServiceImpl.java @@ -23,9 +23,8 @@ public class DashboardServiceImpl implements DashboardService { dashboard.setNewUserNum(dashboardMapper.selectNewUserCount()); dashboard.setCountArticleNum(dashboardMapper.selectArticleCount()); dashboard.setNewArticleNum(dashboardMapper.selectNewArticleCount()); - // TODO 待完成浏览量统计 - dashboard.setCountViewNum(1000); - dashboard.setToadyViewNum(100); + dashboard.setCountViewNum(dashboardMapper.selectCountViewNum()); + dashboard.setTodayViewNum(dashboardMapper.selectTodayViewNum()); return dashboard; } } diff --git a/src/main/java/mapper/DashboardMapper.xml b/src/main/java/mapper/DashboardMapper.xml index 0802056..dfc50e5 100644 --- a/src/main/java/mapper/DashboardMapper.xml +++ b/src/main/java/mapper/DashboardMapper.xml @@ -15,4 +15,11 @@ select count(*) from vertical_article where created_time between date_sub(sysdate(),interval 1 day) and date_sub(sysdate(),interval - 1 day) + + \ No newline at end of file