Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
site-project
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
site-project
Commits
67f7ef9c
Commit
67f7ef9c
authored
Mar 25, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息优化
parent
4640e7ae
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
4 deletions
+51
-4
cloud-site-service/src/main/java/com/yizhi/site/application/mapper/EventTrackMapper.java
+4
-0
cloud-site-service/src/main/resources/mapper/EventTrackMapper.xml
+47
-4
No files found.
cloud-site-service/src/main/java/com/yizhi/site/application/mapper/EventTrackMapper.java
View file @
67f7ef9c
...
...
@@ -21,6 +21,10 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> {
EventTrackDayNumVo
getTodayNum
(
@Param
(
"date"
)
String
date
);
EventTrackDayNumVo
getTodayNumByLogin
(
@Param
(
"date"
)
String
date
);
DayNumVo
getNumByLogin
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
);
DayNumVo
getNumByType
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"types"
)
List
<
Integer
>
types
);
DayNumVo
getTgNumByType
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
);
...
...
cloud-site-service/src/main/resources/mapper/EventTrackMapper.xml
View file @
67f7ef9c
...
...
@@ -15,6 +15,7 @@
case when e.type in (11,12,13) and DATE_SUB(DATE_FORMAT(e.create_time, '%Y-%m-%d'), INTERVAL -1 DAY) = #{date} then 1 else 0 end as admirePreNum
from event_track e where e.deleted =0) a
</select>
<select
id=
"queryNumByType"
resultType=
"com.yizhi.site.application.vo.site.EventTrackTypeNumVo"
>
select
e.type,e.sub_type as subType,count(1) as num from event_track e
...
...
@@ -99,10 +100,10 @@
DATE_SUB(DATE_FORMAT(e.create_time, '%Y-%m-%d'), INTERVAL -1 DAY) = #{dateString}
</if>
<if
test=
"date==2"
>
DATE_FORMAT(DATE_SUB(DATE_FORMAT(
now()
, '%Y-%m-%d'), INTERVAL 1 MONTH),'%Y-%m') = #{dateString}
DATE_FORMAT(DATE_SUB(DATE_FORMAT(
e.create_time
, '%Y-%m-%d'), INTERVAL 1 MONTH),'%Y-%m') = #{dateString}
</if>
<if
test=
"date==1"
>
DATE_FORMAT(DATE_SUB(DATE_FORMAT(
now()
, '%Y-%m-%d'), INTERVAL 1 YEAR),'%Y') = #{dateString}
DATE_FORMAT(DATE_SUB(DATE_FORMAT(
e.create_time
, '%Y-%m-%d'), INTERVAL 1 YEAR),'%Y') = #{dateString}
</if>
then 1 else
0 end as preNum from event_track e
...
...
@@ -140,10 +141,10 @@
DATE_SUB(DATE_FORMAT(e.create_time, '%Y-%m-%d'), INTERVAL -1 DAY) = #{dateString}
</if>
<if
test=
"date==2"
>
DATE_FORMAT(DATE_SUB(DATE_FORMAT(
now()
, '%Y-%m-%d'), INTERVAL 1 MONTH),'%Y-%m') = #{dateString}
DATE_FORMAT(DATE_SUB(DATE_FORMAT(
e.create_time
, '%Y-%m-%d'), INTERVAL 1 MONTH),'%Y-%m') = #{dateString}
</if>
<if
test=
"date==1"
>
DATE_FORMAT(DATE_SUB(DATE_FORMAT(
now()
, '%Y-%m-%d'), INTERVAL 1 YEAR),'%Y') = #{dateString}
DATE_FORMAT(DATE_SUB(DATE_FORMAT(
e.create_time
, '%Y-%m-%d'), INTERVAL 1 YEAR),'%Y') = #{dateString}
</if>
then 1 else
0 end as preNum from publication e
...
...
@@ -198,4 +199,45 @@
and state != 0
and DATE_FORMAT(create_time, '%Y') = #{year})
</select>
<select
id=
"getTodayNumByLogin"
resultType=
"com.yizhi.site.application.vo.site.EventTrackDayNumVo"
>
select sum(loginNum) loginNum,sum(loginPreNum) loginPreNum from (
SELECT count(distinct account_id) loginNum,0 loginPreNum FROM cloud_system.login_log where login_type =2
and DATE_FORMAT(login_date, '%Y-%m-%d') = #{date}
union all
SELECT 0 loginNum,count(distinct account_id) loginPreNum FROM cloud_system.login_log where login_type =2
and DATE_SUB(DATE_FORMAT(login_date, '%Y-%m-%d'), INTERVAL -1 DAY) = #{date}
) a
</select>
<select
id=
"getNumByLogin"
resultType=
"com.yizhi.site.application.vo.site.DayNumVo"
>
select sum(loginNum) num,sum(loginPreNum) preNum from (
SELECT count(distinct account_id) loginNum,0 loginPreNum FROM cloud_system.login_log where login_type =2
<if
test=
"date==4"
>
and WEEK(login_date) = WEEK(now()) and DATE_FORMAT(login_date, '%Y') = DATE_FORMAT(now(), '%Y')
</if>
<if
test=
"date==3"
>
and DATE_FORMAT(login_date, '%Y-%m-%d') = #{dateString}
</if>
<if
test=
"date==2"
>
and DATE_FORMAT(login_date, '%Y-%m') = #{dateString}
</if>
<if
test=
"date==1"
>
and DATE_FORMAT(login_date, '%Y') = #{dateString}
</if>
union all
SELECT 0 loginNum,count(distinct account_id) loginPreNum FROM cloud_system.login_log where login_type =2
and DATE_SUB(DATE_FORMAT(login_date, '%Y-%m-%d'), INTERVAL -1 DAY) = #{date}
<if
test=
"date==4"
>
and WEEK(login_date) = WEEK(DATE_SUB(DATE_FORMAT(now(), '%Y-%m-%d'), INTERVAL 7 DAY)) and DATE_FORMAT(login_date, '%Y') = #{dateString}
</if>
<if
test=
"date==3"
>
and DATE_SUB(DATE_FORMAT(login_date, '%Y-%m-%d'), INTERVAL -1 DAY) = #{dateString}
</if>
<if
test=
"date==2"
>
and DATE_FORMAT(DATE_SUB(DATE_FORMAT(login_date, '%Y-%m-%d'), INTERVAL 1 MONTH),'%Y-%m') = #{dateString}
</if>
<if
test=
"date==1"
>
and DATE_FORMAT(DATE_SUB(DATE_FORMAT(login_date, '%Y-%m-%d'), INTERVAL 1 YEAR),'%Y') = #{dateString}
</if>
) a
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment