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
0fcfd98f
Commit
0fcfd98f
authored
Feb 20, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
投稿统计
parent
298a324a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
2 deletions
+45
-2
cloud-site-service/src/main/java/com/yizhi/site/application/mapper/EventTrackMapper.java
+1
-0
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/EventTrackServiceImpl.java
+6
-0
cloud-site-service/src/main/resources/mapper/EventTrackMapper.xml
+38
-2
No files found.
cloud-site-service/src/main/java/com/yizhi/site/application/mapper/EventTrackMapper.java
View file @
0fcfd98f
...
...
@@ -22,6 +22,7 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> {
EventTrackDayNumVo
getTodayNum
(
@Param
(
"date"
)
String
date
);
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
);
List
<
EventTrackTypeNumVo
>
queryNumByType
(
@Param
(
"deptId"
)
Long
deptId
,
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"types"
)
List
<
Integer
>
types
,
@Param
(
"subNameList"
)
List
<
String
>
subNameList
);
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/EventTrackServiceImpl.java
View file @
0fcfd98f
...
...
@@ -150,7 +150,13 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
if
(
ObjectUtils
.
isEmpty
(
date
)){
date
=
"3"
;
}
if
(
CollectionUtil
.
isEmpty
(
types
)){
return
new
DayNumVo
(){{
setNum
(
0
);
setPreNum
(
0
);}};
}
String
dateString
=
getDateString
(
date
);
if
(
Objects
.
equals
(
types
.
get
(
0
),
5
)){
return
this
.
baseMapper
.
getTgNumByType
(
date
,
dateString
);
}
return
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
);
}
...
...
cloud-site-service/src/main/resources/mapper/EventTrackMapper.xml
View file @
0fcfd98f
...
...
@@ -77,7 +77,7 @@
select ifnull(sum(num),0) as num,ifnull(sum(preNum),0) as preNum
from(
select
case when
e.type = 1 and
case when
<if
test=
"date==4"
>
WEEK(e.create_time) = WEEK(now()) and DATE_FORMAT(e.create_time, '%Y') = DATE_FORMAT(now(), '%Y')
</if>
...
...
@@ -91,7 +91,7 @@
DATE_FORMAT(e.create_time, '%Y') = #{dateString}
</if>
then 1 else 0 end as num,
case when
e.type = 1 and
case when
<if
test=
"date==4"
>
WEEK(e.create_time) = WEEK(DATE_SUB(DATE_FORMAT(now(), '%Y-%m-%d'), INTERVAL 7 DAY)) and DATE_FORMAT(e.create_time, '%Y') = #{dateString}
</if>
...
...
@@ -113,6 +113,42 @@
</if>
) a
</select>
<select
id=
"getTgNumByType"
resultType=
"com.yizhi.site.application.vo.site.DayNumVo"
>
select ifnull(sum(num),0) as num,ifnull(sum(preNum),0) as preNum
from(
select
case when
<if
test=
"date==4"
>
WEEK(e.create_time) = WEEK(now()) and DATE_FORMAT(e.create_time, '%Y') = DATE_FORMAT(now(), '%Y')
</if>
<if
test=
"date==3"
>
DATE_FORMAT(e.create_time, '%Y-%m-%d') = #{dateString}
</if>
<if
test=
"date==2"
>
DATE_FORMAT(e.create_time, '%Y-%m') = #{dateString}
</if>
<if
test=
"date==1"
>
DATE_FORMAT(e.create_time, '%Y') = #{dateString}
</if>
then 1 else 0 end as num,
case when
<if
test=
"date==4"
>
WEEK(e.create_time) = WEEK(DATE_SUB(DATE_FORMAT(now(), '%Y-%m-%d'), INTERVAL 7 DAY)) and DATE_FORMAT(e.create_time, '%Y') = #{dateString}
</if>
<if
test=
"date==3"
>
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}
</if>
<if
test=
"date==1"
>
DATE_FORMAT(DATE_SUB(DATE_FORMAT(now(), '%Y-%m-%d'), INTERVAL 1 YEAR),'%Y') = #{dateString}
</if>
then 1 else
0 end as preNum from publication e
) a
</select>
<select
id=
"getNum"
resultType=
"java.lang.Integer"
>
select count(1) from event_track e where e.deleted =0
and e.type=#{type} and e.business_id = #{businessId}
...
...
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