<?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.QyzgQyzgxxDao">

  <resultMap id="BaseResultMap" type="com.unis.base.server.entity.QyzgQyzgxxDO">
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="STATUS" jdbcType="DECIMAL" property="status" />
    <result column="AREA_CODE" jdbcType="VARCHAR" property="areaCode" />
    <result column="AREA_NAME" jdbcType="VARCHAR" property="areaName" />
    <result column="CREATOR" jdbcType="VARCHAR" property="creator" />
    <result column="CREATOR_CODE" jdbcType="VARCHAR" property="creatorCode" />
    <result column="CREATE_DATE" jdbcType="DATE" property="createDate" />
    <result column="REFRESHER" jdbcType="VARCHAR" property="refresher" />
    <result column="REFRESHER_CODE" jdbcType="VARCHAR" property="refresherCode" />
    <result column="REFRESHER_DATE" jdbcType="DATE" property="refreshTime" />
    <result column="REMARK" jdbcType="VARCHAR" property="remark" />
    <result column="ZGSQ_ID" jdbcType="VARCHAR" property="zgsqId" />
    <result column="ZGLX_DM" jdbcType="VARCHAR" property="zglxDm" />
    <result column="ZGZBH" jdbcType="VARCHAR" property="zgzbh" />
    <result column="QY_ID" jdbcType="DECIMAL" property="qyId" />
    <result column="TYSHXYDM" jdbcType="VARCHAR" property="tyshxydm" />
    <result column="QY_MC" jdbcType="VARCHAR" property="qyMc" />
    <result column="YXQ_KSSJ" jdbcType="DATE" property="yxqKssj" />
    <result column="YXQ_JZSJ" jdbcType="DATE" property="yxqJssj" />
    <result column="ZGCXSJ" jdbcType="DATE" property="zgcxsj" />
    <result column="ZGCXR" jdbcType="VARCHAR" property="zgcxr" />
    <result column="ZGCXR_CODE" jdbcType="VARCHAR" property="zgcxrCode" />
    <result column="ZGCXYY" jdbcType="VARCHAR" property="zgcxyy" />
    <result column="XQNSFKZCSQ" jdbcType="DECIMAL" property="xqnsfkzcsq" />
  </resultMap>

  <sql id="Base_Column_List">
    ID, STATUS, AREA_CODE, AREA_NAME, CREATOR, CREATOR_CODE, CREATE_DATE, REFERSHER, 
    REFERSHER_CODE, REFERSHER_DATE, REMARK, ZGSQ_ID, ZGLX_DM, ZGZBH, QY_ID, TYSHXYDM, 
    QY_MC, YXQ_KSSJ, YXQ_JZSJ, ZGCXSJ, ZGCXR, ZGCXR_CODE, ZGCXYY, XQNSFKZCSQ
  </sql>

<!--  分页获取企业资格信息列表-->
  <select id="getCompanyQualification" parameterType="com.unis.base.common.vo.CompanyQualificationQueryVO" resultMap="BaseResultMap">
    SELECT <include refid="Base_Column_List"/>
    FROM QYZG_QYZGXX
    WHERE 1=1
    <if test=' tyshxydm != null and tyshxydm != "" '>
      AND tyshxydm LIKE concat(CONCAT('%',#{tyshxydm,jdbcType=VARCHAR}),'%')
    </if>
    <if test=" qyId != null ">
      AND qy_id = #{qyId,jdbcType=INTEGER}
    </if>
    <if test=' zglxDm != null and zglxDm != "" '>
      AND zglx_dm LIKE concat(CONCAT('%',#{zglxDm,jdbcType=VARCHAR}),'%')
    </if>
  </select>

<!--  获取企业资格信息详情-->
  <select id="getCompanyQualificationInfo" parameterType="java.util.Map" resultMap="BaseResultMap">
    SELECT <include refid="Base_Column_List"/>
    FROM QYZG_QYZGXX
    WHERE
    1=1
    <if test=' zglxDm != null and zglxDm != "" '>
        AND zglx_dm = #{zglxDm,jdbcType=VARCHAR}
    </if>
    <if test=" qyId != null ">
        AND qy_id = #{qyId,jdbcType=INTEGER}
    </if>
  </select>

  <insert id="insertSelective" parameterType="com.unis.base.server.entity.QyzgQyzgxxDO">
    insert into QYZG_QYZGXX
    <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="refersher != null">
        REFERSHER,
      </if>
      <if test="refersherCode != null">
        REFERSHER_CODE,
      </if>
      <if test="refreshTime != null">
        REFERSHER_DATE,
      </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>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=DECIMAL},
      </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="refersher != null">
        #{refersher,jdbcType=VARCHAR},
      </if>
      <if test="refersherCode != null">
        #{refersherCode,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=DECIMAL},
      </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=DECIMAL},
      </if>
    </trim>
  </insert>

  <update id="updateByPrimaryKeySelective" parameterType="com.unis.base.server.entity.QyzgQyzgxxDO">
    update QYZG_QYZGXX
    <set>
      <if test="status != null">
        STATUS = #{status,jdbcType=DECIMAL},
      </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="refersher != null">
        REFERSHER = #{refersher,jdbcType=VARCHAR},
      </if>
      <if test="refersherCode != null">
        REFERSHER_CODE = #{refersherCode,jdbcType=VARCHAR},
      </if>
      <if test="refreshTime != null">
        REFERSHER_DATE = #{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=DECIMAL},
      </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=DECIMAL},
      </if>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>

</mapper>