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

This commit is contained in:
RuoYi
2023-02-23 10:01:16 +08:00
parent 90970eb9fe
commit 6523fe59a2
5 changed files with 15 additions and 8 deletions

View File

@ -34,10 +34,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(login_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
AND login_time &gt;= #{params.beginTime}
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(login_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
AND login_time &lt;= #{params.endTime}
</if>
</where>
order by info_id desc

View File

@ -56,10 +56,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