<?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.chinaweal.aiccs.aicbiz.mapper.TbBatchGsListMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.chinaweal.aiccs.aicbiz.entity.TbBatchGsList">
        <result column="SNAME" property="sname" />
        <result column="SBOOKCODE" property="sbookcode" />
        <result column="SPUBLICTIME" property="spublictime" />
        <result column="SGSTYPE" property="sgstype" />
        <result column="UPDATETIME" property="updatetime" />
        <result column="DELFLAG" property="delflag" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        SNAME, SBOOKCODE, SPUBLICTIME, SGSTYPE, UPDATETIME, DELFLAG
    </sql>

    <select id="selectRevocationTzsByNameList" resultMap="BaseResultMap">
        select <include refid="Base_Column_List"/>
        from GZGS.tb_batch_gs_list
        <where>
            DELFLAG = '0'
            <if test="params.entName neq '' and params.entName != null ">
                and SNAME = #{params.entName}
            </if>
            <if test="params.sgstype neq '' and params.sgstype != null ">
                and SGSTYPE = #{params.sgstype}
            </if>
        </where>
        order by SPUBLICTIME desc,SBOOKCODE desc
    </select>

</mapper>
