<?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.gic.haoban.manage.service.dao.mapper.TabHaobanBatchAuditLogMapper" >
  <resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanBatchAuditLog" >
    <id column="batch_audit_log_id" property="batchAuditLogId" jdbcType="VARCHAR" />
    <result column="audit_id" property="auditId" jdbcType="VARCHAR" />
    <result column="batch_id" property="batchId" jdbcType="VARCHAR" />
    <result column="enterprise_name" property="enterpriseName" jdbcType="VARCHAR" />
    <result column="commit_name" property="commitName" jdbcType="VARCHAR" />
    <result column="commit_time" property="commitTime" jdbcType="TIMESTAMP" />
    <result column="audit_result" property="auditResult" jdbcType="INTEGER" />
    <result column="audit_type" property="auditType" jdbcType="INTEGER" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
    <result column="status" property="status" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
    batch_audit_log_id, audit_id, batch_id, enterprise_name, commit_name, commit_time, 
    audit_result, audit_type, create_time, update_time, status
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from tab_haoban_batch_audit_log
    where batch_audit_log_id = #{batchAuditLogId,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from tab_haoban_batch_audit_log
    where batch_audit_log_id = #{batchAuditLogId,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanBatchAuditLog" >
    insert into tab_haoban_batch_audit_log (batch_audit_log_id, audit_id, batch_id, 
      enterprise_name, commit_name, commit_time, 
      audit_result, audit_type, create_time, 
      update_time, status)
    values (#{batchAuditLogId,jdbcType=VARCHAR}, #{auditId,jdbcType=VARCHAR}, #{batchId,jdbcType=VARCHAR}, 
      #{enterpriseName,jdbcType=VARCHAR}, #{commitName,jdbcType=VARCHAR}, #{commitTime,jdbcType=TIMESTAMP}, 
      #{auditResult,jdbcType=INTEGER}, #{auditType,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanBatchAuditLog" >
    insert into tab_haoban_batch_audit_log
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="batchAuditLogId != null" >
        batch_audit_log_id,
      </if>
      <if test="auditId != null" >
        audit_id,
      </if>
      <if test="batchId != null" >
        batch_id,
      </if>
      <if test="enterpriseName != null" >
        enterprise_name,
      </if>
      <if test="commitName != null" >
        commit_name,
      </if>
      <if test="commitTime != null" >
        commit_time,
      </if>
      <if test="auditResult != null" >
        audit_result,
      </if>
      <if test="auditType != null" >
        audit_type,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
      <if test="status != null" >
        status,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="batchAuditLogId != null" >
        #{batchAuditLogId,jdbcType=VARCHAR},
      </if>
      <if test="auditId != null" >
        #{auditId,jdbcType=VARCHAR},
      </if>
      <if test="batchId != null" >
        #{batchId,jdbcType=VARCHAR},
      </if>
      <if test="enterpriseName != null" >
        #{enterpriseName,jdbcType=VARCHAR},
      </if>
      <if test="commitName != null" >
        #{commitName,jdbcType=VARCHAR},
      </if>
      <if test="commitTime != null" >
        #{commitTime,jdbcType=TIMESTAMP},
      </if>
      <if test="auditResult != null" >
        #{auditResult,jdbcType=INTEGER},
      </if>
      <if test="auditType != null" >
        #{auditType,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null" >
        #{status,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanBatchAuditLog" >
    update tab_haoban_batch_audit_log
    <set >
      <if test="auditId != null" >
        audit_id = #{auditId,jdbcType=VARCHAR},
      </if>
      <if test="batchId != null" >
        batch_id = #{batchId,jdbcType=VARCHAR},
      </if>
      <if test="enterpriseName != null" >
        enterprise_name = #{enterpriseName,jdbcType=VARCHAR},
      </if>
      <if test="commitName != null" >
        commit_name = #{commitName,jdbcType=VARCHAR},
      </if>
      <if test="commitTime != null" >
        commit_time = #{commitTime,jdbcType=TIMESTAMP},
      </if>
      <if test="auditResult != null" >
        audit_result = #{auditResult,jdbcType=INTEGER},
      </if>
      <if test="auditType != null" >
        audit_type = #{auditType,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=INTEGER},
      </if>
    </set>
    where batch_audit_log_id = #{batchAuditLogId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanBatchAuditLog" >
    update tab_haoban_batch_audit_log
    set audit_id = #{auditId,jdbcType=VARCHAR},
      batch_id = #{batchId,jdbcType=VARCHAR},
      enterprise_name = #{enterpriseName,jdbcType=VARCHAR},
      commit_name = #{commitName,jdbcType=VARCHAR},
      commit_time = #{commitTime,jdbcType=TIMESTAMP},
      audit_result = #{auditResult,jdbcType=INTEGER},
      audit_type = #{auditType,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      status = #{status,jdbcType=INTEGER}
    where batch_audit_log_id = #{batchAuditLogId,jdbcType=VARCHAR}
  </update>
  
    <select id="listByBatchId" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from tab_haoban_batch_audit_log
    where batch_id = #{batchId,jdbcType=VARCHAR}
    	and status = 1
  </select>
  
</mapper>