<?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.securitycontrol.system.base.mapper.ISysLogMapper">

    <!--保存系统日志-->
    <insert id="saveLogs">
        INSERT INTO sys_logs
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="logId != null and logId != ''">log_id,</if>
            <if test="ip != null and ip!=''">ip,</if>
            <if test="userId != null ">user_id,</if>
            <if test="model != null and model!=''">model,</if>
            <if test="operaUserName != null and operaUserName!=''">opera_user_name,</if>
            <if test="operTime != null and operTime!=''">oper_time,</if>
            <if test="method != null and method!=''">method,</if>
            <if test="params != null and params!=''">params,</if>
            <if test="operateDetail != null and operateDetail!=''">operate_detail,</if>
            <if test="operType != null and operType!=''">oper_type,</if>
            <if test="operUri != null and operUri!=''">oper_uri,</if>
            <if test="logType != null">log_type,</if>
            <if test="result != null">result,</if>
            <if test="times != null and times!=''">times,</if>
            <if test="failureReason != null and failureReason!=''">failure_reason,</if>
            <if test="grade != null and grade!=''">grade,</if>
            <if test="errType != null and errType!=''">err_type,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="logId != null and logId != ''">#{logId},</if>
            <if test="ip != null and ip!=''">#{ip},</if>
            <if test="userId != null">#{userId},</if>
            <if test="model != null and model!=''">#{model},</if>
            <if test="operaUserName != null and operaUserName!=''">#{operaUserName},</if>
            <if test="operTime != null and operTime!=''">#{operTime},</if>
            <if test="method != null and method!=''">#{method},</if>
            <if test="params != null and params!=''">#{params},</if>
            <if test="operateDetail != null and operateDetail!=''">#{operateDetail},</if>
            <if test="operType != null and operType!=''">#{operType},</if>
            <if test="operUri != null and operUri!=''">#{operUri},</if>
            <if test="logType != null">#{logType},</if>
            <if test="result != null">#{result},</if>
            <if test="times != null and times!=''">#{times},</if>
            <if test="failureReason != null and failureReason!=''">#{failureReason},</if>
            <if test="grade != null and grade!=''">#{grade},</if>
            <if test="errType != null and errType!=''">#{errType},</if>
        </trim>
    </insert>
</mapper>