From 145580fd820bb31334f2e71643413e846b7ce904 Mon Sep 17 00:00:00 2001
From: shiyunteng <shiyunteng@example.com>
Date: 星期五, 30 十月 2026 15:53:20 +0800
Subject: [PATCH] feat:统计内容1-8页
---
platformx-business-finance-biz/src/main/resources/mapper/ContractInvoiceMapper.xml | 471 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 464 insertions(+), 7 deletions(-)
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/ContractInvoiceMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/ContractInvoiceMapper.xml
index 20efb7b..2bb5061 100644
--- a/platformx-business-finance-biz/src/main/resources/mapper/ContractInvoiceMapper.xml
+++ b/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 >= CURDATE()
+ AND ci.invoice_time < 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 >= DATE_FORMAT(CURDATE(), '%Y-%m-01')
+ AND ci.invoice_time < 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 >= DATE_FORMAT(CURDATE(), '%Y-01-01')
+ AND ci.invoice_time < 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 >= CURDATE()
+ AND ps.payment_time < 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 >= DATE_FORMAT(CURDATE(), '%Y-%m-01')
+ AND ps.payment_time < 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 >= DATE_FORMAT(CURDATE(), '%Y-01-01')
+ AND ps.payment_time < 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 >= CURDATE()
+ AND c.sign_date < 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 >= DATE_FORMAT(CURDATE(), '%Y-%m-01')
+ AND c.sign_date < 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 >= DATE_FORMAT(CURDATE(), '%Y-01-01')
+ AND c.sign_date < 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 >= CURDATE()
+ AND ci.invoice_time < 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 >= DATE_FORMAT(CURDATE(), '%Y-%m-01')
+ AND ci.invoice_time < 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 >= DATE_FORMAT(CURDATE(), '%Y-01-01')
+ AND ci.invoice_time < 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 < 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 > 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 > 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 >= #{startMon}
+ AND ci.invoice_time < #{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 >=#{startYear}
+ AND ci.invoice_time <#{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 >= #{startMon}
+ AND ci.invoice_time < #{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 >=#{startYear}
+ AND ci.invoice_time <#{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 >= #{startMon}
+ AND ci.invoice_time < #{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 >=#{startYear}
+ AND ci.invoice_time <#{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 >= #{startMon}
+ AND ci.invoice_time < #{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 >=#{startYear}
+ AND ci.invoice_time <#{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 >= #{startMon}
+ AND ci.invoice_time < #{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 >=#{startYear}
+ AND ci.invoice_time <#{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 >= #{monstart}
+ AND ci.invoice_time <= #{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 >= #{monstart}
+ AND ci.invoice_time <= #{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 >= #{monstart}
+ AND ci.invoice_time <= #{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 >= #{monstart}
+ AND ci.invoice_time <= #{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 >= #{monstart}
+ AND ci.invoice_time <= #{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 >= #{monstart}
+ AND ci.invoice_time <= #{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 >= #{monstart}
+ AND ci.invoice_time <= #{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 >= #{monstart}
+ AND ci.invoice_time <= #{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>
\ No newline at end of file
--
Gitblit v1.9.1