diff --git a/ruoyi-admin/src/main/resources/templates/system/TempertureData/DistributionCabinetMonitor.html b/ruoyi-admin/src/main/resources/templates/system/TempertureData/DistributionCabinetMonitor.html index b556b09..20eb5de 100644 --- a/ruoyi-admin/src/main/resources/templates/system/TempertureData/DistributionCabinetMonitor.html +++ b/ruoyi-admin/src/main/resources/templates/system/TempertureData/DistributionCabinetMonitor.html @@ -285,7 +285,7 @@
-
实时监控平台
+
配电柜实时监控平台
@@ -373,9 +373,9 @@ + "
\"配电柜\"
" + "
" + "
最低温度:" + formatValue(v.humidity) + "℃
" - + "
" + formatValue(v.tempreture) + "
" + + "
" + formatValue(v.illuminance) + "
" + "
" - + "
最高温度:" + formatValue(v.illuminance) + "℃
" + + "
最高温度:" + formatValue(v.tempreture) + "℃
" + "
" + "
" + ""; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/T_W_TemperturedataServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/T_W_TemperturedataServiceImpl.java index 1a23127..39b6f23 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/T_W_TemperturedataServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/T_W_TemperturedataServiceImpl.java @@ -1,7 +1,12 @@ package com.ruoyi.system.service.impl; +import java.text.SimpleDateFormat; import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import com.ruoyi.common.utils.StringUtils; @@ -97,7 +102,21 @@ public class T_W_TemperturedataServiceImpl implements IT_W_TemperturedataService if (monitorIdList.isEmpty()) { return null; } - t_W_Temperturedata.getParams().put("monitorIdList", monitorIdList); + Map params = t_W_Temperturedata.getParams(); + Object beginCollectTime = params.get("beginCollectTime"); + if (beginCollectTime == null || StringUtils.isBlank(String.valueOf(beginCollectTime))) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.HOUR, -1); + Map timeParams = new HashMap<>(); + timeParams.put("beginCollectTime", simpleDateFormat.format(calendar.getTime())); + timeParams.put("endCollectTime", simpleDateFormat.format(new Date())); + timeParams.put("monitorIdList", monitorIdList); + t_W_Temperturedata.setParams(timeParams); + } else { + params.put("monitorIdList", monitorIdList); + } return t_W_TemperturedataMapper.selectDistributionCabinetRealTimeMonitor(t_W_Temperturedata); } diff --git a/ruoyi-system/src/main/resources/mapper/system/T_W_TemperturedataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/T_W_TemperturedataMapper.xml index 753f1c4..0f9424a 100644 --- a/ruoyi-system/src/main/resources/mapper/system/T_W_TemperturedataMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/T_W_TemperturedataMapper.xml @@ -179,11 +179,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ROW_NUMBER() OVER (PARTITION BY t1.monitorId ORDER BY t1.collectTime DESC) AS rn FROM T_W_TempertureData t1 + + and t1.collectTime between #{params.beginCollectTime} and #{params.endCollectTime} + - and t1.monitorId in - - #{id} - + and exists ( + select 1 + from T_Monitor m1 + where m1.monitorId = t1.monitorId + and ( + m1.monitorId in + + #{id} + + or m1.p_monitorId in + + #{id} + + ) + ) )