<?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.engine.organization.mapper.sislog.SISLogMapper">
    <resultMap id="BaseResultMap" type="com.engine.organization.entity.LoggerContext">
        <!--<result column="id" property="id"/>-->
        <!--<result column="operate_desc" property="operateDesc"/>-->
        <!--<result column="operator_id" property="operatorId"/>-->
        <!--<result column="operator_name" property="operatorName"/>-->
        <!--<result column="create_time" property="createTime"/>-->
        <!--<result column="operate_type" property="operateType"/>-->
        <!--<result column="params_str" property="paramsStr"/>-->
        <!--<result column="client_ip" property="clientIp"/>-->
        <!--<result column="method_name" property="methodName"/>-->
        <!--<result column="class_name" property="className"/>-->
        <!--<result column="delete_type" property="deleteType"/>-->
    </resultMap>

    <!-- 表字段 -->
    <sql id="baseColumns">
        t
        .
        id
        , t.operate_desc
        , t.operator_id
        , t.operator_name
        , t.create_time
        , t.operate_type
        , t.params_str
        , t.client_ip
        , t.method_name
        , t.class_name
        , t.delete_type
    </sql>

    <!-- 插入全部字段 -->
    <insert id="insert" parameterType="com.engine.organization.entity.LoggerContext"
            keyProperty="id" keyColumn="id" useGeneratedKeys="true">
        INSERT INTO hr_log
        <trim prefix="(" suffix=")" suffixOverrides=",">
            operate_desc,
            operator_id,
            operator_name,
            create_time,
            operate_type,
            params_str,
            client_ip,
            method_name,
            class_name,
            delete_type,
            operate_module_name,
            operate_module,
            message,
            value
        </trim>
        <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
            #{operateDesc},
            #{operatorId},
            #{operatorName},
            #{createTime},
            #{operateType},
            #{paramsStr},
            #{clientIp},
            #{methodName},
            #{className},
            #{deleteType},
            #{operateModuleName},
            #{operateModule},
            #{message},
            #{value}
        </trim>
    </insert>

    <insert id="insert" parameterType="com.engine.organization.entity.LoggerContext" databaseId="oracle">
        <selectKey keyProperty="id" resultType="long" order="AFTER">
            select HR_LOG_ID.currval from dual
        </selectKey>
        INSERT INTO hr_log
        <trim prefix="(" suffix=")" suffixOverrides=",">
            operate_desc,
            operator_id,
            operator_name,
            create_time,
            operate_type,
            params_str,
            client_ip,
            method_name,
            class_name,
            delete_type,
            operate_module_name,
            operate_module,
            message,
            value
        </trim>
        <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
            #{operateDesc},
            #{operatorId},
            #{operatorName},
            #{createTime},
            #{operateType},
            #{paramsStr},
            #{clientIp},
            #{methodName},
            #{className},
            #{deleteType},
            #{operateModuleName},
            #{operateModule},
            #{message},
            #{value}
        </trim>
    </insert>


</mapper>