完善初始流量数据库读取mq入库

This commit is contained in:
gaoyutao
2025-08-22 18:13:10 +08:00
parent 34049d1c78
commit 259398bfcc
19 changed files with 334 additions and 264 deletions
@@ -54,18 +54,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
INDEX idx_name_time (`name`,create_time)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='初始带宽流量表';
</update>
<!-- 单条插入 -->
<!-- 单条插入语句 -->
<insert id="insert">
INSERT INTO ${tableName} (
interface_name,
mac_address,
operation_status,
interface_type,
ipv4_address,
inbound_packet_loss,
outbound_packet_loss,
receive_bandwidth,
send_bandwidth,
`name`,
`mac`,
`status`,
`type`,
ipV4,
`in_dropped`,
`out_dropped`,
`in_speed`,
`out_speed`,
business_id,
business_name,
service_sn,
@@ -76,15 +76,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_by,
client_id
) VALUES (
#{interfaceName},
#{macAddress},
#{operationStatus},
#{interfaceType},
#{ipv4Address},
#{inboundPacketLoss},
#{outboundPacketLoss},
#{receiveBandwidth},
#{sendBandwidth},
#{name},
#{mac},
#{status},
#{type},
#{ipV4},
#{inDropped},
#{outDropped},
#{inSpeed},
#{outSpeed},
#{businessId},
#{businessName},
#{serviceSn},
@@ -97,19 +97,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</insert>
<!-- 批量插入 -->
<!-- 批量插入语句 -->
<insert id="batchInsert">
INSERT INTO ${tableName} (
id,
interface_name,
mac_address,
operation_status,
interface_type,
ipv4_address,
inbound_packet_loss,
outbound_packet_loss,
receive_bandwidth,
send_bandwidth,
`name`,
`mac`,
`status`,
`type`,
ipV4,
`in_dropped`,
`out_dropped`,
`in_speed`,
`out_speed`,
business_id,
business_name,
service_sn,
@@ -122,19 +122,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_by,
client_id
) VALUES
<foreach collection="list" item="data" separator=",">
<foreach collection="dataList" item="data" separator=",">
(
#{data.id,jdbcType=BIGINT},
#{data.interfaceName,jdbcType=VARCHAR},
#{data.macAddress,jdbcType=CHAR},
#{data.operationStatus,jdbcType=VARCHAR},
#{data.interfaceType,jdbcType=VARCHAR},
#{data.ipv4Address,jdbcType=VARCHAR},
#{data.inboundPacketLoss,jdbcType=DECIMAL},
#{data.outboundPacketLoss,jdbcType=DECIMAL},
#{data.receiveBandwidth,jdbcType=DECIMAL},
#{data.sendBandwidth,jdbcType=DECIMAL},
#{data.businessId,jdbcType=CHAR},
#{data.name,jdbcType=VARCHAR},
#{data.mac,jdbcType=VARCHAR},
#{data.status,jdbcType=VARCHAR},
#{data.type,jdbcType=VARCHAR},
#{data.ipV4,jdbcType=VARCHAR},
#{data.inDropped,jdbcType=DECIMAL},
#{data.outDropped,jdbcType=DECIMAL},
#{data.inSpeed,jdbcType=VARCHAR},
#{data.outSpeed,jdbcType=VARCHAR},
#{data.businessId,jdbcType=VARCHAR},
#{data.businessName,jdbcType=VARCHAR},
#{data.serviceSn,jdbcType=VARCHAR},
#{data.nodeName,jdbcType=VARCHAR},
@@ -153,15 +153,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectByCondition" resultType="EpsInitialTrafficData">
SELECT
id,
`name` AS interfaceName,
`mac` AS macAddress,
`status` AS operationStatus,
`type` AS interfaceType,
`ipV4` AS ipv4Address,
`in_dropped` AS inboundPacketLoss,
`out_dropped` AS outboundPacketLoss,
`in_speed` AS receiveBandwidth,
`out_speed` AS sendBandwidth,
`name` AS name,
`mac` AS mac,
`status` AS status,
`type` AS type,
`ipV4` AS ipV4,
`in_dropped` AS inDropped,
`out_dropped` AS outDropped,
`in_speed` AS inSpeed,
`out_speed` AS outSpeed,
business_id AS businessId,
business_name AS businessName,
service_sn AS serviceSn,
@@ -193,15 +193,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getAllTraficMsg" resultType="EpsInitialTrafficData">
SELECT
id,
`name` AS interfaceName,
`mac` AS macAddress,
`status` AS operationStatus,
`type` AS interfaceType,
`ipV4` AS ipv4Address,
`in_dropped` AS inboundPacketLoss,
`out_dropped` AS outboundPacketLoss,
`in_speed` AS receiveBandwidth,
`out_speed` AS sendBandwidth,
`name` AS name,
`mac` AS mac,
`status` AS status,
`type` AS type,
`ipV4` AS ipV4,
`in_dropped` AS inDropped,
`out_dropped` AS outDropped,
`in_speed` AS inSpeed,
`out_speed` AS outSpeed,
create_time AS createTime,
update_time AS updateTime,
create_by AS createBy,