152 lines
8.5 KiB
XML
152 lines
8.5 KiB
XML
<?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.RmNetworkInterfaceChildMapper">
|
|
|
|
<resultMap type="RmNetworkInterfaceChild" id="RmNetworkInterfaceChildResult">
|
|
<result property="id" column="id" />
|
|
<result property="clientId" column="client_id" />
|
|
<result property="parentInterface" column="parent_interface" />
|
|
<result property="isp" column="isp" />
|
|
<result property="province" column="province" />
|
|
<result property="city" column="city" />
|
|
<result property="publicIp" column="public_ip" />
|
|
<result property="interfaceName" column="interface_name" />
|
|
<result property="macAddress" column="mac_address" />
|
|
<result property="interfaceType" column="interface_type" />
|
|
<result property="ipv4Address" column="ipv4_address" />
|
|
<result property="ipv6Address" column="ipv6_address" />
|
|
<result property="gateway" column="gateway" />
|
|
<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="bindIp" column="bind_ip" />
|
|
<result property="newFlag" column="new_flag" />
|
|
</resultMap>
|
|
|
|
<sql id="selectRmNetworkInterfaceChildVo">
|
|
select id, client_id, parent_interface, isp, province, city, public_ip, interface_name, mac_address, interface_type, ipv4_address, ipv6_address, gateway, create_time, update_time, create_by, update_by, bind_ip, new_flag from rm_network_interface_child
|
|
</sql>
|
|
|
|
<select id="selectRmNetworkInterfaceChildList" parameterType="RmNetworkInterfaceChild" resultMap="RmNetworkInterfaceChildResult">
|
|
<include refid="selectRmNetworkInterfaceChildVo"/>
|
|
<where>
|
|
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
|
<if test="parentInterface != null and parentInterface != ''"> and parent_interface = #{parentInterface}</if>
|
|
<if test="isp != null and isp != ''"> and isp = #{isp}</if>
|
|
<if test="province != null and province != ''"> and province = #{province}</if>
|
|
<if test="city != null and city != ''"> and city = #{city}</if>
|
|
<if test="publicIp != null and publicIp != ''"> and public_ip = #{publicIp}</if>
|
|
<if test="interfaceName != null and interfaceName != ''"> and interface_name like concat('%', #{interfaceName}, '%')</if>
|
|
<if test="macAddress != null and macAddress != ''"> and mac_address = #{macAddress}</if>
|
|
<if test="interfaceType != null and interfaceType != ''"> and interface_type = #{interfaceType}</if>
|
|
<if test="ipv4Address != null and ipv4Address != ''"> and ipv4_address = #{ipv4Address}</if>
|
|
<if test="ipv6Address != null and ipv6Address != ''"> and ipv6_address = #{ipv6Address}</if>
|
|
<if test="gateway != null and gateway != ''"> and gateway = #{gateway}</if>
|
|
<if test="bindIp != null and bindIp != ''"> and bind_ip = #{bindIp}</if>
|
|
<if test="newFlag != null "> and new_flag = #{newFlag}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectRmNetworkInterfaceChildById" parameterType="Long" resultMap="RmNetworkInterfaceChildResult">
|
|
<include refid="selectRmNetworkInterfaceChildVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertRmNetworkInterfaceChild" parameterType="RmNetworkInterfaceChild" useGeneratedKeys="true" keyProperty="id">
|
|
insert IGNORE into rm_network_interface_child
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="clientId != null">client_id,</if>
|
|
<if test="parentInterface != null">parent_interface,</if>
|
|
<if test="isp != null">isp,</if>
|
|
<if test="province != null">province,</if>
|
|
<if test="city != null">city,</if>
|
|
<if test="publicIp != null">public_ip,</if>
|
|
<if test="interfaceName != null">interface_name,</if>
|
|
<if test="macAddress != null">mac_address,</if>
|
|
<if test="interfaceType != null">interface_type,</if>
|
|
<if test="ipv4Address != null">ipv4_address,</if>
|
|
<if test="ipv6Address != null">ipv6_address,</if>
|
|
<if test="gateway != null">gateway,</if>
|
|
<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="bindIp != null">bind_ip,</if>
|
|
<if test="newFlag != null">new_flag,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="clientId != null">#{clientId},</if>
|
|
<if test="parentInterface != null">#{parentInterface},</if>
|
|
<if test="isp != null">#{isp},</if>
|
|
<if test="province != null">#{province},</if>
|
|
<if test="city != null">#{city},</if>
|
|
<if test="publicIp != null">#{publicIp},</if>
|
|
<if test="interfaceName != null">#{interfaceName},</if>
|
|
<if test="macAddress != null">#{macAddress},</if>
|
|
<if test="interfaceType != null">#{interfaceType},</if>
|
|
<if test="ipv4Address != null">#{ipv4Address},</if>
|
|
<if test="ipv6Address != null">#{ipv6Address},</if>
|
|
<if test="gateway != null">#{gateway},</if>
|
|
<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="bindIp != null">#{bindIp},</if>
|
|
<if test="newFlag != null">#{newFlag},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateRmNetworkInterfaceChild" parameterType="RmNetworkInterfaceChild">
|
|
update rm_network_interface_child
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="clientId != null">client_id = #{clientId},</if>
|
|
<if test="parentInterface != null">parent_interface = #{parentInterface},</if>
|
|
<if test="isp != null">isp = #{isp},</if>
|
|
<if test="province != null">province = #{province},</if>
|
|
<if test="city != null">city = #{city},</if>
|
|
<if test="publicIp != null">public_ip = #{publicIp},</if>
|
|
<if test="interfaceName != null">interface_name = #{interfaceName},</if>
|
|
<if test="macAddress != null">mac_address = #{macAddress},</if>
|
|
<if test="interfaceType != null">interface_type = #{interfaceType},</if>
|
|
<if test="ipv4Address != null">ipv4_address = #{ipv4Address},</if>
|
|
<if test="ipv6Address != null">ipv6_address = #{ipv6Address},</if>
|
|
<if test="gateway != null">gateway = #{gateway},</if>
|
|
<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="bindIp != null">bind_ip = #{bindIp},</if>
|
|
<if test="newFlag != null">new_flag = #{newFlag},</if>
|
|
</trim>
|
|
<where>
|
|
<choose>
|
|
<when test="id != null">
|
|
and id = #{id}
|
|
</when>
|
|
<when test="clientId != null and macAddress != null">
|
|
and mac_address = #{macAddress} and client_id = #{clientId}
|
|
</when>
|
|
<otherwise>
|
|
and 1=0
|
|
</otherwise>
|
|
</choose>
|
|
</where>
|
|
</update>
|
|
|
|
<delete id="deleteRmNetworkInterfaceChildById" parameterType="Long">
|
|
delete from rm_network_interface_child where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteRmNetworkInterfaceChildByIds" parameterType="String">
|
|
delete from rm_network_interface_child where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
<delete id="deleteRmNetworkInterfaceChildByClientId" parameterType="String">
|
|
delete from rm_network_interface_child where client_id = #{clientId}
|
|
</delete>
|
|
</mapper> |