<?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="cn.superdesk.uniorder.dao.mapper.sys.logger.SysUserOperationLogMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.sys.logger.SysUserOperationLog">

    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="nick_name" jdbcType="VARCHAR" property="nickName" />
    <result column="user_name" jdbcType="VARCHAR" property="userName" />
    <result column="method_name" jdbcType="VARCHAR" property="methodName" />
    <result column="operation_time" jdbcType="TIMESTAMP" property="operationTime" />
    <result column="request_ip" jdbcType="VARCHAR" property="requestIp" />
    <result column="request_url" jdbcType="VARCHAR" property="requestUrl" />
    <result column="result_status" jdbcType="VARCHAR" property="resultStatus" />
    <result column="model" jdbcType="VARCHAR" property="model" />
    <result column="request_start_time" jdbcType="TIMESTAMP" property="requestStartTime" />
    <result column="request_end_time" jdbcType="TIMESTAMP" property="requestEndTime" />
    <result column="response_date" jdbcType="BIGINT" property="responseDate" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="cn.superdesk.uniorder.dao.entity.sys.logger.SysUserOperationLog">

    <result column="request_param" jdbcType="LONGVARCHAR" property="requestParam" />
    <result column="response_result" jdbcType="LONGVARCHAR" property="responseResult" />
    <result column="error_info" jdbcType="LONGVARCHAR" property="errorInfo" />
  </resultMap>
  <sql id="Example_Where_Clause">

    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">

    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">

    id, nick_name, user_name, method_name, operation_time, request_ip, request_url, result_status, 
    model, request_start_time, request_end_time, response_date
  </sql>
  <sql id="Blob_Column_List">

    request_param, response_result, error_info
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="cn.superdesk.uniorder.dao.entity.sys.logger.SysUserOperationLogExample" resultMap="ResultMapWithBLOBs">

    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from sys_user_operation_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.sys.logger.SysUserOperationLogExample" resultMap="BaseResultMap">

    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from sys_user_operation_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">

    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from sys_user_operation_log
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">

    delete from sys_user_operation_log
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.sys.logger.SysUserOperationLogExample">

    delete from sys_user_operation_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.sys.logger.SysUserOperationLog">

    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_user_operation_log (nick_name, user_name, method_name, 
      operation_time, request_ip, request_url, 
      result_status, model, request_start_time, 
      request_end_time, response_date, request_param, 
      response_result, error_info)
    values (#{nickName,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{methodName,jdbcType=VARCHAR}, 
      #{operationTime,jdbcType=TIMESTAMP}, #{requestIp,jdbcType=VARCHAR}, #{requestUrl,jdbcType=VARCHAR}, 
      #{resultStatus,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, #{requestStartTime,jdbcType=TIMESTAMP}, 
      #{requestEndTime,jdbcType=TIMESTAMP}, #{responseDate,jdbcType=BIGINT}, #{requestParam,jdbcType=LONGVARCHAR}, 
      #{responseResult,jdbcType=LONGVARCHAR}, #{errorInfo,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.sys.logger.SysUserOperationLog">

    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_user_operation_log
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="nickName != null">
        nick_name,
      </if>
      <if test="userName != null">
        user_name,
      </if>
      <if test="methodName != null">
        method_name,
      </if>
      <if test="operationTime != null">
        operation_time,
      </if>
      <if test="requestIp != null">
        request_ip,
      </if>
      <if test="requestUrl != null">
        request_url,
      </if>
      <if test="resultStatus != null">
        result_status,
      </if>
      <if test="model != null">
        model,
      </if>
      <if test="requestStartTime != null">
        request_start_time,
      </if>
      <if test="requestEndTime != null">
        request_end_time,
      </if>
      <if test="responseDate != null">
        response_date,
      </if>
      <if test="requestParam != null">
        request_param,
      </if>
      <if test="responseResult != null">
        response_result,
      </if>
      <if test="errorInfo != null">
        error_info,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="nickName != null">
        #{nickName,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        #{userName,jdbcType=VARCHAR},
      </if>
      <if test="methodName != null">
        #{methodName,jdbcType=VARCHAR},
      </if>
      <if test="operationTime != null">
        #{operationTime,jdbcType=TIMESTAMP},
      </if>
      <if test="requestIp != null">
        #{requestIp,jdbcType=VARCHAR},
      </if>
      <if test="requestUrl != null">
        #{requestUrl,jdbcType=VARCHAR},
      </if>
      <if test="resultStatus != null">
        #{resultStatus,jdbcType=VARCHAR},
      </if>
      <if test="model != null">
        #{model,jdbcType=VARCHAR},
      </if>
      <if test="requestStartTime != null">
        #{requestStartTime,jdbcType=TIMESTAMP},
      </if>
      <if test="requestEndTime != null">
        #{requestEndTime,jdbcType=TIMESTAMP},
      </if>
      <if test="responseDate != null">
        #{responseDate,jdbcType=BIGINT},
      </if>
      <if test="requestParam != null">
        #{requestParam,jdbcType=LONGVARCHAR},
      </if>
      <if test="responseResult != null">
        #{responseResult,jdbcType=LONGVARCHAR},
      </if>
      <if test="errorInfo != null">
        #{errorInfo,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.sys.logger.SysUserOperationLogExample" resultType="java.lang.Long">

    select count(*) from sys_user_operation_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">

    update sys_user_operation_log
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.nickName != null">
        nick_name = #{record.nickName,jdbcType=VARCHAR},
      </if>
      <if test="record.userName != null">
        user_name = #{record.userName,jdbcType=VARCHAR},
      </if>
      <if test="record.methodName != null">
        method_name = #{record.methodName,jdbcType=VARCHAR},
      </if>
      <if test="record.operationTime != null">
        operation_time = #{record.operationTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.requestIp != null">
        request_ip = #{record.requestIp,jdbcType=VARCHAR},
      </if>
      <if test="record.requestUrl != null">
        request_url = #{record.requestUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.resultStatus != null">
        result_status = #{record.resultStatus,jdbcType=VARCHAR},
      </if>
      <if test="record.model != null">
        model = #{record.model,jdbcType=VARCHAR},
      </if>
      <if test="record.requestStartTime != null">
        request_start_time = #{record.requestStartTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.requestEndTime != null">
        request_end_time = #{record.requestEndTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.responseDate != null">
        response_date = #{record.responseDate,jdbcType=BIGINT},
      </if>
      <if test="record.requestParam != null">
        request_param = #{record.requestParam,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.responseResult != null">
        response_result = #{record.responseResult,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.errorInfo != null">
        error_info = #{record.errorInfo,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">

    update sys_user_operation_log
    set id = #{record.id,jdbcType=BIGINT},
      nick_name = #{record.nickName,jdbcType=VARCHAR},
      user_name = #{record.userName,jdbcType=VARCHAR},
      method_name = #{record.methodName,jdbcType=VARCHAR},
      operation_time = #{record.operationTime,jdbcType=TIMESTAMP},
      request_ip = #{record.requestIp,jdbcType=VARCHAR},
      request_url = #{record.requestUrl,jdbcType=VARCHAR},
      result_status = #{record.resultStatus,jdbcType=VARCHAR},
      model = #{record.model,jdbcType=VARCHAR},
      request_start_time = #{record.requestStartTime,jdbcType=TIMESTAMP},
      request_end_time = #{record.requestEndTime,jdbcType=TIMESTAMP},
      response_date = #{record.responseDate,jdbcType=BIGINT},
      request_param = #{record.requestParam,jdbcType=LONGVARCHAR},
      response_result = #{record.responseResult,jdbcType=LONGVARCHAR},
      error_info = #{record.errorInfo,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">

    update sys_user_operation_log
    set id = #{record.id,jdbcType=BIGINT},
      nick_name = #{record.nickName,jdbcType=VARCHAR},
      user_name = #{record.userName,jdbcType=VARCHAR},
      method_name = #{record.methodName,jdbcType=VARCHAR},
      operation_time = #{record.operationTime,jdbcType=TIMESTAMP},
      request_ip = #{record.requestIp,jdbcType=VARCHAR},
      request_url = #{record.requestUrl,jdbcType=VARCHAR},
      result_status = #{record.resultStatus,jdbcType=VARCHAR},
      model = #{record.model,jdbcType=VARCHAR},
      request_start_time = #{record.requestStartTime,jdbcType=TIMESTAMP},
      request_end_time = #{record.requestEndTime,jdbcType=TIMESTAMP},
      response_date = #{record.responseDate,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.sys.logger.SysUserOperationLog">

    update sys_user_operation_log
    <set>
      <if test="nickName != null">
        nick_name = #{nickName,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        user_name = #{userName,jdbcType=VARCHAR},
      </if>
      <if test="methodName != null">
        method_name = #{methodName,jdbcType=VARCHAR},
      </if>
      <if test="operationTime != null">
        operation_time = #{operationTime,jdbcType=TIMESTAMP},
      </if>
      <if test="requestIp != null">
        request_ip = #{requestIp,jdbcType=VARCHAR},
      </if>
      <if test="requestUrl != null">
        request_url = #{requestUrl,jdbcType=VARCHAR},
      </if>
      <if test="resultStatus != null">
        result_status = #{resultStatus,jdbcType=VARCHAR},
      </if>
      <if test="model != null">
        model = #{model,jdbcType=VARCHAR},
      </if>
      <if test="requestStartTime != null">
        request_start_time = #{requestStartTime,jdbcType=TIMESTAMP},
      </if>
      <if test="requestEndTime != null">
        request_end_time = #{requestEndTime,jdbcType=TIMESTAMP},
      </if>
      <if test="responseDate != null">
        response_date = #{responseDate,jdbcType=BIGINT},
      </if>
      <if test="requestParam != null">
        request_param = #{requestParam,jdbcType=LONGVARCHAR},
      </if>
      <if test="responseResult != null">
        response_result = #{responseResult,jdbcType=LONGVARCHAR},
      </if>
      <if test="errorInfo != null">
        error_info = #{errorInfo,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="cn.superdesk.uniorder.dao.entity.sys.logger.SysUserOperationLog">

    update sys_user_operation_log
    set nick_name = #{nickName,jdbcType=VARCHAR},
      user_name = #{userName,jdbcType=VARCHAR},
      method_name = #{methodName,jdbcType=VARCHAR},
      operation_time = #{operationTime,jdbcType=TIMESTAMP},
      request_ip = #{requestIp,jdbcType=VARCHAR},
      request_url = #{requestUrl,jdbcType=VARCHAR},
      result_status = #{resultStatus,jdbcType=VARCHAR},
      model = #{model,jdbcType=VARCHAR},
      request_start_time = #{requestStartTime,jdbcType=TIMESTAMP},
      request_end_time = #{requestEndTime,jdbcType=TIMESTAMP},
      response_date = #{responseDate,jdbcType=BIGINT},
      request_param = #{requestParam,jdbcType=LONGVARCHAR},
      response_result = #{responseResult,jdbcType=LONGVARCHAR},
      error_info = #{errorInfo,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.sys.logger.SysUserOperationLog">

    update sys_user_operation_log
    set nick_name = #{nickName,jdbcType=VARCHAR},
      user_name = #{userName,jdbcType=VARCHAR},
      method_name = #{methodName,jdbcType=VARCHAR},
      operation_time = #{operationTime,jdbcType=TIMESTAMP},
      request_ip = #{requestIp,jdbcType=VARCHAR},
      request_url = #{requestUrl,jdbcType=VARCHAR},
      result_status = #{resultStatus,jdbcType=VARCHAR},
      model = #{model,jdbcType=VARCHAR},
      request_start_time = #{requestStartTime,jdbcType=TIMESTAMP},
      request_end_time = #{requestEndTime,jdbcType=TIMESTAMP},
      response_date = #{responseDate,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>