2025-08-21 09:28:46 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
<!DOCTYPE mapper
|
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<mapper namespace="com.ruoyi.rocketmq.mapper.InitialBandwidthTrafficMapper">
|
2025-08-21 18:29:22 +08:00
|
|
|
|
2025-08-21 09:28:46 +08:00
|
|
|
<resultMap type="InitialBandwidthTraffic" id="InitialBandwidthTrafficResult">
|
2025-08-21 18:29:22 +08:00
|
|
|
<result property="id" column="id"/>
|
|
|
|
|
<result property="name" column="name"/>
|
|
|
|
|
<result property="mac" column="mac"/>
|
|
|
|
|
<result property="status" column="status"/>
|
|
|
|
|
<result property="type" column="type"/>
|
|
|
|
|
<result property="ipV4" column="ipV4"/>
|
|
|
|
|
<result property="inDropped" column="in_dropped"/>
|
|
|
|
|
<result property="outDropped" column="out_dropped"/>
|
|
|
|
|
<result property="inSpeed" column="in_speed"/>
|
|
|
|
|
<result property="outSpeed" column="out_speed"/>
|
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
|
|
<result property="clientId" column="client_id"/>
|
2025-08-21 09:28:46 +08:00
|
|
|
</resultMap>
|
2025-08-21 18:29:22 +08:00
|
|
|
<sql id="selectInitialBandwidthTrafficVo"> select id, name, mac, status, type, ipV4, in_dropped, out_dropped, in_speed, out_speed, create_time, update_time, create_by, update_by, client_id from initial_bandwidth_traffic </sql>
|
2025-08-21 09:28:46 +08:00
|
|
|
<select id="selectInitialBandwidthTrafficList" parameterType="InitialBandwidthTraffic" resultMap="InitialBandwidthTrafficResult">
|
|
|
|
|
<include refid="selectInitialBandwidthTrafficVo"/>
|
2025-08-21 18:29:22 +08:00
|
|
|
<where>
|
|
|
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
|
|
<if test="mac != null and mac != ''"> and mac = #{mac}</if>
|
|
|
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
|
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
|
|
|
|
<if test="ipV4 != null and ipV4 != ''"> and ipV4 = #{ipV4}</if>
|
|
|
|
|
<if test="inDropped != null "> and in_dropped = #{inDropped}</if>
|
|
|
|
|
<if test="outDropped != null "> and out_dropped = #{outDropped}</if>
|
|
|
|
|
<if test="inSpeed != null and inSpeed != ''"> and in_speed = #{inSpeed}</if>
|
|
|
|
|
<if test="outSpeed != null and outSpeed != ''"> and out_speed = #{outSpeed}</if>
|
|
|
|
|
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
2025-08-21 09:28:46 +08:00
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectInitialBandwidthTrafficById" parameterType="Long" resultMap="InitialBandwidthTrafficResult">
|
|
|
|
|
<include refid="selectInitialBandwidthTrafficVo"/>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
2025-08-21 18:29:22 +08:00
|
|
|
<insert id="insertInitialBandwidthTraffic" parameterType="InitialBandwidthTraffic" useGeneratedKeys="true" keyProperty="id">
|
2025-08-21 09:28:46 +08:00
|
|
|
insert into initial_bandwidth_traffic
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
2025-08-21 18:29:22 +08:00
|
|
|
<if test="name != null">name,</if>
|
|
|
|
|
<if test="mac != null">mac,</if>
|
|
|
|
|
<if test="status != null">status,</if>
|
|
|
|
|
<if test="type != null">type,</if>
|
|
|
|
|
<if test="ipV4 != null">ipV4,</if>
|
|
|
|
|
<if test="inDropped != null">in_dropped,</if>
|
|
|
|
|
<if test="outDropped != null">out_dropped,</if>
|
|
|
|
|
<if test="inSpeed != null">in_speed,</if>
|
|
|
|
|
<if test="outSpeed != null">out_speed,</if>
|
2025-08-21 09:28:46 +08:00
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
2025-08-21 18:29:22 +08:00
|
|
|
<if test="clientId != null">client_id,</if>
|
|
|
|
|
</trim>
|
2025-08-21 09:28:46 +08:00
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
2025-08-21 18:29:22 +08:00
|
|
|
<if test="name != null">#{name},</if>
|
|
|
|
|
<if test="mac != null">#{mac},</if>
|
|
|
|
|
<if test="status != null">#{status},</if>
|
|
|
|
|
<if test="type != null">#{type},</if>
|
|
|
|
|
<if test="ipV4 != null">#{ipV4},</if>
|
|
|
|
|
<if test="inDropped != null">#{inDropped},</if>
|
|
|
|
|
<if test="outDropped != null">#{outDropped},</if>
|
|
|
|
|
<if test="inSpeed != null">#{inSpeed},</if>
|
|
|
|
|
<if test="outSpeed != null">#{outSpeed},</if>
|
2025-08-21 09:28:46 +08:00
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
2025-08-21 18:29:22 +08:00
|
|
|
<if test="clientId != null">#{clientId},</if>
|
|
|
|
|
</trim>
|
2025-08-21 09:28:46 +08:00
|
|
|
</insert>
|
|
|
|
|
<update id="updateInitialBandwidthTraffic" parameterType="InitialBandwidthTraffic">
|
|
|
|
|
update initial_bandwidth_traffic
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
2025-08-21 18:29:22 +08:00
|
|
|
<if test="name != null">name = #{name},</if>
|
|
|
|
|
<if test="mac != null">mac = #{mac},</if>
|
|
|
|
|
<if test="status != null">status = #{status},</if>
|
|
|
|
|
<if test="type != null">type = #{type},</if>
|
|
|
|
|
<if test="ipV4 != null">ipV4 = #{ipV4},</if>
|
|
|
|
|
<if test="inDropped != null">in_dropped = #{inDropped},</if>
|
|
|
|
|
<if test="outDropped != null">out_dropped = #{outDropped},</if>
|
|
|
|
|
<if test="inSpeed != null">in_speed = #{inSpeed},</if>
|
|
|
|
|
<if test="outSpeed != null">out_speed = #{outSpeed},</if>
|
2025-08-21 09:28:46 +08:00
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
2025-08-21 18:29:22 +08:00
|
|
|
<if test="clientId != null">client_id = #{clientId},</if>
|
2025-08-21 09:28:46 +08:00
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
2025-08-21 18:29:22 +08:00
|
|
|
<delete id="deleteInitialBandwidthTrafficById" parameterType="Long"> delete from initial_bandwidth_traffic where id = #{id} </delete>
|
2025-08-21 09:28:46 +08:00
|
|
|
<delete id="deleteInitialBandwidthTrafficByIds" parameterType="String">
|
2025-08-21 18:29:22 +08:00
|
|
|
delete from initial_bandwidth_traffic where id in
|
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach>
|
2025-08-21 09:28:46 +08:00
|
|
|
</delete>
|
2025-08-21 18:29:22 +08:00
|
|
|
<!-- 单条插入 -->
|
|
|
|
|
<insert id="insert" parameterType="InitialBandwidthTraffic">
|
|
|
|
|
INSERT INTO ${tableName} (
|
|
|
|
|
`name`, `mac`, `status`, `type`, ipV4, `in_dropped`, `out_dropped`,
|
2025-09-11 17:57:51 +08:00
|
|
|
`in_speed`, `out_speed`, duplex, speed, create_by, update_by, client_id, create_time
|
2025-08-21 18:29:22 +08:00
|
|
|
) VALUES (
|
|
|
|
|
#{name}, #{mac}, #{status}, #{type}, #{ipV4}, #{inDropped}, #{outDropped},
|
2025-09-11 17:57:51 +08:00
|
|
|
#{inSpeed}, #{outSpeed}, #{duplex}, #{speed}, #{createBy}, #{updateBy}, #{clientId}, #{createTime}
|
2025-08-21 18:29:22 +08:00
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="batchInsert" parameterType="InitialBandwidthTraffic">
|
2025-09-05 14:38:46 +08:00
|
|
|
INSERT IGNORE INTO ${tableName} (
|
2025-08-21 18:29:22 +08:00
|
|
|
`name`, `mac`, `status`, `type`, ipV4, `in_dropped`, `out_dropped`,
|
2025-09-11 17:57:51 +08:00
|
|
|
`in_speed`, `out_speed`,duplex, speed, create_by, update_by, client_id, create_time
|
2025-08-21 18:29:22 +08:00
|
|
|
) VALUES
|
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
|
(
|
|
|
|
|
#{item.name}, #{item.mac}, #{item.status}, #{item.type}, #{item.ipV4}, #{item.inDropped}, #{item.outDropped},
|
2025-09-11 17:57:51 +08:00
|
|
|
#{item.inSpeed}, #{item.outSpeed}, #{item.duplex}, #{item.speed}, #{item.createBy}, #{item.updateBy}, #{item.clientId}, #{item.createTime}
|
2025-08-21 18:29:22 +08:00
|
|
|
)
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
2025-08-21 09:28:46 +08:00
|
|
|
|
|
|
|
|
</mapper>
|