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
73f36cad
Commit
73f36cad
authored
Aug 24, 2025
by
梅存智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工作台优化
parent
2d76a7f8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
207 additions
and
14 deletions
+207
-14
cloud-site-api/src/main/java/com/yizhi/site/application/vo/site/DayNumVo.java
+5
-0
cloud-site-service/src/main/java/com/yizhi/site/application/mapper/EventTrackMapper.java
+8
-1
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/DataClassificationServiceImpl.java
+1
-0
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/EventTrackServiceImpl.java
+138
-6
cloud-site-service/src/main/resources/mapper/EventTrackMapper.xml
+55
-7
No files found.
cloud-site-api/src/main/java/com/yizhi/site/application/vo/site/DayNumVo.java
View file @
73f36cad
...
@@ -12,4 +12,9 @@ import lombok.Data;
...
@@ -12,4 +12,9 @@ import lombok.Data;
public
class
DayNumVo
{
public
class
DayNumVo
{
private
Integer
num
;
private
Integer
num
;
private
Integer
preNum
;
private
Integer
preNum
;
private
Integer
thirdNum
;
private
Integer
fourtNum
;
private
Integer
fifthNum
;
private
Integer
sixNum
;
private
Integer
seventhNum
;
}
}
cloud-site-service/src/main/java/com/yizhi/site/application/mapper/EventTrackMapper.java
View file @
73f36cad
...
@@ -6,9 +6,11 @@ import com.yizhi.site.application.vo.site.DayNumVo;
...
@@ -6,9 +6,11 @@ import com.yizhi.site.application.vo.site.DayNumVo;
import
com.yizhi.site.application.vo.site.EventTrackDayNumVo
;
import
com.yizhi.site.application.vo.site.EventTrackDayNumVo
;
import
com.yizhi.site.application.vo.site.EventTrackDeptNumVo
;
import
com.yizhi.site.application.vo.site.EventTrackDeptNumVo
;
import
com.yizhi.site.application.vo.site.EventTrackTypeNumVo
;
import
com.yizhi.site.application.vo.site.EventTrackTypeNumVo
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
...
@@ -25,11 +27,13 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> {
...
@@ -25,11 +27,13 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> {
DayNumVo
getNumByLogin
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"siteId"
)
Long
siteId
);
DayNumVo
getNumByLogin
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"siteId"
)
Long
siteId
);
DayNumVo
getNumByType
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"types"
)
List
<
Integer
>
types
,
@Param
(
"siteId"
)
Long
siteId
);
DayNumVo
getNumByType
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"types"
)
List
<
Integer
>
types
,
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"weekStartDate"
)
String
weekStartDate
,
@Param
(
"weekEndDate"
)
String
weekEndDate
);
DayNumVo
getTgNumByType
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"siteId"
)
Long
siteId
);
DayNumVo
getTgNumByType
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"siteId"
)
Long
siteId
);
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
,
@Param
(
"siteId"
)
Long
siteId
);
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
,
@Param
(
"siteId"
)
Long
siteId
);
List
<
EventTrackTypeNumVo
>
queryNumByTypeInformation
(
@Param
(
"deptId"
)
Long
deptId
,
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"types"
)
List
<
Integer
>
types
,
@Param
(
"subNameList"
)
List
<
String
>
subNameList
,
@Param
(
"siteId"
)
Long
siteId
);
List
<
EventTrackTypeNumVo
>
queryTgNumByDept
(
@Param
(
"deptName"
)
String
deptName
,
@Param
(
"typeId"
)
Long
typeId
,
@Param
(
"siteId"
)
Long
siteId
);
List
<
EventTrackTypeNumVo
>
queryTgNumByDept
(
@Param
(
"deptName"
)
String
deptName
,
@Param
(
"typeId"
)
Long
typeId
,
@Param
(
"siteId"
)
Long
siteId
);
List
<
EventTrackDeptNumVo
>
queryDeptByType
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"types"
)
List
<
Integer
>
types
,
@Param
(
"siteId"
)
Long
siteId
);
List
<
EventTrackDeptNumVo
>
queryDeptByType
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"types"
)
List
<
Integer
>
types
,
@Param
(
"siteId"
)
Long
siteId
);
...
@@ -49,4 +53,7 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> {
...
@@ -49,4 +53,7 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> {
Integer
getCommentNum
(
@Param
(
"businessId"
)
Long
businessId
,
@Param
(
"siteId"
)
Long
siteId
);
Integer
getCommentNum
(
@Param
(
"businessId"
)
Long
businessId
,
@Param
(
"siteId"
)
Long
siteId
);
DayNumVo
getMailTgNumByType
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"siteId"
)
Long
siteId
);
DayNumVo
getMailTgNumByType
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"siteId"
)
Long
siteId
);
@MapKey
(
"subType"
)
Map
<
String
,
EventTrackTypeNumVo
>
queryTrainningNumBydeptId
();
}
}
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/DataClassificationServiceImpl.java
View file @
73f36cad
...
@@ -63,6 +63,7 @@ public class DataClassificationServiceImpl extends ServiceImpl<DataClassificatio
...
@@ -63,6 +63,7 @@ public class DataClassificationServiceImpl extends ServiceImpl<DataClassificatio
public
List
<
DataClassification
>
getSon
(
Long
parentId
)
{
public
List
<
DataClassification
>
getSon
(
Long
parentId
)
{
DataClassification
data
=
new
DataClassification
();
DataClassification
data
=
new
DataClassification
();
data
.
setParentId
(
parentId
);
data
.
setParentId
(
parentId
);
data
.
setState
(
1
);
EntityWrapper
<
DataClassification
>
wrapper
=
new
EntityWrapper
<
DataClassification
>(
data
);
EntityWrapper
<
DataClassification
>
wrapper
=
new
EntityWrapper
<
DataClassification
>(
data
);
List
<
String
>
list
=
new
ArrayList
<
String
>();
List
<
String
>
list
=
new
ArrayList
<
String
>();
list
.
add
(
"sort"
);
list
.
add
(
"sort"
);
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/EventTrackServiceImpl.java
View file @
73f36cad
...
@@ -175,7 +175,120 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
...
@@ -175,7 +175,120 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
dayNumVo
.
setNum
(
this
.
baseMapper
.
getResearchJoinTotal
(
year
,
context
.
getSiteId
()));
dayNumVo
.
setNum
(
this
.
baseMapper
.
getResearchJoinTotal
(
year
,
context
.
getSiteId
()));
return
dayNumVo
;
return
dayNumVo
;
}
}
return
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
());
if
(
Objects
.
equals
(
types
.
get
(
0
),
1
)){
//月
if
(
date
.
equals
(
"2"
)){
DayNumVo
day7NumVo
=
new
DayNumVo
();
//查询本、上月
dateString
=
dateString
+
"-01 00:00:00"
;
DayNumVo
dayNumVo
=
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
(),
null
,
null
);
day7NumVo
.
setNum
(
dayNumVo
.
getNum
());
day7NumVo
.
setPreNum
(
dayNumVo
.
getPreNum
());
//查询第3、第4月
Date
curDate
=
DateUtil
.
parse
(
dateString
,
"yyyy-MM-dd"
);
curDate
=
DateUtil
.
getFirstDayOfMonth
(
DateUtil
.
addDay
(
curDate
,
-
1
));
curDate
=
DateUtil
.
getFirstDayOfMonth
(
DateUtil
.
addDay
(
curDate
,
-
1
));
dateString
=
DateUtil
.
format
(
curDate
,
"yyyy-MM-dd"
);
dayNumVo
=
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
(),
null
,
null
);
day7NumVo
.
setThirdNum
(
dayNumVo
.
getNum
());
day7NumVo
.
setFourtNum
(
dayNumVo
.
getPreNum
());
//查询第5、第6月
curDate
=
DateUtil
.
parse
(
dateString
,
"yyyy-MM-dd"
);
curDate
=
DateUtil
.
getFirstDayOfMonth
(
DateUtil
.
addDay
(
curDate
,
-
1
));
curDate
=
DateUtil
.
getFirstDayOfMonth
(
DateUtil
.
addDay
(
curDate
,
-
1
));
dateString
=
DateUtil
.
format
(
curDate
,
"yyyy-MM-dd"
);
dayNumVo
=
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
(),
null
,
null
);
day7NumVo
.
setFifthNum
(
dayNumVo
.
getNum
());
day7NumVo
.
setSixNum
(
dayNumVo
.
getPreNum
());
//查询第7月
curDate
=
DateUtil
.
parse
(
dateString
,
"yyyy-MM-dd"
);
curDate
=
DateUtil
.
getFirstDayOfMonth
(
DateUtil
.
addDay
(
curDate
,
-
1
));
curDate
=
DateUtil
.
getFirstDayOfMonth
(
DateUtil
.
addDay
(
curDate
,
-
1
));
dateString
=
DateUtil
.
format
(
curDate
,
"yyyy-MM-dd"
);
dayNumVo
=
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
(),
null
,
null
);
day7NumVo
.
setSeventhNum
(
dayNumVo
.
getNum
());
return
day7NumVo
;
}
//日
if
(
date
.
equals
(
"3"
)){
DayNumVo
day7NumVo
=
new
DayNumVo
();
//查询本、昨日
DayNumVo
dayNumVo
=
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
(),
null
,
null
);
day7NumVo
.
setNum
(
dayNumVo
.
getNum
());
day7NumVo
.
setPreNum
(
dayNumVo
.
getPreNum
());
//查询第3、第4日
Date
curDate
=
DateUtil
.
parse
(
dateString
,
"yyyy-MM-dd"
);
curDate
=
DateUtil
.
addDay
(
curDate
,
-
2
);
dateString
=
DateUtil
.
format
(
curDate
,
"yyyy-MM-dd"
);
dayNumVo
=
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
(),
null
,
null
);
day7NumVo
.
setThirdNum
(
dayNumVo
.
getNum
());
day7NumVo
.
setFourtNum
(
dayNumVo
.
getPreNum
());
//查询第5、第6日
curDate
=
DateUtil
.
addDay
(
curDate
,
-
2
);
dateString
=
DateUtil
.
format
(
curDate
,
"yyyy-MM-dd"
);
dayNumVo
=
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
(),
null
,
null
);
day7NumVo
.
setFifthNum
(
dayNumVo
.
getNum
());
day7NumVo
.
setSixNum
(
dayNumVo
.
getPreNum
());
//查询第7日
curDate
=
DateUtil
.
addDay
(
curDate
,
-
2
);
dateString
=
DateUtil
.
format
(
curDate
,
"yyyy-MM-dd"
);
dayNumVo
=
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
(),
null
,
null
);
day7NumVo
.
setSeventhNum
(
dayNumVo
.
getNum
());
return
day7NumVo
;
}
//周
if
(
date
.
equals
(
"4"
)){
DayNumVo
day7NumVo
=
new
DayNumVo
();
//查询本、上周
Date
curDate
=
new
Date
();
String
weekStartDate
=
DateUtil
.
format
(
DateUtil
.
getFirstDayOfWeek
(
curDate
),
"yyyy-MM-dd"
);
String
weekEndDate
=
DateUtil
.
format
(
curDate
,
"yyyy-MM-dd"
);
DayNumVo
dayNumVo
=
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
(),
weekStartDate
,
weekEndDate
);
day7NumVo
.
setNum
(
dayNumVo
.
getNum
());
day7NumVo
.
setPreNum
(
dayNumVo
.
getPreNum
());
//查询第3、第4周
curDate
=
DateUtil
.
addDay
(
DateUtil
.
getFirstDayOfWeek
(
DateUtil
.
parse
(
weekStartDate
+
" 00:00:00"
,
"yyyy-MM-dd HH:mm:ss"
)),
-
8
);
weekStartDate
=
DateUtil
.
format
(
DateUtil
.
getFirstDayOfWeek
(
curDate
),
"yyyy-MM-dd"
);
weekEndDate
=
DateUtil
.
format
(
curDate
,
"yyyy-MM-dd"
);
dayNumVo
=
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
(),
weekStartDate
,
weekEndDate
);
day7NumVo
.
setThirdNum
(
dayNumVo
.
getNum
());
day7NumVo
.
setFourtNum
(
dayNumVo
.
getPreNum
());
//查询第5、第6周
curDate
=
DateUtil
.
addDay
(
DateUtil
.
getFirstDayOfWeek
(
DateUtil
.
parse
(
weekStartDate
+
" 00:00:00"
,
"yyyy-MM-dd HH:mm:ss"
)),
-
8
);
weekStartDate
=
DateUtil
.
format
(
DateUtil
.
getFirstDayOfWeek
(
curDate
),
"yyyy-MM-dd"
);
weekEndDate
=
DateUtil
.
format
(
curDate
,
"yyyy-MM-dd"
);
dayNumVo
=
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
(),
weekStartDate
,
weekEndDate
);
day7NumVo
.
setFifthNum
(
dayNumVo
.
getNum
());
day7NumVo
.
setSixNum
(
dayNumVo
.
getPreNum
());
//查询第7周
curDate
=
DateUtil
.
addDay
(
DateUtil
.
getFirstDayOfWeek
(
DateUtil
.
parse
(
weekStartDate
+
" 00:00:00"
,
"yyyy-MM-dd HH:mm:ss"
)),
-
8
);
weekStartDate
=
DateUtil
.
format
(
DateUtil
.
getFirstDayOfWeek
(
curDate
),
"yyyy-MM-dd"
);
weekEndDate
=
DateUtil
.
format
(
curDate
,
"yyyy-MM-dd"
);
dayNumVo
=
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
(),
weekStartDate
,
weekEndDate
);
day7NumVo
.
setSeventhNum
(
dayNumVo
.
getNum
());
return
day7NumVo
;
}
//年
return
this
.
baseMapper
.
getNumByType
(
date
,
dateString
,
types
,
context
.
getSiteId
(),
null
,
null
);
}
return
null
;
}
}
@Override
@Override
...
@@ -204,19 +317,27 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
...
@@ -204,19 +317,27 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
subNameList
=
classificationList
.
stream
().
map
(
DataClassification:
:
getName
).
collect
(
Collectors
.
toList
());
subNameList
=
classificationList
.
stream
().
map
(
DataClassification:
:
getName
).
collect
(
Collectors
.
toList
());
}
}
}
}
List
<
EventTrackTypeNumVo
>
eventTrackTypeNumVoList
=
this
.
baseMapper
.
queryNumByType
(
null
,
date
,
dateString
,
types
,
subNameList
,
context
.
getSiteId
());
List
<
EventTrackTypeNumVo
>
eventTrackTypeNumVoList
=
null
;
//判断是否获取阅读量
if
(
types
.
get
(
0
).
equals
(
6
)){
//阅读量
eventTrackTypeNumVoList
=
this
.
baseMapper
.
queryNumByTypeInformation
(
null
,
date
,
dateString
,
types
,
subNameList
,
context
.
getSiteId
());
}
else
{
eventTrackTypeNumVoList
=
this
.
baseMapper
.
queryNumByType
(
null
,
date
,
dateString
,
types
,
subNameList
,
context
.
getSiteId
());
}
if
(
CollectionUtil
.
isNotEmpty
(
subNameList
)){
if
(
CollectionUtil
.
isNotEmpty
(
subNameList
)){
List
<
EventTrackTypeNumVo
>
finalEventTrackTypeNumVoList
=
eventTrackTypeNumVoList
;
subNameList
.
stream
().
forEach
(
name
->{
subNameList
.
stream
().
forEach
(
name
->{
EventTrackTypeNumVo
eventTrackTypeNumVo
=
new
EventTrackTypeNumVo
();
EventTrackTypeNumVo
eventTrackTypeNumVo
=
new
EventTrackTypeNumVo
();
eventTrackTypeNumVo
.
setNum
(
0
);
eventTrackTypeNumVo
.
setNum
(
0
);
eventTrackTypeNumVo
.
setSubType
(
name
);
eventTrackTypeNumVo
.
setSubType
(
name
);
if
(
CollectionUtil
.
isNotEmpty
(
e
ventTrackTypeNumVoList
)){
if
(
CollectionUtil
.
isNotEmpty
(
finalE
ventTrackTypeNumVoList
)){
Optional
optional
=
e
ventTrackTypeNumVoList
.
stream
().
filter
(
e
->
Objects
.
equals
(
e
.
getSubType
(),
name
)).
findFirst
();
Optional
optional
=
finalE
ventTrackTypeNumVoList
.
stream
().
filter
(
e
->
Objects
.
equals
(
e
.
getSubType
(),
name
)).
findFirst
();
if
(
optional
==
null
||!
optional
.
isPresent
()){
if
(
optional
==
null
||!
optional
.
isPresent
()){
e
ventTrackTypeNumVoList
.
add
(
eventTrackTypeNumVo
);
finalE
ventTrackTypeNumVoList
.
add
(
eventTrackTypeNumVo
);
}
}
}
else
{
}
else
{
e
ventTrackTypeNumVoList
.
add
(
eventTrackTypeNumVo
);
finalE
ventTrackTypeNumVoList
.
add
(
eventTrackTypeNumVo
);
}
}
});
});
}
}
...
@@ -296,6 +417,17 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
...
@@ -296,6 +417,17 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
});
});
}
}
//统计参加活动
Map
<
String
,
EventTrackTypeNumVo
>
trainningNum
=
this
.
baseMapper
.
queryTrainningNumBydeptId
();
for
(
EventTrackDeptNumVo
item
:
eventTrackDeptNumVoList
){
EventTrackTypeNumVo
eventTrackTypeNumVo
=
new
EventTrackTypeNumVo
();
eventTrackTypeNumVo
.
setSubType
(
"发起次数"
);
eventTrackTypeNumVo
.
setType
(
99
);
eventTrackTypeNumVo
.
setNum
(
trainningNum
.
get
(
item
.
getDeptId
().
toString
()).
getNum
()
==
null
?
0
:
trainningNum
.
get
(
item
.
getDeptId
().
toString
()).
getNum
());
item
.
getEventTrackTypeNumVoList
().
add
(
eventTrackTypeNumVo
);
}
return
eventTrackDeptNumVoList
;
return
eventTrackDeptNumVoList
;
}
}
...
...
cloud-site-service/src/main/resources/mapper/EventTrackMapper.xml
View file @
73f36cad
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<select
id=
"queryNumByType"
resultType=
"com.yizhi.site.application.vo.site.EventTrackTypeNumVo"
>
<select
id=
"queryNumByType"
resultType=
"com.yizhi.site.application.vo.site.EventTrackTypeNumVo"
>
select
select
e.type,e.sub_type as subType,count(t.id) as num
e.type,e.sub_type as subType,count(t.id) as num
from event_track e
from event_track e
LEFT JOIN event_track t ON e.id=t.id
LEFT JOIN event_track t ON e.id=t.id
<if
test=
"date==4"
>
<if
test=
"date==4"
>
...
@@ -85,13 +85,13 @@
...
@@ -85,13 +85,13 @@
select
select
case when
case when
<if
test=
"date==4"
>
<if
test=
"date==4"
>
WEEK(e.create_time) = WEEK(now()) and DATE_FORMAT(e.create_time, '%Y') = DATE_FORMAT(now(), '%Y
')
DATE_FORMAT(e.create_time, '%Y-%m-%d') >=DATE_FORMAT(#{weekStartDate}, '%Y-%m-%d') AND DATE_FORMAT(e.create_time, '%Y-%m-%d')
<![CDATA[ <= ]]>
DATE_FORMAT(#{weekEndDate}, '%Y-%m-%d
')
</if>
</if>
<if
test=
"date==3"
>
<if
test=
"date==3"
>
DATE_FORMAT(e.create_time, '%Y-%m-%d') = #{dateString}
DATE_FORMAT(e.create_time, '%Y-%m-%d') = #{dateString}
</if>
</if>
<if
test=
"date==2"
>
<if
test=
"date==2"
>
DATE_FORMAT(e.create_time, '%Y-%m') =
#{dateString}
DATE_FORMAT(e.create_time, '%Y-%m') =
DATE_FORMAT(#{dateString}, '%Y-%m')
</if>
</if>
<if
test=
"date==1"
>
<if
test=
"date==1"
>
DATE_FORMAT(e.create_time, '%Y') = #{dateString}
DATE_FORMAT(e.create_time, '%Y') = #{dateString}
...
@@ -99,16 +99,16 @@
...
@@ -99,16 +99,16 @@
then 1 else 0 end as num,
then 1 else 0 end as num,
case when
case when
<if
test=
"date==4"
>
<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}
DATE_FORMAT(e.create_time, '%Y-%m-%d') >= DATE_SUB(DATE_FORMAT(#{weekStartDate}, '%Y-%m-%d'), INTERVAL 7 DAY) AND DATE_FORMAT(e.create_time, '%Y-%m-%d')
<![CDATA[ <= ]]>
DATE_SUB(DATE_FORMAT(#{weekStartDate}, '%Y-%m-%d'), INTERVAL 1 DAY)
</if>
</if>
<if
test=
"date==3"
>
<if
test=
"date==3"
>
DATE_
SUB(DATE_FORMAT(e.create_time, '%Y-%m-%d'), INTERVAL -1 DAY) = #{dateString}
DATE_
FORMAT(e.create_time, '%Y-%m-%d') = DATE_SUB(DATE_FORMAT(#{dateString}, '%Y-%m-%d'), INTERVAL 1 DAY)
</if>
</if>
<if
test=
"date==2"
>
<if
test=
"date==2"
>
DATE_FORMAT(
DATE_SUB(DATE_FORMAT(e.create_time, '%Y-%m-%d'), INTERVAL 1 MONTH),'%Y-%m') = #{dateString}
DATE_FORMAT(
e.create_time, '%Y-%m') = DATE_FORMAT(DATE_SUB(DATE_FORMAT(#{dateString}, '%Y-%m-%d'), INTERVAL 1 MONTH),'%Y-%m')
</if>
</if>
<if
test=
"date==1"
>
<if
test=
"date==1"
>
DATE_FORMAT(
DATE_SUB(DATE_FORMAT(e.create_time, '%Y-%m-%d'), INTERVAL 1 YEAR),'%Y') = #{dateString}
DATE_FORMAT(
e.create_time, '%Y') = DATE_FORMAT(DATE_SUB(DATE_FORMAT(#{dateString}, '%Y-%m-%d'), INTERVAL 1 YEAR),'%Y')
</if>
</if>
then 1 else
then 1 else
0 end as preNum from event_track e
0 end as preNum from event_track e
...
@@ -302,4 +302,51 @@
...
@@ -302,4 +302,51 @@
where e.site_id = #{siteId} and e.state=4 and e.deleted=0
where e.site_id = #{siteId} and e.state=4 and e.deleted=0
) a
) a
</select>
</select>
<select
id=
"queryNumByTypeInformation"
resultType=
"com.yizhi.site.application.vo.site.EventTrackTypeNumVo"
>
select
e.type,e.remark1 as subType,count(t.id) as num
from event_track e
LEFT JOIN event_track t ON e.id=t.id
<if
test=
"date==4"
>
and WEEK(e.create_time) = WEEK(now()) and DATE_FORMAT(e.create_time, '%Y') = DATE_FORMAT(now(), '%Y')
</if>
<if
test=
"date==3"
>
and DATE_FORMAT(e.create_time, '%Y-%m-%d') = #{dateString}
</if>
<if
test=
"date==2"
>
and DATE_FORMAT(e.create_time, '%Y-%m') = #{dateString}
</if>
<if
test=
"date==1"
>
and DATE_FORMAT(e.create_time, '%Y') = #{dateString}
</if>
where e.deleted =0
and e.dept_id in (SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
<if
test=
"types!=null and types.size()>0"
>
AND e.type IN
<foreach
collection=
"types"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"subNameList!=null and subNameList.size()>0"
>
AND e.remark1 IN
<foreach
collection=
"subNameList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"deptId!=null"
>
and e.dept_id = #{deptId}
</if>
AND e.remark1 IS NOT NULL
group by e.type,e.remark1
order by e.type
</select>
<select
id=
"queryTrainningNumBydeptId"
resultType=
"com.yizhi.site.application.vo.site.EventTrackTypeNumVo"
>
SELECT agm.group_id AS subType,count(DISTINCT tvr.account_id) AS num
FROM cloud_trainning_project.tp_view_record tvr
INNER JOIN cloud_system.authz_group_member agm ON agm.member_id=tvr.org_id AND agm.deleted = 0
GROUP BY agm.group_id
</select>
</mapper>
</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