🎨 完善统计功能及错误参数修改

This commit is contained in:
ronger 2020-01-15 10:27:23 +08:00
parent 44defa3aa9
commit 7265554608
4 changed files with 32 additions and 4 deletions

View File

@ -18,5 +18,5 @@ public class Dashboard {
private Integer countViewNum;
private Integer toadyViewNum;
private Integer todayViewNum;
}

View File

@ -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();
}

View File

@ -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;
}
}

View File

@ -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)
</select>
<select id="selectCountViewNum" resultType="java.lang.Integer">
select count(*) from vertical_visit
</select>
<select id="selectTodayViewNum" resultType="java.lang.Integer">
select count(*) from vertical_visit where created_time between date_sub(sysdate(),interval 1 day)
and date_sub(sysdate(),interval - 1 day)
</select>
</mapper>