agent更新按最后一次更新时间排序、服务器管理多条件分页查询优化、服务器底层流量科学计数法优化

This commit is contained in:
gaoyutao
2025-11-10 12:00:50 +08:00
parent 4d1503e988
commit 4137028deb
9 changed files with 139 additions and 21 deletions
@@ -189,10 +189,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
`ipV4` AS ipV4,
`in_dropped` AS inDropped,
`out_dropped` AS outDropped,
sum(ifnull(`in_speed`,0)) AS inSpeed,
sum(ifnull(`out_speed`,0)) AS outSpeed,
sum(ifnull(`total_in_speed`,0)) AS totalInSpeed,
sum(ifnull(`total_out_speed`,0)) AS totalOutSpeed,
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(`total_in_speed`,0)) AS DECIMAL(20,0)) AS totalInSpeed,
CAST(sum(ifnull(`total_out_speed`,0)) AS DECIMAL(20,0)) AS totalOutSpeed,
`machine_flow` AS machineFlow,
`speed` AS speed,
`duplex` AS duplex,
@@ -383,4 +383,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select logical_node_id logicalNodeId from rm_resource_registration where logical_node_id != ''
group by logical_node_id
</select>
<select id="getRegistrationTableInfoList" parameterType="RmResourceRegistration" resultType="RmResourceRegistration">
select
a.id,
a.hardware_sn as hardwareSn,
a.agent_version as agentVersion,
a.registration_status as registrationStatus,
a.online_status as onlineStatus,
a.create_time as createTime,
a.update_time as updateTime,
a.client_id as clientId,
a.business_name as businessName,
a.logical_node_id as logicalNodeId,
a.multi_public_ip_status as multiPublicIpStatus,
a.heartbeat_count as heartbeatCount,
a.heartbeat_interval as heartbeatInterval,
a.onboard_time as onboardTime,
b.machine_code as machineCode
from rm_resource_registration a
left join rm_registration_machine b on a.client_id = b.client_id
<where>
<if test="hardwareSn != null and hardwareSn != ''"> and a.hardware_sn = #{hardwareSn}</if>
<if test="resourceType != null and resourceType != ''"> and a.resource_type = #{resourceType}</if>
<if test="agentVersion != null and agentVersion != ''"> and a.agent_version = #{agentVersion}</if>
<if test="registrationStatus != null and registrationStatus != ''"> and a.registration_status = #{registrationStatus}</if>
<if test="onlineStatus != null and onlineStatus != ''"> and a.online_status = #{onlineStatus}</if>
<if test="clientId != null and clientId != ''"> and a.client_id = #{clientId}</if>
<if test="businessName != null and businessName != ''"> and a.business_name like concat('%', #{businessName}, '%')</if>
<if test="logicalNodeId != null and logicalNodeId != ''"> and a.logical_node_id = #{logicalNodeId}</if>
<if test="multiPublicIpStatus != null and multiPublicIpStatus != ''"> and a.multi_public_ip_status = #{multiPublicIpStatus}</if>
</where>
order by a.create_time desc
</select>
</mapper>