<?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.base.dao.BaseFpdrrzDao">

    <resultMap id="DrrzResultMap" type="com.dxhy.base.model.BaseFpdrrzRespVO">
        <result column="id" property="id"/>
        <result column="fpdm" property="fpdm"/>
        <result column="fphm" property="fphm"/>
        <result column="kprq" property="kprq"/>
        <result column="je" property="je"/>
        <result column="dkse" property="dkse"/>
        <result column="qsrq" property="qsrq"/>
        <result column="qszt" property="qszt"/>
        <result column="qsr" property="qsr"/>
        <result column="gfmc" property="gfmc"/>
    </resultMap>
    <select id="selectByDrrzCxtj" parameterType="java.util.Map"
            resultMap="DrrzResultMap">
        select t.id id,t.invoice_code fpdm,t.invoice_no fphm,t.invoice_date kprq,t.invoice_amount je,t.dk_tax_amount
        dkse,
        t.qs_date qsrq,t.qs_status qszt,t.qs_name qsr,t.gf_name gfmc from t_dx_record_invoice t
        where t.gf_tax_no in
        <foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>

        <if test="fpdm != null and fpdm != '' and fpdm != 'null' ">
            and t.invoice_code = #{fpdm}
        </if>
        <if test="fphm != null and fphm != '' and fphm != 'null' ">
            and t.invoice_no = #{fphm}
        </if>
        <!-- <if test="kprq != null and kprq != '' and kprq != 'null' ">
         and t.invoice_date = #{kprq}
        </if> -->
        <if test="je != null and je != '' and je != 'null' ">
            and t.invoice_amount = #{je}
        </if>

        order by t.invoice_code,t.invoice_no,t.create_date desc
    </select>


</mapper>
