From 9a6bacd8f817f42b69a1a21ed62c971023c06e90 Mon Sep 17 00:00:00 2001 From: yinq Date: Mon, 12 Aug 2024 15:10:47 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/application-druid.yml | 10 +++++++++- .../system/service/impl/T_MonitorServiceImpl.java | 11 ++++++++++- .../mapper/system/TArraytemperaturedataMapper.xml | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index b16c7c6..1cd83f0 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -14,7 +14,15 @@ spring: # url: jdbc:sqlserver://localhost:1433;SelectMethod=cursor;DatabaseName=hw_iot_ems # username: sa # password: haiwei@2024 - # 从库数据源 +# 泰国成山采集系统 +# url: jdbc:sqlserver://localhost:1433;SelectMethod=cursor;DatabaseName=hw_iot_ems +# username: sa +# password: Call3248 +# 沈阳赛轮能源采集系统 +# url: jdbc:sqlserver://192.168.100.60:1433;SelectMethod=cursor;DatabaseName=hw_iot_ems +# username: sa +# password: abc@123 +# 从库数据源 slave: # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver # # 从数据源开关/默认关闭 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/T_MonitorServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/T_MonitorServiceImpl.java index d518a61..e9c41ac 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/T_MonitorServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/T_MonitorServiceImpl.java @@ -83,7 +83,16 @@ public class T_MonitorServiceImpl implements IT_MonitorService TSetmonitorthresholdvalue tSetmonitorthresholdvalue = new TSetmonitorthresholdvalue(); tSetmonitorthresholdvalue.setMonitorId(t_Monitor.getMonitorId()); tSetmonitorthresholdvalue.setMonitorType(16); - tSetmonitorthresholdvalueService.insertTSetmonitorthresholdvalue(tSetmonitorthresholdvalue); + try { + TSetmonitorthresholdvalue setmonitorthresholdvalue = new TSetmonitorthresholdvalue(); + setmonitorthresholdvalue.setMonitorId(t_Monitor.getMonitorId()); + List tSetmonitorthresholdvalueList = tSetmonitorthresholdvalueService.selectTSetmonitorthresholdvalueList(setmonitorthresholdvalue); + if (tSetmonitorthresholdvalueList.size() == 0){ + tSetmonitorthresholdvalueService.insertTSetmonitorthresholdvalue(tSetmonitorthresholdvalue); + } + } catch (Exception e) { + e.printStackTrace(); + } } } catch (Exception e) { e.printStackTrace(); diff --git a/ruoyi-system/src/main/resources/mapper/system/TArraytemperaturedataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TArraytemperaturedataMapper.xml index 73588cc..af39f1c 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TArraytemperaturedataMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TArraytemperaturedataMapper.xml @@ -1591,7 +1591,7 @@ SELECT *, ROW_NUMBER() OVER (PARTITION BY monitorId ORDER BY collectTime DESC) AS rn FROM T_ArrayTemperatureData - WHERE recodeTime > (GETDATE() - 30) + WHERE collectTime > (GETDATE() - 1) and monitorId like concat(#{monitorId}, '%') ) SELECT m.monitorName,t.*