<?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.aiceps.annual.mapper.TREntBaseInfoSplitMapper">

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ENTID,ENTITYNO,ENTTYPE,REGISTNO,ENTNAME,EMPNUMBER,ENTPHONE,ENTADDRESS,ENTZIP,ENTEMAIL,ENTSTATE,ISWEB,ISINVEINFO,REGISTDATE,
        REPORTYEAR,ISSUEDEPTID,ISTRANSFERSTOCK,EMPNUMBERISSHOW,RELATIONS,RELATIONSISSHOW,ONAICCIPS,CREATEDATE,UPDATEDATE,DSTATE,ENTITYTYPE,
        SUBENTITYTYPE,ORGID,ISSYNC,MAINBUSIACT,WOMEMPNUM,HOLDINGSMSG,WOMEMPNUMWHETHER,HOLDINGSMSGWHETHER,ISSOCIALSECURITY,ISGUARANTEE,BELONGENTERPRISE,
        IP,ISPC,IMSTANDMAC
    </sql>

    <sql id="getTableName">
        <choose>
            <when test="temp">
                TRENTBASEINFOTEMP_${year}
            </when>
            <otherwise>
                TRENTBASEINFO_${year}
            </otherwise>
        </choose>
    </sql>
    <select id="selectByWrapper" resultType="com.chinaweal.aiccs.aiceps.annual.entity.TREntBaseInfoSplit">
        select
        <include refid="Base_Column_List"/>
        from
        <include refid="getTableName"/>
        <if test="ew != null">
            ${ew.customSqlSegment}
        </if>
    </select>
    <select id="getYbList" resultType="com.chinaweal.aiccs.aiceps.annual.entity.TREntBaseInfoSplit">
        select * from TRENTBASEINFO where ENTITYNO = #{pripid,jdbcType=VARCHAR} and dstate = '0'
    </select>
</mapper>
