snmp采集工具优化,采集数据入库优化。

This commit is contained in:
gaoyutao
2025-10-20 18:17:44 +08:00
parent b0e63880fc
commit 52728eba49
13 changed files with 336 additions and 27 deletions
@@ -19,10 +19,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="switchType" column="switch_type" />
<result property="deployDevice" column="deploy_device" />
<result property="resourceType" column="resource_type" />
<result property="priority" column="priority" />
</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, resource_type 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, priority from rm_monitor_policy
</sql>
<select id="selectRmMonitorPolicyList" parameterType="RmMonitorPolicy" resultMap="RmMonitorPolicyResult">
@@ -30,11 +31,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="templateId != null "> and template_id = #{templateId}</if>
<if test="resourceType != null "> and resource_type = #{resourceType}</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>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="deployTime != null "> and deploy_time = #{deployTime}</if>
<if test="priority != null "> and priority = #{priority}</if>
<if test="queryName != null and queryName != ''">
and (policy_name like concat('%', #{queryName}, '%')
or template_id in (select id from rm_monitor_template where template_name like concat('%', #{queryName}, '%'))
@@ -65,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="switchType != null">switch_type,</if>
<if test="deployDevice != null">deploy_device,</if>
<if test="resourceType != null">resource_type,</if>
<if test="priority != null">priority,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="templateId != null">#{templateId},</if>
@@ -80,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="switchType != null">#{switchType},</if>
<if test="deployDevice != null">#{deployDevice},</if>
<if test="resourceType != null">#{resourceType},</if>
<if test="priority != null">#{priority},</if>
</trim>
</insert>
@@ -99,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="switchType != null">switch_type = #{switchType},</if>
<if test="deployDevice != null">deploy_device = #{deployDevice},</if>
<if test="resourceType != null">resource_type = #{resourceType},</if>
<if test="priority != null">priority = #{priority},</if>
</trim>
where id = #{id}
</update>