diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/RmSwitchManagement.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/RmSwitchManagement.java index e66f5e3..fbbacd6 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/RmSwitchManagement.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/RmSwitchManagement.java @@ -1,9 +1,11 @@ package com.ruoyi.system.domain; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.web.domain.BaseEntity; +import lombok.Data; + +import java.util.Date; +import java.util.List; /** * 交换机管理对象 rm_switch_management @@ -11,6 +13,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity; * @author gyt * @date 2025-10-10 */ +@Data public class RmSwitchManagement extends BaseEntity { private static final long serialVersionUID = 1L; @@ -36,8 +39,9 @@ public class RmSwitchManagement extends BaseEntity /** 在线状态(0-离线,1-在线) */ @Excel(name = "在线状态(0-离线,1-在线)") - private Integer onlineStatus; - + private String onlineStatus; + /** 上机时间 */ + private Date upTime; /** 心跳监测次数 */ @Excel(name = "心跳监测次数") private Long heartbeatCount; @@ -73,179 +77,7 @@ public class RmSwitchManagement extends BaseEntity /** 密码 */ @Excel(name = "密码") private String switchPassword; + /** 端口备注列表 */ + private List switchInterfaceInfoList; - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - - public void setSwitchName(String switchName) - { - this.switchName = switchName; - } - - public String getSwitchName() - { - return switchName; - } - - public void setHardwareSn(String hardwareSn) - { - this.hardwareSn = hardwareSn; - } - - public String getHardwareSn() - { - return hardwareSn; - } - - public void setSnmpAddress(String snmpAddress) - { - this.snmpAddress = snmpAddress; - } - - public String getSnmpAddress() - { - return snmpAddress; - } - - public void setSnmpPort(Long snmpPort) - { - this.snmpPort = snmpPort; - } - - public Long getSnmpPort() - { - return snmpPort; - } - - public void setOnlineStatus(Integer onlineStatus) - { - this.onlineStatus = onlineStatus; - } - - public Integer getOnlineStatus() - { - return onlineStatus; - } - - public void setHeartbeatCount(Long heartbeatCount) - { - this.heartbeatCount = heartbeatCount; - } - - public Long getHeartbeatCount() - { - return heartbeatCount; - } - - public void setHeartbeatInterval(Long heartbeatInterval) - { - this.heartbeatInterval = heartbeatInterval; - } - - public Long getHeartbeatInterval() - { - return heartbeatInterval; - } - - public void setHeartbeatOid(String heartbeatOid) - { - this.heartbeatOid = heartbeatOid; - } - - public String getHeartbeatOid() - { - return heartbeatOid; - } - - public void setSnmpVersion(String snmpVersion) - { - this.snmpVersion = snmpVersion; - } - - public String getSnmpVersion() - { - return snmpVersion; - } - - public void setReadWritePermission(String readWritePermission) - { - this.readWritePermission = readWritePermission; - } - - public String getReadWritePermission() - { - return readWritePermission; - } - - public void setSecurityLevel(String securityLevel) - { - this.securityLevel = securityLevel; - } - - public String getSecurityLevel() - { - return securityLevel; - } - - public void setEncryptionMethod(String encryptionMethod) - { - this.encryptionMethod = encryptionMethod; - } - - public String getEncryptionMethod() - { - return encryptionMethod; - } - - public void setCommunityName(String communityName) - { - this.communityName = communityName; - } - - public String getCommunityName() - { - return communityName; - } - - public void setSwitchPassword(String switchPassword) - { - this.switchPassword = switchPassword; - } - - public String getSwitchPassword() - { - return switchPassword; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("switchName", getSwitchName()) - .append("hardwareSn", getHardwareSn()) - .append("snmpAddress", getSnmpAddress()) - .append("snmpPort", getSnmpPort()) - .append("onlineStatus", getOnlineStatus()) - .append("heartbeatCount", getHeartbeatCount()) - .append("heartbeatInterval", getHeartbeatInterval()) - .append("heartbeatOid", getHeartbeatOid()) - .append("snmpVersion", getSnmpVersion()) - .append("readWritePermission", getReadWritePermission()) - .append("securityLevel", getSecurityLevel()) - .append("encryptionMethod", getEncryptionMethod()) - .append("communityName", getCommunityName()) - .append("switchPassword", getSwitchPassword()) - .append("createTime", getCreateTime()) - .append("updateTime", getUpdateTime()) - .append("createBy", getCreateBy()) - .append("updateBy", getUpdateBy()) - .toString(); - } } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RmSwitchManagementServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RmSwitchManagementServiceImpl.java index 555a9b2..146324b 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RmSwitchManagementServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RmSwitchManagementServiceImpl.java @@ -1,12 +1,15 @@ package com.ruoyi.system.service.impl; -import java.util.List; import com.ruoyi.common.core.utils.DateUtils; +import com.ruoyi.system.domain.RmSwitchInterfaceInfo; +import com.ruoyi.system.domain.RmSwitchManagement; +import com.ruoyi.system.mapper.RmSwitchInterfaceInfoMapper; +import com.ruoyi.system.mapper.RmSwitchManagementMapper; +import com.ruoyi.system.service.IRmSwitchManagementService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.ruoyi.system.mapper.RmSwitchManagementMapper; -import com.ruoyi.system.domain.RmSwitchManagement; -import com.ruoyi.system.service.IRmSwitchManagementService; + +import java.util.List; /** * 交换机管理Service业务层处理 @@ -19,6 +22,8 @@ public class RmSwitchManagementServiceImpl implements IRmSwitchManagementService { @Autowired private RmSwitchManagementMapper rmSwitchManagementMapper; + @Autowired + private RmSwitchInterfaceInfoMapper rmSwitchInterfaceInfoMapper; /** * 查询交换机管理 @@ -29,7 +34,13 @@ public class RmSwitchManagementServiceImpl implements IRmSwitchManagementService @Override public RmSwitchManagement selectRmSwitchManagementById(Long id) { - return rmSwitchManagementMapper.selectRmSwitchManagementById(id); + RmSwitchManagement rmSwitchManagement = rmSwitchManagementMapper.selectRmSwitchManagementById(id); + // 查询端口备注信息 + RmSwitchInterfaceInfo queryParam = new RmSwitchInterfaceInfo(); + queryParam.setHardwareSn(rmSwitchManagement.getHardwareSn()); + List interfaceInfos = rmSwitchInterfaceInfoMapper.selectRmSwitchInterfaceInfoList(queryParam); + rmSwitchManagement.setSwitchInterfaceInfoList(interfaceInfos); + return rmSwitchManagement; } /** diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/RmSwitchManagementMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/RmSwitchManagementMapper.xml index d047e3e..f2283dc 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/RmSwitchManagementMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/RmSwitchManagementMapper.xml @@ -1,9 +1,9 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -27,21 +28,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, switch_name, hardware_sn, snmp_address, snmp_port, online_status, heartbeat_count, heartbeat_interval, heartbeat_oid, snmp_version, read_write_permission, security_level, encryption_method, community_name, switch_password, create_time, update_time, create_by, update_by from rm_switch_management + select id, switch_name, hardware_sn, snmp_address, snmp_port, online_status, heartbeat_count, heartbeat_interval, heartbeat_oid, snmp_version, up_time, read_write_permission, security_level, encryption_method, community_name, switch_password, create_time, update_time, create_by, update_by from rm_switch_management - + + select fan_name fanName from initial_switch_fan_info + + and fan_ent_index = #{fanEntIndex} + and fan_name like concat('%', #{fanName}, '%') + and fan_entity_fan_state = #{fanEntityFanState} + and client_id = #{clientId} + + group by fan_name + + \ No newline at end of file diff --git a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchMpuInfoMapper.xml b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchMpuInfoMapper.xml index a8ecb7e..d39bd8a 100644 --- a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchMpuInfoMapper.xml +++ b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchMpuInfoMapper.xml @@ -33,6 +33,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and mpu_physical_software_rev = #{mpuPhysicalSoftwareRev} and mpu_entity_temperature = #{mpuEntityTemperature} and client_id = #{clientId} + and create_time >= #{startTime} + and create_time <= #{endTime} @@ -131,4 +133,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) + + \ No newline at end of file diff --git a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchOpticalModuleMapper.xml b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchOpticalModuleMapper.xml index e7f4ac5..32d8250 100644 --- a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchOpticalModuleMapper.xml +++ b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchOpticalModuleMapper.xml @@ -33,6 +33,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and hw_entity_optical_rx_power = #{hwEntityOpticalRxPower} and hw_entity_optical_tx_power = #{hwEntityOpticalTxPower} and client_id = #{clientId} + and create_time >= #{startTime} + and create_time <= #{endTime} @@ -131,4 +133,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) + + + \ No newline at end of file diff --git a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchOtherCollectDataMapper.xml b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchOtherCollectDataMapper.xml index 8115878..386b476 100644 --- a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchOtherCollectDataMapper.xml +++ b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchOtherCollectDataMapper.xml @@ -25,6 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and client_id = #{clientId} and collect_type = #{collectType} and collect_value = #{collectValue} + and create_time >= #{startTime} + and create_time <= #{endTime} diff --git a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchPowerSupplyMapper.xml b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchPowerSupplyMapper.xml index 7196171..1515fdf 100644 --- a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchPowerSupplyMapper.xml +++ b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchPowerSupplyMapper.xml @@ -31,6 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and pwr_entity_pwr_current = #{pwrEntityPwrCurrent} and pwr_entity_pwr_voltage = #{pwrEntityPwrVoltage} and client_id = #{clientId} + and create_time >= #{startTime} + and create_time <= #{endTime} @@ -124,4 +126,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) + + \ No newline at end of file diff --git a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSystemOtherCollectDataMapper.xml b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSystemOtherCollectDataMapper.xml index 17c80f0..00592c7 100644 --- a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSystemOtherCollectDataMapper.xml +++ b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSystemOtherCollectDataMapper.xml @@ -79,4 +79,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + \ No newline at end of file