Files
saas-houduan/tongran-rocketmq/src/main/resources/mapper/rocketmq/RmPppoeConfigSubMapper.xml
T

167 lines
7.8 KiB
XML
Raw Normal View History

2025-12-29 18:25:32 +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.tongran.rocketmq.mapper.RmPppoeConfigSubMapper">
2025-12-29 18:25:32 +08:00
<resultMap type="RmPppoeConfigSub" id="RmPppoeConfigSubResult">
<result property="id" column="id" />
<result property="clientId" column="client_id" />
2025-12-29 18:25:32 +08:00
<result property="serialNumber" column="serial_number" />
<result property="vlanId" column="vlan_id" />
<result property="ipv4Address" column="ipv4_address" />
<result property="ipv4MaskBits" column="ipv4_mask_bits" />
<result property="ipv4Gateway" column="ipv4_gateway" />
2026-01-07 19:20:01 +08:00
<result property="bandwidthResult" column="bandwidth_result" />
2025-12-29 18:25:32 +08:00
<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="status" column="status" />
2025-12-29 18:25:32 +08:00
</resultMap>
<sql id="selectRmPppoeConfigSubVo">
2026-01-07 19:20:01 +08:00
select id, client_id, serial_number, vlan_id, ipv4_address, ipv4_mask_bits, ipv4_gateway, bandwidth_result, create_time, update_time, create_by, update_by, status from rm_pppoe_config_sub
2025-12-29 18:25:32 +08:00
</sql>
2026-01-07 19:20:01 +08:00
<select id="selectRmPppoeConfigSubList" parameterType="RmPppoeConfigSub" resultType="RmPppoeConfigSub">
SELECT
a.id,
2026-01-07 19:20:01 +08:00
a.client_id clientId,
a.serial_number serialNumber,
a.vlan_id vlanId,
a.ipv4_address ipv4Address,
a.ipv4_mask_bits ipv4MaskBits,
a.ipv4_gateway ipv4Gateway,
a.create_time createTime,
a.update_time updateTime,
a.create_by createBy,
a.update_by updateBy,
a.status status,
b.mac_address macAddress,
b.status virStatus
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>
2025-12-29 18:25:32 +08:00
</where>
</select>
2025-12-29 18:25:32 +08:00
<select id="selectRmPppoeConfigSubById" parameterType="Long" resultMap="RmPppoeConfigSubResult">
<include refid="selectRmPppoeConfigSubVo"/>
where id = #{id}
</select>
<insert id="insertRmPppoeConfigSub" parameterType="RmPppoeConfigSub" useGeneratedKeys="true" keyProperty="id">
insert into rm_pppoe_config_sub
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clientId != null">client_id,</if>
2025-12-29 18:25:32 +08:00
<if test="serialNumber != null">serial_number,</if>
<if test="vlanId != null">vlan_id,</if>
<if test="ipv4Address != null">ipv4_address,</if>
<if test="ipv4MaskBits != null">ipv4_mask_bits,</if>
<if test="ipv4Gateway != null">ipv4_gateway,</if>
2026-01-07 19:20:01 +08:00
<if test="bandwidthResult != null">bandwidth_result,</if>
2025-12-29 18:25:32 +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>
<if test="status != null">status,</if>
</trim>
2025-12-29 18:25:32 +08:00
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clientId != null">#{clientId},</if>
2025-12-29 18:25:32 +08:00
<if test="serialNumber != null">#{serialNumber},</if>
<if test="vlanId != null">#{vlanId},</if>
<if test="ipv4Address != null">#{ipv4Address},</if>
<if test="ipv4MaskBits != null">#{ipv4MaskBits},</if>
<if test="ipv4Gateway != null">#{ipv4Gateway},</if>
2026-01-07 19:20:01 +08:00
<if test="bandwidthResult != null">#{bandwidthResult},</if>
2025-12-29 18:25:32 +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>
<if test="status != null">#{status},</if>
</trim>
2025-12-29 18:25:32 +08:00
</insert>
<update id="updateRmPppoeConfigSub" parameterType="RmPppoeConfigSub">
update rm_pppoe_config_sub
<trim prefix="SET" suffixOverrides=",">
<if test="clientId != null">client_id = #{clientId},</if>
2025-12-29 18:25:32 +08:00
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
<if test="vlanId != null">vlan_id = #{vlanId},</if>
<if test="ipv4Address != null">ipv4_address = #{ipv4Address},</if>
<if test="ipv4MaskBits != null">ipv4_mask_bits = #{ipv4MaskBits},</if>
<if test="ipv4Gateway != null">ipv4_gateway = #{ipv4Gateway},</if>
2026-01-07 19:20:01 +08:00
<if test="bandwidthResult != null">bandwidth_result = #{bandwidthResult},</if>
2025-12-29 18:25:32 +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>
<if test="status != null">status = #{status},</if>
2025-12-29 18:25:32 +08:00
</trim>
where id = #{id}
</update>
<delete id="deleteRmPppoeConfigSubById" parameterType="Long">
delete from rm_pppoe_config_sub where id = #{id}
</delete>
<delete id="deleteRmPppoeConfigSubByIds" parameterType="String">
delete from rm_pppoe_config_sub where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="batchInsertRmPppoeConfigSub" parameterType="java.util.List">
insert into rm_pppoe_config_sub
2026-01-07 19:20:01 +08:00
(client_id, serial_number, vlan_id, ipv4_address, ipv4_mask_bits, ipv4_gateway,
bandwidth_result, create_time, update_time, create_by, update_by)
2025-12-29 18:25:32 +08:00
values
<foreach collection="list" item="item" separator=",">
(
#{item.clientId},
2025-12-29 18:25:32 +08:00
#{item.serialNumber},
#{item.vlanId},
#{item.ipv4Address},
#{item.ipv4MaskBits},
#{item.ipv4Gateway},
2026-01-07 19:20:01 +08:00
#{item.bandwidthResult},
2025-12-29 18:25:32 +08:00
#{item.createTime},
#{item.updateTime},
#{item.createBy},
#{item.updateBy}
)
</foreach>
</insert>
<delete id="deleteRmPppoeConfigSubByClientId" parameterType="String">
delete from rm_pppoe_config_sub where client_id = #{clientId}
2025-12-29 18:25:32 +08:00
</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>
2025-12-29 18:25:32 +08:00
</mapper>