Files
cashier-client/src/main/resources/mapper/SysLogMapper.xml
韩鹏辉 b96a251fd8 提交
2024-03-21 10:17:54 +08:00

197 lines
7.2 KiB
XML

<?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.chaozhanggui.system.cashierservice.dao.SysLogMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.SysLog">
<id column="log_id" jdbcType="BIGINT" property="logId" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="log_type" jdbcType="VARCHAR" property="logType" />
<result column="method" jdbcType="VARCHAR" property="method" />
<result column="request_ip" jdbcType="VARCHAR" property="requestIp" />
<result column="time" jdbcType="BIGINT" property="time" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="browser" jdbcType="VARCHAR" property="browser" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.chaozhanggui.system.cashierservice.entity.SysLogWithBLOBs">
<result column="params" jdbcType="LONGVARCHAR" property="params" />
<result column="exception_detail" jdbcType="LONGVARCHAR" property="exceptionDetail" />
</resultMap>
<sql id="Base_Column_List">
log_id, description, log_type, method, request_ip, time, username, address, browser,
create_time
</sql>
<sql id="Blob_Column_List">
params, exception_detail
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from sys_log
where log_id = #{logId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from sys_log
where log_id = #{logId,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.SysLogWithBLOBs">
insert into sys_log (log_id, description, log_type,
method, request_ip, time,
username, address, browser,
create_time, params, exception_detail
)
values (#{logId,jdbcType=BIGINT}, #{description,jdbcType=VARCHAR}, #{logType,jdbcType=VARCHAR},
#{method,jdbcType=VARCHAR}, #{requestIp,jdbcType=VARCHAR}, #{time,jdbcType=BIGINT},
#{username,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{browser,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{params,jdbcType=LONGVARCHAR}, #{exceptionDetail,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.SysLogWithBLOBs">
insert into sys_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="logId != null">
log_id,
</if>
<if test="description != null">
description,
</if>
<if test="logType != null">
log_type,
</if>
<if test="method != null">
method,
</if>
<if test="requestIp != null">
request_ip,
</if>
<if test="time != null">
time,
</if>
<if test="username != null">
username,
</if>
<if test="address != null">
address,
</if>
<if test="browser != null">
browser,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="params != null">
params,
</if>
<if test="exceptionDetail != null">
exception_detail,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="logId != null">
#{logId,jdbcType=BIGINT},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="logType != null">
#{logType,jdbcType=VARCHAR},
</if>
<if test="method != null">
#{method,jdbcType=VARCHAR},
</if>
<if test="requestIp != null">
#{requestIp,jdbcType=VARCHAR},
</if>
<if test="time != null">
#{time,jdbcType=BIGINT},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="browser != null">
#{browser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="params != null">
#{params,jdbcType=LONGVARCHAR},
</if>
<if test="exceptionDetail != null">
#{exceptionDetail,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.SysLogWithBLOBs">
update sys_log
<set>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="logType != null">
log_type = #{logType,jdbcType=VARCHAR},
</if>
<if test="method != null">
method = #{method,jdbcType=VARCHAR},
</if>
<if test="requestIp != null">
request_ip = #{requestIp,jdbcType=VARCHAR},
</if>
<if test="time != null">
time = #{time,jdbcType=BIGINT},
</if>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="browser != null">
browser = #{browser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="params != null">
params = #{params,jdbcType=LONGVARCHAR},
</if>
<if test="exceptionDetail != null">
exception_detail = #{exceptionDetail,jdbcType=LONGVARCHAR},
</if>
</set>
where log_id = #{logId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.chaozhanggui.system.cashierservice.entity.SysLogWithBLOBs">
update sys_log
set description = #{description,jdbcType=VARCHAR},
log_type = #{logType,jdbcType=VARCHAR},
method = #{method,jdbcType=VARCHAR},
request_ip = #{requestIp,jdbcType=VARCHAR},
time = #{time,jdbcType=BIGINT},
username = #{username,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
browser = #{browser,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
params = #{params,jdbcType=LONGVARCHAR},
exception_detail = #{exceptionDetail,jdbcType=LONGVARCHAR}
where log_id = #{logId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.SysLog">
update sys_log
set description = #{description,jdbcType=VARCHAR},
log_type = #{logType,jdbcType=VARCHAR},
method = #{method,jdbcType=VARCHAR},
request_ip = #{requestIp,jdbcType=VARCHAR},
time = #{time,jdbcType=BIGINT},
username = #{username,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
browser = #{browser,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}
where log_id = #{logId,jdbcType=BIGINT}
</update>
</mapper>