From 147416cbf4810dfb16a6211c6b594a640e623553 Mon Sep 17 00:00:00 2001
From: “mitao” <“2763622819@qq.com”>
Date: 星期三, 01 四月 2026 17:44:01 +0800
Subject: [PATCH] fix:委托方端项目列表查询

---
 ruoyi-system/src/main/java/com/ruoyi/system/query/ErrorListQuery.java                |    2 ++
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DeviceUsageServiceImpl.java |    2 +-
 ruoyi-system/src/main/resources/mapper/system/DeviceUsageMapper.xml                  |   34 ++++++++++++++++++++++++++++------
 3 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/query/ErrorListQuery.java b/ruoyi-system/src/main/java/com/ruoyi/system/query/ErrorListQuery.java
index cc417de..82f46b0 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/query/ErrorListQuery.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/query/ErrorListQuery.java
@@ -31,4 +31,6 @@
     private String endTime;
     @ApiModelProperty("内容")
     private String content;
+    @ApiModelProperty("隐患等级")
+    private Integer level;
 }
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DeviceUsageServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DeviceUsageServiceImpl.java
index 2654f53..d25d24b 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DeviceUsageServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DeviceUsageServiceImpl.java
@@ -290,7 +290,7 @@
 
 //                List<Record> recordList = records.stream().filter(e -> taskIds.contains(e.getCheckTaskId())).toList();
 //                Record record = recordList.stream().max(Comparator.comparing(Record::getCreateTime)).orElse(null);
-                if (task1 != null && task1.getState() == 3) {
+                if (task1 != null && (task1.getState() == 3 || Integer.valueOf(7).equals(task1.getState()))) {
                     deviceListVo.setCheckTime(task1.getDate().atStartOfDay());
                     deviceListVo.setCheckResult("已检查");
                 } else {
diff --git a/ruoyi-system/src/main/resources/mapper/system/DeviceUsageMapper.xml b/ruoyi-system/src/main/resources/mapper/system/DeviceUsageMapper.xml
index 25ca488..3c23370 100644
--- a/ruoyi-system/src/main/resources/mapper/system/DeviceUsageMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/DeviceUsageMapper.xml
@@ -146,7 +146,7 @@
         <if test="query.projectId != null">
             and t2.project_id = #{query.projectId}
         </if>
-        <if test="query.state ==4 ">
+        <if test="query.state ==0 ">
             and t1.error_review_id is null
         </if>
         <if test="query.state ==1 ">
@@ -209,7 +209,7 @@
         <if test="query.projectId != null">
             and t2.project_id = #{query.projectId}
         </if>
-        <if test="query.state ==4 ">
+        <if test="query.state == 0">
             and t1.error_review_id is null
         </if>
         <if test="query.state ==1 ">
@@ -227,8 +227,19 @@
             or
             t5.name like CONCAT('%', #{query.content}, '%')
             or
+            t5.description like CONCAT('%', #{query.content}, '%')
+            or
             t1.remark like CONCAT('%', #{query.content}, '%')
             )
+        </if>
+        <if test="query.level != null">
+            and t1.level = #{query.level}
+        </if>
+        <if test="query.startTime != null and query.startTime !='' ">
+            and t1.create_time &gt;= #{query.startTime}
+        </if>
+        <if test="query.endTime != null and query.endTime !='' ">
+            and #{query.endTime} &gt;= t1.create_time
         </if>
         order by t1.create_time desc
     </select>
@@ -256,16 +267,16 @@
         <if test="query.projectId != null">
             and t2.project_id = #{query.projectId}
         </if>
-        <if test="query.state ==4 ">
+        <if test="query.state == 0 ">
             and t1.error_review_id is null
         </if>
-        <if test="query.state ==1 ">
+        <if test="query.state == 1 ">
             and t6.state = 0
         </if>
-        <if test="query.state ==2 ">
+        <if test="query.state == 2 ">
             and t6.state = 1
         </if>
-        <if test="query.state ==3 ">
+        <if test="query.state == 3 ">
             and t6.state = 2
         </if>
 
@@ -274,9 +285,20 @@
             or
             t5.name like CONCAT('%', #{query.content}, '%')
             or
+            t5.description like CONCAT('%', #{query.content}, '%')
+            or
             t1.remark like CONCAT('%', #{query.content}, '%')
             )
         </if>
+        <if test="query.level != null">
+            and t1.level = #{query.level}
+        </if>
+        <if test="query.startTime != null and query.startTime !='' ">
+            and t1.create_time &gt;= #{query.startTime}
+        </if>
+        <if test="query.endTime != null and query.endTime !='' ">
+            and #{query.endTime} &gt;= t1.create_time
+        </if>
         order by t1.create_time desc
     </select>
 

--
Gitblit v1.7.1