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.*