日志管理使用索引提升查询性能

This commit is contained in:
RuoYi
2023-02-23 12:32:02 +08:00
parent 20dd6d37ea
commit 7c9903e057
5 changed files with 16 additions and 9 deletions

View File

@@ -31,10 +31,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND user_name like concat('%', #{userName}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(access_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
AND access_time &gt;= #{params.beginTime}
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(access_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
AND access_time &lt;= #{params.endTime}
</if>
</where>
order by info_id desc

View File

@@ -55,10 +55,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND oper_name like concat('%', #{operName}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(oper_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
AND oper_time &gt;= #{params.beginTime}
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(oper_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
AND oper_time &lt;= #{params.endTime}
</if>
</where>
order by oper_id desc