All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mapper.LogMapper.xml Maven / Gradle / Ivy

The newest version!
<?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.github.rexsheng.springboot.faster.system.mapper.LogMapper">

    <!-- selectByName -->
    <insert id="insertOrDuplicateUpdate" parameterType="com.github.rexsheng.springboot.faster.system.log.domain.SysLog">
        insert into `sys_log`
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="logId != null">
                `id`,
            </if>
            <if test="className != null">
                `class_name`,
            </if>
            <if test="methodName != null">
                `method_name`,
            </if>
            <if test="methodNote != null">
                `method_note`,
            </if>
            <if test="requestMethod != null">
                `request_method`,
            </if>
            <if test="requestUrl != null">
                request_url,
            </if>
            <if test="requestIp != null">
                `request_ip`,
            </if>
            <if test="requestParam != null">
                `request_param`,
            </if>
            <if test="requestHeader != null">
                `request_header`,
            </if>
            <if test="userAgent != null">
                `user_agent`,
            </if>
            <if test="server != null">
                `server`,
            </if>
            <if test="module != null">
                `module`,
            </if>
            <if test="user != null">
                `user`,
            </if>
            <if test="startTime != null">
                `start_time`,
            </if>
            <if test="endTime != null">
                `end_time`,
            </if>
            <if test="costTime != null">
                `cost_time`,
            </if>
            <if test="error != null">
                `error`,
            </if>
            <if test="errorMsg != null">
                `error_msg`,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="logId != null">
                #{logId,jdbcType=VARCHAR},
            </if>
            <if test="className != null">
                #{className,jdbcType=VARCHAR},
            </if>
            <if test="methodName != null">
                #{methodName,jdbcType=VARCHAR},
            </if>
            <if test="methodNote != null">
                #{methodNote,jdbcType=VARCHAR},
            </if>
            <if test="requestMethod != null">
                #{requestMethod,jdbcType=VARCHAR},
            </if>
            <if test="requestUrl != null">
                #{requestUrl,jdbcType=VARCHAR},
            </if>
            <if test="requestIp != null">
                #{requestIp,jdbcType=VARCHAR},
            </if>
            <if test="requestParam != null">
                #{requestParam,jdbcType=VARCHAR},
            </if>
            <if test="requestHeader != null">
                #{requestHeader,jdbcType=VARCHAR},
            </if>
            <if test="userAgent != null">
                #{userAgent,jdbcType=VARCHAR},
            </if>
            <if test="server != null">
                #{server,jdbcType=VARCHAR},
            </if>
            <if test="module != null">
                #{module,jdbcType=VARCHAR},
            </if>
            <if test="user != null">
                #{user,jdbcType=BIGINT},
            </if>
            <if test="startTime != null">
                #{startTime,jdbcType=TIMESTAMP},
            </if>
            <if test="endTime != null">
                #{endTime,jdbcType=TIMESTAMP},
            </if>
            <if test="costTime != null">
                #{costTime,jdbcType=BIGINT},
            </if>
            <if test="error != null">
                #{error,jdbcType=BOOLEAN},
            </if>
            <if test="errorMsg != null">
                #{errorMsg,jdbcType=LONGVARCHAR},
            </if>
        </trim>
        on DUPLICATE KEY UPDATE
        <trim suffixOverrides=",">
            <if test="className != null">
                `class_name` = #{className,jdbcType=VARCHAR},
            </if>
            <if test="methodName != null">
                `method_name` = #{methodName,jdbcType=VARCHAR},
            </if>
            <if test="methodNote != null">
                `method_note` = #{methodNote,jdbcType=VARCHAR},
            </if>
            <if test="requestMethod != null">
                `request_method` = #{requestMethod,jdbcType=VARCHAR},
            </if>
            <if test="requestUrl != null">
                `request_url` = #{requestUrl,jdbcType=VARCHAR},
            </if>
            <if test="requestIp != null">
                `request_ip` = #{requestIp,jdbcType=VARCHAR},
            </if>
            <if test="requestParam != null">
                `request_param` = #{requestParam,jdbcType=VARCHAR},
            </if>
            <if test="requestHeader != null">
                `request_header` = #{requestHeader,jdbcType=VARCHAR},
            </if>
            <if test="userAgent != null">
                `user_agent` = #{userAgent,jdbcType=VARCHAR},
            </if>
            <if test="server != null">
                `server` = #{server,jdbcType=VARCHAR},
            </if>
            <if test="module != null">
                `module` = #{module,jdbcType=VARCHAR},
            </if>
            <if test="user != null">
                `user` = #{user,jdbcType=BIGINT},
            </if>
            <if test="startTime != null">
                `start_time` = #{startTime,jdbcType=TIMESTAMP},
            </if>
            <if test="endTime != null">
                `end_time` = #{endTime,jdbcType=TIMESTAMP},
            </if>
            <if test="costTime != null">
                `cost_time` = #{costTime,jdbcType=BIGINT},
            </if>
            <if test="error != null">
                `error` = #{error,jdbcType=BOOLEAN},
            </if>
            <if test="errorMsg != null">
                `error_msg` = #{errorMsg,jdbcType=LONGVARCHAR},
            </if>
        </trim>
    </insert>

</mapper>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy