采用枚举类型

This commit is contained in:
RuoYi
2018-08-18 23:51:19 +08:00
parent e5c9aca10f
commit 9631720a38
37 changed files with 275 additions and 233 deletions

View File

@ -1,18 +1,21 @@
#数据源配置
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.jdbc.Driver
druid:
master: #主库
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
username: root
password: password
#slave: #从库
# open: true
# url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
# username: root
# password: password
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initial-size: 10
# 最大连接池数量

View File

@ -7,10 +7,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="OperLog" id="OperLogResult">
<id property="operId" column="oper_id" />
<result property="title" column="title" />
<result property="action" column="action" />
<result property="businessType" column="business_type" />
<result property="method" column="method" />
<result property="channel" column="channel" />
<result property="operName" column="oper_name" />
<result property="operatorType" column="operator_type" />
<result property="operName" column="oper_name" />
<result property="deptName" column="dept_name" />
<result property="operUrl" column="oper_url" />
<result property="operIp" column="oper_ip" />
@ -23,14 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectOperLogVo">
select
oper_id, title, action, method, channel, oper_name, dept_name, oper_url, oper_ip,oper_location,oper_param,status,error_msg,oper_time
oper_id, title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip,oper_location,oper_param,status,error_msg,oper_time
from
sys_oper_log
</sql>
<insert id="insertOperlog" parameterType="OperLog">
insert into sys_oper_log(title, action, method, channel, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time)
values (#{title}, #{action}, #{method}, #{channel}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{status}, #{errorMsg}, sysdate())
insert into sys_oper_log(title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time)
values (#{title}, #{businessType}, #{method}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{status}, #{errorMsg}, sysdate())
</insert>
<select id="selectOperLogList" parameterType="OperLog" resultMap="OperLogResult">
@ -39,8 +39,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="title != null and title != ''">
AND title like concat('%', #{title}, '%')
</if>
<if test="action != null and action != ''">
AND action = #{action}
<if test="businessType != null">
AND business_type = #{businessType}
</if>
<if test="operName != null and operName != ''">
AND oper_name like concat('%', #{operName}, '%')

View File

@ -8,7 +8,7 @@
<form class="form-horizontal m-t" id="signupForm">
<div class="form-group">
<label class="col-sm-2 control-label">操作模块:</label>
<div class="form-control-static" th:text="${operLog.title} + ' / ' + ${@dict.getLabel('sys_oper_type',operLog.action)}">
<div class="form-control-static" th:text="${operLog.title} + ' / ' + ${@dict.getLabel('sys_oper_type',operLog.businessType)}">
</div>
</div>
<div class="form-group">
@ -33,10 +33,10 @@
</div>
<div class="form-group">
<label class="col-sm-2 control-label">状态:</label>
<div class="form-control-static" th:class="${operLog.status == '0' ? 'label label-primary' : 'label label-danger'}" th:text="${operLog.status == '0' ? '正常' : '异常'}">
<div class="form-control-static" th:class="${operLog.status == 0 ? 'label label-primary' : 'label label-danger'}" th:text="${operLog.status == 0 ? '正常' : '异常'}">
</div>
</div>
<div class="form-group" th:style="'display:' + ${operLog.status == '0' ? 'none' : 'block'}">
<div class="form-group" th:style="'display:' + ${operLog.status == 0 ? 'none' : 'block'}">
<label class="col-sm-2 control-label">异常信息:</label>
<div class="form-control-static" th:text="${operLog.errorMsg}">
</div>

View File

@ -18,7 +18,7 @@
<label>操作人员: </label><input type="text" name="operName"/>
</li>
<li>
<label>操作类型: </label><select name="action" th:with="type=${@dict.getType('sys_oper_type')}">
<label>操作类型: </label><select name="businessType" th:with="type=${@dict.getType('sys_oper_type')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
</select>
@ -77,7 +77,7 @@
title: '系统模块'
},
{
field: 'action',
field: 'businessType',
title: '操作类型',
align: 'center',
formatter: function(value, row, index) {