From 2b67ed2da39eba5824cfee7950e03be2c1a256ec Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期一, 20 十月 2025 13:17:04 +0800
Subject: [PATCH] 新增数据上传准东
---
src/main/resources/mybatis/doublePrevention/TrHiddenDangerCheckPointMapper.xml | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mybatis/doublePrevention/TrHiddenDangerCheckPointMapper.xml b/src/main/resources/mybatis/doublePrevention/TrHiddenDangerCheckPointMapper.xml
index 435914b..54716db 100644
--- a/src/main/resources/mybatis/doublePrevention/TrHiddenDangerCheckPointMapper.xml
+++ b/src/main/resources/mybatis/doublePrevention/TrHiddenDangerCheckPointMapper.xml
@@ -108,4 +108,34 @@
</if>
</select>
+
+<!-- List<TroubleDataRespDTO> getSPIData(SPIDataReqBO spiDataReqBO);-->
+ <select id="getSPIData" resultType="com.ruoyi.doublePrevention.entity.SPI.TroubleData">
+ SELECT
+ DATE_FORMAT(register_create_time, '%Y-%m') time, sum(1) count,
+ sum(case when rectify_status = '1' then 1 else 0 end) rectifyFinish,
+ sum(case when rectify_status = '0' then 1 else 0 end) rectifyNotFinish,
+ sum(case when accept_result = '1' then 1 else 0 end) accept,
+ sum(case when danger_level = '0' then 1 else 0 end) generalDanger,
+ sum(case when danger_level = '1' then 1 else 0 end) majorDanger
+ FROM tr_hidden_danger_check_point
+ WHERE whether_danger =1 and examine_status =1 and register_create_time >= #{spiDataReqBO.startTime} and #{spiDataReqBO.endTime} >= register_create_time and whether_danger = 1
+ GROUP BY time
+ ORDER BY time ASC
+ </select>
+
+<!-- TroubleLevel getTroubleLevel(SPIDataReqBO spiDataReqBO);-->
+ <select id="getTroubleLevel" resultType="com.ruoyi.doublePrevention.entity.SPI.TroubleLevel">
+ select
+ sum(case when trouble_type_name = 'A级隐患' then 1 else 0 end) A,
+ sum(case when trouble_type_name = 'B级隐患' then 1 else 0 end) B,
+ sum(case when trouble_type_name = 'C级隐患' then 1 else 0 end) C,
+ sum(case when rectify_status = '1' then 1 else 0 end) rectifyFinish,
+ sum(case when rectify_status = '0' then 1 else 0 end) rectifyNotFinish
+ from tr_hidden_danger_check_point
+ WHERE whether_danger =1 and examine_status =1 and YEAR(register_create_time) = #{spiDataReqBO.year}
+ <if test="spiDataReqBO.month != null and spiDataReqBO.month != ''">
+ AND MONTH(register_create_time) = #{spiDataReqBO.month}
+ </if>
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.2