<?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.dxhy.core.dao.QyswxxDao">

    <resultMap id="BaseResultMap" type="com.dxhy.core.model.QyswxxRespVO">
        <result column="gfsh" property="gfsh"/>
        <result column="jsh" property="jsh"/>
        <result column="gfmc" property="gfmc"/>
        <result column="skssq" property="skssq"/>
        <result column="gxksrq" property="gxksrq"/>
        <result column="gxjsrq" property="gxjsrq"/>
        <result column="ssqjsrq" property="ssqjsrq"/>
        <result column="xydj" property="xydj"/>
        <result column="sbzq" property="sbzq"/>
        <result column="sdzt" property="sdzt"/>
        <result column="companyType" property="companyType"/>
        <result column="oilType" property="oilType"/>
        <result column="taxpayerType" property="taxpayerType"/>
        <result column="syncTime" property="syncTime"/>
        <result column="indexInfo" property="indexInfo"/>
        <result column="periodIndexInfo" property="periodIndexInfo"/>
        <result column="monthIndexInfo" property="monthIndexInfo"/>
        <result column="newBussiPwd" property="newBussiPwd"/>
    </resultMap>

    <select id="selectByGfshAndXydj" parameterType="java.util.Map"
            resultMap="BaseResultMap">
        select t.taxno gfsh,t.old_tax_no jsh ,t.taxname gfmc, t.current_tax_period skssq ,t.select_start_date gxksrq
        ,t.select_end_date gxjsrq,
        t.operation_end_date ssqjsrq, t.credit_rating xydj, t.declare_period sbzq, t.latch_status sdzt,t.company_type
        companyType,
        t.oil_type oilType,t.taxpayer_type taxpayerType,t.sync_time syncTime,t.index_info indexInfo,t.period_index_info
        periodIndexInfo,
        t.month_index_info monthIndexInfo,t.new_bussi_pwd newBussiPwd
        from t_dx_tax_current t
        WHERE
        t.taxno in
        <foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>

        <if test="xydj != null and xydj != '' and xydj != 'null' ">
            and t.credit_rating = #{xydj}
        </if>
        <if test="sbzq != null and sbzq != '' and sbzq != 'null' ">
            and t.declare_period = #{sbzq}
        </if>
        order by t.taxno
    </select>


</mapper>