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/ContractSubjectMatterMapper.xml | 191 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 191 insertions(+), 0 deletions(-)
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/ContractSubjectMatterMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/ContractSubjectMatterMapper.xml
index b0a7b2e..4e3804a 100644
--- a/platformx-business-finance-biz/src/main/resources/mapper/ContractSubjectMatterMapper.xml
+++ b/platformx-business-finance-biz/src/main/resources/mapper/ContractSubjectMatterMapper.xml
@@ -37,4 +37,195 @@
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
+ <select id="gcpbkwcqk" resultType="com.by4cloud.platformx.business.vo.GcpbkwcqkItemVo">
+ SELECT
+ d.dict_name AS bkmc,
+ IFNULL(sum(c.unit_price*c.quantity),0) AS wc
+ FROM
+ bip_dict d
+ LEFT JOIN
+ contract_subject_matter c
+
+ ON
+ d.dict_code = c.product_section and c.del_flag = '0'
+ LEFT JOIN
+ contract c1
+ ON
+ c.contract_id = c1.id and c1.del_flag = '0'
+ and c1.sign_date >= #{monstart}
+ and c1.sign_date <= #{monend}
+ WHERE
+ d.dict_key = 'zb-cpbk'
+ GROUP BY
+ d.dict_name, d.dict_key;
+
+ </select>
+ <select id="gcpbkwcqkBySK" resultType="com.by4cloud.platformx.business.vo.GcpbkwcqkItemVo">
+ SELECT
+ d.dict_name AS bkmc,
+ IFNULL(ROUND(SUM(
+ IFNULL(pay.total_paid, 0) *
+ (agg.sub_total / NULLIF(IFNULL(c1.amount, 0), 0))
+ ), 2), 0) AS wc
+ FROM
+ bip_dict d
+ LEFT JOIN (
+ SELECT
+ c.product_section,
+ c.contract_id,
+ SUM(c.unit_price * c.quantity) AS sub_total
+ FROM
+ contract_subject_matter c
+ WHERE
+ c.del_flag = '0'
+ GROUP BY
+ c.product_section, c.contract_id
+ ) agg ON d.dict_code = agg.product_section
+ LEFT JOIN
+ contract c1
+ ON
+ agg.contract_id = c1.id
+ AND c1.del_flag = '0'
+ LEFT JOIN (
+ SELECT
+ contract_id,
+ SUM(payment_amount) AS total_paid
+ FROM
+ payment_slip
+ WHERE
+ del_flag = '0'
+ and payment_time >= #{monstart}
+ and payment_time <= #{monend}
+ GROUP BY
+ contract_id
+ ) pay ON c1.id = pay.contract_id
+ WHERE
+ d.dict_key = 'zb-cpbk'
+ GROUP BY
+ d.dict_name;
+
+ </select>
+ <select id="sckfzdgzwcqk" resultType="com.by4cloud.platformx.business.vo.GcpbkwcqkItemVo">
+ SELECT
+ '鐭崇叅鏈�' dw,
+ d.dict_code `code`,
+ d.dict_name AS xm,
+ IFNULL(sum(c.unit_price*c.quantity),0) AS wc
+ FROM
+ bip_dict d
+ LEFT JOIN
+ contract_subject_matter c
+
+ ON
+ d.dict_code = c.product_section and c.del_flag = '0'
+ AND (c.comp_id = 2089995177814495234 or c.comp_id = 2089996921978040321 or c.comp_id = 2089997578009128962 or c.comp_id = 2101966257365045249)
+ LEFT JOIN
+ contract c1
+ ON
+ c.contract_id = c1.id and c1.del_flag = '0'
+ and c1.sign_date >= #{monstart}
+ and c1.sign_date <= #{monend}
+ WHERE
+ d.dict_key = 'zb-ywxm'
+ AND (d.comp_id = 2089995177814495234 or d.comp_id = 2089996921978040321 or d.comp_id = 2089997578009128962 or d.comp_id = 2101966257365045249)
+ GROUP BY
+ d.dict_name,d.dict_code, d.dict_key
+ union all
+ SELECT
+ '鐭冲伐娉�' dw,
+ d.dict_code `code`,
+ d.dict_name AS bkmc,
+ IFNULL(sum(c.unit_price*c.quantity),0) AS wc
+ FROM
+ bip_dict d
+ LEFT JOIN
+ contract_subject_matter c
+
+ ON
+ d.dict_code = c.product_section and c.del_flag = '0'
+ AND c.comp_id = 2056556196124250113
+ LEFT JOIN
+ contract c1
+ ON
+ c.contract_id = c1.id and c1.del_flag = '0'
+ and c1.sign_date >= #{monstart}
+ and c1.sign_date <= #{monend}
+ WHERE
+ d.dict_key = 'zb-ywxm'
+ AND d.comp_id = 2056556196124250113
+ GROUP BY
+ d.dict_name,d.dict_code, d.dict_key
+ union all
+ SELECT
+ '閭㈠彴鍘�' dw,
+ d.dict_code `code`,
+ d.dict_name AS bkmc,
+ IFNULL(sum(c.unit_price*c.quantity),0) AS wc
+ FROM
+ bip_dict d
+ LEFT JOIN
+ contract_subject_matter c
+
+ ON
+ d.dict_code = c.product_section and c.del_flag = '0'
+ AND c.comp_id = 2056556317461270529
+ LEFT JOIN
+ contract c1
+ ON
+ c.contract_id = c1.id and c1.del_flag = '0'
+ and c1.sign_date >= #{monstart}
+ and c1.sign_date <= #{monend}
+ WHERE
+ d.dict_key = 'zb-ywxm'
+ AND d.comp_id = 2056556317461270529
+ GROUP BY
+ d.dict_name,d.dict_code, d.dict_key
+ union all
+ SELECT
+ '閫氭柟鍘�' dw,
+ d.dict_code `code`,
+ d.dict_name AS bkmc,
+ IFNULL(sum(c.unit_price*c.quantity),0) AS wc
+ FROM
+ bip_dict d
+ LEFT JOIN
+ contract_subject_matter c
+
+ ON
+ d.dict_code = c.product_section and c.del_flag = '0'
+ AND c.comp_id = 2056556421857497090
+ LEFT JOIN
+ contract c1
+ ON
+ c.contract_id = c1.id and c1.del_flag = '0'
+ and c1.sign_date >= #{monstart}
+ and c1.sign_date <= #{monend}
+ WHERE
+ d.dict_key = 'zb-ywxm'
+ AND d.comp_id = 2056556421857497090
+ GROUP BY
+ d.dict_name,d.dict_code, d.dict_key
+
+ </select>
+ <select id="cpxzhtwcqk" resultType="com.by4cloud.platformx.business.vo.CpxssrwcqkItemVo">
+ SELECT
+ d.dict_name AS xm,
+ IFNULL( sum( c.quantity ), 0 ) AS xsl,
+ IFNULL( sum( c.unit_price * c.quantity ), 0 ) AS xssr
+ FROM
+ bip_dict d
+ LEFT JOIN contract_subject_matter c ON d.dict_code = c.product_category
+ AND c.del_flag = '0'
+ LEFT JOIN contract c1 ON c.contract_id = c1.id
+ AND c1.del_flag = '0'
+ and c1.sign_date >= #{monstart}
+ and c1.sign_date <= #{monend}
+ WHERE
+ d.dict_key = 'zb-cpmc'
+ and d.comp_id = 2089995177814495234
+ GROUP BY
+ d.dict_name,
+ d.dict_key;
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1