<?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.operation.ExcelImportLogMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.operation.ExcelImportLog">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="batch_id" jdbcType="VARCHAR" property="batchId" />
    <result column="operation_type" jdbcType="VARCHAR" property="operationType" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
    <result column="create_user_name" jdbcType="VARCHAR" property="createUserName" />
    <result column="validate_code" jdbcType="VARCHAR" property="validateCode" />
    <result column="process_result" jdbcType="TINYINT" property="processResult" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="cn.superdesk.uniorder.dao.entity.operation.ExcelImportLog">
    <result column="validate_message" jdbcType="LONGVARCHAR" property="validateMessage" />
    <result column="process_report" jdbcType="LONGVARCHAR" property="processReport" />
    <result column="row_data" jdbcType="LONGVARCHAR" property="rowData" />
  </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, batch_id, operation_type, create_time, create_user_id, create_user_name, validate_code, 
    process_result
  </sql>
  <sql id="Blob_Column_List">
    validate_message, process_report, row_data
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="cn.superdesk.uniorder.dao.entity.operation.ExcelImportLogExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from excel_import_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.operation.ExcelImportLogExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from excel_import_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 excel_import_log
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from excel_import_log
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.operation.ExcelImportLogExample">
    delete from excel_import_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.operation.ExcelImportLog">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into excel_import_log (batch_id, operation_type, create_time, 
      create_user_id, create_user_name, validate_code, 
      process_result, validate_message, process_report, 
      row_data)
    values (#{batchId,jdbcType=VARCHAR}, #{operationType,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{createUserId,jdbcType=BIGINT}, #{createUserName,jdbcType=VARCHAR}, #{validateCode,jdbcType=VARCHAR}, 
      #{processResult,jdbcType=TINYINT}, #{validateMessage,jdbcType=LONGVARCHAR}, #{processReport,jdbcType=LONGVARCHAR}, 
      #{rowData,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.operation.ExcelImportLog">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into excel_import_log
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="batchId != null">
        batch_id,
      </if>
      <if test="operationType != null">
        operation_type,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createUserId != null">
        create_user_id,
      </if>
      <if test="createUserName != null">
        create_user_name,
      </if>
      <if test="validateCode != null">
        validate_code,
      </if>
      <if test="processResult != null">
        process_result,
      </if>
      <if test="validateMessage != null">
        validate_message,
      </if>
      <if test="processReport != null">
        process_report,
      </if>
      <if test="rowData != null">
        row_data,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="batchId != null">
        #{batchId,jdbcType=VARCHAR},
      </if>
      <if test="operationType != null">
        #{operationType,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="createUserName != null">
        #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="validateCode != null">
        #{validateCode,jdbcType=VARCHAR},
      </if>
      <if test="processResult != null">
        #{processResult,jdbcType=TINYINT},
      </if>
      <if test="validateMessage != null">
        #{validateMessage,jdbcType=LONGVARCHAR},
      </if>
      <if test="processReport != null">
        #{processReport,jdbcType=LONGVARCHAR},
      </if>
      <if test="rowData != null">
        #{rowData,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.operation.ExcelImportLogExample" resultType="java.lang.Long">
    select count(*) from excel_import_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update excel_import_log
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.batchId != null">
        batch_id = #{record.batchId,jdbcType=VARCHAR},
      </if>
      <if test="record.operationType != null">
        operation_type = #{record.operationType,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createUserId != null">
        create_user_id = #{record.createUserId,jdbcType=BIGINT},
      </if>
      <if test="record.createUserName != null">
        create_user_name = #{record.createUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.validateCode != null">
        validate_code = #{record.validateCode,jdbcType=VARCHAR},
      </if>
      <if test="record.processResult != null">
        process_result = #{record.processResult,jdbcType=TINYINT},
      </if>
      <if test="record.validateMessage != null">
        validate_message = #{record.validateMessage,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.processReport != null">
        process_report = #{record.processReport,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.rowData != null">
        row_data = #{record.rowData,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update excel_import_log
    set id = #{record.id,jdbcType=BIGINT},
      batch_id = #{record.batchId,jdbcType=VARCHAR},
      operation_type = #{record.operationType,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_user_id = #{record.createUserId,jdbcType=BIGINT},
      create_user_name = #{record.createUserName,jdbcType=VARCHAR},
      validate_code = #{record.validateCode,jdbcType=VARCHAR},
      process_result = #{record.processResult,jdbcType=TINYINT},
      validate_message = #{record.validateMessage,jdbcType=LONGVARCHAR},
      process_report = #{record.processReport,jdbcType=LONGVARCHAR},
      row_data = #{record.rowData,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update excel_import_log
    set id = #{record.id,jdbcType=BIGINT},
      batch_id = #{record.batchId,jdbcType=VARCHAR},
      operation_type = #{record.operationType,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_user_id = #{record.createUserId,jdbcType=BIGINT},
      create_user_name = #{record.createUserName,jdbcType=VARCHAR},
      validate_code = #{record.validateCode,jdbcType=VARCHAR},
      process_result = #{record.processResult,jdbcType=TINYINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.operation.ExcelImportLog">
    update excel_import_log
    <set>
      <if test="batchId != null">
        batch_id = #{batchId,jdbcType=VARCHAR},
      </if>
      <if test="operationType != null">
        operation_type = #{operationType,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        create_user_id = #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="createUserName != null">
        create_user_name = #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="validateCode != null">
        validate_code = #{validateCode,jdbcType=VARCHAR},
      </if>
      <if test="processResult != null">
        process_result = #{processResult,jdbcType=TINYINT},
      </if>
      <if test="validateMessage != null">
        validate_message = #{validateMessage,jdbcType=LONGVARCHAR},
      </if>
      <if test="processReport != null">
        process_report = #{processReport,jdbcType=LONGVARCHAR},
      </if>
      <if test="rowData != null">
        row_data = #{rowData,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="cn.superdesk.uniorder.dao.entity.operation.ExcelImportLog">
    update excel_import_log
    set batch_id = #{batchId,jdbcType=VARCHAR},
      operation_type = #{operationType,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      create_user_name = #{createUserName,jdbcType=VARCHAR},
      validate_code = #{validateCode,jdbcType=VARCHAR},
      process_result = #{processResult,jdbcType=TINYINT},
      validate_message = #{validateMessage,jdbcType=LONGVARCHAR},
      process_report = #{processReport,jdbcType=LONGVARCHAR},
      row_data = #{rowData,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.operation.ExcelImportLog">
    update excel_import_log
    set batch_id = #{batchId,jdbcType=VARCHAR},
      operation_type = #{operationType,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      create_user_name = #{createUserName,jdbcType=VARCHAR},
      validate_code = #{validateCode,jdbcType=VARCHAR},
      process_result = #{processResult,jdbcType=TINYINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>