相关接口增加ipv4、ipv6出入流量字段。

服务器管理列表新增字段和排序。
优化监控看板流量统计。
This commit is contained in:
gaoyutao
2025-12-05 18:59:02 +08:00
parent 9dee067a87
commit 802e668d9a
22 changed files with 753 additions and 1067 deletions
@@ -430,32 +430,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTrafficListByClientIds" resultType="EpsInitialTrafficData">
SELECT
CAST(sum(ifnull(in_speed,0)) AS DECIMAL(20,0)) AS inSpeed,
CAST(sum(ifnull(out_speed,0)) AS DECIMAL(20,0)) AS outSpeed,
CAST(sum(ifnull(ipv4_in_speed,0)) AS DECIMAL(20,0)) AS ipv4InSpeed,
CAST(sum(ifnull(ipv4_out_speed,0)) AS DECIMAL(20,0)) AS ipv4OutSpeed,
CAST(sum(ifnull(ipv6_in_speed,0)) AS DECIMAL(20,0)) AS ipv6InSpeed,
CAST(sum(ifnull(ipv6_out_speed,0)) AS DECIMAL(20,0)) AS ipv6OutSpeed,
create_time AS createTime
FROM ${tableName}
CAST(sum(ifnull(a.in_speed,0)) AS DECIMAL(20,0)) AS inSpeed,
CAST(sum(ifnull(a.out_speed,0)) AS DECIMAL(20,0)) AS outSpeed,
CAST(sum(ifnull(a.ipv4_in_speed,0)) AS DECIMAL(20,0)) AS ipv4InSpeed,
CAST(sum(ifnull(a.ipv4_out_speed,0)) AS DECIMAL(20,0)) AS ipv4OutSpeed,
CAST(sum(ifnull(a.ipv6_in_speed,0)) AS DECIMAL(20,0)) AS ipv6InSpeed,
CAST(sum(ifnull(a.ipv6_out_speed,0)) AS DECIMAL(20,0)) AS ipv6OutSpeed,
a.create_time AS createTime
FROM ${tableName} a
INNER JOIN rm_network_interface b ON a.client_id = b.client_id and a.mac = b.mac_address
AND (b.bind_ip = 1 OR b.bind_ip = 3)
AND b.new_flag = 1
<where>
<if test="businessId != '' and businessId != null">
and business_id = #{businessId}
and a.business_id = #{businessId}
</if>
<if test="startTime != null">
and create_time &gt;= #{startTime}
and a.create_time &gt;= #{startTime}
</if>
<if test="endTime != null">
and create_time &lt;= #{endTime}
and a.create_time &lt;= #{endTime}
</if>
<if test="clientIds != null">
and client_id in
and a.client_id in
<foreach collection="clientIds.split(',')" item="clientId" open="(" separator="," close=")">
#{clientId}
</foreach>
</if>
</where>
group by create_time
ORDER BY out_speed desc
group by a.create_time
ORDER BY outSpeed desc
</select>
</mapper>
@@ -320,8 +320,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="calculationMode != null and calculationMode != ''"> and calculation_mode = #{calculationMode}</if>
<if test="bandwidthType != null and bandwidthType != ''"> and bandwidth_type = #{bandwidthType}</if>
<if test="resourceType != null and resourceType != ''"> and resource_type = #{resourceType}</if>
<if test="startTime != null and startTime != ''"> and create_time &gt;= #{startTime}</if>
<if test="endTime != null and endTime != ''"> and create_time &lt;= #{endTime}</if>
<if test="startTime != null and startTime != ''"> and create_time &gt;= left(#{startTime},10)</if>
<if test="endTime != null and endTime != ''"> and create_time &lt;= left(#{endTime},10)</if>
<if test="clientIds != '' and clientIds != null">
and client_id in
<foreach collection="clientIds.split(',')" item="clientId" open="(" separator="," close=")">
@@ -23,10 +23,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="reportedBandwidth" column="reported_bandwidth" />
</resultMap>
<sql id="selectRmResourceRegistrationVo">
select id, client_id, hardware_sn, business_name, logical_node_id, multi_public_ip_status, registration_status, online_status, resource_type, agent_version, create_time, update_time, heartbeat_count, heartbeat_interval, onboard_time, remark, create_by, update_by from rm_resource_registration
select id, client_id, hardware_sn, business_name, logical_node_id, multi_public_ip_status, registration_status, online_status, resource_type, agent_version, create_time, update_time, heartbeat_count, heartbeat_interval, onboard_time, remark, create_by, update_by, reported_bandwidth from rm_resource_registration
</sql>
<select id="selectRmResourceRegistrationList" parameterType="RmResourceRegistration" resultMap="RmResourceRegistrationResult">
@@ -73,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="reportedBandwidth != null">reported_bandwidth,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clientId != null">#{clientId},</if>
@@ -92,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="reportedBandwidth != null">#{reportedBandwidth},</if>
</trim>
</insert>
@@ -115,6 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="reportedBandwidth != null">reported_bandwidth = #{reportedBandwidth},</if>
</trim>
where id = #{id}
</update>
@@ -153,6 +157,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="reportedBandwidth != null">reported_bandwidth = #{reportedBandwidth},</if>
</trim>
<where>
<choose>
@@ -204,6 +209,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.heartbeat_interval as heartbeatInterval,
a.onboard_time as onboardTime,
a.remark as remark,
a.reported_bandwidth as reportedBandwidth,
b.machine_code as machineCode
from rm_resource_registration a
left join rm_registration_machine b on a.client_id = b.client_id
@@ -240,4 +246,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{clientId}
</foreach>
</update>
<update id="addReportedBandwidth" parameterType="RmResourceRegistration">
update rm_resource_registration set reported_bandwidth = #{reportedBandwidth}
where id =#{id}
</update>
</mapper>