shiyunteng
2026-10-30 145580fd820bb31334f2e71643413e846b7ce904
platformx-business-finance-biz/src/main/resources/mapper/ContractInvoiceMapper.xml
@@ -44,21 +44,22 @@
               SELECT sum(ci.invoice_total_price_tax)
               FROM contract_invoice ci
               WHERE ci.del_flag = '0'
                AND comp_id = 2056555602756063234
                AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
                AND ci.invoice_time >= CURDATE()
                AND ci.invoice_time < DATE_ADD(CURDATE(), INTERVAL 1 DAY ))                            smjbr,
            (
               SELECT sum(ci.invoice_total_price_tax)
               FROM contract_invoice ci
               WHERE ci.del_flag = '0'
                AND comp_id = 2056555602756063234
                AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
                AND ci.invoice_time >= DATE_FORMAT(CURDATE(), '%Y-%m-01')
                AND ci.invoice_time < DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01')) smjby,
            (
               SELECT sum(ci.invoice_total_price_tax)
               FROM contract_invoice ci
               WHERE ci.del_flag = '0'
                AND comp_id = 2056555602756063234
                AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
                AND ci.invoice_time >= DATE_FORMAT(CURDATE(), '%Y-01-01')
                AND ci.invoice_time < DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01'))  smjbn,
            (
@@ -454,6 +455,7 @@
      t.comp_id,
      t1.contract_no,
      t2.company_name AS busGuestName,
      t.bw_request_result,
      t1.party_b
      FROM
      contract_invoice t
@@ -467,14 +469,20 @@
      <if test="queryDTO.invoiceCategory !=null and queryDTO.invoiceCategory !=''">
         AND t.invoice_category = #{queryDTO.invoiceCategory}
      </if>
      <if test="queryDTO.isMerge !=null and queryDTO.isMerge !=''">
         AND t.is_merge = #{queryDTO.isMerge}
      </if>
      <if test="queryDTO.bwRequestResult !=null and queryDTO.bwRequestResult !=''">
         AND t.bw_request_result = #{queryDTO.bwRequestResult}
      </if>
      <if test="queryDTO.contractNo !=null and queryDTO.contractNo !=''">
         AND t1.contract_no LIKE CONCAT('%', #{queryDTO.contractNo}, '%')
      </if>
      <if test="queryDTO.partyA !=null and queryDTO.partyA !=''">
         AND t2.company_name LIKE CONCAT('%', #{queryDTO.partyA}, '%')
      </if>
      <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''">
         AND t2.class_id = #{queryDTO.queryArea}
      <if test="queryDTO.queryProvince !=null and queryDTO.queryProvince !=''">
         AND t2.province = #{queryDTO.queryProvince}
      </if>
      <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''">
         AND t2.export_service_attr = #{queryDTO.queryServiceAttr}
@@ -566,14 +574,19 @@
      update_time,
      del_flag,
      comp_id,
      (select count(1) from contract_invoice ci where ci.del_flag = '0' and ci.contract_id = c.id) invoiceNum,
      (select planned_amount from contract_payment_schedule cps where cps.del_flag='0' and cps.stage_name='合同签订' and cps.contract_id = c.id) advanceAmount
      (select count(1) from contract_invoice ci where ci.del_flag = '0' and (ci.contract_id = c.id or
      FIND_IN_SET(c.id,REPLACE(REPLACE(ci.contract_ids,'[', ''), ']', '')))) invoiceNum,
      (select planned_amount from contract_payment_schedule cps where cps.del_flag='0' and cps.stage_name='合同签订' and
      cps.contract_id = c.id) advanceAmount
      FROM
      contract c
      WHERE
      del_flag = '0'
      <if test="queryDTO.contractNo !=null and queryDTO.contractNo !=''">
         AND contract_no LIKE CONCAT('%', #{queryDTO.contractNo}, '%')
      </if>
      <if test="queryDTO.contractName !=null and queryDTO.contractName !=''">
         AND contract_name LIKE CONCAT('%', #{queryDTO.contractName}, '%')
      </if>
      <if test="queryDTO.partyA !=null and queryDTO.partyA !=''">
         AND party_a LIKE CONCAT('%', #{queryDTO.partyA}, '%')
@@ -590,4 +603,448 @@
      ORDER BY
      create_time ASC
   </select>
   <select id="homeZgsData" resultType="com.by4cloud.platformx.business.vo.HomeZgsData">
      SELECT (
               SELECT sum(ci.invoice_total_price_tax)
               FROM contract_invoice ci,
                  contract c,
                  business_customer bc
               WHERE ci.del_flag = '0'
                AND bc.del_flag = '0'
                AND c.del_flag = '0'
                AND ci.contract_id = c.id
                AND bc.id = c.party_a_id
                AND c.party_b_id = #{compId}
                AND bc.province = #{province}
                AND ci.invoice_time &gt;= CURDATE()
                AND ci.invoice_time &lt; DATE_ADD(CURDATE(), INTERVAL 1 DAY ))                            kpbr,
            (
               SELECT sum(ci.invoice_total_price_tax)
               FROM contract_invoice ci,
                  contract c,
                  business_customer bc
               WHERE ci.del_flag = '0'
                AND bc.del_flag = '0'
                AND c.del_flag = '0'
                AND ci.contract_id = c.id
                AND bc.id = c.party_a_id
                AND c.party_b_id = #{compId}
                AND bc.province = #{province}
                AND ci.invoice_time &gt;= DATE_FORMAT(CURDATE(), '%Y-%m-01')
                AND ci.invoice_time &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01')) kpby,
            (
               SELECT sum(ci.invoice_total_price_tax)
               FROM contract_invoice ci,
                  contract c,
                  business_customer bc
               WHERE ci.del_flag = '0'
                AND bc.del_flag = '0'
                AND c.del_flag = '0'
                AND ci.contract_id = c.id
                AND bc.id = c.party_a_id
                AND c.party_b_id = #{compId}
                AND bc.province = #{province}
                AND ci.invoice_time &gt;= DATE_FORMAT(CURDATE(), '%Y-01-01')
                AND ci.invoice_time &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 YEAR ), '%Y-%m-01'))  kpbn,
            (
               SELECT sum(ps.payment_amount)
               FROM payment_slip ps,
                  business_customer bc
               WHERE ps.del_flag = '0'
                AND bc.del_flag = '0'
                AND bc.id = ps.bus_guest_id
                AND ps.comp_id = #{compId}
                AND bc.province = #{province}
                AND ps.payment_time &gt;= CURDATE()
                AND ps.payment_time &lt; DATE_ADD(CURDATE(), INTERVAL 1 DAY ))                            skbr,
            (
               SELECT sum(ps.payment_amount)
               FROM payment_slip ps,
                  business_customer bc
               WHERE ps.del_flag = '0'
                AND bc.del_flag = '0'
                AND bc.id = ps.bus_guest_id
                AND ps.comp_id = #{compId}
                AND bc.province = #{province}
                AND ps.payment_time &gt;= DATE_FORMAT(CURDATE(), '%Y-%m-01')
                AND ps.payment_time &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01')) skby,
            (
               SELECT sum(ps.payment_amount)
               FROM payment_slip ps,
                  business_customer bc
               WHERE ps.del_flag = '0'
                AND bc.del_flag = '0'
                AND bc.id = ps.bus_guest_id
                AND ps.comp_id = #{compId}
                AND bc.province = #{province}
                AND ps.payment_time &gt;= DATE_FORMAT(CURDATE(), '%Y-01-01')
                AND ps.payment_time &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 YEAR ), '%Y-%m-01'))  skbn,
            (
               SELECT sum(c.amount)
               FROM contract c
                     LEFT JOIN business_customer bc ON bc.id = c.party_a_id
               WHERE c.del_flag = '0'
                AND c.party_b_id = #{compId}
                AND bc.province = #{province}
                AND c.sign_date &gt;= CURDATE()
                AND c.sign_date &lt; DATE_ADD(CURDATE(), INTERVAL 1 DAY ))                                htbr,
            (
               SELECT sum(c.amount)
               FROM contract c
                     LEFT JOIN business_customer bc ON bc.id = c.party_a_id
               WHERE c.del_flag = '0'
                AND c.party_b_id = #{compId}
                AND bc.province = #{province}
                AND c.sign_date &gt;= DATE_FORMAT(CURDATE(), '%Y-%m-01')
                AND c.sign_date &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01'))     htby,
            (
               SELECT sum(c.amount)
               FROM contract c
                     LEFT JOIN business_customer bc ON bc.id = c.party_a_id
               WHERE c.del_flag = '0'
                AND c.party_b_id = #{compId}
                AND bc.province = #{province}
                AND c.sign_date &gt;= DATE_FORMAT(CURDATE(), '%Y-01-01')
                AND c.sign_date &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 YEAR ), '%Y-%m-01'))      htbn
   </select>
   <select id="zbjtStatisticByInvoice" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticVo">
      SELECT (
               SELECT IFNULL(sum(ci.invoice_total_price_tax), 0)
               FROM contract_invoice ci
               WHERE ci.del_flag = '0'
                AND ci.invoice_time &gt;= CURDATE()
                AND ci.invoice_time &lt; DATE_ADD(CURDATE(), INTERVAL 1 DAY )
            ) AS br,
            (
               SELECT IFNULL(sum(ci.invoice_total_price_tax), 0)
               FROM contract_invoice ci
               WHERE ci.del_flag = '0'
                AND ci.invoice_time &gt;= DATE_FORMAT(CURDATE(), '%Y-%m-01')
                AND ci.invoice_time &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01')
            ) AS bm,
            (
               SELECT IFNULL(sum(ci.invoice_total_price_tax), 0)
               FROM contract_invoice ci
               WHERE ci.del_flag = '0'
                AND ci.invoice_time &gt;= DATE_FORMAT(CURDATE(), '%Y-01-01')
                AND ci.invoice_time &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01')
            ) AS bn
   </select>
   <select id="zbjtIndicatorTrend" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo">
      WITH RECURSIVE month_series AS (
         SELECT
         DATE ( #{startMon} ) AS month_start
      UNION ALL
      SELECT DATE_ADD(month_start, INTERVAL 1 MONTH )
      FROM month_series
      WHERE month_start &lt; DATE (#{endMon} )
         )
      SELECT DATE_FORMAT(ms.month_start, '%Y-%m')        AS `yearMon`,
            COALESCE(SUM(c.invoice_total_price_tax), 0) AS `je`
      FROM month_series ms
             LEFT JOIN contract_invoice c
                     ON DATE_FORMAT(c.invoice_time, '%Y-%m') = DATE_FORMAT(ms.month_start, '%Y-%m')
      GROUP BY ms.month_start
      ORDER BY ms.month_start;
   </select>
   <select id="zbjtPlanAchieced" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo">
      WITH RECURSIVE month_series AS (
      SELECT
      DATE_FORMAT( CURDATE(), '%Y-%m-01' ) AS month_start UNION ALL
      SELECT
      DATE_SUB( month_start, INTERVAL 1 MONTH )
      FROM
      month_series
      WHERE
      month_start &gt; DATE_SUB( DATE_FORMAT( CURDATE(), '%Y-%m-01' ), INTERVAL 11 MONTH )
      ) SELECT
      DATE_FORMAT( ms.month_start, '%m' ) AS `yearMon`,
      COALESCE ( SUM( ci.invoice_total_price_tax ), 0 ) AS `je`
      FROM
      month_series ms
      LEFT JOIN contract_invoice ci ON DATE_FORMAT( ci.invoice_time, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m'
      )
      AND ci.del_flag = '0'
      <if test="compId !=null">
         AND ci.comp_id = #{compId}
      </if>
      GROUP BY
      ms.month_start
      ORDER BY
      ms.month_start ASC;
   </select>
   <select id="zbjtPlanAchiecedSmj" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo">
      WITH RECURSIVE month_series AS (
         SELECT DATE_FORMAT(CURDATE(), '%Y-%m-01') AS month_start
         UNION ALL
         SELECT DATE_SUB(month_start, INTERVAL 1 MONTH )
         FROM month_series
         WHERE month_start &gt; DATE_SUB(DATE_FORMAT(CURDATE(), '%Y-%m-01'), INTERVAL 11 MONTH )
      )
      SELECT DATE_FORMAT(ms.month_start, '%m')            AS `yearMon`,
            COALESCE(SUM(ci.invoice_total_price_tax), 0) AS `je`
      FROM month_series ms
             LEFT JOIN contract_invoice ci
                     ON DATE_FORMAT(ci.invoice_time, '%Y-%m') = DATE_FORMAT(ms.month_start, '%Y-%m')
                        AND ci.del_flag = '0'
                        AND (ci.comp_id = 2089995177814495234 or ci.comp_id = 2089996921978040321 or
                           ci.comp_id = 2089997578009128962 or ci.comp_id = 2101966257365045249)
      GROUP BY ms.month_start
      ORDER BY ms.month_start ASC;
   </select>
   <select id="homeZbjtYearAndMon" resultType="com.by4cloud.platformx.business.vo.HomeZbjtVo">
      SELECT
         (
            SELECT IFNULL(sum(ci.invoice_total_price_tax),0)
            FROM contract_invoice ci
            WHERE ci.del_flag = '0'
             AND comp_id = 2056556196124250113
             AND ci.invoice_time &gt;= #{startMon}
             AND ci.invoice_time &lt; #{endMon}) sgbby,
         (
            SELECT IFNULL(sum(ci.invoice_total_price_tax),0)
            FROM contract_invoice ci
            WHERE ci.del_flag = '0'
             AND comp_id = 2056556196124250113
             AND ci.invoice_time &gt;=#{startYear}
             AND ci.invoice_time &lt;#{endYear})  sgbbn,
         (
            SELECT IFNULL(sum(ci.invoice_total_price_tax),0)
            FROM contract_invoice ci
            WHERE ci.del_flag = '0'
             AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
             AND ci.invoice_time &gt;= #{startMon}
             AND ci.invoice_time &lt; #{endMon}) smjby,
         (
            SELECT IFNULL(sum(ci.invoice_total_price_tax),0)
            FROM contract_invoice ci
            WHERE ci.del_flag = '0'
             AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
             AND ci.invoice_time &gt;=#{startYear}
             AND ci.invoice_time &lt;#{endYear})  smjbn,
         (
            SELECT IFNULL(sum(ci.invoice_total_price_tax),0)
            FROM contract_invoice ci
            WHERE ci.del_flag = '0'
             AND comp_id = 2056556317461270529
             AND ci.invoice_time &gt;= #{startMon}
             AND ci.invoice_time &lt; #{endMon}) jxcby,
         (
            SELECT IFNULL(sum(ci.invoice_total_price_tax),0)
            FROM contract_invoice ci
            WHERE ci.del_flag = '0'
             AND comp_id = 2056556317461270529
             AND ci.invoice_time &gt;=#{startYear}
             AND ci.invoice_time &lt;#{endYear})  jxcbn,
         (
            SELECT IFNULL(sum(ci.invoice_total_price_tax),0)
            FROM contract_invoice ci
            WHERE ci.del_flag = '0'
             AND comp_id = 2056556421857497090
             AND ci.invoice_time &gt;= #{startMon}
             AND ci.invoice_time &lt; #{endMon}) tfby,
         (
            SELECT IFNULL(sum(ci.invoice_total_price_tax),0)
            FROM contract_invoice ci
            WHERE ci.del_flag = '0'
             AND comp_id = 2056556421857497090
             AND ci.invoice_time &gt;=#{startYear}
             AND ci.invoice_time &lt;#{endYear})  tfbn,
         (
            SELECT IFNULL(sum(ci.invoice_total_price_tax),0)
            FROM contract_invoice ci
            WHERE ci.del_flag = '0'
             AND comp_id = 2056556535640576002
             AND ci.invoice_time &gt;= #{startMon}
             AND ci.invoice_time &lt; #{endMon}) ymjby,
         (
            SELECT IFNULL(sum(ci.invoice_total_price_tax),0)
            FROM contract_invoice ci
            WHERE ci.del_flag = '0'
             AND comp_id = 2056556535640576002
             AND ci.invoice_time &gt;=#{startYear}
             AND ci.invoice_time &lt;#{endYear})  ymjbn
   </select>
   <select id="pjsxywwcqk" resultType="com.by4cloud.platformx.business.vo.GcpbkwcqkItemVo">
      SELECT
         '配件' yw,
         '销售收入' lb,
         '石煤机' dw,
         IFNULL(sum( invoice_total_price_tax ),0) wc
      FROM
         contract_invoice ci
            LEFT JOIN contract c ON c.id = ci.contract_id
            AND c.supply_attribute =  #{type}
            AND ( c.comp_id = 2089995177814495234 OR c.comp_id = 2089996921978040321 OR c.comp_id = 2089997578009128962 OR c.comp_id = 2101966257365045249 )
      WHERE
         ci.del_flag = '0'
        AND ci.invoice_time &gt;= #{monstart}
        AND ci.invoice_time &lt;= #{monend}
      UNION ALL
      SELECT
         '配件' yw,
         '销售收入' lb,
         '石工泵' dw,
         IFNULL(sum( invoice_total_price_tax ),0) wc
      FROM
         contract_invoice ci
            LEFT JOIN contract c ON c.id = ci.contract_id
            AND c.supply_attribute =  #{type}
            AND c.comp_id = 2056556196124250113
      WHERE
         ci.del_flag = '0'
        AND ci.invoice_time &gt;= #{monstart}
        AND ci.invoice_time &lt;= #{monend}
      UNION ALL
      SELECT
         '配件' yw,
         '销售收入' lb,
         '邢台厂' dw,
         IFNULL(sum( invoice_total_price_tax ),0) wc
      FROM
         contract_invoice ci
            LEFT JOIN contract c ON c.id = ci.contract_id
            AND c.supply_attribute =  #{type}
            AND c.comp_id = 2056556317461270529
      WHERE
         ci.del_flag = '0'
        AND ci.invoice_time &gt;= #{monstart}
        AND ci.invoice_time &lt;= #{monend}
      UNION ALL
      SELECT
         '配件' yw,
         '销售收入' lb,
         '通方厂' dw,
         IFNULL(sum( invoice_total_price_tax ),0) wc
      FROM
         contract_invoice ci
            LEFT JOIN contract c ON c.id = ci.contract_id
            AND c.supply_attribute = #{type}
            AND c.comp_id = 2056556421857497090
      WHERE
         ci.del_flag = '0'
        AND ci.invoice_time &gt;= #{monstart}
        AND ci.invoice_time &lt;= #{monend}
   </select>
   <select id="dxsxywwcqk" resultType="com.by4cloud.platformx.business.vo.GcpbkwcqkItemVo">
      SELECT
         '大修' yw,
         '销售收入' lb,
         '石煤机' dw,
         IFNULL(sum( invoice_total_price_tax ),0) wc
      FROM
         contract_invoice ci
            LEFT JOIN contract c ON c.id = ci.contract_id
            AND c.supply_attribute =  #{type}
            AND ( c.comp_id = 2089995177814495234 OR c.comp_id = 2089996921978040321 OR c.comp_id = 2089997578009128962 OR c.comp_id = 2101966257365045249 )
      WHERE
         ci.del_flag = '0'
        AND ci.invoice_time &gt;= #{monstart}
        AND ci.invoice_time &lt;= #{monend}
      UNION ALL
      SELECT
         '大修' yw,
         '销售收入' lb,
         '石工泵' dw,
         IFNULL(sum( invoice_total_price_tax ),0) wc
      FROM
         contract_invoice ci
            LEFT JOIN contract c ON c.id = ci.contract_id
            AND c.supply_attribute =  #{type}
            AND c.comp_id = 2056556196124250113
      WHERE
         ci.del_flag = '0'
        AND ci.invoice_time &gt;= #{monstart}
        AND ci.invoice_time &lt;= #{monend}
      UNION ALL
      SELECT
         '大修' yw,
         '销售收入' lb,
         '邢台厂' dw,
         IFNULL(sum( invoice_total_price_tax ),0) wc
      FROM
         contract_invoice ci
            LEFT JOIN contract c ON c.id = ci.contract_id
            AND c.supply_attribute =  #{type}
            AND c.comp_id = 2056556317461270529
      WHERE
         ci.del_flag = '0'
        AND ci.invoice_time &gt;= #{monstart}
        AND ci.invoice_time &lt;= #{monend}
      UNION ALL
      SELECT
         '大修' yw,
         '销售收入' lb,
         '通方厂' dw,
         IFNULL(sum( invoice_total_price_tax ),0) wc
      FROM
         contract_invoice ci
            LEFT JOIN contract c ON c.id = ci.contract_id
            AND c.supply_attribute = #{type}
            AND c.comp_id = 2056556421857497090
      WHERE
         ci.del_flag = '0'
        AND ci.invoice_time &gt;= #{monstart}
        AND ci.invoice_time &lt;= #{monend}
   </select>
   <select id="cksxywwcqk" resultType="com.by4cloud.platformx.business.vo.GcpbkwcqkItemVo">
      SELECT
         '出口' yw,
         '销售收入' lb,
         '石煤机' dw,
         IFNULL(sum( invoice_total_price_tax ),0) wc
      FROM
         contract_invoice ci
            INNER JOIN contract c ON c.id = ci.contract_id
            AND ( c.comp_id = 2089995177814495234 OR c.comp_id = 2089996921978040321 OR c.comp_id = 2089997578009128962 OR c.comp_id = 2101966257365045249 )
            INNER JOIN business_customer bc ON bc.id = c.party_a_id
            AND bc.export_service_attr = '2'
      WHERE
         ci.del_flag = '0' UNION ALL
      SELECT
         '出口' yw,
         '销售收入' lb,
         '石工泵' dw,
         IFNULL(sum( invoice_total_price_tax ),0) wc
      FROM
         contract_invoice ci
            INNER JOIN contract c ON c.id = ci.contract_id
            AND c.comp_id = 2056556196124250113
            INNER JOIN business_customer bc ON bc.id = c.party_a_id
            AND bc.export_service_attr = '2'
      WHERE
         ci.del_flag = '0' UNION ALL
      SELECT
         '出口' yw,
         '销售收入' lb,
         '邢台厂' dw,
         IFNULL(sum( invoice_total_price_tax ),0) wc
      FROM
         contract_invoice ci
            INNER JOIN contract c ON c.id = ci.contract_id
            AND c.comp_id = 2056556317461270529
            INNER JOIN business_customer bc ON bc.id = c.party_a_id
            AND bc.export_service_attr = '2'
      WHERE
         ci.del_flag = '0' UNION ALL
      SELECT
         '出口' yw,
         '销售收入' lb,
         '通方厂' dw,
         IFNULL(sum( invoice_total_price_tax ),0) wc
      FROM
         contract_invoice ci
            INNER JOIN contract c ON c.id = ci.contract_id
            AND c.comp_id = 2056556421857497090
            INNER JOIN business_customer bc ON bc.id = c.party_a_id
            AND bc.export_service_attr = '2'
      WHERE
         ci.del_flag = '0'
   </select>
</mapper>