From f7ed78a8642ca84859b753698d09ce762e861f8c Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 28 一月 2026 11:49:26 +0800
Subject: [PATCH] 代码提交

---
 ruoyi-system/src/main/resources/mapper/system/DeviceUsageMapper.xml |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/DeviceUsageMapper.xml b/ruoyi-system/src/main/resources/mapper/system/DeviceUsageMapper.xml
index 2dcb35b..1c6e139 100644
--- a/ruoyi-system/src/main/resources/mapper/system/DeviceUsageMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/DeviceUsageMapper.xml
@@ -55,7 +55,10 @@
         group by device_id
         ) latest on t2.id = latest.device_id
         left join project t3 on t1.project_id = t3.id
-        where t1.project_id = #{query.projectId} and t1.deleted = 0 and t1.disabled = 0
+        where  t1.deleted = 0 and t1.disabled = 0
+        <if test="query.projectId != null">
+            and t1.project_id = #{query.projectId}
+        </if>
         <if test="query.type != null">
             and t2.type = #{query.type}
         </if>

--
Gitblit v1.7.1