拓扑管理字段新增,交换机管理接口优化、网卡信息接口新增
This commit is contained in:
+10
@@ -4,6 +4,7 @@ import com.ruoyi.common.core.constant.SecurityConstants;
|
||||
import com.ruoyi.common.core.constant.ServiceNameConstants;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.system.api.domain.RmAlarmRecordRemote;
|
||||
import com.ruoyi.system.api.domain.RmNetworkInterfaceRemote;
|
||||
import com.ruoyi.system.api.factory.RemoteRocketMqFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -42,4 +43,13 @@ public interface RemoteRocketMqService {
|
||||
*/
|
||||
@GetMapping("/alarmRecord/alarmHandlingStatus")
|
||||
public R<Map> alarmHandlingStatus(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 获取网卡接口列表
|
||||
* @param rmNetworkInterfaceRemote
|
||||
* @param source
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/networkInterface/getNetworkInterfaceList")
|
||||
public R<List<RmNetworkInterfaceRemote>> getNetworkInterfaceList(@RequestBody RmNetworkInterfaceRemote rmNetworkInterfaceRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
}
|
||||
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package com.ruoyi.system.api.domain;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RmNetworkInterfaceRemote extends BaseEntity {
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 客户端ID */
|
||||
@Excel(name = "客户端ID")
|
||||
private String clientId;
|
||||
|
||||
/** 运营商 */
|
||||
@Excel(name = "运营商")
|
||||
private String isp;
|
||||
|
||||
/** 省 */
|
||||
@Excel(name = "省")
|
||||
private String province;
|
||||
|
||||
/** 市 */
|
||||
@Excel(name = "市")
|
||||
private String city;
|
||||
|
||||
/** 公网IP */
|
||||
@Excel(name = "公网IP")
|
||||
private String publicIp;
|
||||
|
||||
/** 接口名称 */
|
||||
@Excel(name = "接口名称")
|
||||
private String interfaceName;
|
||||
|
||||
/** MAC地址 */
|
||||
@Excel(name = "MAC地址")
|
||||
private String macAddress;
|
||||
|
||||
/** 接口类型 */
|
||||
@Excel(name = "接口类型")
|
||||
private String interfaceType;
|
||||
|
||||
/** IPv4地址 */
|
||||
@Excel(name = "IPv4地址")
|
||||
private String ipv4Address;
|
||||
|
||||
/** 网关 */
|
||||
@Excel(name = "网关")
|
||||
private String gateway;
|
||||
/** 绑定ip 1业务IP,2管理ip */
|
||||
private String bindIp;
|
||||
}
|
||||
+6
@@ -3,6 +3,7 @@ package com.ruoyi.system.api.factory;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.system.api.RemoteRocketMqService;
|
||||
import com.ruoyi.system.api.domain.RmAlarmRecordRemote;
|
||||
import com.ruoyi.system.api.domain.RmNetworkInterfaceRemote;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
@@ -45,6 +46,11 @@ public class RemoteRocketMqFallbackFactory implements FallbackFactory<RemoteRock
|
||||
public R<Map> alarmHandlingStatus(String source) {
|
||||
return R.fail(throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<List<RmNetworkInterfaceRemote>> getNetworkInterfaceList(RmNetworkInterfaceRemote rmNetworkInterfaceRemote, String source) {
|
||||
return R.fail(throwable.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -100,4 +100,14 @@ public class RmSwitchManagementController extends BaseController
|
||||
{
|
||||
return toAjax(rmSwitchManagementService.deleteRmSwitchManagementByIds(ids));
|
||||
}
|
||||
/**
|
||||
* 查询交换机管理列表
|
||||
*/
|
||||
@RequiresPermissions("system:switchManagement:list")
|
||||
@PostMapping("/getAllSwitchName")
|
||||
public AjaxResult getAllSwitchName(@RequestBody RmSwitchManagement rmSwitchManagement)
|
||||
{
|
||||
List<RmSwitchManagement> list = rmSwitchManagementService.selectRmSwitchManagementList(rmSwitchManagement);
|
||||
return success(list);
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -49,6 +49,8 @@ public class EpsMethodChangeRecord extends BaseEntity
|
||||
|
||||
/** 业务代码(12位) */
|
||||
private String businessCode;
|
||||
/** 客户端id */
|
||||
private String clientId;
|
||||
/** 开始时间 */
|
||||
private String startTime;
|
||||
/** 结束时间 */
|
||||
|
||||
+15
@@ -75,4 +75,19 @@ public class RmEpsTopologyManagement extends BaseEntity
|
||||
private String switchIpAddress;
|
||||
/** 资源名称 */
|
||||
private String resourceName;
|
||||
|
||||
/**
|
||||
* 对端交换机名称
|
||||
*/
|
||||
private String peerSwitchName;
|
||||
|
||||
/**
|
||||
* 对端交换机接口
|
||||
*/
|
||||
private String peerSwitchInterface;
|
||||
|
||||
/**
|
||||
* 服务器clientId
|
||||
*/
|
||||
private String serverClientId;
|
||||
}
|
||||
|
||||
+2
-67
@@ -1,9 +1,8 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 交换机接口信息对象 rm_switch_interface_info
|
||||
@@ -11,6 +10,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
* @author gyt
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Data
|
||||
public class RmSwitchInterfaceInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -33,69 +33,4 @@ public class RmSwitchInterfaceInfo extends BaseEntity
|
||||
/** 接口备注 */
|
||||
@Excel(name = "接口备注")
|
||||
private String interfaceRemark;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setHardwareSn(String hardwareSn)
|
||||
{
|
||||
this.hardwareSn = hardwareSn;
|
||||
}
|
||||
|
||||
public String getHardwareSn()
|
||||
{
|
||||
return hardwareSn;
|
||||
}
|
||||
|
||||
public void setSwitchName(String switchName)
|
||||
{
|
||||
this.switchName = switchName;
|
||||
}
|
||||
|
||||
public String getSwitchName()
|
||||
{
|
||||
return switchName;
|
||||
}
|
||||
|
||||
public void setInterfaceName(String interfaceName)
|
||||
{
|
||||
this.interfaceName = interfaceName;
|
||||
}
|
||||
|
||||
public String getInterfaceName()
|
||||
{
|
||||
return interfaceName;
|
||||
}
|
||||
|
||||
public void setInterfaceRemark(String interfaceRemark)
|
||||
{
|
||||
this.interfaceRemark = interfaceRemark;
|
||||
}
|
||||
|
||||
public String getInterfaceRemark()
|
||||
{
|
||||
return interfaceRemark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("hardwareSn", getHardwareSn())
|
||||
.append("switchName", getSwitchName())
|
||||
.append("interfaceName", getInterfaceName())
|
||||
.append("interfaceRemark", getInterfaceRemark())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
+6
-2
@@ -44,11 +44,11 @@ public class RmSwitchManagement extends BaseEntity
|
||||
private Date upTime;
|
||||
/** 心跳监测次数 */
|
||||
@Excel(name = "心跳监测次数")
|
||||
private Long heartbeatCount;
|
||||
private String heartbeatCount;
|
||||
|
||||
/** 心跳监测周期(秒) */
|
||||
@Excel(name = "心跳监测周期(秒)")
|
||||
private Long heartbeatInterval;
|
||||
private String heartbeatInterval;
|
||||
|
||||
/** 心跳检测OID */
|
||||
@Excel(name = "心跳检测OID")
|
||||
@@ -77,6 +77,10 @@ public class RmSwitchManagement extends BaseEntity
|
||||
/** 密码 */
|
||||
@Excel(name = "密码")
|
||||
private String switchPassword;
|
||||
/** 交换机类型 */
|
||||
private String switchType;
|
||||
/** 用户名 */
|
||||
private String switchUser;
|
||||
/** 端口备注列表 */
|
||||
private List<RmSwitchInterfaceInfo> switchInterfaceInfoList;
|
||||
|
||||
|
||||
+45
-1
@@ -1,11 +1,16 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.system.api.RemoteRocketMqService;
|
||||
import com.ruoyi.system.api.domain.RmNetworkInterfaceRemote;
|
||||
import com.ruoyi.system.domain.EpsBusinessDeploy;
|
||||
import com.ruoyi.system.domain.EpsMethodChangeRecord;
|
||||
import com.ruoyi.system.domain.RmResourceRegistration;
|
||||
import com.ruoyi.system.mapper.EpsBusinessDeployMapper;
|
||||
import com.ruoyi.system.mapper.EpsMethodChangeRecordMapper;
|
||||
import com.ruoyi.system.mapper.RmResourceRegistrationMapper;
|
||||
import com.ruoyi.system.service.IEpsBusinessDeployService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -13,6 +18,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 业务下发管理Service业务层处理
|
||||
@@ -27,6 +33,10 @@ public class EpsBusinessDeployServiceImpl implements IEpsBusinessDeployService
|
||||
private EpsBusinessDeployMapper epsBusinessDeployMapper;
|
||||
@Autowired
|
||||
private RmResourceRegistrationMapper rmResourceRegistrationMapper;
|
||||
@Autowired
|
||||
private RemoteRocketMqService remoteRocketMqService;
|
||||
@Autowired
|
||||
private EpsMethodChangeRecordMapper epsMethodChangeRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询业务下发管理
|
||||
@@ -147,6 +157,40 @@ public class EpsBusinessDeployServiceImpl implements IEpsBusinessDeployService
|
||||
// 设置审核信息
|
||||
epsBusinessDeploy.setReviewBy(SecurityUtils.getUsername());
|
||||
epsBusinessDeploy.setReviewTime(DateUtils.getNowDate());
|
||||
return epsBusinessDeployMapper.updateEpsBusinessDeploy(epsBusinessDeploy);
|
||||
int rows = epsBusinessDeployMapper.updateEpsBusinessDeploy(epsBusinessDeploy);
|
||||
// 根据id查询业务信息
|
||||
EpsBusinessDeploy businessMsg = epsBusinessDeployMapper.selectEpsBusinessDeployById(epsBusinessDeploy.getId());
|
||||
String businessCode = businessMsg.getBusinessCode();
|
||||
String businessName = businessMsg.getBusinessName();
|
||||
String clientIdStr = businessMsg.getDeployDevice();
|
||||
String[] clientIds = clientIdStr.split("\n");
|
||||
// 保存业务修改记录
|
||||
for (String clientId : clientIds) {
|
||||
// 根据clientId查询网卡接口名称
|
||||
RmNetworkInterfaceRemote queryParam = new RmNetworkInterfaceRemote();
|
||||
queryParam.setClientId(clientId);
|
||||
List<RmNetworkInterfaceRemote> interfaceList = remoteRocketMqService.getNetworkInterfaceList(queryParam, SecurityConstants.INNER).getData();
|
||||
String interfaceName = "";
|
||||
if (interfaceList != null && !interfaceList.isEmpty()) {
|
||||
interfaceName = interfaceList.stream()
|
||||
.filter(interfaceRemote -> "1".equals(interfaceRemote.getBindIp()))
|
||||
.map(RmNetworkInterfaceRemote::getInterfaceName)
|
||||
.filter(name -> name != null && !name.trim().isEmpty())
|
||||
.collect(Collectors.joining(","));
|
||||
}
|
||||
EpsMethodChangeRecord changeRecord = new EpsMethodChangeRecord();
|
||||
// 设置基本信息
|
||||
changeRecord.setClientId(clientId);
|
||||
changeRecord.setTrafficPort(interfaceName);
|
||||
changeRecord.setBusinessCode(businessCode);
|
||||
changeRecord.setBusinessName(businessName);
|
||||
changeRecord.setCreateTime(DateUtils.getNowDate());
|
||||
changeRecord.setCreatBy(SecurityUtils.getUsername());
|
||||
// 修改内容
|
||||
String content = "流量网口设置为" + interfaceName + ",业务为" + businessName;
|
||||
// 保存数据
|
||||
epsMethodChangeRecordMapper.insertEpsMethodChangeRecord(changeRecord);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-1
@@ -18,10 +18,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="packageBandwidth" column="package_bandwidth" />
|
||||
<result property="businessName" column="business_name" />
|
||||
<result property="businessCode" column="business_code" />
|
||||
<result property="clientId" column="client_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEpsMethodChangeRecordVo">
|
||||
select id, node_name, change_content, hardware_sn, create_time, creat_by, update_time, update_by, revenue_method, traffic_port, package_bandwidth, business_name, business_code from eps_method_change_record
|
||||
select id, node_name, change_content, hardware_sn, create_time, creat_by, update_time, update_by, revenue_method, traffic_port, package_bandwidth, business_name, business_code, client_id from eps_method_change_record
|
||||
</sql>
|
||||
|
||||
<select id="selectEpsMethodChangeRecordList" parameterType="EpsMethodChangeRecord" resultMap="EpsMethodChangeRecordResult">
|
||||
@@ -36,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="packageBandwidth != null "> and package_bandwidth = #{packageBandwidth}</if>
|
||||
<if test="businessName != null and businessName != ''"> and business_name like concat('%', #{businessName}, '%')</if>
|
||||
<if test="businessCode != null and businessCode != ''"> and business_code = #{businessCode}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
@@ -63,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="packageBandwidth != null">package_bandwidth,</if>
|
||||
<if test="businessName != null">business_name,</if>
|
||||
<if test="businessCode != null">business_code,</if>
|
||||
<if test="clientId != null">client_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
@@ -78,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="packageBandwidth != null">#{packageBandwidth},</if>
|
||||
<if test="businessName != null">#{businessName},</if>
|
||||
<if test="businessCode != null">#{businessCode},</if>
|
||||
<if test="clientId != null">#{clientId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -96,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="packageBandwidth != null">package_bandwidth = #{packageBandwidth},</if>
|
||||
<if test="businessName != null">business_name = #{businessName},</if>
|
||||
<if test="businessCode != null">business_code = #{businessCode},</if>
|
||||
<if test="clientId != null">client_id = #{clientId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
+16
-1
@@ -20,10 +20,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updaterId" column="updater_id" />
|
||||
<result property="updaterName" column="updater_name" />
|
||||
<result property="switchIpAddress" column="switch_ip_address" />
|
||||
<result property="peerSwitchName" column="peer_switch_name" />
|
||||
<result property="peerSwitchInterface" column="peer_switch_interface" />
|
||||
<result property="serverClientId" column="server_client_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmEpsTopologyManagementVo">
|
||||
select id, switch_name, switch_sn, interface_name, connected_device_type, server_name, server_sn, server_port, create_time, update_time, creator_id, creator_name, updater_id, updater_name, switch_ip_address from rm_eps_topology_management
|
||||
select id, switch_name, switch_sn, interface_name, connected_device_type, server_name, server_sn, server_port, create_time, update_time, creator_id, creator_name, updater_id, updater_name, switch_ip_address, peer_switch_name, peer_switch_interface, server_client_id from rm_eps_topology_management
|
||||
</sql>
|
||||
|
||||
<select id="selectRmEpsTopologyManagementList" parameterType="RmEpsTopologyManagement" resultMap="RmEpsTopologyManagementResult">
|
||||
@@ -42,6 +45,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updaterName != null and updaterName != ''"> and updater_name like concat('%', #{updaterName}, '%')</if>
|
||||
<if test="switchIpAddress != null and switchIpAddress != ''"> and switch_ip_address = #{switchIpAddress}</if>
|
||||
<if test="resourceName != null and resourceName != ''">and (switch_name like concat('%', #{resourceName}, '%') or server_name like concat('%', #{resourceName}, '%'))</if>
|
||||
<if test="peerSwitchName != null and peerSwitchName != ''"> and peer_switch_name like concat('%', #{peerSwitchName}, '%')</if>
|
||||
<if test="peerSwitchInterface != null and peerSwitchInterface != ''"> and peer_switch_interface = #{peerSwitchInterface}</if>
|
||||
<if test="serverClientId != null and serverClientId != ''"> and server_client_id = #{serverClientId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -67,6 +73,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updaterId != null">updater_id,</if>
|
||||
<if test="updaterName != null">updater_name,</if>
|
||||
<if test="switchIpAddress != null">switch_ip_address,</if>
|
||||
<if test="peerSwitchName != null">peer_switch_name,</if>
|
||||
<if test="peerSwitchInterface != null">peer_switch_interface,</if>
|
||||
<if test="serverClientId != null">server_client_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="switchName != null">#{switchName},</if>
|
||||
@@ -83,6 +92,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updaterId != null">#{updaterId},</if>
|
||||
<if test="updaterName != null">#{updaterName},</if>
|
||||
<if test="switchIpAddress != null">#{switchIpAddress},</if>
|
||||
<if test="peerSwitchName != null">#{peerSwitchName},</if>
|
||||
<if test="peerSwitchInterface != null">#{peerSwitchInterface},</if>
|
||||
<if test="serverClientId != null">#{serverClientId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -103,6 +115,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updaterId != null">updater_id = #{updaterId},</if>
|
||||
<if test="updaterName != null">updater_name = #{updaterName},</if>
|
||||
<if test="switchIpAddress != null">switch_ip_address = #{switchIpAddress},</if>
|
||||
<if test="peerSwitchName != null">peer_switch_name = #{peerSwitchName},</if>
|
||||
<if test="peerSwitchInterface != null">peer_switch_interface = #{peerSwitchInterface},</if>
|
||||
<if test="serverClientId != null">server_client_id = #{serverClientId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
+19
-9
@@ -6,6 +6,7 @@
|
||||
|
||||
<resultMap type="RmSwitchManagement" id="RmSwitchManagementResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="switchType" column="switch_type" />
|
||||
<result property="switchName" column="switch_name" />
|
||||
<result property="hardwareSn" column="hardware_sn" />
|
||||
<result property="snmpAddress" column="snmp_address" />
|
||||
@@ -20,6 +21,7 @@
|
||||
<result property="securityLevel" column="security_level" />
|
||||
<result property="encryptionMethod" column="encryption_method" />
|
||||
<result property="communityName" column="community_name" />
|
||||
<result property="switchUser" column="switch_user" />
|
||||
<result property="switchPassword" column="switch_password" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
@@ -28,19 +30,20 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmSwitchManagementVo">
|
||||
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 id, switch_type, 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_user, switch_password, create_time, update_time, create_by, update_by from rm_switch_management
|
||||
</sql>
|
||||
|
||||
<select id="selectRmSwitchManagementList" parameterType="RmSwitchManagement" resultMap="RmSwitchManagementResult">
|
||||
<include refid="selectRmSwitchManagementVo"/>
|
||||
<where>
|
||||
<if test="switchType != null and switchType != ''"> and switch_type = #{switchType}</if>
|
||||
<if test="switchName != null and switchName != ''"> and switch_name like concat('%', #{switchName}, '%')</if>
|
||||
<if test="hardwareSn != null and hardwareSn != ''"> and hardware_sn = #{hardwareSn}</if>
|
||||
<if test="snmpAddress != null and snmpAddress != ''"> and snmp_address = #{snmpAddress}</if>
|
||||
<if test="snmpPort != null "> and snmp_port = #{snmpPort}</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''"> and online_status = #{onlineStatus}</if>
|
||||
<if test="heartbeatCount != null "> and heartbeat_count = #{heartbeatCount}</if>
|
||||
<if test="heartbeatInterval != null "> and heartbeat_interval = #{heartbeatInterval}</if>
|
||||
<if test="heartbeatCount != null and heartbeatCount != ''"> and heartbeat_count = #{heartbeatCount}</if>
|
||||
<if test="heartbeatInterval != null and heartbeatInterval != ''"> and heartbeat_interval = #{heartbeatInterval}</if>
|
||||
<if test="heartbeatOid != null and heartbeatOid != ''"> and heartbeat_oid = #{heartbeatOid}</if>
|
||||
<if test="snmpVersion != null and snmpVersion != ''"> and snmp_version = #{snmpVersion}</if>
|
||||
<if test="upTime != null "> and up_time = #{upTime}</if>
|
||||
@@ -48,6 +51,7 @@
|
||||
<if test="securityLevel != null and securityLevel != ''"> and security_level = #{securityLevel}</if>
|
||||
<if test="encryptionMethod != null and encryptionMethod != ''"> and encryption_method = #{encryptionMethod}</if>
|
||||
<if test="communityName != null and communityName != ''"> and community_name like concat('%', #{communityName}, '%')</if>
|
||||
<if test="switchUser != null and switchUser != ''"> and switch_user = #{switchUser}</if>
|
||||
<if test="switchPassword != null and switchPassword != ''"> and switch_password = #{switchPassword}</if>
|
||||
</where>
|
||||
</select>
|
||||
@@ -60,13 +64,14 @@
|
||||
<insert id="insertRmSwitchManagement" parameterType="RmSwitchManagement" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_switch_management
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="switchType != null">switch_type,</if>
|
||||
<if test="switchName != null and switchName != ''">switch_name,</if>
|
||||
<if test="hardwareSn != null and hardwareSn != ''">hardware_sn,</if>
|
||||
<if test="snmpAddress != null and snmpAddress != ''">snmp_address,</if>
|
||||
<if test="snmpPort != null">snmp_port,</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''">online_status,</if>
|
||||
<if test="heartbeatCount != null">heartbeat_count,</if>
|
||||
<if test="heartbeatInterval != null">heartbeat_interval,</if>
|
||||
<if test="heartbeatCount != null and heartbeatCount != ''">heartbeat_count,</if>
|
||||
<if test="heartbeatInterval != null and heartbeatInterval != ''">heartbeat_interval,</if>
|
||||
<if test="heartbeatOid != null and heartbeatOid != ''">heartbeat_oid,</if>
|
||||
<if test="snmpVersion != null and snmpVersion != ''">snmp_version,</if>
|
||||
<if test="upTime != null">up_time,</if>
|
||||
@@ -74,6 +79,7 @@
|
||||
<if test="securityLevel != null">security_level,</if>
|
||||
<if test="encryptionMethod != null">encryption_method,</if>
|
||||
<if test="communityName != null">community_name,</if>
|
||||
<if test="switchUser != null">switch_user,</if>
|
||||
<if test="switchPassword != null">switch_password,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
@@ -81,13 +87,14 @@
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="switchType != null">#{switchType},</if>
|
||||
<if test="switchName != null and switchName != ''">#{switchName},</if>
|
||||
<if test="hardwareSn != null and hardwareSn != ''">#{hardwareSn},</if>
|
||||
<if test="snmpAddress != null and snmpAddress != ''">#{snmpAddress},</if>
|
||||
<if test="snmpPort != null">#{snmpPort},</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''">#{onlineStatus},</if>
|
||||
<if test="heartbeatCount != null">#{heartbeatCount},</if>
|
||||
<if test="heartbeatInterval != null">#{heartbeatInterval},</if>
|
||||
<if test="heartbeatCount != null and heartbeatCount != ''">#{heartbeatCount},</if>
|
||||
<if test="heartbeatInterval != null and heartbeatInterval != ''">#{heartbeatInterval},</if>
|
||||
<if test="heartbeatOid != null and heartbeatOid != ''">#{heartbeatOid},</if>
|
||||
<if test="snmpVersion != null and snmpVersion != ''">#{snmpVersion},</if>
|
||||
<if test="upTime != null">#{upTime},</if>
|
||||
@@ -95,6 +102,7 @@
|
||||
<if test="securityLevel != null">#{securityLevel},</if>
|
||||
<if test="encryptionMethod != null">#{encryptionMethod},</if>
|
||||
<if test="communityName != null">#{communityName},</if>
|
||||
<if test="switchUser != null">#{switchUser},</if>
|
||||
<if test="switchPassword != null">#{switchPassword},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
@@ -106,13 +114,14 @@
|
||||
<update id="updateRmSwitchManagement" parameterType="RmSwitchManagement">
|
||||
update rm_switch_management
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="switchType != null">switch_type = #{switchType},</if>
|
||||
<if test="switchName != null and switchName != ''">switch_name = #{switchName},</if>
|
||||
<if test="hardwareSn != null and hardwareSn != ''">hardware_sn = #{hardwareSn},</if>
|
||||
<if test="snmpAddress != null and snmpAddress != ''">snmp_address = #{snmpAddress},</if>
|
||||
<if test="snmpPort != null">snmp_port = #{snmpPort},</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''">online_status = #{onlineStatus},</if>
|
||||
<if test="heartbeatCount != null">heartbeat_count = #{heartbeatCount},</if>
|
||||
<if test="heartbeatInterval != null">heartbeat_interval = #{heartbeatInterval},</if>
|
||||
<if test="heartbeatCount != null and heartbeatCount != ''">heartbeat_count = #{heartbeatCount},</if>
|
||||
<if test="heartbeatInterval != null and heartbeatInterval != ''">heartbeat_interval = #{heartbeatInterval},</if>
|
||||
<if test="heartbeatOid != null and heartbeatOid != ''">heartbeat_oid = #{heartbeatOid},</if>
|
||||
<if test="snmpVersion != null and snmpVersion != ''">snmp_version = #{snmpVersion},</if>
|
||||
<if test="upTime != null">up_time = #{upTime},</if>
|
||||
@@ -120,6 +129,7 @@
|
||||
<if test="securityLevel != null">security_level = #{securityLevel},</if>
|
||||
<if test="encryptionMethod != null">encryption_method = #{encryptionMethod},</if>
|
||||
<if test="communityName != null">community_name = #{communityName},</if>
|
||||
<if test="switchUser != null">switch_user = #{switchUser},</if>
|
||||
<if test="switchPassword != null">switch_password = #{switchPassword},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ public class InitialSwitchOtherCollectDataController extends BaseController
|
||||
@PostMapping("/getSwitchMonitorMsg")
|
||||
public AjaxResult getSwitchMonitorMsg(@RequestBody InitialSwitchOtherCollectData initialSwitchOtherCollectData)
|
||||
{
|
||||
List<Map> list = initialSwitchOtherCollectDataService.getSwitchMonitorMsg(initialSwitchOtherCollectData);
|
||||
Map list = initialSwitchOtherCollectDataService.getSwitchMonitorMsg(initialSwitchOtherCollectData);
|
||||
return success(list);
|
||||
}
|
||||
/**
|
||||
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
package com.ruoyi.rocketmq.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.InnerAuth;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.rocketmq.domain.RmNetworkInterface;
|
||||
import com.ruoyi.rocketmq.service.IRmNetworkInterfaceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户端网络接口信息Controller
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/networkInterface")
|
||||
public class RmNetworkInterfaceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRmNetworkInterfaceService rmNetworkInterfaceService;
|
||||
|
||||
/**
|
||||
* 查询客户端网络接口信息列表
|
||||
*/
|
||||
@RequiresPermissions("rocketmq:networkInterface:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RmNetworkInterface rmNetworkInterface)
|
||||
{
|
||||
startPage();
|
||||
List<RmNetworkInterface> list = rmNetworkInterfaceService.selectRmNetworkInterfaceList(rmNetworkInterface);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出客户端网络接口信息列表
|
||||
*/
|
||||
@RequiresPermissions("rocketmq:networkInterface:export")
|
||||
@Log(title = "客户端网络接口信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RmNetworkInterface rmNetworkInterface)
|
||||
{
|
||||
List<RmNetworkInterface> list = rmNetworkInterfaceService.selectRmNetworkInterfaceList(rmNetworkInterface);
|
||||
ExcelUtil<RmNetworkInterface> util = new ExcelUtil<RmNetworkInterface>(RmNetworkInterface.class);
|
||||
util.exportExcel(response, list, "客户端网络接口信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取客户端网络接口信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("rocketmq:networkInterface:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rmNetworkInterfaceService.selectRmNetworkInterfaceById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户端网络接口信息
|
||||
*/
|
||||
@RequiresPermissions("rocketmq:networkInterface:add")
|
||||
@Log(title = "客户端网络接口信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RmNetworkInterface rmNetworkInterface)
|
||||
{
|
||||
return toAjax(rmNetworkInterfaceService.insertRmNetworkInterface(rmNetworkInterface));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户端网络接口信息
|
||||
*/
|
||||
@RequiresPermissions("rocketmq:networkInterface:edit")
|
||||
@Log(title = "客户端网络接口信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RmNetworkInterface rmNetworkInterface)
|
||||
{
|
||||
return toAjax(rmNetworkInterfaceService.updateRmNetworkInterface(rmNetworkInterface));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户端网络接口信息
|
||||
*/
|
||||
@RequiresPermissions("rocketmq:networkInterface:remove")
|
||||
@Log(title = "客户端网络接口信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rmNetworkInterfaceService.deleteRmNetworkInterfaceByIds(ids));
|
||||
}
|
||||
/**
|
||||
* 远程调用查询客户端网络接口信息列表
|
||||
*/
|
||||
@InnerAuth
|
||||
@PostMapping("/getNetworkInterfaceList")
|
||||
public R getNetworkInterfaceList(@RequestBody RmNetworkInterface rmNetworkInterface)
|
||||
{
|
||||
List<RmNetworkInterface> list = rmNetworkInterfaceService.selectRmNetworkInterfaceList(rmNetworkInterface);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.rocketmq.domain;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 客户端网络接口信息对象 rm_network_interface
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
@Data
|
||||
public class RmNetworkInterface extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 客户端ID */
|
||||
@Excel(name = "客户端ID")
|
||||
private String clientId;
|
||||
|
||||
/** 运营商 */
|
||||
@Excel(name = "运营商")
|
||||
private String isp;
|
||||
|
||||
/** 省 */
|
||||
@Excel(name = "省")
|
||||
private String province;
|
||||
|
||||
/** 市 */
|
||||
@Excel(name = "市")
|
||||
private String city;
|
||||
|
||||
/** 公网IP */
|
||||
@Excel(name = "公网IP")
|
||||
private String publicIp;
|
||||
|
||||
/** 接口名称 */
|
||||
@Excel(name = "接口名称")
|
||||
private String interfaceName;
|
||||
|
||||
/** MAC地址 */
|
||||
@Excel(name = "MAC地址")
|
||||
private String macAddress;
|
||||
|
||||
/** 接口类型 */
|
||||
@Excel(name = "接口类型")
|
||||
private String interfaceType;
|
||||
|
||||
/** IPv4地址 */
|
||||
@Excel(name = "IPv4地址")
|
||||
private String ipv4Address;
|
||||
|
||||
/** 网关 */
|
||||
@Excel(name = "网关")
|
||||
private String gateway;
|
||||
/** 绑定ip 1业务IP,2管理ip */
|
||||
private String bindIp;
|
||||
|
||||
}
|
||||
+1
-1
@@ -66,5 +66,5 @@ public interface InitialSwitchOtherCollectDataMapper
|
||||
* @param initialSwitchOtherCollectData
|
||||
* @return
|
||||
*/
|
||||
List<Map> getSwitchMonitorMsg(InitialSwitchOtherCollectData initialSwitchOtherCollectData);
|
||||
Map getSwitchMonitorMsg(InitialSwitchOtherCollectData initialSwitchOtherCollectData);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.rocketmq.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.rocketmq.domain.RmNetworkInterface;
|
||||
|
||||
/**
|
||||
* 客户端网络接口信息Mapper接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
public interface RmNetworkInterfaceMapper
|
||||
{
|
||||
/**
|
||||
* 查询客户端网络接口信息
|
||||
*
|
||||
* @param id 客户端网络接口信息主键
|
||||
* @return 客户端网络接口信息
|
||||
*/
|
||||
public RmNetworkInterface selectRmNetworkInterfaceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询客户端网络接口信息列表
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 客户端网络接口信息集合
|
||||
*/
|
||||
public List<RmNetworkInterface> selectRmNetworkInterfaceList(RmNetworkInterface rmNetworkInterface);
|
||||
|
||||
/**
|
||||
* 新增客户端网络接口信息
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmNetworkInterface(RmNetworkInterface rmNetworkInterface);
|
||||
|
||||
/**
|
||||
* 修改客户端网络接口信息
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmNetworkInterface(RmNetworkInterface rmNetworkInterface);
|
||||
|
||||
/**
|
||||
* 删除客户端网络接口信息
|
||||
*
|
||||
* @param id 客户端网络接口信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmNetworkInterfaceById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除客户端网络接口信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmNetworkInterfaceByIds(Long[] ids);
|
||||
}
|
||||
+1
-1
@@ -66,7 +66,7 @@ public interface IInitialSwitchOtherCollectDataService
|
||||
* @param initialSwitchOtherCollectData
|
||||
* @return
|
||||
*/
|
||||
List<Map> getSwitchMonitorMsg(InitialSwitchOtherCollectData initialSwitchOtherCollectData);
|
||||
Map getSwitchMonitorMsg(InitialSwitchOtherCollectData initialSwitchOtherCollectData);
|
||||
|
||||
/**
|
||||
* 图形监控交换机设备CPU使用率
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.rocketmq.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.rocketmq.domain.RmNetworkInterface;
|
||||
|
||||
/**
|
||||
* 客户端网络接口信息Service接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
public interface IRmNetworkInterfaceService
|
||||
{
|
||||
/**
|
||||
* 查询客户端网络接口信息
|
||||
*
|
||||
* @param id 客户端网络接口信息主键
|
||||
* @return 客户端网络接口信息
|
||||
*/
|
||||
public RmNetworkInterface selectRmNetworkInterfaceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询客户端网络接口信息列表
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 客户端网络接口信息集合
|
||||
*/
|
||||
public List<RmNetworkInterface> selectRmNetworkInterfaceList(RmNetworkInterface rmNetworkInterface);
|
||||
|
||||
/**
|
||||
* 新增客户端网络接口信息
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmNetworkInterface(RmNetworkInterface rmNetworkInterface);
|
||||
|
||||
/**
|
||||
* 修改客户端网络接口信息
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmNetworkInterface(RmNetworkInterface rmNetworkInterface);
|
||||
|
||||
/**
|
||||
* 批量删除客户端网络接口信息
|
||||
*
|
||||
* @param ids 需要删除的客户端网络接口信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmNetworkInterfaceByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除客户端网络接口信息信息
|
||||
*
|
||||
* @param id 客户端网络接口信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmNetworkInterfaceById(Long id);
|
||||
}
|
||||
+1
-1
@@ -100,7 +100,7 @@ public class InitialSwitchOtherCollectDataServiceImpl implements IInitialSwitchO
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getSwitchMonitorMsg(InitialSwitchOtherCollectData initialSwitchOtherCollectData) {
|
||||
public Map getSwitchMonitorMsg(InitialSwitchOtherCollectData initialSwitchOtherCollectData) {
|
||||
|
||||
return initialSwitchOtherCollectDataMapper.getSwitchMonitorMsg(initialSwitchOtherCollectData);
|
||||
}
|
||||
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package com.ruoyi.rocketmq.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.rocketmq.mapper.RmNetworkInterfaceMapper;
|
||||
import com.ruoyi.rocketmq.domain.RmNetworkInterface;
|
||||
import com.ruoyi.rocketmq.service.IRmNetworkInterfaceService;
|
||||
|
||||
/**
|
||||
* 客户端网络接口信息Service业务层处理
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
@Service
|
||||
public class RmNetworkInterfaceServiceImpl implements IRmNetworkInterfaceService
|
||||
{
|
||||
@Autowired
|
||||
private RmNetworkInterfaceMapper rmNetworkInterfaceMapper;
|
||||
|
||||
/**
|
||||
* 查询客户端网络接口信息
|
||||
*
|
||||
* @param id 客户端网络接口信息主键
|
||||
* @return 客户端网络接口信息
|
||||
*/
|
||||
@Override
|
||||
public RmNetworkInterface selectRmNetworkInterfaceById(Long id)
|
||||
{
|
||||
return rmNetworkInterfaceMapper.selectRmNetworkInterfaceById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户端网络接口信息列表
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 客户端网络接口信息
|
||||
*/
|
||||
@Override
|
||||
public List<RmNetworkInterface> selectRmNetworkInterfaceList(RmNetworkInterface rmNetworkInterface)
|
||||
{
|
||||
return rmNetworkInterfaceMapper.selectRmNetworkInterfaceList(rmNetworkInterface);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户端网络接口信息
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRmNetworkInterface(RmNetworkInterface rmNetworkInterface)
|
||||
{
|
||||
rmNetworkInterface.setCreateTime(DateUtils.getNowDate());
|
||||
return rmNetworkInterfaceMapper.insertRmNetworkInterface(rmNetworkInterface);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户端网络接口信息
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRmNetworkInterface(RmNetworkInterface rmNetworkInterface)
|
||||
{
|
||||
rmNetworkInterface.setUpdateTime(DateUtils.getNowDate());
|
||||
return rmNetworkInterfaceMapper.updateRmNetworkInterface(rmNetworkInterface);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除客户端网络接口信息
|
||||
*
|
||||
* @param ids 需要删除的客户端网络接口信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmNetworkInterfaceByIds(Long[] ids)
|
||||
{
|
||||
return rmNetworkInterfaceMapper.deleteRmNetworkInterfaceByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户端网络接口信息信息
|
||||
*
|
||||
* @param id 客户端网络接口信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmNetworkInterfaceById(Long id)
|
||||
{
|
||||
return rmNetworkInterfaceMapper.deleteRmNetworkInterfaceById(id);
|
||||
}
|
||||
}
|
||||
+21
@@ -81,4 +81,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="getSwitchMonitorMsg" parameterType="InitialSwitchOtherCollectData" resultType="java.util.Map">
|
||||
SELECT
|
||||
MAX(CASE WHEN t.collect_type = 'sysDescr' THEN t.collect_value END) as sysDescr,
|
||||
MAX(CASE WHEN t.collect_type = 'sysObjectID' THEN t.collect_value END) as sysObjectID,
|
||||
MAX(CASE WHEN t.collect_type = 'sysUpTime' THEN t.collect_value END) as sysUpTime,
|
||||
MAX(CASE WHEN t.collect_type = 'sysContact' THEN t.collect_value END) as sysContact,
|
||||
MAX(CASE WHEN t.collect_type = 'sysName' THEN t.collect_value END) as sysName,
|
||||
MAX(CASE WHEN t.collect_type = 'sysLocation' THEN t.collect_value END) as sysLocation,
|
||||
MAX(CASE WHEN t.collect_type = 'hwStackSystemMac' THEN t.collect_value END) as hwStackSystemMac,
|
||||
MAX(CASE WHEN t.collect_type = 'entIndex' THEN t.collect_value END) as entIndex,
|
||||
MAX(CASE WHEN t.collect_type = 'entPhysicalName' THEN t.collect_value END) as entPhysicalName,
|
||||
MAX(CASE WHEN t.collect_type = 'entPhysicalSoftwareRev' THEN t.collect_value END) as entPhysicalSoftwareRev
|
||||
FROM `initial_switch_other_collect_data` t
|
||||
INNER JOIN (
|
||||
SELECT client_id, MAX(create_time) as max_time
|
||||
FROM `initial_switch_other_collect_data`
|
||||
WHERE client_id = #{clientId}
|
||||
GROUP BY client_id
|
||||
) latest ON t.client_id = latest.client_id AND t.create_time = latest.max_time
|
||||
WHERE t.client_id = #{clientId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -18,16 +18,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="switchType" column="switch_type" />
|
||||
<result property="deployDevice" column="deploy_device" />
|
||||
<result property="resourceType" column="resource_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmMonitorPolicyVo">
|
||||
select id, template_id, resource_group_id, policy_name, description, status, deploy_time, create_time, update_time, create_by, update_by, switch_type, deploy_device from rm_monitor_policy
|
||||
select id, template_id, resource_group_id, policy_name, description, status, deploy_time, create_time, update_time, create_by, update_by, switch_type, deploy_device, resource_type from rm_monitor_policy
|
||||
</sql>
|
||||
|
||||
<select id="selectRmMonitorPolicyList" parameterType="RmMonitorPolicy" resultMap="RmMonitorPolicyResult">
|
||||
<include refid="selectRmMonitorPolicyVo"/>
|
||||
<where>
|
||||
<if test="templateId != null "> and template_id = #{templateId}</if>
|
||||
<if test="resourceType != null "> and resource_type = #{resourceType}</if>
|
||||
<if test="resourceGroupId != null "> and resource_group_id = #{resourceGroupId}</if>
|
||||
<if test="policyName != null and policyName != ''"> and policy_name like concat('%', #{policyName}, '%')</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
@@ -62,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="switchType != null">switch_type,</if>
|
||||
<if test="deployDevice != null">deploy_device,</if>
|
||||
<if test="resourceType != null">resource_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="templateId != null">#{templateId},</if>
|
||||
@@ -76,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="switchType != null">#{switchType},</if>
|
||||
<if test="deployDevice != null">#{deployDevice},</if>
|
||||
<if test="resourceType != null">#{resourceType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -94,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="switchType != null">switch_type = #{switchType},</if>
|
||||
<if test="deployDevice != null">deploy_device = #{deployDevice},</if>
|
||||
<if test="resourceType != null">resource_type = #{resourceType},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.rocketmq.mapper.RmNetworkInterfaceMapper">
|
||||
|
||||
<resultMap type="RmNetworkInterface" id="RmNetworkInterfaceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="isp" column="isp" />
|
||||
<result property="province" column="province" />
|
||||
<result property="city" column="city" />
|
||||
<result property="publicIp" column="public_ip" />
|
||||
<result property="interfaceName" column="interface_name" />
|
||||
<result property="macAddress" column="mac_address" />
|
||||
<result property="interfaceType" column="interface_type" />
|
||||
<result property="ipv4Address" column="ipv4_address" />
|
||||
<result property="gateway" column="gateway" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="bindIp" column="bind_ip" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmNetworkInterfaceVo">
|
||||
select id, client_id, isp, province, city, public_ip, interface_name, mac_address, interface_type, ipv4_address, gateway, create_time, update_time, create_by, update_by, bind_ip from rm_network_interface
|
||||
</sql>
|
||||
|
||||
<select id="selectRmNetworkInterfaceList" parameterType="RmNetworkInterface" resultMap="RmNetworkInterfaceResult">
|
||||
<include refid="selectRmNetworkInterfaceVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="isp != null and isp != ''"> and isp = #{isp}</if>
|
||||
<if test="province != null and province != ''"> and province = #{province}</if>
|
||||
<if test="city != null and city != ''"> and city = #{city}</if>
|
||||
<if test="publicIp != null and publicIp != ''"> and public_ip = #{publicIp}</if>
|
||||
<if test="interfaceName != null and interfaceName != ''"> and interface_name like concat('%', #{interfaceName}, '%')</if>
|
||||
<if test="macAddress != null and macAddress != ''"> and mac_address = #{macAddress}</if>
|
||||
<if test="interfaceType != null and interfaceType != ''"> and interface_type = #{interfaceType}</if>
|
||||
<if test="ipv4Address != null and ipv4Address != ''"> and ipv4_address = #{ipv4Address}</if>
|
||||
<if test="gateway != null and gateway != ''"> and gateway = #{gateway}</if>
|
||||
<if test="bindIp != null and bindIp != ''"> and bind_ip = #{bindIp}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmNetworkInterfaceById" parameterType="Long" resultMap="RmNetworkInterfaceResult">
|
||||
<include refid="selectRmNetworkInterfaceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmNetworkInterface" parameterType="RmNetworkInterface" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_network_interface
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="isp != null">isp,</if>
|
||||
<if test="province != null">province,</if>
|
||||
<if test="city != null">city,</if>
|
||||
<if test="publicIp != null">public_ip,</if>
|
||||
<if test="interfaceName != null and interfaceName != ''">interface_name,</if>
|
||||
<if test="macAddress != null">mac_address,</if>
|
||||
<if test="interfaceType != null">interface_type,</if>
|
||||
<if test="ipv4Address != null">ipv4_address,</if>
|
||||
<if test="gateway != null">gateway,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="bindIp != null">bind_ip,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">#{clientId},</if>
|
||||
<if test="isp != null">#{isp},</if>
|
||||
<if test="province != null">#{province},</if>
|
||||
<if test="city != null">#{city},</if>
|
||||
<if test="publicIp != null">#{publicIp},</if>
|
||||
<if test="interfaceName != null and interfaceName != ''">#{interfaceName},</if>
|
||||
<if test="macAddress != null">#{macAddress},</if>
|
||||
<if test="interfaceType != null">#{interfaceType},</if>
|
||||
<if test="ipv4Address != null">#{ipv4Address},</if>
|
||||
<if test="gateway != null">#{gateway},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="bindIp != null">#{bindIp},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmNetworkInterface" parameterType="RmNetworkInterface">
|
||||
update rm_network_interface
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="isp != null">isp = #{isp},</if>
|
||||
<if test="province != null">province = #{province},</if>
|
||||
<if test="city != null">city = #{city},</if>
|
||||
<if test="publicIp != null">public_ip = #{publicIp},</if>
|
||||
<if test="interfaceName != null and interfaceName != ''">interface_name = #{interfaceName},</if>
|
||||
<if test="macAddress != null">mac_address = #{macAddress},</if>
|
||||
<if test="interfaceType != null">interface_type = #{interfaceType},</if>
|
||||
<if test="ipv4Address != null">ipv4_address = #{ipv4Address},</if>
|
||||
<if test="gateway != null">gateway = #{gateway},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="bindIp != null">bind_ip = #{bindIp},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRmNetworkInterfaceById" parameterType="Long">
|
||||
delete from rm_network_interface where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmNetworkInterfaceByIds" parameterType="String">
|
||||
delete from rm_network_interface where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user