Merge remote-tracking branch 'upstream/6170' into 6170

This commit is contained in:
2025-10-11 11:06:15 +08:00
3 changed files with 12 additions and 5 deletions

View File

@ -105,6 +105,7 @@ public class DeviceQueryCriteria extends BaseEntity {
/**
* 设备所属分组
* group_id
*/
private Long groupId;

View File

@ -140,6 +140,9 @@
<if test="criteria.deviceStatus != null">
and d.device_status = #{criteria.deviceStatus}
</if>
<if test="criteria.groupId != null">
and d.group_id = #{criteria.groupId}
</if>
<if test="criteria.currentOwnerId != null">
and d.current_owner_id = #{criteria.currentOwnerId}
</if>
@ -475,7 +478,7 @@
d.type_name AS deviceName,
COUNT(*) AS frequency
FROM device_log dl
LEFT JOIN device d ON dl.device_id = d.id
INNER JOIN device d ON dl.device_id = d.id
WHERE dl.create_time >= DATE_SUB(NOW(), INTERVAL #{days} DAY)
GROUP BY d.device_type, d.type_name
ORDER BY frequency DESC