You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
4.2 KiB

3 years ago
<?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">
<mapper namespace="com.qs.serve.modules.sys.mapper.SysOperationLogMapper">
<resultMap id="sysOperationLogMap" type="com.qs.serve.modules.sys.entity.SysOperationLog" >
<result property="id" column="id"/>
<result property="module" column="module"/>
<result property="title" column="title"/>
<result property="bizType" column="biz_type"/>
<result property="optDesc" column="opt_desc"/>
<result property="interType" column="inter_type"/>
<result property="codeMethod" column="code_method"/>
<result property="reqMethod" column="req_method"/>
<result property="reqUrl" column="req_url"/>
<result property="reqParam" column="req_param"/>
<result property="reqIp" column="req_ip"/>
<result property="userType" column="user_type"/>
<result property="userId" column="user_id"/>
<result property="errMsg" column="err_msg"/>
<result property="jsonResult" column="json_result"/>
<result property="elapsedTime" column="elapsed_time"/>
<result property="userAgent" column="user_agent"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="tenantId" column="tenant_id"/>
<result property="creatorName" column="creator_name"/>
</resultMap>
<sql id="sysOperationLogSql">
`sys_operation_log`.`id`,
`sys_operation_log`.`title`,
`sys_operation_log`.`biz_type`,
`sys_operation_log`.`inter_type`,
`sys_operation_log`.`code_method`,
`sys_operation_log`.`req_method`,
`sys_operation_log`.`req_url`,
`sys_operation_log`.`req_param`,
`sys_operation_log`.`req_ip`,
`sys_operation_log`.`user_type`,
`sys_operation_log`.`user_id`,
`sys_operation_log`.`err_msg`,
`sys_operation_log`.`json_result`,
`sys_operation_log`.`elapsed_time`,
`sys_operation_log`.`user_agent`,
`sys_operation_log`.`create_time`,
`sys_operation_log`.`create_by`,
`sys_operation_log`.`update_time`,
`sys_operation_log`.`update_by`
</sql>
<insert id="saveLog" parameterType="com.qs.serve.modules.sys.entity.SysOperationLog">
INSERT INTO `sys_operation_log`
(`title`, `biz_type`, `inter_type`, `code_method`, `req_method`, `req_url`, `req_param`, `req_ip`, `user_type`, `user_id`,
`err_msg`, `json_result`, `elapsed_time`, `user_agent`, `create_time`, `create_by`, `tenant_id`,creator_name)
VALUES
( #{title}, #{bizType}, #{interType}, #{codeMethod}, #{reqMethod}, #{reqUrl}, #{reqParam}, #{reqIp}, #{userType}, #{userId},
#{errMsg}, #{jsonResult}, #{elapsedTime}, #{userAgent}, now(), #{userId}, #{tenantId},#{creatorName});
</insert>
<select id="selectSysOperationLogList" parameterType="com.qs.serve.modules.sys.entity.SysOperationLog" resultMap="sysOperationLogMap">
SELECT
<include refid="sysOperationLogSql"/>
FROM `sys_operation_log`
<where>
and `sys_operation_log`.`del_flag` = b'0'
<if test="title != null and title != ''"> and `title` = #{title}</if>
<if test="bizType != null and bizType != ''"> and `biz_type` = #{bizType}</if>
<if test="interType != null and interType != ''"> and `inter_type` = #{interType}</if>
<if test="reqMethod != null and reqMethod != ''"> and `req_method` = #{reqMethod}</if>
<if test="userType != null and userType != ''"> and `user_type` = #{userType}</if>
<if test="userId != null and userId != ''"> and `user_id` = #{userId}</if>
<if test="jsonResult != null and jsonResult != ''"> and `json_result` = #{jsonResult}</if>
<if test="elapsedTime != null"> and `elapsed_time` = #{elapsedTime}</if>
<if test="createBy != null and createBy != ''"> and `create_by` = #{createBy}</if>
<if test="updateBy != null and updateBy != ''"> and `update_by` = #{updateBy}</if>
</where>
</select>
</mapper>