Browse Source

http请求修改

gao.qiang 2 weeks ago
parent
commit
7d185ca54b
1 changed files with 12 additions and 1 deletions
  1. 12 1
      base-system/src/main/resources/mapper/system/SysOperLogMapper.xml

+ 12 - 1
base-system/src/main/resources/mapper/system/SysOperLogMapper.xml

@@ -64,7 +64,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 				and date_format(oper_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
 			</if>
 		</where>
-		order by oper_time desc  limit 60000;
+		<choose>
+			<when test="...无查询条件...">
+				<!-- 默认只查最近3个月数据 + LIMIT -->
+				WHERE oper_time >= DATE_SUB(NOW(), INTERVAL 1 MONTH)
+				ORDER BY oper_time DESC
+				LIMIT 60000
+			</when>
+			<!-- 有查询条件时使用正常排序和分页 -->
+			<otherwise>
+				ORDER BY oper_time DESC 60000
+			</otherwise>
+		</choose>
 	</select>
 
 	<delete id="deleteOperLogByIds" parameterType="Long">