优化部分查询SQL

This commit is contained in:
wangchl
2018-08-06 11:42:15 +08:00
parent 127b532825
commit db8f960b0d
10 changed files with 26 additions and 16 deletions

View File

@@ -21,13 +21,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="operTime" column="oper_time" />
</resultMap>
<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
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>
<select id="selectOperLogList" parameterType="OperLog" resultMap="OperLogResult">
select * from sys_oper_log
<include refid="selectOperLogVo"/>
<where>
<if test="title != null and title != ''">
AND title like concat('%', #{title}, '%')
@@ -55,8 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectOperLogById" parameterType="Long" resultMap="OperLogResult">
select *
from sys_oper_log
<include refid="selectOperLogVo"/>
where oper_id = #{operId}
</select>