优化交换机数据采集、脚本策略、agent更新优化、注册增加路由信息

This commit is contained in:
gaoyutao
2025-10-24 18:55:21 +08:00
parent 37eff51e48
commit 36362e2236
23 changed files with 263 additions and 98 deletions
@@ -157,7 +157,7 @@
<where>
<if test="policyStatus != null and policyStatus != ''"> and policy_status = #{policyStatus}</if>
<if test="deployDevice != null ">
FIND_IN_SET(#{deployDevice}, REPLACE(deploy_device, '\n', ',')) > 0
and FIND_IN_SET(#{deployDevice}, REPLACE(deploy_device, '\n', ',')) > 0
</if>
</where>
</select>
@@ -21,10 +21,11 @@
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="bindIp" column="bind_ip" />
<result property="newFlag" column="new_flag" />
</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
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, new_flag from rm_network_interface
</sql>
<select id="selectRmNetworkInterfaceList" parameterType="RmNetworkInterface" resultMap="RmNetworkInterfaceResult">
@@ -41,6 +42,7 @@
<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>
<if test="newFlag != null "> and new_flag = #{newFlag}</if>
</where>
</select>
@@ -67,6 +69,7 @@
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="bindIp != null">bind_ip,</if>
<if test="newFlag != null">new_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">#{clientId},</if>
@@ -84,6 +87,7 @@
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="bindIp != null">#{bindIp},</if>
<if test="newFlag != null">#{newFlag},</if>
</trim>
</insert>
@@ -105,9 +109,21 @@
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="bindIp != null">bind_ip = #{bindIp},</if>
<if test="newFlag != null">new_flag = #{newFlag},</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>
<update id="updateRmNetworkInterfaceByMac" parameterType="RmNetworkInterface">
update rm_network_interface
<trim prefix="SET" suffixOverrides=",">
@@ -125,18 +141,8 @@
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="bindIp != null">bind_ip = #{bindIp},</if>
<if test="newFlag != null">new_flag = #{newFlag},</if>
</trim>
where mac_address = #{macAddress}
</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>
@@ -1,9 +1,9 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.rocketmq.mapper.RmResourceRemoteMapper">
<resultMap type="RmResourceRemote" id="RmResourceRemoteResult">
<result property="id" column="id" />
<result property="hardwareSn" column="hardware_sn" />
@@ -19,15 +19,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="clientId" column="client_id" />
<result property="resultFlag" column="result_flag" />
<result property="scriptId" column="script_id" />
</resultMap>
<sql id="selectRmResourceRemoteVo">
select id, hardware_sn, resource_type, resource_name, description, internal_ip, external_ip, management_port, online_status, connection_method, create_time, update_time, create_by, update_by from rm_resource_remote
select id, hardware_sn, resource_type, resource_name, description, internal_ip, external_ip, management_port, online_status, connection_method, create_time, update_time, create_by, update_by, client_id, result_flag, script_id from rm_resource_remote
</sql>
<select id="selectRmResourceRemoteList" parameterType="RmResourceRemote" resultMap="RmResourceRemoteResult">
<include refid="selectRmResourceRemoteVo"/>
<where>
<where>
<if test="hardwareSn != null and hardwareSn != ''"> and hardware_sn = #{hardwareSn}</if>
<if test="resourceType != null and resourceType != ''"> and resource_type = #{resourceType}</if>
<if test="resourceName != null and resourceName != ''"> and resource_name like concat('%', #{resourceName}, '%')</if>
@@ -37,16 +40,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="managementPort != null "> and management_port = #{managementPort}</if>
<if test="onlineStatus != null and onlineStatus != ''"> and online_status = #{onlineStatus}</if>
<if test="connectionMethod != null and connectionMethod != ''"> and connection_method = #{connectionMethod}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
<if test="resultFlag != null "> and result_flag = #{resultFlag}</if>
<if test="scriptId != null "> and script_id = #{scriptId}</if>
</where>
</select>
<select id="selectRmResourceRemoteById" parameterType="Long" resultMap="RmResourceRemoteResult">
<include refid="selectRmResourceRemoteVo"/>
where id = #{id}
</select>
<insert id="insertRmResourceRemote" parameterType="RmResourceRemote" useGeneratedKeys="true" keyProperty="id">
insert IGNORE into rm_resource_remote
insert into rm_resource_remote
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="hardwareSn != null and hardwareSn != ''">hardware_sn,</if>
<if test="resourceType != null and resourceType != ''">resource_type,</if>
@@ -61,7 +67,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<if test="clientId != null">client_id,</if>
<if test="resultFlag != null">result_flag,</if>
<if test="scriptId != null">script_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="hardwareSn != null and hardwareSn != ''">#{hardwareSn},</if>
<if test="resourceType != null and resourceType != ''">#{resourceType},</if>
@@ -76,7 +85,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
<if test="clientId != null">#{clientId},</if>
<if test="resultFlag != null">#{resultFlag},</if>
<if test="scriptId != null">#{scriptId},</if>
</trim>
</insert>
<update id="updateRmResourceRemote" parameterType="RmResourceRemote">
@@ -95,6 +107,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="clientId != null">client_id = #{clientId},</if>
<if test="resultFlag != null">result_flag = #{resultFlag},</if>
<if test="scriptId != null">script_id = #{scriptId},</if>
</trim>
where id = #{id}
</update>
@@ -104,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteRmResourceRemoteByIds" parameterType="String">
delete from rm_resource_remote where id in
delete from rm_resource_remote where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>