实时95值计算功能、优化服务器收益功能

This commit is contained in:
gaoyutao
2025-10-29 18:35:44 +08:00
parent 8c439013e1
commit 15ecd5caaf
22 changed files with 1606 additions and 71 deletions
@@ -298,4 +298,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</foreach>
</insert>
<select id="getswitchDetailList" parameterType="InitialSwitchInfoDetails" resultType="InitialSwitchInfoDetails">
select in_speed inSpeed, out_speed outSpeed, create_time createTime from initial_switch_info_details
<where>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
<if test="name != null and name != ''"> and name = #{name}</if>
<if test="inBytes != null "> and in_bytes = #{inBytes}</if>
<if test="outBytes != null "> and out_bytes = #{outBytes}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="inSpeed != null "> and in_speed = #{inSpeed}</if>
<if test="outSpeed != null "> and out_speed = #{outSpeed}</if>
<if test="switchIp != null and switchIp != ''"> and switch_ip = #{switchIp}</if>
<if test="switchName != null and switchName != ''"> and switch_name like concat('%', #{switchName}, '%')</if>
<if test="interfaceDeviceType != null and interfaceDeviceType != ''"> and interface_device_type = #{interfaceDeviceType}</if>
<if test="serverName != null and serverName != ''"> and server_name like concat('%', #{serverName}, '%')</if>
<if test="serverPort != null and serverPort != ''"> and server_port = #{serverPort}</if>
<if test="serverSn != null and serverSn != ''"> and server_sn = #{serverSn}</if>
<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="startTime != null">
and create_time &gt;= #{startTime}
</if>
<if test="endTime != null">
and create_time &lt;= #{endTime}
</if>
</where>
</select>
<select id="sumSwitchTrafficByclientIds" parameterType="InitialSwitchInfoDetails" resultType="InitialSwitchInfoDetails">
select sum(ifnull(in_speed,0)) AS inSpeed,
sum(ifnull(out_speed,0)) AS outSpeed,
sum(ifnull(max_speed,0)) AS maxSpeed,
create_time createTime from initial_switch_info_details
<where>
<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="startTime != null">
and create_time &gt;= #{startTime}
</if>
<if test="endTime != null">
and create_time &lt;= #{endTime}
</if>
<if test="clientIds != '' and clientIds != null">
and client_id in
<foreach collection="clientIds.split(',')" item="clientId" open="(" separator="," close=")">
#{clientId}
</foreach>
</if>
</where>
group by create_time
ORDER BY max_speed desc
</select>
</mapper>