<?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.passengerticket.dao.PassengerInvoiceStatisticsDao">
    <resultMap id="BaseResultMap"
               type="com.dxhy.passengerticket.vo.CertifiedInvoiceVo">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="invoice_type" property="invoiceType"
                jdbcType="VARCHAR"/>
        <result column="invoice_code" property="invoiceCode"
                jdbcType="VARCHAR"/>
        <result column="invoice_no" property="invoiceNo"
                jdbcType="VARCHAR"/>
        <result column="invoice_date" property="invoiceDate"
                jdbcType="DATE"/>
        <result column="gf_tax_no" property="gfTaxNo"
                jdbcType="VARCHAR"/>
        <result column="gf_name" property="gfName" jdbcType="VARCHAR"/>
        <result column="xf_tax_no" property="xfTaxNo"
                jdbcType="VARCHAR"/>
        <result column="xf_name" property="xfName" jdbcType="VARCHAR"/>
        <result column="invoice_amount" property="invoiceAmount"
                jdbcType="VARCHAR"/>
        <result column="tax_amount" property="taxAmount"
                jdbcType="VARCHAR"/>
        <result column="total_amount" property="totalAmount"
                jdbcType="VARCHAR"/>
        <result column="invoice_status" property="invoiceStatus"
                jdbcType="VARCHAR"/>
        <result column="dqskssq" property="dqskssq" jdbcType="VARCHAR"/>
        <result column="source_system" property="sourceSystem"
                jdbcType="VARCHAR"/>
        <result column="invoice_name" property="invoiceName"
                jdbcType="VARCHAR"/>
        <result column="qs_date" property="qsDate" jdbcType="VARCHAR"/>
        <result column="qs_type" property="qsType" jdbcType="VARCHAR"/>
        <result column="qs_name" property="qsName" jdbcType="VARCHAR"/>
        <result column="qs_status" property="qsStatus"
                jdbcType="VARCHAR"/>
        <result column="rzh_yesorno" property="rzhYesorno"
                jdbcType="VARCHAR"/>
        <result column="create_date" property="createDate"
                jdbcType="VARCHAR"/>
        <result column="uuid" property="uuid" jdbcType="VARCHAR"/>
        <result column="select_id" property="selectId"
                jdbcType="VARCHAR"/>
    </resultMap>
    <select id="selectLegalizedInvoiceCard"
            parameterType="java.util.Map" resultType="com.dxhy.passengerticket.vo.InvoiceAmountVo"
            databaseId="mysql">
        select count(id) as monthCount, sum(tax_amount) as monthTaxAmount
        from t_dx_record_invoice
        where gf_tax_no = #{gfTaxNo}
          and date_format(create_date, '%Y-%m-%d') &gt;= date_format(#{monthStart}, '%Y-%m-%d')
          and date_format(create_date, '%Y-%m-%d') &lt; date_format(#{monthEnd}, '%Y-%m-%d')
          and invoice_type in ('01', '14', '03')
    </select>
    <select id="selectLegalizedInvoiceCard"
            parameterType="java.util.Map" resultType="com.dxhy.passengerticket.vo.InvoiceAmountVo"
            databaseId="oracle">
        select count(id) as monthCount, sum(tax_amount) as monthTaxAmount
        from t_dx_record_invoice
        where gf_tax_no = #{gfTaxNo}
          and create_date &gt;= to_date(#{monthStart}, 'yyyy-mm-dd')
          and create_date &lt; to_date(#{monthEnd}, 'yyyy-mm-dd')
          and invoice_type in ('01', '14', '03')
    </select>

    <select id="selectLegalizedInvoiceCardYear"
            parameterType="java.util.Map" resultType="com.dxhy.passengerticket.vo.InvoiceAmountVo"
            databaseId="mysql">
        select count(id) as yearCount, sum(tax_amount) as yearTaxAmount
        from t_dx_record_invoice
        where gf_tax_no = #{gfTaxNo}
          and year(create_date) = #{year}
          and invoice_type in ('01', '14', '03')
    </select>
    <select id="selectLegalizedInvoiceCardYear"
            parameterType="java.util.Map" resultType="com.dxhy.passengerticket.vo.InvoiceAmountVo"
            databaseId="oracle">
        select count(id) as yearCount, sum(tax_amount) as yearTaxAmount
        from t_dx_record_invoice
        where gf_tax_no = #{gfTaxNo}
          and to_char(create_date, 'yyyy') = #{year}
          and invoice_type in ('01', '14', '03')
    </select>


    <select id="selectpassengerTicketMonthCar"
            parameterType="java.util.Map" resultType="com.dxhy.passengerticket.vo.InvoiceAmountVo"
            databaseId="mysql">

        SELECT count(t.id)       AS monthCount,
               sum(t.tax_amount) AS monthTaxAmount
        FROM ${dxhyTertiary}.t_dx_invoice_reimburse t
        WHERE t.gf_tax_no = #{gfTaxNo}

          AND t.is_deduction = '0'
          AND date_format(t.create_date, '%Y-%m-%d') &gt;= date_format(#{monthStart}, '%Y-%m-%d')

          AND date_format(t.create_date, '%Y-%m-%d') &lt; date_format(#{monthEnd}, '%Y-%m-%d')

          AND (
                (t.is_domestic = '0' AND t.invoice_type IN ('92', '89', '88', '87'))
                OR (t.invoice_type = '90' AND
                    exists(select area_name from ${dxhyAdmin}.sys_city where locate(area_name, t.departure_city))
                AND exists(select area_name from ${dxhyAdmin}.sys_city where locate(area_name, t.reaching_city)))
                OR (
                        t.invoice_type = '10'
                        AND t.invoice_date > '2019-04-01 00:00:00'
                        AND t.tag LIKE '%运输服务%'
                        AND t.tax_rate IN ('3%', '9%')
                    )
            )
    </select>
    <select id="selectpassengerTicketYearCar"
            parameterType="java.util.Map" resultType="com.dxhy.passengerticket.vo.InvoiceAmountVo"
            databaseId="mysql">
        SELECT count(t.id)       AS yearCount,
               sum(t.tax_amount) AS yearTaxAmount
        FROM ${dxhyTertiary}.t_dx_invoice_reimburse t
        WHERE t.gf_tax_no = #{gfTaxNo}
          AND YEAR(t.create_date) = #{year}

          AND t.is_deduction = '0'
          AND (
                (t.is_domestic = '0' AND t.invoice_type IN ('92', '89', '88', '87'))
                OR (t.invoice_type = '90' AND
                    exists(select area_name from ${dxhyAdmin}.sys_city where locate(area_name, t.departure_city))
                AND exists(select area_name from ${dxhyAdmin}.sys_city where locate(area_name, t.reaching_city)))
                OR (t.invoice_type = '10' AND t.invoice_date > '2019-04-01 00:00:00' AND t.tag LIKE '%运输服务%')
            )
    </select>
    <select id="selectReimOtherInvoiceMonthCar"
            parameterType="java.util.Map" resultType="java.lang.Integer"
            databaseId="mysql">
        select count(id)
        from t_dx_invoice_reimburse
        WHERE gf_tax_no = #{gfTaxNo}
          and date_format(create_date, '%Y-%m-%d') &gt;= date_format(#{monthStart}, '%Y-%m-%d')
          and date_format(create_date, '%Y-%m-%d') &lt; date_format(#{monthEnd}, '%Y-%m-%d')
          and (
                (invoice_type in ('04', '11', '02', '91', '93', '94', '95', '96', '00', '97', '98'))
                or
                (invoice_type in ('92', '89', '88', '87', '90', '10')
                    and is_deduction = '1'
                    )
            )
    </select>
    <select id="selectPassOtherInvoiceMonthCar"
            parameterType="java.util.Map" resultType="java.lang.Integer"
            databaseId="mysql">
        select count(re.id)
        from t_dx_record_invoice re
                 left join t_dx_invoice_reimburse ri on re.uuid = ri.uuid
        WHERE ri.id is null
          and re.gf_tax_no = #{gfTaxNo}
          and date_format(re.create_date, '%Y-%m-%d') &gt;= date_format(#{monthStart}, '%Y-%m-%d')
          and date_format(re.create_date, '%Y-%m-%d') &lt; date_format(#{monthEnd}, '%Y-%m-%d')
          and re.invoice_type in ('04', '10', '11', '02', '91', '93', '94', '95', '96', '00', '97', '98', '92',
                                  '89', '88', '87', '90', '10')
    </select>

    <select id="selectReimOtherInvoiceYearCar"
            parameterType="java.util.Map" resultType="java.lang.Integer"
            databaseId="mysql">
        select count(id)
        from t_dx_invoice_reimburse
        WHERE gf_tax_no = #{gfTaxNo}
          and year(create_date) = #{year}
          and (
                (invoice_type in ('04', '11', '02', '91', '93', '94', '95', '96', '00', '97', '98'))
                or
                (invoice_type in ('92', '89', '88', '87', '90', '10')
                    and is_deduction = '1'
                    )
            )
    </select>
    <select id="selectPassOtherInvoiceYearCar"
            parameterType="java.util.Map" resultType="java.lang.Integer"
            databaseId="mysql">
        select count(re.id)
        from t_dx_record_invoice re
                 left join t_dx_invoice_reimburse ri on re.uuid = ri.uuid
        WHERE ri.id is null
          and re.gf_tax_no = #{gfTaxNo}
          and year(re.create_date) = #{year}
          and re.invoice_type in ('04', '10', '11', '02', '91', '93', '94', '95', '96', '00', '97', '98', '92',
                                  '89', '88', '87', '90', '10')
    </select>
    <select id="selectLegalizedInvoiceTable"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="mysql">
        SELECT *
        FROM (
                 SELECT '01' type
                 UNION
                 SELECT '14' type
                 UNION
                 SELECT '03' type
             ) t
                 LEFT JOIN (
            SELECT invoice_type,
                   count(id)       AS count,
                   sum(tax_amount) AS taxAmountsum,
                   sum(CASE
                           WHEN invoice_amount &lt; 0 and invoice_status != '0' and date_format(create_date, '%Y-%m-%d')
                               &gt;= date_format(#{monthEnd}, '%Y-%m-%d') THEN 0
                           else tax_amount end)
                                   AS authenticationTaxAmountsum
            FROM t_dx_record_invoice
            WHERE gf_tax_no = #{gfTaxNo}
              AND date_format(create_date, '%Y-%m-%d')
                &gt;= date_format(#{monthStart}, '%Y-%m-%d')
              AND date_format(create_date, '%Y-%m-%d')
                &lt; date_format(#{monthEnd}, '%Y-%m-%d')
              AND invoice_type IN ('01', '14', '03')
            GROUP BY invoice_type
        ) t1 ON t.type = t1.invoice_type
    </select>

    <select id="selectSjdkse"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo">
        SELECT invoice_type          type,
               sum(dk_tax_amount) AS dkTaxAmount
        FROM t_dx_record_invoice
        WHERE gf_tax_no = #{gfTaxNo}
          and rzh_yesorno = '1'
          and rzh_belong_date = #{rzhBelongDate}
          AND invoice_type IN ('01', '14', '03')
        GROUP BY invoice_type

    </select>

    <select id="slelectPassengerTicketRailwayVo"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="mysql">
        select count(id)       AS count,
               sum(tax_amount) AS taxAmountsum,
               sum(tax_amount)
                               AS authenticationTaxAmountsum
        from t_dx_invoice_reimburse
        WHERE gf_tax_no = #{gfTaxNo}
          and date_format(create_date, '%Y-%m-%d') &gt;= date_format(#{monthStart}, '%Y-%m-%d')
          and date_format(create_date, '%Y-%m-%d') &lt; date_format(#{monthEnd}, '%Y-%m-%d')
          and is_domestic = '0'
          AND invoice_type = '92'
          and is_deduction = '0'
    </select>
    <select id="slelectPassengerTicketaAircraftVo"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="mysql">
        SELECT count(t.id)       count,
               sum(t.tax_amount) taxAmountsum,
               sum(t.tax_amount) authenticationTaxAmountsum
        FROM ${dxhyTertiary}.t_dx_invoice_reimburse t
        WHERE t.gf_tax_no = #{gfTaxNo}

          AND date_format(t.create_date, '%Y-%m-%d') &gt;= date_format(#{monthStart}, '%Y-%m-%d')

          AND date_format(t.create_date, '%Y-%m-%d') &lt; date_format(#{monthEnd}, '%Y-%m-%d')

          AND t.invoice_type = '90'
          AND t.is_deduction = '0'
          AND exists(select area_name from ${dxhyAdmin}.sys_city where locate(area_name, t.departure_city))
          AND exists(select area_name from ${dxhyAdmin}.sys_city where locate(area_name, t.reaching_city))

    </select>
    <select id="slelectPassengerTicketaHighwayVo"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="mysql">
        select count(id)       AS count,
               sum(tax_amount) AS taxAmountsum,
               sum(tax_amount)
                               AS authenticationTaxAmountsum
        FROM t_dx_invoice_reimburse
        WHERE gf_tax_no = #{gfTaxNo}
          and date_format(create_date, '%Y-%m-%d') &gt;= date_format(#{monthStart}, '%Y-%m-%d')
          and date_format(create_date, '%Y-%m-%d') &lt; date_format(#{monthEnd}, '%Y-%m-%d')
          and invoice_type in ('88', '89', '87')
          and is_deduction = '0'
          and is_domestic = '0'

    </select>
    <select id="slelectPassengerTicketaGeneralVoteVo"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="mysql">
        select count(id)       AS count,
               sum(tax_amount) AS taxAmountsum,
               sum(tax_amount)
                               AS authenticationTaxAmountsum
        FROM t_dx_invoice_reimburse
        WHERE gf_tax_no = #{gfTaxNo}
          and date_format(create_date, '%Y-%m-%d') &gt;= date_format(#{monthStart}, '%Y-%m-%d')
          and date_format(create_date, '%Y-%m-%d') &lt; date_format(#{monthEnd}, '%Y-%m-%d')
          and invoice_type = '10'
          and is_deduction = '0'
          AND invoice_date > '2019-04-01 00:00:00'
          AND tag LIKE '%运输服务%'
          and tax_rate in ('3%', '9%')
    </select>
    <select id="selectotherReimInvoiceListTable"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="mysql">
        SELECT t1.count as count,
               t.type   as type
        FROM (
                 SELECT '04' type
                 UNION
                 SELECT '10' type
                 UNION
                 SELECT '11' type
             ) t
                 LEFT JOIN (
            SELECT invoice_type,
                   count(id) AS count
            from t_dx_invoice_reimburse
            where gf_tax_no = #{gfTaxNo}
                and
                  date_format(create_date, '%Y-%m-%d') &gt;= date_format(#{monthStart}, '%Y-%m-%d')
                and
                  date_format(create_date, '%Y-%m-%d') &lt; date_format(#{monthEnd}, '%Y-%m-%d')
                and
                  invoice_type IN ('04', '11')
               OR (invoice_type = '10' and is_deduction = '1')
            GROUP BY invoice_type
        ) t1 ON t.type = t1.invoice_type
    </select>
    <select id="selectotherPassInvoiceListTable"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="mysql">
        SELECT t1.count as count,
               t.type   as type
        FROM (
                 SELECT '04' type
                 UNION
                 SELECT '10' type
                 UNION
                 SELECT '11' type
             ) t
                 LEFT JOIN (
            SELECT re.invoice_type,
                   count(re.id) AS count
            from t_dx_record_invoice re
                     left join t_dx_invoice_reimburse ir on re.uuid = ir.uuid
            where ir.id is null
              and re.gf_tax_no = #{gfTaxNo}
              and date_format(re.create_date, '%Y-%m-%d') &gt;= date_format(#{monthStart}, '%Y-%m-%d')
              and date_format(re.create_date, '%Y-%m-%d') &lt; date_format(#{monthEnd}, '%Y-%m-%d')
              and re.invoice_type IN ('04', '10', '11')
            GROUP BY re.invoice_type
        ) t1 ON t.type = t1.invoice_type
    </select>
    <select id="selectotherInvoiceReimVo"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="mysql">
        select ifnull(count(id), 0) as count
        from t_dx_invoice_reimburse
        where gf_tax_no = #{gfTaxNo}
          and date_format(create_date, '%Y-%m-%d') &gt;= date_format(#{monthStart}, '%Y-%m-%d')
          and date_format(create_date, '%Y-%m-%d') &lt; date_format(#{monthEnd}, '%Y-%m-%d')
          and (
                (invoice_type in ('02', '91', '93', '94', '95', '96', '00', '97', '98'))
                or
                (invoice_type in ('92', '89', '88', '87', '90')
                    and is_deduction = '1'
                    )
            )
    </select>
    <select id="selectotherInvoicePassVo"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="mysql">
        select ifnull(count(id), 0) as count
        from t_dx_record_invoice
        where gf_tax_no = #{gfTaxNo}
          and date_format(create_date, '%Y-%m-%d') &gt;= date_format(#{monthStart}, '%Y-%m-%d')
          and date_format(create_date, '%Y-%m-%d') &lt; date_format(#{monthEnd}, '%Y-%m-%d')
          and invoice_type in ('02', '91', '93', '94', '95', '96', '00', '97', '98', '92',
                               '89', '88', '87', '90')
    </select>


    <select id="selectotherInvoicePassVo"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="oracle">
        select nvl(count(id), 0) as count
        from t_dx_record_invoice
        where gf_tax_no = #{gfTaxNo}
          and create_date between to_date(#{monthStart}, 'yyyy-mm-dd') and to_date(#{monthEnd}, 'yyyy-mm-dd')
          and invoice_type in ('02', '91', '93', '94', '95', '96', '00', '97', '98', '92',
                               '89', '88', '87', '90')
    </select>


    <select id="selectpassengerTicketMonthCar"
            parameterType="java.util.Map" resultType="com.dxhy.passengerticket.vo.InvoiceAmountVo"
            databaseId="oracle">

        SELECT count(t.id)       AS monthCount,
               sum(t.tax_amount) AS monthTaxAmount
        FROM ${dxhyTertiary}.t_dx_invoice_reimburse t
        WHERE t.gf_tax_no = #{ gfTaxNo }
          AND t.is_deduction = '0'
          AND t.create_date &gt;= to_date(#{ monthStart }, 'yyyy-mm-dd')
          AND t.create_date &lt; to_date(#{ monthEnd }, 'yyyy-mm-dd')
          AND (
                (t.is_domestic = '0' AND t.invoice_type IN ('92', '89', '88', '87'))
                OR (t.invoice_type = '90' AND t.departure_city in (select area_name from ${dxhyAdmin}.sys_city)
                AND t.reaching_city in (select area_name from ${dxhyAdmin}.sys_city))
                OR (
                        t.invoice_type = '10'
                        AND t.invoice_date > '2019-04-01 00:00:00'
                        AND t.tag LIKE '%运输服务%'
                        AND t.tax_rate IN ('3%', '9%')
                    )
            )
    </select>
    <select id="selectpassengerTicketYearCar"
            parameterType="java.util.Map" resultType="com.dxhy.passengerticket.vo.InvoiceAmountVo"
            databaseId="oracle">
        SELECT count(t.id)       AS yearCount,
               sum(t.tax_amount) AS yearTaxAmount
        FROM ${dxhyTertiary}.t_dx_invoice_reimburse t,
             ${dxhyAdmin}.sys_city c
        WHERE t.gf_tax_no = #{ gfTaxNo }
          AND to_char(t.invoice_date, 'yyyy') = #{ year }
          AND t.is_deduction = '0'
          AND (
                (t.is_domestic = '0' AND t.invoice_type IN ('92', '89', '88', '87'))
                OR (t.invoice_type = '90' AND t.departure_city in (select area_name from ${dxhyAdmin}.sys_city)
                AND t.reaching_city in (select area_name from ${dxhyAdmin}.sys_city))
                OR (t.invoice_type = '10' AND t.invoice_date > '2019-04-01 00:00:00' AND t.tag LIKE '%运输服务%'))
    </select>
    <select id="selectReimOtherInvoiceMonthCar"
            parameterType="java.util.Map" resultType="java.lang.Integer"
            databaseId="oracle">
        select count(id)
        from t_dx_invoice_reimburse
        WHERE gf_tax_no = #{gfTaxNo}
          and create_date &gt;= to_date(#{monthStart}, 'yyyy-mm-dd')
          and create_date &lt; to_date(#{monthEnd}, 'yyyy-mm-dd')
          and (
                (invoice_type in ('04', '10', '11', '02', '91', '93', '94', '95', '96', '00', '97', '98'))
                or
                (invoice_type in ('92', '89', '88', '87', '90', '10')
                    and is_deduction = '1'
                    )
            )
    </select>
    <select id="selectPassOtherInvoiceMonthCar"
            parameterType="java.util.Map" resultType="java.lang.Integer"
            databaseId="oracle">
        select count(id)
        from t_dx_record_invoice
        WHERE gf_tax_no = #{gfTaxNo}
          and create_date &gt;= to_date(#{monthStart}, 'yyyy-mm-dd')
          and create_date &lt; to_date(#{monthEnd}, 'yyyy-mm-dd')
          and invoice_type in ('04', '10', '11', '02', '91', '93', '94', '95', '96', '00', '97', '98', '92',
                               '89', '88', '87', '90', '10')
    </select>

    <select id="selectReimOtherInvoiceYearCar"
            parameterType="java.util.Map" resultType="java.lang.Integer"
            databaseId="oracle">
        select count(id)
        from t_dx_invoice_reimburse
        WHERE gf_tax_no = #{gfTaxNo}
          and to_char(create_date, 'yyyy') = #{year}
          and (
                (invoice_type in ('04', '10', '11', '02', '91', '93', '94', '95', '96', '00', '97', '98'))
                or
                (invoice_type in ('92', '89', '88', '87', '90', '10')
                    and is_deduction = '1'
                    )
            )
    </select>
    <select id="selectPassOtherInvoiceYearCar"
            parameterType="java.util.Map" resultType="java.lang.Integer"
            databaseId="oracle">
        select count(id)
        from t_dx_record_invoice
        WHERE gf_tax_no = #{gfTaxNo}
          and to_char(create_date, 'yyyy') = #{year}
          and invoice_type in ('04', '10', '11', '02', '91', '93', '94', '95', '96', '00', '97', '98', '92',
                               '89', '88', '87', '90', '10')
    </select>
    <select id="selectLegalizedInvoiceTable"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="oracle">

        SELECT invoice_type                                                   type,
               invoice_type,
               count(id)                                                   AS count,
               sum(tax_amount)                                             AS taxAmountsum,
               sum(dk_tax_amount)                                          AS dkTaxAmount,
               sum(CASE WHEN auth_status = '4' THEN tax_amount else 0 end) AS authenticationTaxAmountsum
        FROM t_dx_record_invoice
        WHERE gf_tax_no = #{gfTaxNo}
          AND create_date &gt;= to_date(#{monthStart}, 'yyyy-mm-dd')
          AND create_date &lt; to_date(#{monthEnd}, 'yyyy-mm-dd')
          AND invoice_type in ('01', '14', '03')
        GROUP BY invoice_type
    </select>


    <select id="slelectPassengerTicketRailwayVo"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="oracle">
        select count(id)       AS count,
               sum(tax_amount) AS taxAmountsum,
               sum(tax_amount) AS authenticationTaxAmountsum
        from t_dx_invoice_reimburse
        WHERE gf_tax_no = #{gfTaxNo}
          and create_date &gt;= to_date(#{monthStart}, 'yyyy-mm-dd')
          and create_date &lt; to_date(#{monthEnd}, 'yyyy-mm-dd')
          and is_domestic = '0'
          AND invoice_type = '92'
          and is_deduction = '0'
    </select>
    <select id="slelectPassengerTicketaAircraftVo"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="oracle">
        SELECT count(t.id)       AS count,
               sum(t.tax_amount) AS taxAmountsum,
               sum(t.tax_amount) AS authenticationTaxAmountsum
        FROM ${dxhyTertiary}.t_dx_invoice_reimburse t
        WHERE t.gf_tax_no = #{gfTaxNo}
          and t.create_date &gt;= to_date(#{monthStart}, 'yyyy-mm-dd')
          and t.create_date &lt; to_date(#{monthEnd}, 'yyyy-mm-dd')
          and t.invoice_type = '90'
          and t.is_deduction = '0'
          AND t.departure_city in (select area_name from ${dxhyAdmin}.sys_city)
          AND t.reaching_city in (select area_name from ${dxhyAdmin}.sys_city)

    </select>
    <select id="slelectPassengerTicketaHighwayVo"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="oracle">
        select count(id)       AS count,
               sum(tax_amount) AS taxAmountsum,
               sum(tax_amount) AS authenticationTaxAmountsum
        FROM t_dx_invoice_reimburse
        WHERE gf_tax_no = #{gfTaxNo}
          and create_date &gt;= to_date(#{monthStart}, 'yyyy-mm-dd')
          and create_date &lt; to_date(#{monthEnd}, 'yyyy-mm-dd')
          and invoice_type in ('88', '89', '87')
          and is_deduction = '0'
          and is_domestic = '0'

    </select>
    <select id="slelectPassengerTicketaGeneralVoteVo"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="oracle">
        SELECT count(id)       AS count,
               sum(tax_amount) AS taxAmountsum,
               sum(tax_amount) AS authenticationTaxAmountsum
        FROM t_dx_invoice_reimburse
        WHERE gf_tax_no = #{ gfTaxNo }
          AND create_date &gt;= to_date(#{monthStart}, 'yyyy-mm-dd')
          AND create_date &lt; to_date(#{monthEnd}, 'yyyy-mm-dd')
          AND invoice_type = '10'
          AND is_deduction = '0'
          AND invoice_date > '2019-04-01'
          AND tag LIKE '%运输服务%'
          AND tax_rate IN ('3%', '9%')
    </select>
    <select id="selectotherReimInvoiceListTable"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="oracle">
        SELECT invoice_type type,
               count(id) AS count
        FROM t_dx_invoice_reimburse
        WHERE gf_tax_no = #{ gfTaxNo }
            AND create_date &gt;= to_date(#{monthStart}, 'yyyy-mm-dd')
            AND create_date &lt; to_date(#{monthEnd}, 'yyyy-mm-dd')
            AND invoice_type IN ('04', '11')
           OR (invoice_type = '10' AND is_deduction = '1')
        GROUP BY invoice_type
    </select>
    <select id="selectotherPassInvoiceListTable"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="oracle">
        SELECT invoice_type TYPE,
               count(id) AS count
        FROM t_dx_record_invoice
        WHERE gf_tax_no = #{ gfTaxNo }
          AND create_date &gt;= to_date(#{ monthStart }, 'yyyy-mm-dd')
          AND create_date &lt; to_date(#{ monthEnd }, 'yyyy-mm-dd')
          AND invoice_type IN ('04', '10', '11')
        GROUP BY invoice_type
    </select>
    <select id="selectotherInvoiceReimVo"
            parameterType="java.util.Map"
            resultType="com.dxhy.passengerticket.vo.InvoiceTableVo"
            databaseId="oracle">
        SELECT nvl(count(id), 0) AS count
        FROM t_dx_invoice_reimburse
        WHERE gf_tax_no = #{ gfTaxNo }
          AND create_date &gt;= to_date(#{monthStart}, 'yyyy-mm-dd')
          AND create_date &lt; to_date(#{monthEnd}, 'yyyy-mm-dd')
          AND (
                (
                    invoice_type IN ('02', '91', '93', '94', '95', '96', '00', '97', '98'))
                OR (invoice_type IN ('92', '89', '88', '87', '90') AND is_deduction = '1')
            )
    </select>

</mapper>
