流量数据的查询依然不稳定 完全重写绕开IP和MAC的变更问题

This commit is contained in:
Your Name
2026-08-10 21:18:12 +08:00
parent afdeb7116d
commit 94ad6d1f5a
@@ -599,20 +599,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM ${tableName} a
<!-- 动态关联表 -->
<if test="mac == null or mac == ''">
INNER JOIN (
SELECT
a.client_id,ifnull(b.mac_address,a.mac_address) mac_address,b.ipv4_address ipV4
FROM rm_network_interface a
LEFT JOIN rm_network_interface_child b on b.ipv4_address!='' and b.ipv4_address!='N/A'
and a.client_id = b.client_id
AND a.interface_name = b.parent_interface
where
(a.bind_ip = 1 OR a.bind_ip = 3)
AND a.new_flag = 1 and a.client_id = #{clientId}
) b
ON a.client_id = b.client_id and a.ipV4 = b.ipV4
LEFT JOIN rm_network_interface b ON a.client_id = b.client_id
</if>
<where>
<if test="mac == null or mac == ''">
and (b.bind_ip = 1 or b.bind_ip = 3)
and a.ipV4 IS NOT NULL
and a.ipV4 != ''
and NOT (a.total_in_speed = 0 and a.total_out_speed = 0)
</if>
<if test="serviceSn != '' and serviceSn != null">
and a.service_sn = #{serviceSn}
</if>