|
@@ -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
|
|
|
+ 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>
|
|
@@ -47,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND business_type in
|
|
|
<foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
|
|
|
#{businessType}
|
|
|
- </foreach>
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
AND status = #{status}
|
|
@@ -64,19 +68,19 @@ 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>
|
|
|
+ </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>
|