Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
sts网站
Commits
6523fe59
Commit
6523fe59
authored
Feb 23, 2023
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志管理使用索引提升查询性能
parent
90970eb9
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
8 deletions
+15
-8
SysLogininforMapper.xml
.../src/main/resources/mapper/system/SysLogininforMapper.xml
+2
-2
SysOperLogMapper.xml
...tem/src/main/resources/mapper/system/SysOperLogMapper.xml
+2
-2
index.vue
ruoyi-ui/src/views/monitor/logininfor/index.vue
+2
-1
index.vue
ruoyi-ui/src/views/monitor/operlog/index.vue
+2
-1
ry_20230223.sql
sql/ry_20230223.sql
+7
-2
No files found.
ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml
View file @
6523fe59
...
...
@@ -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')
>
= date_format(#{params.beginTime},'%y%m%d')
AND login_time
>
= #{params.beginTime}
</if>
<if
test=
"params.endTime != null and params.endTime != ''"
>
<!-- 结束时间检索 -->
and date_format(login_time,'%y%m%d')
<
= date_format(#{params.endTime},'%y%m%d')
AND login_time
<
= #{params.endTime}
</if>
</where>
order by info_id desc
...
...
ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml
View file @
6523fe59
...
...
@@ -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')
>
= date_format(#{params.beginTime},'%y%m%d')
AND oper_time
>
= #{params.beginTime}
</if>
<if
test=
"params.endTime != null and params.endTime != ''"
>
<!-- 结束时间检索 -->
and date_format(oper_time,'%y%m%d')
<
= date_format(#{params.endTime},'%y%m%d')
AND oper_time
<
= #{params.endTime}
</if>
</where>
order by oper_id desc
...
...
ruoyi-ui/src/views/monitor/logininfor/index.vue
View file @
6523fe59
...
...
@@ -38,11 +38,12 @@
<el-date-picker
v-model=
"dateRange"
style=
"width: 240px"
value-format=
"yyyy-MM-dd"
value-format=
"yyyy-MM-dd
HH:mm:ss
"
type=
"daterange"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00', '23:59:59']"
></el-date-picker>
</el-form-item>
<el-form-item>
...
...
ruoyi-ui/src/views/monitor/operlog/index.vue
View file @
6523fe59
...
...
@@ -53,11 +53,12 @@
<el-date-picker
v-model=
"dateRange"
style=
"width: 240px"
value-format=
"yyyy-MM-dd"
value-format=
"yyyy-MM-dd
HH:mm:ss
"
type=
"daterange"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00', '23:59:59']"
></el-date-picker>
</el-form-item>
<el-form-item>
...
...
sql/ry_2023022
1
.sql
→
sql/ry_2023022
3
.sql
View file @
6523fe59
...
...
@@ -433,7 +433,10 @@ create table sys_oper_log (
error_msg
varchar
(
2000
)
default
''
comment
'错误消息'
,
oper_time
datetime
comment
'操作时间'
,
cost_time
bigint
(
20
)
default
0
comment
'消耗时间'
,
primary
key
(
oper_id
)
primary
key
(
oper_id
),
key
idx_sys_oper_log_bt
(
business_type
),
key
idx_sys_oper_log_s
(
status
),
key
idx_sys_oper_log_ot
(
oper_time
)
)
engine
=
innodb
auto_increment
=
100
comment
=
'操作日志记录'
;
...
...
@@ -562,7 +565,9 @@ create table sys_logininfor (
status
char
(
1
)
default
'0'
comment
'登录状态(0成功 1失败)'
,
msg
varchar
(
255
)
default
''
comment
'提示消息'
,
login_time
datetime
comment
'访问时间'
,
primary
key
(
info_id
)
primary
key
(
info_id
),
key
idx_sys_logininfor_s
(
status
),
key
idx_sys_logininfor_lt
(
login_time
)
)
engine
=
innodb
auto_increment
=
100
comment
=
'系统访问记录'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment