From e02812df9217d3e50a368a8234c07c60c64c0ff4 Mon Sep 17 00:00:00 2001
From: shiyunteng <shiyunteng@example.com>
Date: 星期三, 05 八月 2026 08:34:26 +0800
Subject: [PATCH] feat:新增石煤机 机械厂模版合同/客户数据主数据同步接口/合同履约进度新增质保结束操作/合同开票状态 修改为待开 可开 已开/出库逻辑完善

---
 platformx-business-finance-biz/src/main/resources/mapper/ContractMapper.xml |   79 ++++++++++++++++++++++-----------------
 1 files changed, 44 insertions(+), 35 deletions(-)

diff --git a/platformx-business-finance-biz/src/main/resources/mapper/ContractMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/ContractMapper.xml
index 12793f6..baaff55 100644
--- a/platformx-business-finance-biz/src/main/resources/mapper/ContractMapper.xml
+++ b/platformx-business-finance-biz/src/main/resources/mapper/ContractMapper.xml
@@ -434,19 +434,17 @@
 	<select id="contractAmountAnalysisByIndustry"
 			resultType="com.by4cloud.platformx.business.vo.ContractIncomeAnalysisAreaVo">
 		SELECT
-		b.industry_id area_id,
+		c.industry_code area_id,
 		SUM( CASE WHEN c.party_b_id = #{sgbCompId} THEN c.amount ELSE 0 END ) AS sgbze,
 		ROUND(
 		SUM( CASE WHEN c.party_b_id = #{sgbCompId} THEN c.amount ELSE 0 END ) / (
 		SELECT
 		SUM( amount )
 		FROM
-		contract c, business_customer bc
-		WHERE
-		bc.id = c.party_a_id
-		and c.del_flag = '0'
-		and bc.del_flag = '0'
-		and bc.industry_id = b.industry_id
+		contract c1
+		where
+		c1.del_flag = '0'
+		and c1.industry_code = c.industry_code
 		and party_b_id IN
 		<foreach collection="compIds" item="id" open="(" close=")" separator=",">
 			#{id}
@@ -460,12 +458,10 @@
 		SELECT
 		SUM( amount )
 		FROM
-		contract c, business_customer bc
-		WHERE
-		bc.id = c.party_a_id
-		and c.del_flag = '0'
-		and bc.del_flag = '0'
-		and bc.industry_id = b.industry_id
+		contract c1
+		where
+		c1.del_flag = '0'
+		and c1.industry_code = c.industry_code
 		and party_b_id IN
 		<foreach collection="compIds" item="id" open="(" close=")" separator=",">
 			#{id}
@@ -479,12 +475,10 @@
 		SELECT
 		SUM( amount )
 		FROM
-		contract c, business_customer bc
-		WHERE
-		bc.id = c.party_a_id
-		and c.del_flag = '0'
-		and bc.del_flag = '0'
-		and bc.industry_id = b.industry_id
+		contract c1
+		where
+		c1.del_flag = '0'
+		and c1.industry_code = c.industry_code
 		and party_b_id IN
 		<foreach collection="compIds" item="id" open="(" close=")" separator=",">
 			#{id}
@@ -498,12 +492,10 @@
 		SELECT
 		SUM( amount )
 		FROM
-		contract c, business_customer bc
-		WHERE
-		bc.id = c.party_a_id
-		and c.del_flag = '0'
-		and bc.del_flag = '0'
-		and bc.industry_id = b.industry_id
+		contract c1
+		where
+		c1.del_flag = '0'
+		and c1.industry_code = c.industry_code
 		and party_b_id IN
 		<foreach collection="compIds" item="id" open="(" close=")" separator=",">
 			#{id}
@@ -517,12 +509,10 @@
 		SELECT
 		SUM( amount )
 		FROM
-		contract c, business_customer bc
-		WHERE
-		bc.id = c.party_a_id
-		and c.del_flag = '0'
-		and bc.del_flag = '0'
-		and bc.industry_id = b.industry_id
+		contract c1
+		where
+		      c1.del_flag = '0'
+		and c1.industry_code = c.industry_code
 		and party_b_id IN
 		<foreach collection="compIds" item="id" open="(" close=")" separator=",">
 			#{id}
@@ -532,12 +522,11 @@
 		) AS tfzb
 		FROM
 		contract c
-		JOIN business_customer b ON c.party_a_id = b.id
-		WHERE
-		b.industry_id IS NOT NULL
+		where
+		c.industry_code  is not null
 		AND YEAR ( sign_date ) = #{queryDTO.year}
 		GROUP BY
-		b.industry_id
+		c.industry_code
 
 	</select>
 	<select id="contractAmountAnalysisByMarket"
@@ -1063,6 +1052,8 @@
 			c.paid_amount,
 			c.contract_category,
 			c.exec_frequency,
+		   	c.next_schedule_name,
+		    c.warranty_schedule_id,
 			c.comp_id,
 			(select sum(delivered_quantity*unit_price) from contract_subject_matter csm where csm.contract_id = c.id) outAmount
 			FROM
@@ -1559,4 +1550,22 @@
 		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-01-01' )) hwbn
 	</select>
+	<select id="fourAssociation" resultType="com.by4cloud.platformx.business.vo.FourAssociationPageVo">
+		SELECT
+			c.id,
+			c.contract_no,
+			c.sign_date,
+		    c.amount,
+		    c.paid_amount,
+			c.billing_amout,
+			c.comp_id
+		FROM
+			contract c
+		where
+			c.del_flag = '0'
+		and c.contract_status = 2
+		order by
+			c.create_time
+
+	</select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1