🐛 流量/文章发布量统计问题修复

This commit is contained in:
ronger 2020-08-26 10:24:37 +08:00
parent 9589d7010f
commit 5013a9a3c1

View File

@ -9,26 +9,23 @@
select count(*) from vertical_user select count(*) from vertical_user
</select> </select>
<select id="selectNewUserCount" resultType="java.lang.Integer"> <select id="selectNewUserCount" resultType="java.lang.Integer">
select count(*) from vertical_user where created_time between date_sub(sysdate(),interval 1 day) select count(*) from vertical_user where created_time > str_to_date(date_format(sysdate(),'%Y-%m-%d'),'%Y-%m-%d')
and date_sub(sysdate(),interval - 1 day)
</select> </select>
<select id="selectArticleCount" resultType="java.lang.Integer"> <select id="selectArticleCount" resultType="java.lang.Integer">
select count(*) from vertical_article select count(*) from vertical_article
</select> </select>
<select id="selectNewArticleCount" resultType="java.lang.Integer"> <select id="selectNewArticleCount" resultType="java.lang.Integer">
select count(*) from vertical_article where created_time between date_sub(sysdate(),interval 1 day) select count(*) from vertical_article where created_time > str_to_date(date_format(sysdate(),'%Y-%m-%d'),'%Y-%m-%d') and article_status = 0
and date_sub(sysdate(),interval - 1 day)
</select> </select>
<select id="selectCountViewNum" resultType="java.lang.Integer"> <select id="selectCountViewNum" resultType="java.lang.Integer">
select count(*) from vertical_visit select count(*) from vertical_visit
</select> </select>
<select id="selectTodayViewNum" resultType="java.lang.Integer"> <select id="selectTodayViewNum" resultType="java.lang.Integer">
select count(*) from vertical_visit where created_time between str_to_date(date_format(sysdate(),'%Y-%m-%d'),'%Y-%m-%d') select count(*) from vertical_visit where created_time > str_to_date(date_format(sysdate(),'%Y-%m-%d'),'%Y-%m-%d')
and str_to_date(date_format(date_sub(sysdate(),interval - 1 day),'%Y-%m-%d'),'%Y-%m-%d')
</select> </select>
<select id="selectLastThirtyDaysArticleData" resultMap="DashboardDataResultMap"> <select id="selectLastThirtyDaysArticleData" resultMap="DashboardDataResultMap">
select COUNT(*) as value, date_format(created_time, '%Y-%m-%d') as label from vertical_article select COUNT(*) as value, date_format(created_time, '%Y-%m-%d') as label from vertical_article
where created_time > str_to_date(date_format(date_sub(sysdate(),interval + 30 day),'%Y-%m-%d'),'%Y-%m-%d') GROUP BY date_format(created_time, '%Y-%m-%d') where created_time > str_to_date(date_format(date_sub(sysdate(),interval + 30 day),'%Y-%m-%d'),'%Y-%m-%d') and article_status = 0 GROUP BY date_format(created_time, '%Y-%m-%d')
</select> </select>
<select id="selectLastThirtyDaysUserData" resultMap="DashboardDataResultMap"> <select id="selectLastThirtyDaysUserData" resultMap="DashboardDataResultMap">
select COUNT(*) as value, date_format(created_time, '%Y-%m-%d') as label from vertical_user select COUNT(*) as value, date_format(created_time, '%Y-%m-%d') as label from vertical_user
@ -40,7 +37,7 @@
</select> </select>
<select id="selectHistoryArticleData" resultMap="DashboardDataResultMap"> <select id="selectHistoryArticleData" resultMap="DashboardDataResultMap">
select COUNT(*) as value, date_format(created_time, '%Y-%m') as label from vertical_article select COUNT(*) as value, date_format(created_time, '%Y-%m') as label from vertical_article
where created_time > str_to_date(date_format(date_sub(sysdate(),interval + 1 year),'%Y-%m-%d'),'%Y-%m-%d') GROUP BY date_format(created_time, '%Y-%m') where created_time > str_to_date(date_format(date_sub(sysdate(),interval + 1 year),'%Y-%m-%d'),'%Y-%m-%d') and article_status = 0 GROUP BY date_format(created_time, '%Y-%m')
</select> </select>
<select id="selectHistoryUserData" resultMap="DashboardDataResultMap"> <select id="selectHistoryUserData" resultMap="DashboardDataResultMap">
select COUNT(*) as value, date_format(created_time, '%Y-%m') as label from vertical_user select COUNT(*) as value, date_format(created_time, '%Y-%m') as label from vertical_user