|
@@ -1,7 +1,7 @@
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
<!DOCTYPE mapper
|
|
|
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.zkqy.system.mapper.SysOperLogMapper">
|
|
|
|
|
|
<resultMap type="SysOperLog" id="SysOperLogResult">
|
|
@@ -22,21 +22,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="errorMsg" column="error_msg" />
|
|
|
<result property="operTime" column="oper_time" />
|
|
|
<result property="costTime" column="cost_time" />
|
|
|
+ <result property="tenantId" column="tenant_id" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectOperLogVo">
|
|
|
- select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, cost_time
|
|
|
- from sys_oper_log
|
|
|
- </sql>
|
|
|
-
|
|
|
+ select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, cost_time,tenant_id
|
|
|
+ from sys_oper_log
|
|
|
+ </sql>
|
|
|
+
|
|
|
<insert id="insertOperlog" parameterType="SysOperLog">
|
|
|
- insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time)
|
|
|
- values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate())
|
|
|
+ insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time,tenant_id)
|
|
|
+ values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate(),#{tenantId})
|
|
|
</insert>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
|
|
|
<include refid="selectOperLogVo"/>
|
|
|
<where>
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ AND tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
<if test="title != null and title != ''">
|
|
|
AND title like concat('%', #{title}, '%')
|
|
|
</if>
|
|
@@ -44,10 +48,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND business_type = #{businessType}
|
|
|
</if>
|
|
|
<if test="businessTypes != null and businessTypes.length > 0">
|
|
|
- AND business_type in
|
|
|
- <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
|
|
|
- #{businessType}
|
|
|
- </foreach>
|
|
|
+ AND business_type in
|
|
|
+ <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
|
|
|
+ #{businessType}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
AND status = #{status}
|
|
@@ -64,21 +68,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</where>
|
|
|
order by oper_id desc
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<delete id="deleteOperLogByIds" parameterType="Long">
|
|
|
- delete from sys_oper_log where oper_id in
|
|
|
- <foreach collection="array" item="operId" open="(" separator="," close=")">
|
|
|
- #{operId}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
-
|
|
|
- <select id="selectOperLogById" parameterType="Long" resultMap="SysOperLogResult">
|
|
|
+ delete from sys_oper_log where oper_id in
|
|
|
+ <foreach collection="array" item="operId" open="(" separator="," close=")">
|
|
|
+ #{operId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="selectOperLogById" parameterType="Long" resultMap="SysOperLogResult">
|
|
|
<include refid="selectOperLogVo"/>
|
|
|
where oper_id = #{operId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<update id="cleanOperLog">
|
|
|
- truncate table sys_oper_log
|
|
|
- </update>
|
|
|
+ truncate table sys_oper_log
|
|
|
+ </update>
|
|
|
|
|
|
</mapper>
|