单网卡总流量、ipv4流量、ipv6流量合并到一个图

pppoe状态上报增加
This commit is contained in:
gaoyutao
2025-12-30 18:23:09 +08:00
parent 6e2ca8ac53
commit 08680bb46a
20 changed files with 298 additions and 58 deletions
@@ -3,10 +3,10 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tongran.rocketmq.mapper.RmPppoeConfigSubMapper">
<resultMap type="RmPppoeConfigSub" id="RmPppoeConfigSubResult">
<result property="id" column="id" />
<result property="mainId" column="main_id" />
<result property="clientId" column="client_id" />
<result property="serialNumber" column="serial_number" />
<result property="vlanId" column="vlan_id" />
<result property="ipv4Address" column="ipv4_address" />
@@ -16,24 +16,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="status" column="status" />
<result property="macAddress" column="mac_address" />
</resultMap>
<sql id="selectRmPppoeConfigSubVo">
select id, main_id, serial_number, vlan_id, ipv4_address, ipv4_mask_bits, ipv4_gateway, create_time, update_time, create_by, update_by from rm_pppoe_config_sub
select id, client_id, serial_number, vlan_id, ipv4_address, ipv4_mask_bits, ipv4_gateway, create_time, update_time, create_by, update_by, status from rm_pppoe_config_sub
</sql>
<select id="selectRmPppoeConfigSubList" parameterType="RmPppoeConfigSub" resultMap="RmPppoeConfigSubResult">
<include refid="selectRmPppoeConfigSubVo"/>
<where>
<if test="mainId != null "> and main_id = #{mainId}</if>
<if test="serialNumber != null "> and serial_number = #{serialNumber}</if>
<if test="vlanId != null "> and vlan_id = #{vlanId}</if>
<if test="ipv4Address != null and ipv4Address != ''"> and ipv4_address = #{ipv4Address}</if>
<if test="ipv4MaskBits != null "> and ipv4_mask_bits = #{ipv4MaskBits}</if>
<if test="ipv4Gateway != null and ipv4Gateway != ''"> and ipv4_gateway = #{ipv4Gateway}</if>
SELECT
a.id,
a.client_id,
a.serial_number,
a.vlan_id,
a.ipv4_address,
a.ipv4_mask_bits,
a.ipv4_gateway,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.status,
b.mac_address
FROM
rm_pppoe_config_sub a
LEFT JOIN
rm_network_interface_child b
ON a.client_id = b.client_id
AND a.ipv4_address = b.ipv4_address
<where>
<if test="clientId != null and clientId != ''"> and a.client_id = #{clientId}</if>
<if test="serialNumber != null "> and a.serial_number = #{serialNumber}</if>
<if test="vlanId != null "> and a.vlan_id = #{vlanId}</if>
<if test="ipv4Address != null and ipv4Address != ''"> and a.ipv4_address = #{ipv4Address}</if>
<if test="ipv4MaskBits != null "> and a.ipv4_mask_bits = #{ipv4MaskBits}</if>
<if test="ipv4Gateway != null and ipv4Gateway != ''"> and a.ipv4_gateway = #{ipv4Gateway}</if>
<if test="status != null and status != ''"> and a.status = #{status}</if>
</where>
</select>
<select id="selectRmPppoeConfigSubById" parameterType="Long" resultMap="RmPppoeConfigSubResult">
<include refid="selectRmPppoeConfigSubVo"/>
where id = #{id}
@@ -42,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertRmPppoeConfigSub" parameterType="RmPppoeConfigSub" useGeneratedKeys="true" keyProperty="id">
insert into rm_pppoe_config_sub
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mainId != null">main_id,</if>
<if test="clientId != null">client_id,</if>
<if test="serialNumber != null">serial_number,</if>
<if test="vlanId != null">vlan_id,</if>
<if test="ipv4Address != null">ipv4_address,</if>
@@ -52,9 +74,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<if test="status != null">status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mainId != null">#{mainId},</if>
<if test="clientId != null">#{clientId},</if>
<if test="serialNumber != null">#{serialNumber},</if>
<if test="vlanId != null">#{vlanId},</if>
<if test="ipv4Address != null">#{ipv4Address},</if>
@@ -64,13 +87,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
<if test="status != null">#{status},</if>
</trim>
</insert>
<update id="updateRmPppoeConfigSub" parameterType="RmPppoeConfigSub">
update rm_pppoe_config_sub
<trim prefix="SET" suffixOverrides=",">
<if test="mainId != null">main_id = #{mainId},</if>
<if test="clientId != null">client_id = #{clientId},</if>
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
<if test="vlanId != null">vlan_id = #{vlanId},</if>
<if test="ipv4Address != null">ipv4_address = #{ipv4Address},</if>
@@ -80,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="status != null">status = #{status},</if>
</trim>
where id = #{id}
</update>
@@ -96,11 +121,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<insert id="batchInsertRmPppoeConfigSub" parameterType="java.util.List">
insert into rm_pppoe_config_sub
(main_id, serial_number, vlan_id, ipv4_address, ipv4_mask_bits, ipv4_gateway, create_time, update_time, create_by, update_by)
(client_id, serial_number, vlan_id, ipv4_address, ipv4_mask_bits, ipv4_gateway, create_time, update_time, create_by, update_by)
values
<foreach collection="list" item="item" separator=",">
(
#{item.mainId},
#{item.clientId},
#{item.serialNumber},
#{item.vlanId},
#{item.ipv4Address},
@@ -113,7 +138,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</foreach>
</insert>
<delete id="deleteRmPppoeConfigSubByMainId" parameterType="Long">
delete from rm_pppoe_config_sub where main_id = #{mainId}
<delete id="deleteRmPppoeConfigSubByClientId" parameterType="String">
delete from rm_pppoe_config_sub where client_id = #{clientId}
</delete>
<update id="updateRmPppoeConfigSubByVlan" parameterType="RmPppoeConfigSub">
update rm_pppoe_config_sub
<trim prefix="SET" suffixOverrides=",">
<if test="status != null">status = #{status},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
<where>
<choose>
<when test="clientId!=null and vlanId!=null and serialNumber != null">
and client_id=#{clientId} and vlan_id=#{vlanId} and serial_number=#{serialNumber}
</when>
<otherwise>
and 1=0
</otherwise>
</choose>
</where>
</update>
</mapper>