Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
map-parent
Commits
3e32ec29
Commit
3e32ec29
authored
Aug 26, 2022
by
宋珺琪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加各个模块的统计计数接口
parent
a9ed9df6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
1 deletions
+64
-1
common/service_base/src/main/java/com/founder/servicebase/logs/LogMoudleCount.java
+24
-0
common/service_base/src/main/java/com/founder/servicebase/logs/controller/SkSysLogController.java
+16
-0
common/service_base/src/main/java/com/founder/servicebase/logs/mapper/mysqlMapper/SkSysLogMapper.java
+3
-0
common/service_base/src/main/java/com/founder/servicebase/logs/mapper/mysqlMapper/SkSysLogMapper.xml
+13
-1
common/service_base/src/main/java/com/founder/servicebase/logs/service/SkSysLogService.java
+3
-0
common/service_base/src/main/java/com/founder/servicebase/logs/service/impl/SkSysLogServiceImpl.java
+5
-0
No files found.
common/service_base/src/main/java/com/founder/servicebase/logs/LogMoudleCount.java
0 → 100644
View file @
3e32ec29
package
com
.
founder
.
servicebase
.
logs
;
import
lombok.Data
;
@Data
public
class
LogMoudleCount
{
/**
* 计数
*/
private
Integer
count
;
/**
* 模块名称
*/
private
String
moudle
;
public
LogMoudleCount
()
{
}
public
LogMoudleCount
(
Integer
count
,
String
moudle
)
{
this
.
count
=
count
;
this
.
moudle
=
moudle
;
}
}
common/service_base/src/main/java/com/founder/servicebase/logs/controller/SkSysLogController.java
View file @
3e32ec29
...
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.founder.commonutils.model.newPublicEntity.MapRestResult
;
import
com.founder.commonutils.util.DateUtil
;
import
com.founder.commonutils.util.StringUtil
;
import
com.founder.servicebase.logs.LogMoudleCount
;
import
com.founder.servicebase.logs.SkSysLog
;
import
com.founder.servicebase.logs.param.LogCountParam
;
import
com.founder.servicebase.logs.param.LogParam
;
...
...
@@ -82,4 +83,19 @@ public class SkSysLogController {
return
new
MapRestResult
(
service
.
countTotal
(
param
));
}
/**
* 各个模块接口的统计计数
* @param param
* @return
* @throws ParseException
*/
@PostMapping
(
"countMoudle"
)
public
MapRestResult
countMoudle
(
@RequestBody
LogCountParam
param
)
throws
ParseException
{
List
<
LogMoudleCount
>
logMoudleCounts
=
service
.
countMoudle
(
param
);
return
new
MapRestResult
(
200
,
"ok"
,
logMoudleCounts
.
size
(),
logMoudleCounts
);
}
}
common/service_base/src/main/java/com/founder/servicebase/logs/mapper/mysqlMapper/SkSysLogMapper.java
View file @
3e32ec29
...
...
@@ -2,6 +2,7 @@ package com.founder.servicebase.logs.mapper.mysqlMapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.founder.servicebase.logs.LogCount
;
import
com.founder.servicebase.logs.LogMoudleCount
;
import
com.founder.servicebase.logs.SkSysLog
;
import
com.founder.servicebase.logs.param.LogCountParam
;
import
org.apache.ibatis.annotations.Mapper
;
...
...
@@ -17,4 +18,6 @@ public interface SkSysLogMapper extends BaseMapper<SkSysLog> {
public
List
<
LogCount
>
countTotal
(
LogCountParam
param
);
LogCount
countOne
(
@Param
(
"date"
)
String
date
);
List
<
LogMoudleCount
>
countMoudle
(
LogCountParam
param
);
}
common/service_base/src/main/java/com/founder/servicebase/logs/mapper/mysqlMapper/SkSysLogMapper.xml
View file @
3e32ec29
...
...
@@ -26,6 +26,18 @@
and str_to_date(#{date},'%Y-%m-%d')
<![CDATA[ = ]]>
date_format(createDate,'%Y-%m-%d')
</if>
</select>
<select
id=
"countMoudle"
resultType=
"com.founder.servicebase.logs.LogMoudleCount"
parameterType=
"com.founder.servicebase.logs.param.LogCountParam"
>
select COUNT(*) as count ,SUBSTRING_INDEX(message,'_',1) as moudle from sk_sys_log
where
SUBSTRING_INDEX(message,'_',1) in ('以人侦查','以案侦查','以车侦查','以图研判','区域管控','态势分析','轨迹分析','主题研判','点位校验')
<if
test=
"startTime!=null and startTime!='' "
>
and str_to_date(#{startTime},'%Y-%m-%d')
<![CDATA[ <= ]]>
date_format(createDate,'%Y-%m-%d')
</if>
<if
test=
"endTime!=null and endTime!='' "
>
and str_to_date(#{endTime},'%Y-%m-%d')
<![CDATA[ >= ]]>
date_format(createDate,'%Y-%m-%d')
</if>
and
message is not NULL group by SUBSTRING_INDEX(message,'_',1)
</select>
</mapper>
common/service_base/src/main/java/com/founder/servicebase/logs/service/SkSysLogService.java
View file @
3e32ec29
...
...
@@ -3,6 +3,7 @@ package com.founder.servicebase.logs.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.founder.servicebase.logs.LogCount
;
import
com.founder.servicebase.logs.LogMoudleCount
;
import
com.founder.servicebase.logs.SkSysLog
;
import
com.founder.servicebase.logs.param.LogCountParam
;
...
...
@@ -11,4 +12,6 @@ import java.util.List;
public
interface
SkSysLogService
extends
IService
<
SkSysLog
>
{
List
<
LogCount
>
countTotal
(
LogCountParam
param
)
throws
ParseException
;
List
<
LogMoudleCount
>
countMoudle
(
LogCountParam
param
);
}
common/service_base/src/main/java/com/founder/servicebase/logs/service/impl/SkSysLogServiceImpl.java
View file @
3e32ec29
...
...
@@ -3,6 +3,7 @@ package com.founder.servicebase.logs.service.impl;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.founder.servicebase.logs.LogCount
;
import
com.founder.servicebase.logs.LogMoudleCount
;
import
com.founder.servicebase.logs.SkSysLog
;
import
com.founder.servicebase.logs.mapper.mysqlMapper.SkSysLogMapper
;
import
com.founder.servicebase.logs.param.LogCountParam
;
...
...
@@ -38,6 +39,10 @@ public class SkSysLogServiceImpl extends ServiceImpl<SkSysLogMapper, SkSysLog> i
return
all
;
}
@Override
public
List
<
LogMoudleCount
>
countMoudle
(
LogCountParam
param
)
{
return
baseMapper
.
countMoudle
(
param
);
}
/**
...
...
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