Commit 54149001 by hzc

修改操作日志日期筛选问题

parent b11f2a85
...@@ -19,8 +19,13 @@ public class LoggingEventServiceImpl implements LoggingEventService { ...@@ -19,8 +19,13 @@ public class LoggingEventServiceImpl implements LoggingEventService {
public List<LogStatistics> findClassNameAndCount(LogQuery logQuery) { public List<LogStatistics> findClassNameAndCount(LogQuery logQuery) {
if(logQuery!=null){ if(logQuery!=null){
logQuery.setStartTime(this.getDateTime(logQuery.getStartDateStr())); logQuery.setStartTime(this.getDateTime(logQuery.getStartDateStr()));
logQuery.setEndTime(this.getDateTime(logQuery.getEndDateStr())); Long endDateTime = this.getDateTime(logQuery.getEndDateStr());
if(endDateTime!=null){
endDateTime= endDateTime+60*60*24*1000;//加一天
}
logQuery.setEndTime(endDateTime);
} }
List<LogStatistics> logStatisticsList = loggingEventMapper.findClassNameAndCount(logQuery); List<LogStatistics> logStatisticsList = loggingEventMapper.findClassNameAndCount(logQuery);
Collections.sort(logStatisticsList, new Comparator<LogStatistics>() { Collections.sort(logStatisticsList, new Comparator<LogStatistics>() {
@Override @Override
...@@ -97,7 +102,12 @@ public class LoggingEventServiceImpl implements LoggingEventService { ...@@ -97,7 +102,12 @@ public class LoggingEventServiceImpl implements LoggingEventService {
public long findCountByLogQuery(LogQuery logQuery) { public long findCountByLogQuery(LogQuery logQuery) {
if(logQuery!=null){ if(logQuery!=null){
logQuery.setStartTime(this.getDateTime(logQuery.getStartDateStr())); logQuery.setStartTime(this.getDateTime(logQuery.getStartDateStr()));
logQuery.setEndTime(this.getDateTime(logQuery.getEndDateStr())); Long endDateTime = this.getDateTime(logQuery.getEndDateStr());
if(endDateTime!=null){
endDateTime= endDateTime+60*60*24*1000;//加一天
}
logQuery.setEndTime(endDateTime);
// logQuery.setEndTime(this.getDateTime(logQuery.getEndDateStr()));
} }
return loggingEventMapper.findCountByLogQuery(logQuery); return loggingEventMapper.findCountByLogQuery(logQuery);
} }
...@@ -106,7 +116,11 @@ public class LoggingEventServiceImpl implements LoggingEventService { ...@@ -106,7 +116,11 @@ public class LoggingEventServiceImpl implements LoggingEventService {
public List<LoggingEvent> findVisitMsg(LogQuery logQuery) { public List<LoggingEvent> findVisitMsg(LogQuery logQuery) {
if(logQuery!=null){ if(logQuery!=null){
logQuery.setStartTime(this.getDateTime(logQuery.getStartDateStr())); logQuery.setStartTime(this.getDateTime(logQuery.getStartDateStr()));
logQuery.setEndTime(this.getDateTime(logQuery.getEndDateStr())); Long endDateTime = this.getDateTime(logQuery.getEndDateStr());
if(endDateTime!=null){
endDateTime= endDateTime+60*60*24*1000;//加一天
}
logQuery.setEndTime(endDateTime);
} }
return loggingEventMapper.findVisitMsg(logQuery); return loggingEventMapper.findVisitMsg(logQuery);
} }
......
...@@ -40,13 +40,13 @@ ...@@ -40,13 +40,13 @@
and timestmp &gt;= #{startTime} and timestmp &gt;= #{startTime}
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
and timestmp &lt;= #{endTime} and timestmp &lt; #{endTime}
</if> </if>
<if test="loggerName != null and loggerName!=''"> <if test="loggerName != null and loggerName!=''">
and arg1 like concat('%',#{loggerName},'%') and arg1 like concat('%',#{loggerName},'%')
</if> </if>
<if test="employeeId != null and employeeId!=''"> <if test="employeeId != null and employeeId!=''">
and arg0 like concat(#{employeeId},':%') and arg0 like concat('%',#{employeeId},'%')
</if> </if>
<if test="url != null and url!=''"> <if test="url != null and url!=''">
and arg3 = #{url} and arg3 = #{url}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment