gao.qiang 1 týždeň pred
rodič
commit
be3f448ba8

+ 18 - 1
base-system/src/main/resources/mapper/system/SysLogininforMapper.xml

@@ -40,7 +40,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 				and date_format(login_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
 			</if>
 		</where>
-		order by login_time desc  limit 60000;
+		<choose>
+			<when test="ipaddr != null and ipaddr != ''
+			    and (status != null and status != '')
+                and (userName != null and userName != '')
+                and (startTime == null or startTime == '')
+                and (endTime == null or endTime == '')">
+				WHERE login_time >= (
+				SELECT login_time FROM sys_oper_log
+				ORDER BY login_time DESC
+				LIMIT 60000, 1
+				)
+				ORDER BY login_time DESC
+			</when>
+			<!-- 有查询条件时使用正常排序和分页 -->
+			<otherwise>
+				ORDER BY login_time DESC  LIMIT 60000
+			</otherwise>
+		</choose>
 	</select>
 
 	<delete id="deleteLogininforByIds" parameterType="Long">

+ 5 - 3
base-system/src/main/resources/mapper/system/SysOperLogMapper.xml

@@ -69,10 +69,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 and (userId == null or userId == '')
                 and (startTime == null or startTime == '')
                 and (endTime == null or endTime == '')">
-				<!-- 默认只查最近3个月数据 + LIMIT -->
-				WHERE oper_time >= DATE_SUB(NOW(), INTERVAL 1 MONTH)
+				WHERE oper_time >= (
+				SELECT oper_time FROM sys_oper_log
+				ORDER BY oper_time DESC
+				LIMIT 60000, 1
+				)
 				ORDER BY oper_time DESC
-				LIMIT 60000
 			</when>
 			<!-- 有查询条件时使用正常排序和分页 -->
 			<otherwise>