拓扑管理字段新增,交换机管理接口优化、网卡信息接口新增
This commit is contained in:
+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