优化实时95值计算功能、服务器收益功能、用户自定义列展示、交换机基础数据采集

This commit is contained in:
gaoyutao
2025-10-31 21:46:17 +08:00
parent c0f057d7ed
commit 01c51b39fe
36 changed files with 964 additions and 452 deletions
@@ -198,13 +198,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getAllDeviceSn" parameterType="AllInterfaceName" resultType="AllInterfaceName">
SELECT
client_id AS clientId, interface_name interfaceName
client_id AS clientId
FROM
all_interface_name
<where>
and resource_type = '1' and interface_name != ''
and resource_type = '1' and client_id != ''
</where>
group by interface_name
group by client_id
</select>
<select id="getAllSwitchSn" parameterType="AllInterfaceName" resultType="AllInterfaceName">
SELECT
@@ -175,8 +175,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
`ipV4` AS ipV4,
`in_dropped` AS inDropped,
`out_dropped` AS outDropped,
`in_speed` AS inSpeed,
`out_speed` AS outSpeed,
sum(ifnull(`in_speed`,0)) AS inSpeed,
sum(ifnull(`out_speed`,0)) AS outSpeed,
`machine_flow` AS machineFlow,
`speed` AS speed,
`duplex` AS duplex,
@@ -213,7 +213,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
</where>
ORDER BY create_time desc
group BY create_time desc
</select>
<!-- 条件查询 -->
@@ -16,14 +16,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="avgMonthlyBandwidth95" column="avg_monthly_bandwidth_95" />
<result property="packageBandwidthDaily" column="package_bandwidth_daily" />
<result property="machineFlow" column="machine_flow" />
<result property="customerId" column="customer_id" />
<result property="customerName" column="customer_name" />
<result property="serviceNumber" column="service_number" />
<result property="uplinkSwitch" column="uplink_switch" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="creatorId" column="creator_id" />
<result property="creatorName" column="creator_name" />
<result property="switchSn" column="switch_sn" />
<result property="interfaceName" column="interface_name" />
<result property="resourceType" column="resource_type" />
@@ -36,22 +31,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark1" column="remark1" />
<result property="createDatetime" column="create_datetime" />
<result property="clientId" column="client_id" />
<result property="serverClientId" column="server_client_id" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectEpsNodeBandwidthVo">
select id, node_name, hardware_sn, calculation_mode, bandwidth_type, bandwidth_result, bandwidth_95_daily,
bandwidth_95_monthly, avg_monthly_bandwidth_95, package_bandwidth_daily, machine_flow, customer_id,
customer_name, service_number, uplink_switch, create_time, update_time, creator_id, creator_name,
switch_sn, interface_name, resource_type, interface_link_device_type, effective_bandwidth_95_daily,
effective_bandwidth_95_monthly, effective_avg_monthly_bandwidth_95, business_name, business_id,
remark1, create_datetime, client_id from eps_node_bandwidth
select id, node_name, hardware_sn, calculation_mode, bandwidth_type, bandwidth_result, bandwidth_95_daily, bandwidth_95_monthly, avg_monthly_bandwidth_95, package_bandwidth_daily, machine_flow, uplink_switch, create_time, update_time, switch_sn, interface_name, resource_type, interface_link_device_type, effective_bandwidth_95_daily, effective_bandwidth_95_monthly, effective_avg_monthly_bandwidth_95, business_name, business_id, remark1, create_datetime, client_id, server_client_id, create_by, update_by from eps_node_bandwidth
</sql>
<select id="selectEpsNodeBandwidthList" parameterType="EpsNodeBandwidth" resultMap="EpsNodeBandwidthResult">
<include refid="selectEpsNodeBandwidthVo"/>
<where>
<if test="nodeName != null and nodeName != ''"> and node_name like concat('%', #{nodeName}, '%')</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
<if test="hardwareSn != null and hardwareSn != ''"> and hardware_sn = #{hardwareSn}</if>
<if test="calculationMode != null and calculationMode != ''"> and calculation_mode = #{calculationMode}</if>
<if test="bandwidthType != null and bandwidthType != ''"> and bandwidth_type = #{bandwidthType}</if>
@@ -60,12 +52,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bandwidth95Monthly != null "> and bandwidth_95_monthly = #{bandwidth95Monthly}</if>
<if test="avgMonthlyBandwidth95 != null "> and avg_monthly_bandwidth_95 = #{avgMonthlyBandwidth95}</if>
<if test="packageBandwidthDaily != null "> and package_bandwidth_daily = #{packageBandwidthDaily}</if>
<if test="customerId != null and customerId != ''"> and customer_id = #{customerId}</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="serviceNumber != null and serviceNumber != ''"> and service_number = #{serviceNumber}</if>
<if test="machineFlow != null "> and machine_flow = #{machineFlow}</if>
<if test="uplinkSwitch != null and uplinkSwitch != ''"> and uplink_switch like concat('%', #{uplinkSwitch}, '%')</if>
<if test="creatorId != null "> and creator_id = #{creatorId}</if>
<if test="creatorName != null and creatorName != ''"> and creator_name like concat('%', #{creatorName}, '%')</if>
<if test="switchSn != null and switchSn != ''"> and switch_sn = #{switchSn}</if>
<if test="interfaceName != null and interfaceName != ''"> and interface_name like concat('%', #{interfaceName}, '%')</if>
<if test="resourceType != null and resourceType != ''"> and resource_type = #{resourceType}</if>
@@ -76,6 +64,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="businessName != null and businessName != ''"> and business_name like concat('%', #{businessName}, '%')</if>
<if test="businessId != null and businessId != ''"> and business_id = #{businessId}</if>
<if test="remark1 != null and remark1 != ''"> and remark1 = #{remark1}</if>
<if test="createDatetime != null "> and create_datetime = #{createDatetime}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
<if test="serverClientId != null and serverClientId != ''"> and server_client_id = #{serverClientId}</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="createTime != null"> and create_time = #{createTime}</if>
@@ -112,14 +103,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bandwidth95Monthly != null">bandwidth_95_monthly,</if>
<if test="avgMonthlyBandwidth95 != null">avg_monthly_bandwidth_95,</if>
<if test="packageBandwidthDaily != null">package_bandwidth_daily,</if>
<if test="customerId != null">customer_id,</if>
<if test="customerName != null">customer_name,</if>
<if test="serviceNumber != null">service_number,</if>
<if test="machineFlow != null">machine_flow,</if>
<if test="uplinkSwitch != null">uplink_switch,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="creatorId != null">creator_id,</if>
<if test="creatorName != null">creator_name,</if>
<if test="switchSn != null">switch_sn,</if>
<if test="interfaceName != null">interface_name,</if>
<if test="resourceType != null">resource_type,</if>
@@ -130,8 +115,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="businessName != null">business_name,</if>
<if test="businessId != null">business_id,</if>
<if test="remark1 != null">remark1,</if>
<if test="createDatetime != null">create_datetime,</if>
<if test="clientId != null">client_id,</if>
create_datetime,
<if test="serverClientId != null">server_client_id,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
create_time,
update_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="nodeName != null">#{nodeName},</if>
@@ -143,14 +133,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bandwidth95Monthly != null">#{bandwidth95Monthly},</if>
<if test="avgMonthlyBandwidth95 != null">#{avgMonthlyBandwidth95},</if>
<if test="packageBandwidthDaily != null">#{packageBandwidthDaily},</if>
<if test="customerId != null">#{customerId},</if>
<if test="customerName != null">#{customerName},</if>
<if test="serviceNumber != null">#{serviceNumber},</if>
<if test="machineFlow != null">#{machineFlow},</if>
<if test="uplinkSwitch != null">#{uplinkSwitch},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="creatorId != null">#{creatorId},</if>
<if test="creatorName != null">#{creatorName},</if>
<if test="switchSn != null">#{switchSn},</if>
<if test="interfaceName != null">#{interfaceName},</if>
<if test="resourceType != null">#{resourceType},</if>
@@ -161,8 +145,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="businessName != null">#{businessName},</if>
<if test="businessId != null">#{businessId},</if>
<if test="remark1 != null">#{remark1},</if>
<if test="createDatetime != null">#{createDatetime},</if>
<if test="clientId != null">#{clientId},</if>
NOW(),
<if test="serverClientId != null">#{serverClientId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<choose>
<when test="createTime != null">
#{createTime},
</when>
<otherwise>
NOW(),
</otherwise>
</choose>
<choose>
<when test="updateTime != null">
#{updateTime},
</when>
<otherwise>
NOW(),
</otherwise>
</choose>
</trim>
</insert>
@@ -178,14 +181,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bandwidth95Monthly != null">bandwidth_95_monthly = #{bandwidth95Monthly},</if>
<if test="avgMonthlyBandwidth95 != null">avg_monthly_bandwidth_95 = #{avgMonthlyBandwidth95},</if>
<if test="packageBandwidthDaily != null">package_bandwidth_daily = #{packageBandwidthDaily},</if>
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="serviceNumber != null">service_number = #{serviceNumber},</if>
<if test="machineFlow != null">machine_flow = #{machineFlow},</if>
<if test="uplinkSwitch != null">uplink_switch = #{uplinkSwitch},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="creatorId != null">creator_id = #{creatorId},</if>
<if test="creatorName != null">creator_name = #{creatorName},</if>
<if test="switchSn != null">switch_sn = #{switchSn},</if>
<if test="interfaceName != null">interface_name = #{interfaceName},</if>
<if test="resourceType != null">resource_type = #{resourceType},</if>
@@ -198,6 +197,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark1 != null">remark1 = #{remark1},</if>
<if test="createDatetime != null">create_datetime = #{createDatetime},</if>
<if test="clientId != null">client_id = #{clientId},</if>
<if test="serverClientId != null">server_client_id = #{serverClientId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
@@ -14,7 +14,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="type" column="type" />
<result property="inSpeed" column="in_speed" />
<result property="outSpeed" column="out_speed" />
<result property="maxSpeed" column="max_speed" />
<result property="switchIp" column="switch_ip" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
@@ -34,10 +33,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="ifInErrors" column="if_in_errors" />
<result property="ifOutErrors" column="if_out_errors" />
<result property="ifIndex" column="if_index" />
<result property="maxSpeed" column="max_speed" />
<result property="interfaceNameRemark" column="interface_name_remark" />
<result property="serverClientId" column="server_client_id" />
</resultMap>
<sql id="selectInitialSwitchInfoDetailsVo">
select id, client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, max_speed, switch_ip, create_by, update_by, create_time, update_time, switch_name, interface_device_type, server_name, server_port, server_sn, switch_sn, business_code, business_name, if_speed, if_in_discards, if_out_discards, if_in_errors, if_out_errors, if_index from initial_switch_info_details
select id, client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, switch_ip, create_by, update_by, create_time, update_time, switch_name, interface_device_type, server_name, server_port, server_sn, switch_sn, business_code, business_name, if_speed, if_in_discards, if_out_discards, if_in_errors, if_out_errors, if_index, max_speed, interface_name_remark, server_client_id from initial_switch_info_details
</sql>
<select id="selectInitialSwitchInfoDetailsList" parameterType="InitialSwitchInfoDetails" resultMap="InitialSwitchInfoDetailsResult">
@@ -60,6 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="switchSn != null and switchSn != ''"> and switch_sn = #{switchSn}</if>
<if test="businessCode != null and businessCode != ''"> and business_code = #{businessCode}</if>
<if test="businessName != null and businessName != ''"> and business_name like concat('%', #{businessName}, '%')</if>
<if test="interfaceNameRemark != null and interfaceNameRemark != ''"> and interface_name_remark = #{interfaceNameRemark}</if>
<if test="serverClientId != null and serverClientId != ''"> and server_client_id = #{serverClientId}</if>
<if test="startTime != null">
and create_time &gt;= #{startTime}
</if>
@@ -86,7 +90,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="type != null">type,</if>
<if test="inSpeed != null">in_speed,</if>
<if test="outSpeed != null">out_speed,</if>
<if test="maxSpeed != null">max_speed,</if>
<if test="switchIp != null">switch_ip,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
@@ -105,7 +108,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="ifOutDiscards != null">if_out_discards,</if>
<if test="ifInErrors != null">if_in_errors,</if>
<if test="ifOutErrors != null">if_out_errors,</if>
<if test="ifIndex != null and ifIndex != ''">if_index,</if>
<if test="ifIndex != null">if_index,</if>
<if test="maxSpeed != null">max_speed,</if>
<if test="interfaceNameRemark != null">interface_name_remark,</if>
<if test="serverClientId != null">server_client_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">#{clientId},</if>
@@ -116,7 +122,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="type != null">#{type},</if>
<if test="inSpeed != null">#{inSpeed},</if>
<if test="outSpeed != null">#{outSpeed},</if>
<if test="maxSpeed != null">#{maxSpeed},</if>
<if test="switchIp != null">#{switchIp},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
@@ -135,7 +140,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="ifOutDiscards != null">#{ifOutDiscards},</if>
<if test="ifInErrors != null">#{ifInErrors},</if>
<if test="ifOutErrors != null">#{ifOutErrors},</if>
<if test="ifIndex != null and ifIndex != ''">#{ifIndex},</if>
<if test="ifIndex != null">#{ifIndex},</if>
<if test="maxSpeed != null">#{maxSpeed},</if>
<if test="interfaceNameRemark != null">#{interfaceNameRemark},</if>
<if test="serverClientId != null">#{serverClientId},</if>
</trim>
</insert>
@@ -150,7 +158,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="type != null">type = #{type},</if>
<if test="inSpeed != null">in_speed = #{inSpeed},</if>
<if test="outSpeed != null">out_speed = #{outSpeed},</if>
<if test="maxSpeed != null">max_speed = #{maxSpeed},</if>
<if test="switchIp != null">switch_ip = #{switchIp},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
@@ -169,7 +176,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="ifOutDiscards != null">if_out_discards = #{ifOutDiscards},</if>
<if test="ifInErrors != null">if_in_errors = #{ifInErrors},</if>
<if test="ifOutErrors != null">if_out_errors = #{ifOutErrors},</if>
<if test="ifIndex != null and ifIndex != ''">if_index = #{ifIndex},</if>
<if test="ifIndex != null">if_index = #{ifIndex},</if>
<if test="maxSpeed != null">max_speed = #{maxSpeed},</if>
<if test="interfaceNameRemark != null">interface_name_remark = #{interfaceNameRemark},</if>
<if test="serverClientId != null">server_client_id = #{serverClientId},</if>
</trim>
where id = #{id}
</update>
@@ -196,7 +206,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
`type`,
in_speed AS inSpeed,
out_speed AS outSpeed,
max_speed AS maxSpeed,
switch_ip AS switchIp,
if_index AS ifIndex,
if_speed AS ifSpeed,
@@ -248,7 +257,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
create_by,
update_by,
create_time,
update_time
update_time,
interface_name_remark,
server_client_id
)
VALUES
<foreach collection="dataList" item="item" separator=",">
@@ -294,7 +305,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<otherwise>
NOW()
</otherwise>
</choose>
</choose>,
#{item.interfaceNameRemark},
#{item.serverClientId}
)
</foreach>
</insert>
@@ -359,7 +359,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and client_id = #{clientId}
</when>
<otherwise>
1=0 <!-- 如果两个条件都不满足,则不更新任何记录 -->
and 1=0 <!-- 如果两个条件都不满足,则不更新任何记录 -->
</otherwise>
</choose>
</where>
@@ -61,7 +61,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateUserTableColumnConfig" parameterType="UserTableColumnConfig">
update user_table_column_config
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="pageRoute != null and pageRoute != ''">page_route = #{pageRoute},</if>
<if test="columnConfig != null and columnConfig != ''">column_config = #{columnConfig},</if>
<if test="createBy != null">create_by = #{createBy},</if>
@@ -70,7 +69,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
<where>
<choose>
<when test="id != null">
and id = #{id}
</when>
<when test="userId != null">
and user_id = #{userId}
</when>
<otherwise>
and 1=0 <!-- 如果两个条件都不满足,则不更新任何记录 -->
</otherwise>
</choose>
</where>
</update>
<delete id="deleteUserTableColumnConfigById" parameterType="Long">