<?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.QybgsqDao'>
  
  <!--lipenghe-->
  <!--企业变更申请表  单表[TY_QYBGSQ]表
        和实体基础映射-->
  <resultMap id='ResultMapBase' type='com.unis.base.server.entity.QybgsqDO'>
    <id column='SQID' jdbcType='VARCHAR' property='sqid' /><!--变更申请id#<主键><唯一><检索><非空>-->
    <result column='QYMC' jdbcType='VARCHAR' property='qymc' /><!--企业名称#<检索><非空>-->
    <result column='TYSHXYDM' jdbcType='VARCHAR' property='tyshxydm' /><!--统一社会信用代码#<非空>-->
    <result column='SQQYBM' jdbcType='VARCHAR' property='sqqybm' /><!--申请区域编码#<检索>-->
    <result column='SQQYBMMC' jdbcType='VARCHAR' property='sqqybmmc' /><!--申请区域编码名称-->
    <result column='SQQY' jdbcType='VARCHAR' property='sqqy' /><!--申请原因-->
    <result column='SQRID' jdbcType='VARCHAR' property='sqrid' /><!--申请人id#<检索>-->
    <result column='SQRIDMC' jdbcType='VARCHAR' property='sqridmc' /><!--申请人名称-->
    <result column='SQSJ' jdbcType='TIMESTAMP' property='sqsj' /><!--申请时间#<默认值:current>-->
    <result column='SFTY' jdbcType='VARCHAR' property='sfty' /><!--是否同意#<检索>-->
    <result column='SPYJ' jdbcType='VARCHAR' property='spyj' /><!--审批意见-->
    <result column='SPRID' jdbcType='VARCHAR' property='sprid' /><!--审批人id-->
    <result column='SPRIDMC' jdbcType='VARCHAR' property='spridmc' /><!--审批人名称-->
    <result column='SPSJ' jdbcType='TIMESTAMP' property='spsj' /><!--审批时间#<默认值:current>-->
    <result column='STATUS' jdbcType='DECIMAL' property='status' /><!--数据状态-->
    <result column='VERSION' jdbcType='DECIMAL' property='version' /><!--数据版本-->
    <result column='CREATOR' jdbcType='VARCHAR' property='creator' /><!--创建人-->
    <result column='CREATOR_CODE' jdbcType='VARCHAR' property='creatorCode' /><!--创建人编码-->
    <result column='CREATE_DATE' jdbcType='TIMESTAMP' property='createDate' /><!--创建时间#<默认值:current>-->
    <result column='REFRESHER' jdbcType='VARCHAR' property='refresher' /><!--修改人-->
    <result column='REFRESHER_CODE' jdbcType='VARCHAR' property='refresherCode' /><!--修改人编码-->
    <result column='REFRESH_TIME' jdbcType='TIMESTAMP' property='refreshTime' /><!--修改时间#<默认值:current>-->
    <result column='REMARK' jdbcType='VARCHAR' property='remark' /><!--备注-->
    <result column='BGQQYBM' jdbcType='VARCHAR' property='bgqqybm' /><!--变更前区域编码-->
    <result column='BGQQYBMMC' jdbcType='VARCHAR' property='bgqqybmmc' /><!--变更前区域编码名称-->
  </resultMap>
  
  <!--[TY_QYBGSQ]表基础列-->
  <sql id='Column_Base_List'>
    SQID, QYMC, TYSHXYDM, SQQYBM, SQQYBMMC, SQQY, SQRID, SQRIDMC, SQSJ, SFTY, SPYJ, SPRID, 
    SPRIDMC, SPSJ, STATUS, VERSION, CREATOR, CREATOR_CODE, CREATE_DATE, REFRESHER, REFRESHER_CODE, 
    REFRESH_TIME, REMARK, BGQQYBM, BGQQYBMMC
  </sql>
  
  <!--[TY_QYBGSQ]带别名的表基础列,别名为大写表名-->
  <sql id='Column_Alias_List'>
    A.SQID, A.QYMC, A.TYSHXYDM, A.SQQYBM, A.SQQYBMMC, A.SQQY, A.SQRID, A.SQRIDMC, A.SQSJ, 
    A.SFTY, A.SPYJ, A.SPRID, A.SPRIDMC, A.SPSJ, A.STATUS, A.VERSION, A.CREATOR, A.CREATOR_CODE, 
    A.CREATE_DATE, A.REFRESHER, A.REFRESHER_CODE, A.REFRESH_TIME, A.REMARK, A.BGQQYBM, 
    A.BGQQYBMMC
  </sql>
  
  <!--[TY_QYBGSQ]表 order by 条件-->
  <sql id='Order_By_Clause'>
    ORDER BY SQID ASC
  </sql>
  
  <!--[TY_QYBGSQ]表 order by 条件-->
  <sql id='Order_By_Alias_Clause'>
     ORDER BY A.SQID ASC
  </sql>
  
  <!--批量插入全部字段,[GBase Server]特别注意:批量插入全部字段时,数据库默认值会不起效-->
  <insert id='insertBatchEntityList'>
    insert into TY_QYBGSQ (SQID, QYMC, TYSHXYDM, 
      SQQYBM, SQQYBMMC, SQQY, 
      SQRID, SQRIDMC, SQSJ, 
      SFTY, SPYJ, SPRID, 
      SPRIDMC, SPSJ, STATUS, 
      VERSION, CREATOR, CREATOR_CODE, 
      CREATE_DATE, REFRESHER, REFRESHER_CODE, 
      REFRESH_TIME, REMARK, BGQQYBM, 
      BGQQYBMMC)  SELECT * FROM 
    <foreach close=')' collection='list' index='index' item='item' open='(' separator='UNION ALL'>
       SELECT #{item.sqid,jdbcType=VARCHAR}, #{item.qymc,jdbcType=VARCHAR}, #{item.tyshxydm,jdbcType=VARCHAR}, 
        #{item.sqqybm,jdbcType=VARCHAR}, #{item.sqqybmmc,jdbcType=VARCHAR}, #{item.sqqy,jdbcType=VARCHAR}, 
        #{item.sqrid,jdbcType=VARCHAR}, #{item.sqridmc,jdbcType=VARCHAR}, #{item.sqsj,jdbcType=TIMESTAMP}, 
        #{item.sfty,jdbcType=VARCHAR}, #{item.spyj,jdbcType=VARCHAR}, #{item.sprid,jdbcType=VARCHAR}, 
        #{item.spridmc,jdbcType=VARCHAR}, #{item.spsj,jdbcType=TIMESTAMP}, #{item.status,jdbcType=DECIMAL}, 
        #{item.version,jdbcType=DECIMAL}, #{item.creator,jdbcType=VARCHAR}, #{item.creatorCode,jdbcType=VARCHAR}, 
        #{item.createDate,jdbcType=TIMESTAMP}, #{item.refresher,jdbcType=VARCHAR}, #{item.refresherCode,jdbcType=VARCHAR}, 
        #{item.refreshTime,jdbcType=TIMESTAMP}, #{item.remark,jdbcType=VARCHAR}, #{item.bgqqybm,jdbcType=VARCHAR}, 
        #{item.bgqqybmmc,jdbcType=VARCHAR} FROM DUAL 
    </foreach>
  </insert>
  
  <!--更改状态-->
  <update id='updateStatusByEntity'>
    update TY_QYBGSQ
    <set>
      <if test='tyshxydm != null'>
        TYSHXYDM = #{tyshxydm,jdbcType=VARCHAR},
      </if>
      <if test='refresher != null'>
        REFRESHER = #{refresher,jdbcType=VARCHAR},
      </if>
      <if test='refresherCode != null'>
        REFRESHER_CODE = #{refresherCode,jdbcType=VARCHAR},
      </if>
      <if test='refreshTime != null'>
        REFRESH_TIME = #{refreshTime,jdbcType=TIMESTAMP},
      </if>
      <if test='sqqybm != null'>
        SQQYBM = #{sqqybm,jdbcType=VARCHAR},
      </if>
      <if test='sqqybmmc != null'>
        SQQYBMMC = #{sqqybmmc,jdbcType=VARCHAR},
      </if>
      <if test='bgqqybm != null'>
        BGQQYBM = #{bgqqybm,jdbcType=VARCHAR},
      </if>
      <if test='bgqqybmmc != null'>
        BGQQYBMMC = #{bgqqybmmc,jdbcType=VARCHAR},
      </if>
      <if test='sqqy != null'>
        SQQY = #{sqqy,jdbcType=VARCHAR},
      </if>
      <if test='sqrid != null'>
        SQRID = #{sqrid,jdbcType=VARCHAR},
      </if>
      <if test='sqridmc != null'>
        SQRIDMC = #{sqridmc,jdbcType=VARCHAR},
      </if>
      <if test='sqsj != null'>
        SQSJ = #{sqsj,jdbcType=TIMESTAMP},
      </if>
      <if test='spyj != null'>
        SPYJ = #{spyj,jdbcType=VARCHAR},
      </if>
      <if test='sprid != null'>
        SPRID = #{sprid,jdbcType=VARCHAR},
      </if>
      <if test='spridmc != null'>
        SPRIDMC = #{spridmc,jdbcType=VARCHAR},
      </if>
      <if test='spsj != null'>
        SPSJ = #{spsj,jdbcType=TIMESTAMP},
      </if>
      <if test='sfty != null'>
        SFTY = #{sfty,jdbcType=VARCHAR},
      </if>
      <if test='qymc != null'>
        QYMC = #{qymc,jdbcType=VARCHAR},
      </if>
      <if test='creatorCode != null'>
        CREATOR_CODE = #{creatorCode,jdbcType=VARCHAR},
      </if>
        VERSION = VERSION +1 
    </set>
    <where>
      <!--此处为必填条件,如不满足则不执行,以免更新全部-->
      <choose>
        <when test='sqid !=null and sqid != ""'>
          AND SQID = #{sqid,jdbcType=VARCHAR}
        </when>
        <otherwise>
          AND 1=0
        </otherwise>
      </choose>
      <!--version乐观锁-->
      <if test='version !=null'>
        AND VERSION = #{version,jdbcType=DECIMAL}
      </if>
    </where>
  </update>
  
  <!--根据实体批量更新全部字段,[GBase Server]批量更新全部字段-->
  <update id='updateBatchByEntityList' parameterType='java.util.List'>
    <foreach collection='list' index='index' item='item' separator=';'>
      update TY_QYBGSQ
      set QYMC = #{item.qymc,jdbcType=VARCHAR},
        TYSHXYDM = #{item.tyshxydm,jdbcType=VARCHAR},
        SQQYBM = #{item.sqqybm,jdbcType=VARCHAR},
        SQQYBMMC = #{item.sqqybmmc,jdbcType=VARCHAR},
        SQQY = #{item.sqqy,jdbcType=VARCHAR},
        SQRID = #{item.sqrid,jdbcType=VARCHAR},
        SQRIDMC = #{item.sqridmc,jdbcType=VARCHAR},
        SQSJ = #{item.sqsj,jdbcType=TIMESTAMP},
        SFTY = #{item.sfty,jdbcType=VARCHAR},
        SPYJ = #{item.spyj,jdbcType=VARCHAR},
        SPRID = #{item.sprid,jdbcType=VARCHAR},
        SPRIDMC = #{item.spridmc,jdbcType=VARCHAR},
        SPSJ = #{item.spsj,jdbcType=TIMESTAMP},
        STATUS = #{item.status,jdbcType=DECIMAL},
        REFRESHER = #{item.refresher,jdbcType=VARCHAR},
        REFRESHER_CODE = #{item.refresherCode,jdbcType=VARCHAR},
        REFRESH_TIME = #{item.refreshTime,jdbcType=TIMESTAMP},
        REMARK = #{item.remark,jdbcType=VARCHAR},
        BGQQYBM = #{item.bgqqybm,jdbcType=VARCHAR},
        BGQQYBMMC = #{item.bgqqybmmc,jdbcType=VARCHAR}
      <where>
        <!--此处为必填条件,如不满足则不执行,以免更新全部-->
        <choose>
          <when test='item.sqid !=null and item.sqid != ""'>
            SQID = #{item.sqid,jdbcType=VARCHAR}
          </when>
          <otherwise>
            AND 1=0
          </otherwise>
        </choose>
        <!--此处可添加状态条件等-->
        <if test='item.status!=null'>
          AND STATUS = #{item.status,jdbcType=DECIMAL}
        </if>
      </where>
    </foreach>
  </update>
  
  <!--根据实体某些属性更新全部字段-->
  <update id='updateByEntity'>
    update TY_QYBGSQ
    set QYMC = #{qymc,jdbcType=VARCHAR},
      TYSHXYDM = #{tyshxydm,jdbcType=VARCHAR},
      SQQYBM = #{sqqybm,jdbcType=VARCHAR},
      SQQYBMMC = #{sqqybmmc,jdbcType=VARCHAR},
      SQQY = #{sqqy,jdbcType=VARCHAR},
      SQRID = #{sqrid,jdbcType=VARCHAR},
      SQRIDMC = #{sqridmc,jdbcType=VARCHAR},
      SQSJ = #{sqsj,jdbcType=TIMESTAMP},
      SFTY = #{sfty,jdbcType=VARCHAR},
      SPYJ = #{spyj,jdbcType=VARCHAR},
      SPRID = #{sprid,jdbcType=VARCHAR},
      SPRIDMC = #{spridmc,jdbcType=VARCHAR},
      SPSJ = #{spsj,jdbcType=TIMESTAMP},
      STATUS = #{status,jdbcType=DECIMAL},
      REFRESHER = #{refresher,jdbcType=VARCHAR},
      REFRESHER_CODE = #{refresherCode,jdbcType=VARCHAR},
      REFRESH_TIME = #{refreshTime,jdbcType=TIMESTAMP},
      REMARK = #{remark,jdbcType=VARCHAR},
      BGQQYBM = #{bgqqybm,jdbcType=VARCHAR},
      BGQQYBMMC = #{bgqqybmmc,jdbcType=VARCHAR},
      VERSION = VERSION +1 
    <where>
      <!--此处为必填条件,如不满足则不执行,以免更新全部-->
      <choose>
        <when test='sqid !=null and sqid != ""'>
          AND SQID = #{sqid,jdbcType=VARCHAR}
        </when>
        <otherwise>
          AND 1=0
        </otherwise>
      </choose>
      <!--version乐观锁-->
      <if test='version !=null'>
        AND VERSION = #{version,jdbcType=DECIMAL}
      </if>
      <!--此处可添加状态条件等-->
      <if test='status!=null'>
        AND STATUS = #{status,jdbcType=DECIMAL}
      </if>
    </where>
  </update>
  
  <!--根据实体不为空的属性,选择性更新字段-->
  <update id='updateByEntitySelective'>
    update TY_QYBGSQ
    <set>
      <if test='qymc != null'>
        QYMC = #{qymc,jdbcType=VARCHAR},
      </if>
      <if test='tyshxydm != null'>
        TYSHXYDM = #{tyshxydm,jdbcType=VARCHAR},
      </if>
      <if test='sqqybm != null'>
        SQQYBM = #{sqqybm,jdbcType=VARCHAR},
      </if>
      <if test='sqqybmmc != null'>
        SQQYBMMC = #{sqqybmmc,jdbcType=VARCHAR},
      </if>
      <if test='sqqy != null'>
        SQQY = #{sqqy,jdbcType=VARCHAR},
      </if>
      <if test='sqrid != null'>
        SQRID = #{sqrid,jdbcType=VARCHAR},
      </if>
      <if test='sqridmc != null'>
        SQRIDMC = #{sqridmc,jdbcType=VARCHAR},
      </if>
      <if test='sqsj != null'>
        SQSJ = #{sqsj,jdbcType=TIMESTAMP},
      </if>
      <if test='sfty != null'>
        SFTY = #{sfty,jdbcType=VARCHAR},
      </if>
      <if test='spyj != null'>
        SPYJ = #{spyj,jdbcType=VARCHAR},
      </if>
      <if test='sprid != null'>
        SPRID = #{sprid,jdbcType=VARCHAR},
      </if>
      <if test='spridmc != null'>
        SPRIDMC = #{spridmc,jdbcType=VARCHAR},
      </if>
      <if test='spsj != null'>
        SPSJ = #{spsj,jdbcType=TIMESTAMP},
      </if>
      <if test='status != null'>
        STATUS = #{status,jdbcType=DECIMAL},
      </if>
      <if test='refresher != null'>
        REFRESHER = #{refresher,jdbcType=VARCHAR},
      </if>
      <if test='refresherCode != null'>
        REFRESHER_CODE = #{refresherCode,jdbcType=VARCHAR},
      </if>
      <if test='refreshTime != null'>
        REFRESH_TIME = #{refreshTime,jdbcType=TIMESTAMP},
      </if>
      <if test='remark != null'>
        REMARK = #{remark,jdbcType=VARCHAR},
      </if>
      <if test='bgqqybm != null'>
        BGQQYBM = #{bgqqybm,jdbcType=VARCHAR},
      </if>
      <if test='bgqqybmmc != null'>
        BGQQYBMMC = #{bgqqybmmc,jdbcType=VARCHAR},
      </if>
        VERSION = VERSION +1 
    </set>
    <where>
      <!--此处为必填条件,如不满足则不执行,以免更新全部-->
      <choose>
        <when test='sqid !=null and sqid != ""'>
          AND SQID = #{sqid,jdbcType=VARCHAR}
        </when>
        <otherwise>
          AND 1=0
        </otherwise>
      </choose>
      <!--version乐观锁-->
      <if test='version !=null'>
        AND VERSION = #{version,jdbcType=DECIMAL}
      </if>
      <!--此处可添加状态条件等-->
      <if test='status!=null'>
        AND STATUS = #{status,jdbcType=DECIMAL}
      </if>
    </where>
  </update>
  
  <!--[真删除]根据实体的某些属性进行单条或者批量删除
          此处不支持id集合的形式,如有其他情况自行添加-->
  <delete id='deleteByEntity'>
    DELETE FROM TY_QYBGSQ
    <where>
      <!--此处为必填条件,如不满足则不执行,以免更新全部-->
      <choose>
        <when test='sqid !=null and sqid != ""'>
          AND SQID = #{sqid,jdbcType=VARCHAR}
        </when>
        <otherwise>
          AND 1=0
        </otherwise>
      </choose>
      <!--此处可添加状态条件等-->
      <if test='status!=null'>
        AND STATUS = #{status,jdbcType=DECIMAL}
      </if>
    </where>
  </delete>
  
  <!--[假删除]根据实体的某些属性进行单条或者批量删除
          此处不支持id集合的形式,如有其他情况自行添加-->
  <update id='deleteShamByEntity'>
    update TY_QYBGSQ
    set 
    STATUS = #{status,jdbcType=DECIMAL}
    <where>
      <!--此处为必填条件,如不满足则不执行,以免更新全部-->
      <choose>
        <when test='sqid !=null and sqid != ""'>
          AND SQID = #{sqid,jdbcType=VARCHAR}
        </when>
        <otherwise>
          AND 1=0
        </otherwise>
      </choose>
    </where>
  </update>
  
  <!--根据实体的某些属性查询数量-->
  <select id='selectCountByEntity' resultType='java.lang.Integer'>
    SELECT 
    COUNT(1)
    FROM TY_QYBGSQ
    <where>
      <!--自定义配置的检索条件-->
      <if test='sqid !=null and sqid != ""'>
        AND SQID = #{sqid,jdbcType=VARCHAR}
      </if>
      <if test='qymc !=null and qymc != ""'>
        AND QYMC LIKE CONCAT('%',CONCAT(#{qymc,jdbcType=VARCHAR},'%'))
      </if>
      <if test='sqrid !=null and sqrid != ""'>
        AND SQRID = #{sqrid,jdbcType=VARCHAR}
      </if>
      <if test='sfty !=null and sfty != ""'>
        AND SFTY = #{sfty,jdbcType=VARCHAR}
      </if>
      <if test='sqqybm !=null and sqqybm != ""'>
        AND SQQYBM = #{sqqybm,jdbcType=VARCHAR}
      </if>
      <!--if条件要注意,以免误删除或者更新全部-->
      <if test='tyshxydm !=null and tyshxydm != ""'>
        AND TYSHXYDM = #{tyshxydm,jdbcType=VARCHAR}
      </if>
      <if test='sqqybmmc !=null and sqqybmmc != ""'>
        AND SQQYBMMC = #{sqqybmmc,jdbcType=VARCHAR}
      </if>
      <!--此处可添加状态条件等-->
      <if test='status!=null'>
        AND STATUS = #{status,jdbcType=DECIMAL}
      </if>
    </where>
  </select>
  
  <!--根据实体的唯一属性查询数量-->
  <select id='selectCountById' resultType='java.lang.Integer'>
    SELECT 
    COUNT(1)
    FROM TY_QYBGSQ
    <where>
      <if test='sqid !=null and sqid != ""'>
        OR SQID = #{sqid,jdbcType=VARCHAR}
      </if>
    </where>
  </select>
  
  <!--根据实体的业务唯一属性(且非指定主键数据)判断是否存在-->
  <select id='selectExistsByEntity' resultType='java.lang.Integer'>
    SELECT
    COUNT(1)
    FROM TY_QYBGSQ
    <where>
      <if test='sqid !=null and sqid != ""'>
        AND SQID != #{sqid,jdbcType=VARCHAR}
      </if>
      <!--此处可添加状态条件等-->
      <!--
      <if test='status!=null'>
        AND STATUS = #{status,jdbcType=DECIMAL}
      </if>
      -->
    </where>
  </select>
  
  <!--根据实体(唯一标示)查询一条数据,如id,联合主键,业务唯一标示等,多种方式均可,但要保证数据唯一
          此处只使用系统id,如有其他情况自行添加-->
  <select id='selectById' resultType='com.unis.base.common.vo.QybgsqVO'>
    SELECT 
    <include refid='Column_Base_List' />
    FROM TY_QYBGSQ
    <where>
      <!--此处为必填条件,如不满足则不执行,以免查询全部-->
      <choose>
        <when test='sqid !=null and sqid != ""'>
          AND SQID = #{sqid,jdbcType=VARCHAR}
        </when>
        <!--初始值是-999-->
        <when test='tyshxydm !=null and tyshxydm != ""'>
          AND TYSHXYDM = #{tyshxydm,jdbcType=VARCHAR}
          AND SFTY='-999'
        </when>
        <otherwise>
          AND 1=0
        </otherwise>
      </choose>
      <!--此处可添加状态条件等-->
      <if test='status!=null'>
        AND STATUS = #{status,jdbcType=DECIMAL}
      </if>
    </where>
  </select>
  
  <!--根据实体的某些属性查询分页数据
          此处选取其中1-2个字段,需要根据实际情况修改-->
  <select id='selectPageByEntity' resultType='com.unis.base.common.vo.QybgsqVO'>
    SELECT 
    <include refid='Column_Base_List' />
    FROM TY_QYBGSQ
    <where>
      <!--自定义配置的检索条件-->
      <if test='sqid !=null and sqid != ""'>
        AND SQID = #{sqid,jdbcType=VARCHAR}
      </if>
      <if test='qymc !=null and qymc != ""'>
        AND QYMC LIKE CONCAT('%',CONCAT(#{qymc,jdbcType=VARCHAR},'%'))
      </if>
      <if test='sqrid !=null and sqrid != ""'>
        AND SQRID = #{sqrid,jdbcType=VARCHAR}
      </if>
      <if test='sfty !=null and sfty != ""'>
        AND SFTY = #{sfty,jdbcType=VARCHAR}
      </if>
      <if test='sqqybm !=null and sqqybm != ""'>
        AND SQQYBM = #{sqqybm,jdbcType=VARCHAR}
      </if>
      <!--if条件要注意,以免误删除或者更新全部-->
      <if test='tyshxydm !=null and tyshxydm != ""'>
        AND TYSHXYDM = #{tyshxydm,jdbcType=VARCHAR}
      </if>
      <if test='sqqybmmc !=null and sqqybmmc != ""'>
        AND SQQYBMMC = #{sqqybmmc,jdbcType=VARCHAR}
      </if>
      <!--此处可添加状态条件等-->
      <if test='status!=null'>
        AND STATUS = #{status,jdbcType=DECIMAL}
      </if>
    </where>
  </select>
  
  <!--根据实体的某些属性查询列表
          此处选取其中1-2个字段,需要根据实际情况修改-->
  <select id='selectByEntity' resultType='com.unis.base.common.vo.QybgsqVO'>
    SELECT 
    <include refid='Column_Base_List' />
    FROM TY_QYBGSQ
    <where>
      <!--自定义配置的检索条件-->
      <if test='sqid !=null and sqid != ""'>
        AND SQID = #{sqid,jdbcType=VARCHAR}
      </if>
      <if test='qymc !=null and qymc != ""'>
        AND QYMC LIKE CONCAT('%',CONCAT(#{qymc,jdbcType=VARCHAR},'%'))
      </if>
      <if test='sqrid !=null and sqrid != ""'>
        AND SQRID = #{sqrid,jdbcType=VARCHAR}
      </if>
      <if test='sfty !=null and sfty != ""'>
        AND SFTY = #{sfty,jdbcType=VARCHAR}
      </if>
      <if test='sqqybm !=null and sqqybm != ""'>
        AND SQQYBM = #{sqqybm,jdbcType=VARCHAR}
      </if>
      <!--if条件要注意,以免误删除或者更新全部-->
      <if test='tyshxydm !=null and tyshxydm != ""'>
        AND TYSHXYDM = #{tyshxydm,jdbcType=VARCHAR}
      </if>
      <if test='sqqybmmc !=null and sqqybmmc != ""'>
        AND SQQYBMMC = #{sqqybmmc,jdbcType=VARCHAR}
      </if>
      <!--此处可添加状态条件等-->
      <if test='status!=null'>
        AND STATUS = #{status,jdbcType=DECIMAL}
      </if>
    </where>
    <include refid='Order_By_Clause' />
  </select>
</mapper>