ysh 2 年之前
父节点
当前提交
bdd4416907

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java

@@ -231,7 +231,8 @@ public class LoginController {
 		obj.put("totalVisitCount", totalVisitCount);
 		Long todayVisitCount = logService.findTodayVisitCount(dayStart,dayEnd);
 		obj.put("todayVisitCount", todayVisitCount);
-		Long todayIp = logService.findTodayIp(dayStart,dayEnd);
+//		Long todayIp = logService.findTodayIp(dayStart,dayEnd);
+		Long todayIp = logService.findTotalVisitCountSeven();//获取系统近7天访问次数
 		//update-end--Author:zhangweijian  Date:20190428 for:传入开始时间,结束时间参数
 		obj.put("todayIp", todayIp);
 		result.setResult(obj);

+ 8 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysLogMapper.java

@@ -31,6 +31,14 @@ public interface SysLogMapper extends BaseMapper<SysLog> {
 	 */
 	Long findTotalVisitCount();
 
+
+	/**
+	 * 获取系统近7天访问次数
+	 *
+	 * @return Long
+	 */
+	Long findTotalVisitCountSeven();
+
 	//update-begin--Author:zhangweijian  Date:20190428 for:传入开始时间,结束时间参数
 	/**
 	 * 获取系统今日访问次数

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysLogMapper.xml

@@ -12,6 +12,11 @@
         select count(1) from sys_log where log_type = 1
     </select>
 
+	<!-- 获取访问总数 -->
+	<select id="findTotalVisitCountSeven" resultType="long">
+        select count(1) from sys_log where log_type = 1 and DATE_SUB(CURDATE(), INTERVAL 7 DAY) &lt;= create_time
+    </select>
+
 	<!-- 获取今日访问总数 -->
     <select id="findTodayVisitCount" resultType="long">
         select count(1) from sys_log where log_type = 1 and create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd}

+ 6 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysLogService.java

@@ -30,6 +30,12 @@ public interface ISysLogService extends IService<SysLog> {
 	 */
 	Long findTotalVisitCount();
 
+	/**
+	 * 获取系统近7天访问次数
+	 * @return
+	 */
+	Long findTotalVisitCountSeven();
+
 	//update-begin--Author:zhangweijian  Date:20190428 for:传入开始时间,结束时间参数
 	/**
 	 * 获取系统今日访问次数

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysLogServiceImpl.java

@@ -46,6 +46,11 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
 		return sysLogMapper.findTotalVisitCount();
 	}
 
+	@Override
+	public Long findTotalVisitCountSeven() {
+		return sysLogMapper.findTotalVisitCountSeven();
+	}
+
 	//update-begin--Author:zhangweijian  Date:20190428 for:传入开始时间,结束时间参数
 	@Override
 	public Long findTodayVisitCount(Date dayStart, Date dayEnd) {