交换机管理图形监控只展示端口为up的。

优化frp信息上报
This commit is contained in:
gaoyutao
2025-12-24 19:55:47 +08:00
parent 5eda46802e
commit 30373bbb1e
13 changed files with 120 additions and 44 deletions
@@ -102,4 +102,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) latest ON t.collect_type = latest.collect_type AND t.create_time = latest.max_time
WHERE t.client_id = #{clientId}
</select>
<delete id="deleteInitialSwitchOtherCollectData" parameterType="Long">
delete from initial_switch_other_collect_data
<where>
<choose>
<when test="clientId != null and collectType != null and createTime != null">
AND client_id = #{clientId}
AND collect_type = #{collectType}
AND create_time &lt; #{createTime}
</when>
<otherwise>
and 1=0
</otherwise>
</choose>
</where>
</delete>
</mapper>
@@ -11,6 +11,7 @@
<result property="frpcServerPort" column="frpc_server_port" />
<result property="frpcRemotePort" column="frpc_remote_port" />
<result property="frpcLocalPort" column="frpc_local_port" />
<result property="frpcType" column="frpc_type" />
<result property="frpcName" column="frpc_name" />
<result property="frpcConnectionStatus" column="frpc_connection_status" />
<result property="frpcCreateTime" column="frpc_create_time" />
@@ -23,7 +24,7 @@
</resultMap>
<sql id="selectRmFrpcConfigManageVo">
select id, client_id, frpc_server_addr, frpc_server_port, frpc_remote_port, frpc_local_port, frpc_name, frpc_connection_status, frpc_create_time, create_time, update_time, create_by, update_by, frpc_local_ip, frpc_status from rm_frpc_config_manage
select id, client_id, frpc_server_addr, frpc_server_port, frpc_remote_port, frpc_local_port, frpc_type, frpc_name, frpc_connection_status, frpc_create_time, create_time, update_time, create_by, update_by, frpc_local_ip, frpc_status from rm_frpc_config_manage
</sql>
<select id="selectRmFrpcConfigManageList" parameterType="RmFrpcConfigManage" resultMap="RmFrpcConfigManageResult">
@@ -64,6 +65,7 @@
<if test="updateBy != null">update_by,</if>
<if test="frpcLocalIp != null">frpc_local_ip,</if>
<if test="frpcStatus != null">frpc_status,</if>
<if test="frpcType != null">frpc_type,</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="clientId != null">#{clientId},</if>
@@ -80,10 +82,10 @@
<if test="updateBy != null">#{updateBy},</if>
<if test="frpcLocalIp != null">#{frpcLocalIp},</if>
<if test="frpcStatus != null">#{frpcStatus},</if>
<if test="frpcType != null">#{frpcType},</if>
</trim>
ON DUPLICATE KEY UPDATE
<trim suffixOverrides=",">
<if test="clientId != null">client_id = VALUES(client_id),</if>
<if test="frpcServerAddr != null">frpc_server_addr = VALUES(frpc_server_addr),</if>
<if test="frpcServerPort != null">frpc_server_port = VALUES(frpc_server_port),</if>
<if test="frpcRemotePort != null">frpc_remote_port = VALUES(frpc_remote_port),</if>
@@ -91,11 +93,11 @@
<if test="frpcName != null">frpc_name = VALUES(frpc_name),</if>
<if test="frpcConnectionStatus != null">frpc_connection_status = VALUES(frpc_connection_status),</if>
<if test="frpcCreateTime != null">frpc_create_time = VALUES(frpc_create_time),</if>
<!-- 通常更新时间字段在更新时会设置为当前时间 -->
update_time = NOW(),
<if test="updateTime != null">update_time = VALUES(update_time),</if>
<if test="updateBy != null">update_by = VALUES(update_by),</if>
<if test="frpcLocalIp != null">frpc_local_ip = VALUES(frpc_local_ip),</if>
<if test="frpcStatus != null">frpc_status = VALUES(frpc_status),</if>
<if test="frpcType != null">frpc_type = VALUES(frpc_type),</if>
</trim>
</insert>
@@ -116,6 +118,7 @@
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="frpcLocalIp != null">frpc_local_ip = #{frpcLocalIp},</if>
<if test="frpcStatus != null">frpc_status = #{frpcStatus},</if>
<if test="frpcType != null">frpc_type = #{frpcType},</if>
</trim>
where id = #{id}
</update>