交换机管理,图形监控,策略

This commit is contained in:
gaoyutao
2025-10-11 17:54:17 +08:00
parent 6ffdf8d355
commit 054b0f1272
41 changed files with 1111 additions and 582 deletions
@@ -110,4 +110,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</foreach>
</insert>
<select id="getAllFanName" parameterType="InitialSwitchFanInfo" resultType="java.util.Map">
select fan_name fanName from initial_switch_fan_info
<where>
<if test="fanEntIndex != null and fanEntIndex != ''"> and fan_ent_index = #{fanEntIndex}</if>
<if test="fanName != null and fanName != ''"> and fan_name like concat('%', #{fanName}, '%')</if>
<if test="fanEntityFanState != null and fanEntityFanState != ''"> and fan_entity_fan_state = #{fanEntityFanState}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
group by fan_name
</select>
<select id="getFanMsg" parameterType="InitialSwitchFanInfo" resultMap="InitialSwitchFanInfoResult">
<include refid="selectInitialSwitchFanInfoVo"/>
<where>
<if test="fanEntIndex != null and fanEntIndex != ''"> and fan_ent_index = #{fanEntIndex}</if>
<if test="fanName != null and fanName != ''"> and fan_name like concat('%', #{fanName}, '%')</if>
<if test="fanEntityFanState != null and fanEntityFanState != ''"> and fan_entity_fan_state = #{fanEntityFanState}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
order by create_time desc limit 1
</select>
</mapper>
@@ -33,6 +33,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="mpuPhysicalSoftwareRev != null and mpuPhysicalSoftwareRev != ''"> and mpu_physical_software_rev = #{mpuPhysicalSoftwareRev}</if>
<if test="mpuEntityTemperature != null "> and mpu_entity_temperature = #{mpuEntityTemperature}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</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>
</where>
</select>
@@ -131,4 +133,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</foreach>
</insert>
<select id="getMpuMsg" parameterType="InitialSwitchMpuInfo" resultMap="InitialSwitchMpuInfoResult">
<include refid="selectInitialSwitchMpuInfoVo"/>
<where>
<if test="mpuEntIndex != null and mpuEntIndex != ''"> and mpu_ent_index = #{mpuEntIndex}</if>
<if test="mpuName != null and mpuName != ''"> and mpu_name like concat('%', #{mpuName}, '%')</if>
<if test="mpuEntityCpuUsage != null "> and mpu_entity_cpu_usage = #{mpuEntityCpuUsage}</if>
<if test="mpuEntityMemUsage != null "> and mpu_entity_mem_usage = #{mpuEntityMemUsage}</if>
<if test="mpuPhysicalSoftwareRev != null and mpuPhysicalSoftwareRev != ''"> and mpu_physical_software_rev = #{mpuPhysicalSoftwareRev}</if>
<if test="mpuEntityTemperature != null "> and mpu_entity_temperature = #{mpuEntityTemperature}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
order by create_time desc limit 1
</select>
<select id="getAllMpuName" parameterType="InitialSwitchMpuInfo" resultType="java.util.Map">
select mpu_name mpuName from initial_switch_mpu_info
<where>
<if test="mpuEntIndex != null and mpuEntIndex != ''"> and mpu_ent_index = #{mpuEntIndex}</if>
<if test="mpuName != null and mpuName != ''"> and mpu_name like concat('%', #{mpuName}, '%')</if>
<if test="mpuEntityCpuUsage != null "> and mpu_entity_cpu_usage = #{mpuEntityCpuUsage}</if>
<if test="mpuEntityMemUsage != null "> and mpu_entity_mem_usage = #{mpuEntityMemUsage}</if>
<if test="mpuPhysicalSoftwareRev != null and mpuPhysicalSoftwareRev != ''"> and mpu_physical_software_rev = #{mpuPhysicalSoftwareRev}</if>
<if test="mpuEntityTemperature != null "> and mpu_entity_temperature = #{mpuEntityTemperature}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
group by mpu_name
</select>
</mapper>
@@ -33,6 +33,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hwEntityOpticalRxPower != null "> and hw_entity_optical_rx_power = #{hwEntityOpticalRxPower}</if>
<if test="hwEntityOpticalTxPower != null "> and hw_entity_optical_tx_power = #{hwEntityOpticalTxPower}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</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>
</where>
</select>
@@ -131,4 +133,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</foreach>
</insert>
<select id="switchOpticalModuleMsg" parameterType="InitialSwitchOpticalModule" resultMap="InitialSwitchOpticalModuleResult">
<include refid="selectInitialSwitchOpticalModuleVo"/>
<where>
<if test="fiberEntIndex != null and fiberEntIndex != ''"> and fiber_ent_index = #{fiberEntIndex}</if>
<if test="fiberPortName != null and fiberPortName != ''"> and fiber_port_name like concat('%', #{fiberPortName}, '%')</if>
<if test="hwEntityOpticalTxLowThreshold != null "> and hw_entity_optical_tx_low_threshold = #{hwEntityOpticalTxLowThreshold}</if>
<if test="hwEntityOpticalRxLowThreshold != null "> and hw_entity_optical_rx_low_threshold = #{hwEntityOpticalRxLowThreshold}</if>
<if test="hwEntityOpticalRxPower != null "> and hw_entity_optical_rx_power = #{hwEntityOpticalRxPower}</if>
<if test="hwEntityOpticalTxPower != null "> and hw_entity_optical_tx_power = #{hwEntityOpticalTxPower}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
order by create_time desc limit 1
</select>
<select id="getAllModuleName" parameterType="InitialSwitchOpticalModule" resultType="java.util.Map">
select fiber_port_name fiberPortName from initial_switch_optical_module
<where>
<if test="fiberEntIndex != null and fiberEntIndex != ''"> and fiber_ent_index = #{fiberEntIndex}</if>
<if test="fiberPortName != null and fiberPortName != ''"> and fiber_port_name like concat('%', #{fiberPortName}, '%')</if>
<if test="hwEntityOpticalTxLowThreshold != null "> and hw_entity_optical_tx_low_threshold = #{hwEntityOpticalTxLowThreshold}</if>
<if test="hwEntityOpticalRxLowThreshold != null "> and hw_entity_optical_rx_low_threshold = #{hwEntityOpticalRxLowThreshold}</if>
<if test="hwEntityOpticalRxPower != null "> and hw_entity_optical_rx_power = #{hwEntityOpticalRxPower}</if>
<if test="hwEntityOpticalTxPower != null "> and hw_entity_optical_tx_power = #{hwEntityOpticalTxPower}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
group by fiber_port_name
</select>
</mapper>
@@ -25,6 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
<if test="collectType != null and collectType != ''"> and collect_type = #{collectType}</if>
<if test="collectValue != null and collectValue != ''"> and collect_value = #{collectValue}</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>
</where>
</select>
@@ -31,6 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="pwrEntityPwrCurrent != null "> and pwr_entity_pwr_current = #{pwrEntityPwrCurrent}</if>
<if test="pwrEntityPwrVoltage != null "> and pwr_entity_pwr_voltage = #{pwrEntityPwrVoltage}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</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>
</where>
</select>
@@ -124,4 +126,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</foreach>
</insert>
<select id="getAllPwrName" parameterType="InitialSwitchPowerSupply" resultType="java.util.Map">
select pwr_name pwrName from initial_switch_power_supply
<where>
<if test="pwrEntIndex != null and pwrEntIndex != ''"> and pwr_ent_index = #{pwrEntIndex}</if>
<if test="pwrName != null and pwrName != ''"> and pwr_name like concat('%', #{pwrName}, '%')</if>
<if test="pwrEntityPwrState != null and pwrEntityPwrState != ''"> and pwr_entity_pwr_state = #{pwrEntityPwrState}</if>
<if test="pwrEntityPwrCurrent != null "> and pwr_entity_pwr_current = #{pwrEntityPwrCurrent}</if>
<if test="pwrEntityPwrVoltage != null "> and pwr_entity_pwr_voltage = #{pwrEntityPwrVoltage}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
group by pwr_name
</select>
<select id="getPwrMsg" parameterType="InitialSwitchPowerSupply" resultMap="InitialSwitchPowerSupplyResult">
<include refid="selectInitialSwitchPowerSupplyVo"/>
<where>
<if test="pwrEntIndex != null and pwrEntIndex != ''"> and pwr_ent_index = #{pwrEntIndex}</if>
<if test="pwrName != null and pwrName != ''"> and pwr_name like concat('%', #{pwrName}, '%')</if>
<if test="pwrEntityPwrState != null and pwrEntityPwrState != ''"> and pwr_entity_pwr_state = #{pwrEntityPwrState}</if>
<if test="pwrEntityPwrCurrent != null "> and pwr_entity_pwr_current = #{pwrEntityPwrCurrent}</if>
<if test="pwrEntityPwrVoltage != null "> and pwr_entity_pwr_voltage = #{pwrEntityPwrVoltage}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
order by create_time desc limit 1
</select>
</mapper>
@@ -79,4 +79,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="getSwitchMonitorMsg" parameterType="InitialSwitchOtherCollectData" resultType="java.util.Map">
SELECT
MAX(CASE WHEN t.collect_type = 'sysDescr' THEN t.collect_value END) as sysDescr,
MAX(CASE WHEN t.collect_type = 'sysObjectID' THEN t.collect_value END) as sysObjectID,
MAX(CASE WHEN t.collect_type = 'sysUpTime' THEN t.collect_value END) as sysUpTime,
MAX(CASE WHEN t.collect_type = 'sysContact' THEN t.collect_value END) as sysContact,
MAX(CASE WHEN t.collect_type = 'sysName' THEN t.collect_value END) as sysName,
MAX(CASE WHEN t.collect_type = 'sysLocation' THEN t.collect_value END) as sysLocation,
MAX(CASE WHEN t.collect_type = 'hwStackSystemMac' THEN t.collect_value END) as hwStackSystemMac,
MAX(CASE WHEN t.collect_type = 'entIndex' THEN t.collect_value END) as entIndex,
MAX(CASE WHEN t.collect_type = 'entPhysicalName' THEN t.collect_value END) as entPhysicalName,
MAX(CASE WHEN t.collect_type = 'entPhysicalSoftwareRev' THEN t.collect_value END) as entPhysicalSoftwareRev
FROM `initial_switch_other_collect_data` t
INNER JOIN (
SELECT client_id, MAX(create_time) as max_time
FROM `initial_switch_other_collect_data`
WHERE client_id = #{clientId}
GROUP BY client_id
) latest ON t.client_id = latest.client_id AND t.create_time = latest.max_time
WHERE t.client_id = #{clientId}
</select>
</mapper>