<?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.unis.base.server.dao.QyzgQyzgxxHisDao" >
  <resultMap id="BaseResultMap" type="com.unis.base.server.entity.QyzgQyzgxxHisDO" >
    <id column="ID" property="id" jdbcType="VARCHAR" />
    <result column="STATUS" property="status" jdbcType="INTEGER" />
    <result column="AREA_CODE" property="areaCode" jdbcType="VARCHAR" />
    <result column="AREA_NAME" property="areaName" jdbcType="VARCHAR" />
    <result column="CREATOR" property="creator" jdbcType="VARCHAR" />
    <result column="CREATOR_CODE" property="creatorCode" jdbcType="VARCHAR" />
    <result column="CREATE_DATE" property="createDate" jdbcType="DATE" />
    <result column="REFRESHER" property="refresher" jdbcType="VARCHAR" />
    <result column="REFRESHER_CODE" property="refresherCode" jdbcType="VARCHAR" />
    <result column="REFRESHER_TIME" property="refreshTime" jdbcType="DATE" />
    <result column="REMARK" property="remark" jdbcType="VARCHAR" />
    <result column="ZGSQ_ID" property="zgsqId" jdbcType="VARCHAR" />
    <result column="ZGLX_DM" property="zglxDm" jdbcType="VARCHAR" />
    <result column="ZGZBH" property="zgzbh" jdbcType="VARCHAR" />
    <result column="QY_ID" property="qyId" jdbcType="INTEGER" />
    <result column="TYSHXYDM" property="tyshxydm" jdbcType="VARCHAR" />
    <result column="QY_MC" property="qyMc" jdbcType="VARCHAR" />
    <result column="YXQ_KSSJ" property="yxqKssj" jdbcType="DATE" />
    <result column="YXQ_JZSJ" property="yxqJzsj" jdbcType="DATE" />
    <result column="ZGCXSJ" property="zgcxsj" jdbcType="DATE" />
    <result column="ZGCXR" property="zgcxr" jdbcType="VARCHAR" />
    <result column="ZGCXR_CODE" property="zgcxrCode" jdbcType="VARCHAR" />
    <result column="ZGCXYY" property="zgcxyy" jdbcType="VARCHAR" />
    <result column="XQNSFKZCSQ" property="xqnsfkzcsq" jdbcType="INTEGER" />
    <result column="KZZD_1" property="kzzd1" jdbcType="VARCHAR" />
    <result column="KZZD_2" property="kzzd2" jdbcType="VARCHAR" />
    <result column="KZZD_3" property="kzzd3" jdbcType="VARCHAR" />
    <result column="KZZD_4" property="kzzd4" jdbcType="VARCHAR" />
    <result column="KZZD_5" property="kzzd5" jdbcType="VARCHAR" />
    <result column="KZZD_6" property="kzzd6" jdbcType="VARCHAR" />
    <result column="KZZD_7" property="kzzd7" jdbcType="VARCHAR" />
    <result column="KZZD_8" property="kzzd8" jdbcType="VARCHAR" />
    <result column="KZZD_9" property="kzzd9" jdbcType="VARCHAR" />
    <result column="KZZD_10" property="kzzd10" jdbcType="VARCHAR" />
    <result column="SPYJ" property="spyj" jdbcType="VARCHAR" />
    <result column="SFBA" property="sfba" jdbcType="INTEGER" />
    
    <result column="SHRYBH" property="shrybh" jdbcType="VARCHAR" />
    <result column="SHRYMC" property="shrymc" jdbcType="VARCHAR" />
    <result column="SHBMBH" property="shbmbh" jdbcType="VARCHAR" />
    <result column="SHBMMC" property="shbmmc" jdbcType="VARCHAR" />
  </resultMap>
  
 
  <sql id="Base_Column_List" >
    ID, STATUS, AREA_CODE, AREA_NAME, CREATOR, CREATOR_CODE, CREATE_DATE, REFRESHER, 
    REFRESHER_CODE, REFRESHER_TIME, REMARK, ZGSQ_ID, ZGLX_DM, ZGZBH, QY_ID, TYSHXYDM, 
    QY_MC, YXQ_KSSJ, YXQ_JZSJ, ZGCXSJ, ZGCXR, ZGCXR_CODE, ZGCXYY, XQNSFKZCSQ, KZZD_1, 
    KZZD_2, KZZD_3, KZZD_4, KZZD_5, KZZD_6, KZZD_7, KZZD_8, KZZD_9, KZZD_10, SPYJ, SFBA, SHRYBH, SHRYMC, SHBMBH, SHBMMC
  </sql>
  
  <select id="selectUsePrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  select
  <include refid="Base_Column_List" />
    from QYZG_QYZGXX_HIS
    where ID = #{id,jdbcType=VARCHAR}
  </select>
  
  
  <insert id="insert" parameterType="com.unis.base.server.entity.QyzgQyzgxxHisDO" >
    insert into QYZG_QYZGXX_HIS (ID, STATUS, AREA_CODE, 
      AREA_NAME, CREATOR, CREATOR_CODE, 
      CREATE_DATE, REFRESHER, REFRESHER_CODE, 
      REFRESHER_TIME, REMARK, ZGSQ_ID, 
      ZGLX_DM, ZGZBH, QY_ID, 
      TYSHXYDM, QY_MC, YXQ_KSSJ, 
      YXQ_JZSJ, ZGCXSJ, ZGCXR, ZGCXR_CODE, 
      ZGCXYY, XQNSFKZCSQ, KZZD_1, 
      KZZD_2, KZZD_3, KZZD_4, 
      KZZD_5, KZZD_6, KZZD_7, 
      KZZD_8, KZZD_9, KZZD_10, 
      SPYJ, SFBA, SHRYBH, SHRYMC, SHBMBH, SHBMMC)
    values (#{id,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{areaCode,jdbcType=VARCHAR}, 
      #{areaName,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, #{creatorCode,jdbcType=VARCHAR}, 
      #{createDate,jdbcType=DATE}, #{refresher,jdbcType=VARCHAR}, #{refresherCode,jdbcType=VARCHAR},
      #{refreshTime,jdbcType=DATE}, #{remark,jdbcType=VARCHAR}, #{zgsqId,jdbcType=VARCHAR},
      #{zglxDm,jdbcType=VARCHAR}, #{zgzbh,jdbcType=VARCHAR}, #{qyId,jdbcType=INTEGER}, 
      #{tyshxydm,jdbcType=VARCHAR}, #{qyMc,jdbcType=VARCHAR}, #{yxqKssj,jdbcType=DATE}, 
      #{yxqJzsj,jdbcType=DATE}, #{zgcxsj,jdbcType=DATE}, #{zgcxr,jdbcType=VARCHAR}, #{zgcxrCode,jdbcType=VARCHAR}, 
      #{zgcxyy,jdbcType=VARCHAR}, #{xqnsfkzcsq,jdbcType=INTEGER}, #{kzzd1,jdbcType=VARCHAR}, 
      #{kzzd2,jdbcType=VARCHAR}, #{kzzd3,jdbcType=VARCHAR}, #{kzzd4,jdbcType=VARCHAR}, 
      #{kzzd5,jdbcType=VARCHAR}, #{kzzd6,jdbcType=VARCHAR}, #{kzzd7,jdbcType=VARCHAR}, 
      #{kzzd8,jdbcType=VARCHAR}, #{kzzd9,jdbcType=VARCHAR}, #{kzzd10,jdbcType=VARCHAR}, 
      #{spyj,jdbcType=VARCHAR}, #{sfba,jdbcType=INTEGER},  #{shrybh,jdbcType=VARCHAR}, #{shrymc,jdbcType=VARCHAR}, #{shbmbh,jdbcType=VARCHAR}, 
      #{shbmmc,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.unis.base.server.entity.QyzgQyzgxxHisDO" >
    insert into QYZG_QYZGXX_HIS
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        ID,
      </if>
      <if test="status != null" >
        STATUS,
      </if>
      <if test="areaCode != null" >
        AREA_CODE,
      </if>
      <if test="areaName != null" >
        AREA_NAME,
      </if>
      <if test="creator != null" >
        CREATOR,
      </if>
      <if test="creatorCode != null" >
        CREATOR_CODE,
      </if>
      <if test="createDate != null" >
        CREATE_DATE,
      </if>
      <if test="refresher != null" >
        REFRESHER,
      </if>
      <if test="refresherCode != null" >
        REFRESHER_CODE,
      </if>
      <if test="refreshTime != null" >
        REFRESHER_TIME,
      </if>
      <if test="remark != null" >
        REMARK,
      </if>
      <if test="zgsqId != null" >
        ZGSQ_ID,
      </if>
      <if test="zglxDm != null" >
        ZGLX_DM,
      </if>
      <if test="zgzbh != null" >
        ZGZBH,
      </if>
      <if test="qyId != null" >
        QY_ID,
      </if>
      <if test="tyshxydm != null" >
        TYSHXYDM,
      </if>
      <if test="qyMc != null" >
        QY_MC,
      </if>
      <if test="yxqKssj != null" >
        YXQ_KSSJ,
      </if>
      <if test="yxqJzsj != null" >
        YXQ_JZSJ,
      </if>
      <if test="zgcxsj != null" >
        ZGCXSJ,
      </if>
      <if test="zgcxr != null" >
        ZGCXR,
      </if>
      <if test="zgcxrCode != null" >
        ZGCXR_CODE,
      </if>
      <if test="zgcxyy != null" >
        ZGCXYY,
      </if>
      <if test="xqnsfkzcsq != null" >
        XQNSFKZCSQ,
      </if>
      <if test="kzzd1 != null" >
        KZZD_1,
      </if>
      <if test="kzzd2 != null" >
        KZZD_2,
      </if>
      <if test="kzzd3 != null" >
        KZZD_3,
      </if>
      <if test="kzzd4 != null" >
        KZZD_4,
      </if>
      <if test="kzzd5 != null" >
        KZZD_5,
      </if>
      <if test="kzzd6 != null" >
        KZZD_6,
      </if>
      <if test="kzzd7 != null" >
        KZZD_7,
      </if>
      <if test="kzzd8 != null" >
        KZZD_8,
      </if>
      <if test="kzzd9 != null" >
        KZZD_9,
      </if>
      <if test="kzzd10 != null" >
        KZZD_10,
      </if>
      <if test="spyj != null" >
        SPYJ,
      </if>
      <if test="sfba != null" >
        SFBA,
      </if>
      
      <if test="shrybh != null" >
        SHRYBH,
      </if>
      <if test="shrymc != null" >
        SHRYMC,
      </if>
      <if test="shbmbh != null" >
        SHBMBH,
      </if>
      <if test="shbmmc != null" >
        SHBMMC,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        #{status,jdbcType=INTEGER},
      </if>
      <if test="areaCode != null" >
        #{areaCode,jdbcType=VARCHAR},
      </if>
      <if test="areaName != null" >
        #{areaName,jdbcType=VARCHAR},
      </if>
      <if test="creator != null" >
        #{creator,jdbcType=VARCHAR},
      </if>
      <if test="creatorCode != null" >
        #{creatorCode,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null" >
        #{createDate,jdbcType=DATE},
      </if>
      <if test="refresher != null" >
        #{refresher,jdbcType=VARCHAR},
      </if>
      <if test="refresherCode != null" >
        #{refresherCode,jdbcType=VARCHAR},
      </if>
      <if test="refreshTime != null" >
        #{refreshTime,jdbcType=DATE},
      </if>
      <if test="remark != null" >
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="zgsqId != null" >
        #{zgsqId,jdbcType=VARCHAR},
      </if>
      <if test="zglxDm != null" >
        #{zglxDm,jdbcType=VARCHAR},
      </if>
      <if test="zgzbh != null" >
        #{zgzbh,jdbcType=VARCHAR},
      </if>
      <if test="qyId != null" >
        #{qyId,jdbcType=INTEGER},
      </if>
      <if test="tyshxydm != null" >
        #{tyshxydm,jdbcType=VARCHAR},
      </if>
      <if test="qyMc != null" >
        #{qyMc,jdbcType=VARCHAR},
      </if>
      <if test="yxqKssj != null" >
        #{yxqKssj,jdbcType=DATE},
      </if>
      <if test="yxqJzsj != null" >
        #{yxqJzsj,jdbcType=DATE},
      </if>
      <if test="zgcxsj != null" >
        #{zgcxsj,jdbcType=DATE},
      </if>
      <if test="zgcxr != null" >
        #{zgcxr,jdbcType=VARCHAR},
      </if>
      <if test="zgcxrCode != null" >
        #{zgcxrCode,jdbcType=VARCHAR},
      </if>
      <if test="zgcxyy != null" >
        #{zgcxyy,jdbcType=VARCHAR},
      </if>
      <if test="xqnsfkzcsq != null" >
        #{xqnsfkzcsq,jdbcType=INTEGER},
      </if>
      <if test="kzzd1 != null" >
        #{kzzd1,jdbcType=VARCHAR},
      </if>
      <if test="kzzd2 != null" >
        #{kzzd2,jdbcType=VARCHAR},
      </if>
      <if test="kzzd3 != null" >
        #{kzzd3,jdbcType=VARCHAR},
      </if>
      <if test="kzzd4 != null" >
        #{kzzd4,jdbcType=VARCHAR},
      </if>
      <if test="kzzd5 != null" >
        #{kzzd5,jdbcType=VARCHAR},
      </if>
      <if test="kzzd6 != null" >
        #{kzzd6,jdbcType=VARCHAR},
      </if>
      <if test="kzzd7 != null" >
        #{kzzd7,jdbcType=VARCHAR},
      </if>
      <if test="kzzd8 != null" >
        #{kzzd8,jdbcType=VARCHAR},
      </if>
      <if test="kzzd9 != null" >
        #{kzzd9,jdbcType=VARCHAR},
      </if>
      <if test="kzzd10 != null" >
        #{kzzd10,jdbcType=VARCHAR},
      </if>
      <if test="spyj != null" >
        #{spyj,jdbcType=VARCHAR},
      </if>
      <if test="sfba != null" >
        #{sfba,jdbcType=INTEGER},
      </if>
      
      <if test="shrybh != null" >
        #{shrybh,jdbcType=VARCHAR},
      </if>
      <if test="shrymc != null" >
        #{shrymc,jdbcType=VARCHAR},
      </if>
      <if test="shbmbh != null" >
        #{shbmbh,jdbcType=VARCHAR},
      </if>
      <if test="shbmmc != null" >
        #{shbmmc,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  
  
  
  <update id="updateByPrimaryKeySelective" parameterType="com.unis.base.server.entity.QyzgQyzgxxHisDO" >
    update QYZG_QYZGXX_HIS
    <set >
      <if test="status != null" >
        STATUS = #{status,jdbcType=INTEGER},
      </if>
      <if test="areaCode != null" >
        AREA_CODE = #{areaCode,jdbcType=VARCHAR},
      </if>
      <if test="areaName != null" >
        AREA_NAME = #{areaName,jdbcType=VARCHAR},
      </if>
      <if test="creator != null" >
        CREATOR = #{creator,jdbcType=VARCHAR},
      </if>
      <if test="creatorCode != null" >
        CREATOR_CODE = #{creatorCode,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null" >
        CREATE_DATE = #{createDate,jdbcType=DATE},
      </if>
      <if test="refresher != null" >
        REFRESHER = #{refresher,jdbcType=VARCHAR},
      </if>
      <if test="refresherCode != null" >
        REFRESHER_CODE = #{refresherCode,jdbcType=VARCHAR},
      </if>
      <if test="refreshTime != null" >
        REFRESHER_TIME = #{refreshTime,jdbcType=DATE},
      </if>
      <if test="remark != null" >
        REMARK = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="zgsqId != null" >
        ZGSQ_ID = #{zgsqId,jdbcType=VARCHAR},
      </if>
      <if test="zglxDm != null" >
        ZGLX_DM = #{zglxDm,jdbcType=VARCHAR},
      </if>
      <if test="zgzbh != null" >
        ZGZBH = #{zgzbh,jdbcType=VARCHAR},
      </if>
      <if test="qyId != null" >
        QY_ID = #{qyId,jdbcType=INTEGER},
      </if>
      <if test="tyshxydm != null" >
        TYSHXYDM = #{tyshxydm,jdbcType=VARCHAR},
      </if>
      <if test="qyMc != null" >
        QY_MC = #{qyMc,jdbcType=VARCHAR},
      </if>
      <if test="yxqKssj != null" >
        YXQ_KSSJ = #{yxqKssj,jdbcType=DATE},
      </if>
      <if test="yxqJzsj != null" >
        YXQ_JZSJ = #{yxqJzsj,jdbcType=DATE},
      </if>
      <if test="zgcxsj != null" >
        ZGCXSJ = #{zgcxsj,jdbcType=DATE},
      </if>
      <if test="zgcxr != null" >
        ZGCXR = #{zgcxr,jdbcType=VARCHAR},
      </if>
      <if test="zgcxrCode != null" >
        ZGCXR_CODE = #{zgcxrCode,jdbcType=VARCHAR},
      </if>
      <if test="zgcxyy != null" >
        ZGCXYY = #{zgcxyy,jdbcType=VARCHAR},
      </if>
      <if test="xqnsfkzcsq != null" >
        XQNSFKZCSQ = #{xqnsfkzcsq,jdbcType=INTEGER},
      </if>
      <if test="kzzd1 != null" >
        KZZD_1 = #{kzzd1,jdbcType=VARCHAR},
      </if>
      <if test="kzzd2 != null" >
        KZZD_2 = #{kzzd2,jdbcType=VARCHAR},
      </if>
      <if test="kzzd3 != null" >
        KZZD_3 = #{kzzd3,jdbcType=VARCHAR},
      </if>
      <if test="kzzd4 != null" >
        KZZD_4 = #{kzzd4,jdbcType=VARCHAR},
      </if>
      <if test="kzzd5 != null" >
        KZZD_5 = #{kzzd5,jdbcType=VARCHAR},
      </if>
      <if test="kzzd6 != null" >
        KZZD_6 = #{kzzd6,jdbcType=VARCHAR},
      </if>
      <if test="kzzd7 != null" >
        KZZD_7 = #{kzzd7,jdbcType=VARCHAR},
      </if>
      <if test="kzzd8 != null" >
        KZZD_8 = #{kzzd8,jdbcType=VARCHAR},
      </if>
      <if test="kzzd9 != null" >
        KZZD_9 = #{kzzd9,jdbcType=VARCHAR},
      </if>
      <if test="kzzd10 != null" >
        KZZD_10 = #{kzzd10,jdbcType=VARCHAR},
      </if>
      <if test="spyj != null" >
        SPYJ = #{spyj,jdbcType=VARCHAR},
      </if>
      <if test="sfba != null" >
        SFBA = #{sfba,jdbcType=INTEGER},
      </if>
      
      <if test="shrybh != null" >
        SHRYBH = #{shrybh,jdbcType=VARCHAR},
      </if>
      <if test="shrymc != null" >
        SHRYMC = #{shrymc,jdbcType=VARCHAR},
      </if>
      <if test="shbmbh != null" >
        SHBMBH = #{shbmbh,jdbcType=VARCHAR},
      </if>
      <if test="shbmmc != null" >
        SHBMMC = #{shbmmc,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.unis.base.server.entity.QyzgQyzgxxHisDO" >
    update QYZG_QYZGXX_HIS
    set STATUS = #{status,jdbcType=INTEGER},
      AREA_CODE = #{areaCode,jdbcType=VARCHAR},
      AREA_NAME = #{areaName,jdbcType=VARCHAR},
      CREATOR = #{creator,jdbcType=VARCHAR},
      CREATOR_CODE = #{creatorCode,jdbcType=VARCHAR},
      CREATE_DATE = #{createDate,jdbcType=DATE},
      REFRESHER = #{refresher,jdbcType=VARCHAR},
      REFRESHER_CODE = #{refresherCode,jdbcType=VARCHAR},
      REFRESHER_TIME = #{refreshTime,jdbcType=DATE},
      REMARK = #{remark,jdbcType=VARCHAR},
      ZGSQ_ID = #{zgsqId,jdbcType=VARCHAR},
      ZGLX_DM = #{zglxDm,jdbcType=VARCHAR},
      ZGZBH = #{zgzbh,jdbcType=VARCHAR},
      QY_ID = #{qyId,jdbcType=INTEGER},
      TYSHXYDM = #{tyshxydm,jdbcType=VARCHAR},
      QY_MC = #{qyMc,jdbcType=VARCHAR},
      YXQ_KSSJ = #{yxqKssj,jdbcType=DATE},
      YXQ_JZSJ = #{yxqJzsj,jdbcType=DATE},
      ZGCXSJ = #{zgcxsj,jdbcType=DATE},
      ZGCXR = #{zgcxr,jdbcType=VARCHAR},
      ZGCXR_CODE = #{zgcxrCode,jdbcType=VARCHAR},
      ZGCXYY = #{zgcxyy,jdbcType=VARCHAR},
      XQNSFKZCSQ = #{xqnsfkzcsq,jdbcType=INTEGER},
      KZZD_1 = #{kzzd1,jdbcType=VARCHAR},
      KZZD_2 = #{kzzd2,jdbcType=VARCHAR},
      KZZD_3 = #{kzzd3,jdbcType=VARCHAR},
      KZZD_4 = #{kzzd4,jdbcType=VARCHAR},
      KZZD_5 = #{kzzd5,jdbcType=VARCHAR},
      KZZD_6 = #{kzzd6,jdbcType=VARCHAR},
      KZZD_7 = #{kzzd7,jdbcType=VARCHAR},
      KZZD_8 = #{kzzd8,jdbcType=VARCHAR},
      KZZD_9 = #{kzzd9,jdbcType=VARCHAR},
      KZZD_10 = #{kzzd10,jdbcType=VARCHAR},
      SPYJ = #{spyj,jdbcType=VARCHAR},
      SFBA = #{sfba,jdbcType=INTEGER},
      
      SHRYBH = #{shrybh,jdbcType=VARCHAR},
      SHRYMC = #{shrymc,jdbcType=VARCHAR},
      SHBMBH = #{shbmbh,jdbcType=VARCHAR},
      SHBMMC = #{shbmmc,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  
  
  <select id="getList" resultMap="BaseResultMap" parameterType="com.unis.base.common.vo.EnterpriseQualificationInformationHisqueryVO" >
    select 
    <include refid="Base_Column_List" />
    from QYZG_QYZGXX_HIS
    where STATUS=1
  </select>
  
  <!-- 主键 -->
  <select id="getMaxCodeById" parameterType="java.lang.String" resultType="java.lang.String">
        SELECT 
        	max(ID) 
        from 
			QYZG_QYZGXX_HIS
			where ID LIKE CONCAT(#{pstr,jdbcType=VARCHAR}, '%') and status=1
  </select>
    
</mapper>