From 40e249cff23e39ec2222d1f3ffb7b7fddf9fc846 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期四, 29 一月 2026 14:27:14 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-system/src/main/java/com/ruoyi/system/model/AccidentBrief.java                      |    7 +++----
 ruoyi-system/src/main/java/com/ruoyi/system/query/HiddenDangerListQuery.java              |    2 +-
 ruoyi-system/src/main/java/com/ruoyi/system/vo/HiddenDangerListVo.java                    |    3 +++
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DashboardStatisticsController.java |    1 +
 ruoyi-system/src/main/resources/mapper/system/RecordMapper.xml                            |   14 ++++++++++----
 ruoyi-system/src/main/resources/mapper/system/ProjectMapper.xml                           |    2 +-
 6 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DashboardStatisticsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DashboardStatisticsController.java
index 05489a3..049ea34 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DashboardStatisticsController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/DashboardStatisticsController.java
@@ -114,6 +114,7 @@
         List<AccidentClassification> list = accidentClassificationService.list(new LambdaQueryWrapper<AccidentClassification>().eq(AccidentClassification::getDeleted, false));
         LambdaQueryWrapper<AccidentBrief> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(AccidentBrief::getState,1);
+        wrapper.eq(AccidentBrief::getDeleted,false);
         if(query.getCity()!=null && !query.getCity().isEmpty()){
             wrapper.eq(AccidentBrief::getCity, query.getCity());
         }
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/model/AccidentBrief.java b/ruoyi-system/src/main/java/com/ruoyi/system/model/AccidentBrief.java
index c99a8b2..d7cb60b 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/model/AccidentBrief.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/model/AccidentBrief.java
@@ -1,11 +1,9 @@
 package com.ruoyi.system.model;
 
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.*;
+
 import java.time.LocalDate;
-import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
-import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -80,6 +78,7 @@
 
     @ApiModelProperty(value = "false正常true删除")
     @TableField("deleted")
+    @TableLogic
     private Boolean deleted;
 
     @TableField("create_time")
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/query/HiddenDangerListQuery.java b/ruoyi-system/src/main/java/com/ruoyi/system/query/HiddenDangerListQuery.java
index 3111e8c..1011fff 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/query/HiddenDangerListQuery.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/query/HiddenDangerListQuery.java
@@ -17,7 +17,7 @@
     @ApiModelProperty("隐患类型 1=安全 2=设备")
     private Integer type;
 
-    @ApiModelProperty("整改情况 1已整改 0未整改")
+    @ApiModelProperty("整改情况 0未整改  1部分整改  2已整改")
     private Integer reformed;
 
     @ApiModelProperty("开始时间")
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/vo/HiddenDangerListVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/vo/HiddenDangerListVo.java
index f9999d0..d943191 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/vo/HiddenDangerListVo.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/vo/HiddenDangerListVo.java
@@ -60,4 +60,7 @@
     @ApiModelProperty("责任人")
     private String responsiblePerson;
 
+    @ApiModelProperty("0未整改  1部分整改  2已整改")
+    private Integer state;
+
 }
diff --git a/ruoyi-system/src/main/resources/mapper/system/ProjectMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ProjectMapper.xml
index 2d04038..ba59c08 100644
--- a/ruoyi-system/src/main/resources/mapper/system/ProjectMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/ProjectMapper.xml
@@ -43,7 +43,7 @@
             <if test="query.endTime != null and query.endTime != ''">
                 and  #{query.endTime} >=t1.date
             </if>
-
+            GROUP BY t2.id
             order by t1.date desc
 
 
diff --git a/ruoyi-system/src/main/resources/mapper/system/RecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/RecordMapper.xml
index 196b13b..fb07a86 100644
--- a/ruoyi-system/src/main/resources/mapper/system/RecordMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/RecordMapper.xml
@@ -37,19 +37,22 @@
         when t1.device_id is null then 1
         else 2
         end as type,
-        t1.create_time,t1.reformed,t1.responsible_person responsiblePerson
+        t1.create_time,t1.reformed,t1.responsible_person responsiblePerson,
+        case
+            when t5.id is null then 0
+        else t5.state
+        end as state
         from record t1
         left join problem t2 on t1.problem_id = t2.id
         left join task t3 on t1.check_task_id = t3.id
         left join plan t4 on t3.plan_id = t4.id
+        left join error_review t5 on t1.error_review_id = t5.id
         where t1.deleted = 0 and t1.level is not null
         and t1.check_task_id in
         <foreach item="item" index="index" collection="taskIds" open="(" separator="," close=")">
             #{item}
         </foreach>
-        <if test="query.reformed != null">
-            and t1.reformed = #{query.reformed}
-        </if>
+
         <if test="query.type == null">
             and t1.level = 0
         </if>
@@ -64,6 +67,9 @@
         <if test="query.type != null">
             and o.type = #{query.type}
         </if>
+        <if test="query.reformed != null">
+            and o.state = #{query.reformed}
+        </if>
         order by o.create_time desc
     </select>
 

--
Gitblit v1.7.1