源数据表+入库逻辑+计算95带宽值/日
This commit is contained in:
+192
@@ -0,0 +1,192 @@
|
||||
<?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.system.mapper.AllInterfaceNameMapper">
|
||||
|
||||
<resultMap type="AllInterfaceName" id="AllInterfaceNameResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="interfaceName" column="interface_name" />
|
||||
<result property="deviceSn" column="device_sn" />
|
||||
<result property="nodeName" column="node_name" />
|
||||
<result property="businessCode" column="business_code" />
|
||||
<result property="businessName" column="business_name" />
|
||||
<result property="resourceType" column="resource_type" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAllInterfaceNameVo">
|
||||
select id, client_id, interface_name, device_sn, node_name, business_code, business_name, resource_type, switch_name, interface_device_type, server_port, switch_sn, create_time, update_time, create_by, update_by from all_interface_name
|
||||
</sql>
|
||||
|
||||
<select id="selectAllInterfaceNameList" parameterType="AllInterfaceName" resultMap="AllInterfaceNameResult">
|
||||
<include refid="selectAllInterfaceNameVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="interfaceName != null and interfaceName != ''"> and interface_name like concat('%', #{interfaceName}, '%')</if>
|
||||
<if test="deviceSn != null and deviceSn != ''"> and device_sn = #{deviceSn}</if>
|
||||
<if test="nodeName != null and nodeName != ''"> and node_name like concat('%', #{nodeName}, '%')</if>
|
||||
<if test="businessCode != null and businessCode != ''"> and business_code = #{businessCode}</if>
|
||||
<if test="businessName != null and businessName != ''"> and business_name like concat('%', #{businessName}, '%')</if>
|
||||
<if test="resourceType != null and resourceType != ''"> and resource_type = #{resourceType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAllInterfaceNameById" parameterType="Long" resultMap="AllInterfaceNameResult">
|
||||
<include refid="selectAllInterfaceNameVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAllInterfaceName" parameterType="AllInterfaceName" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into all_interface_name
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="interfaceName != null and interfaceName != ''">interface_name,</if>
|
||||
<if test="deviceSn != null and deviceSn != ''">device_sn,</if>
|
||||
<if test="nodeName != null">node_name,</if>
|
||||
<if test="businessCode != null">business_code,</if>
|
||||
<if test="businessName != null">business_name,</if>
|
||||
<if test="resourceType != null">resource_type,</if>
|
||||
<if test="switchName != null">switch_name,</if>
|
||||
<if test="interfaceDeviceType != null">interface_device_type,</if>
|
||||
<if test="serverPort != null">server_port,</if>
|
||||
<if test="switchSn != null">switch_sn,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">#{clientId},</if>
|
||||
<if test="interfaceName != null and interfaceName != ''">#{interfaceName},</if>
|
||||
<if test="deviceSn != null and deviceSn != ''">#{deviceSn},</if>
|
||||
<if test="nodeName != null">#{nodeName},</if>
|
||||
<if test="businessCode != null">#{businessCode},</if>
|
||||
<if test="businessName != null">#{businessName},</if>
|
||||
<if test="resourceType != null">#{resourceType},</if>
|
||||
<if test="switchName != null">#{switchName},</if>
|
||||
<if test="interfaceDeviceType != null">#{interfaceDeviceType},</if>
|
||||
<if test="serverPort != null">#{serverPort},</if>
|
||||
<if test="switchSn != null">#{switchSn},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAllInterfaceName" parameterType="AllInterfaceName">
|
||||
update all_interface_name
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="interfaceName != null and interfaceName != ''">interface_name = #{interfaceName},</if>
|
||||
<if test="deviceSn != null and deviceSn != ''">device_sn = #{deviceSn},</if>
|
||||
<if test="nodeName != null">node_name = #{nodeName},</if>
|
||||
<if test="businessCode != null">business_code = #{businessCode},</if>
|
||||
<if test="businessName != null">business_name = #{businessName},</if>
|
||||
<if test="resourceType != null">resource_type = #{resourceType},</if>
|
||||
<if test="switchName != null">switch_name = #{switchName},</if>
|
||||
<if test="interfaceDeviceType != null">interface_device_type = #{interfaceDeviceType},</if>
|
||||
<if test="serverPort != null">server_port = #{serverPort},</if>
|
||||
<if test="switchSn != null">switch_sn = #{switchSn},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAllInterfaceNameById" parameterType="Long">
|
||||
delete from all_interface_name where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAllInterfaceNameByIds" parameterType="String">
|
||||
delete from all_interface_name where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<!-- 根据接口名称批量查询 -->
|
||||
<select id="selectByNames" parameterType="java.lang.String" resultType="AllInterfaceName">
|
||||
SELECT
|
||||
id,
|
||||
interface_name AS interfaceName,
|
||||
client_id AS clientId,
|
||||
resource_type AS resourceType,
|
||||
device_sn AS deviceSn,
|
||||
node_name AS nodeName,
|
||||
business_code AS businessCode,
|
||||
business_name AS businessName,
|
||||
switch_name AS switchName,
|
||||
interface_device_type AS interfaceDeviceType,
|
||||
server_port AS serverPort,
|
||||
switch_sn AS switchSn
|
||||
FROM
|
||||
all_interface_name
|
||||
WHERE
|
||||
interface_name IN
|
||||
<foreach collection="collection" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 批量插入接口名称 -->
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
INSERT INTO all_interface_name
|
||||
(
|
||||
interface_name,
|
||||
client_id,
|
||||
resource_type,
|
||||
device_sn,
|
||||
node_name,
|
||||
business_code,
|
||||
business_name,
|
||||
switch_name, interface_device_type, server_port, switch_sn,
|
||||
create_time,
|
||||
update_time
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.interfaceName},
|
||||
#{item.clientId},
|
||||
#{item.resourceType},
|
||||
#{item.deviceSn},
|
||||
#{item.nodeName},
|
||||
#{item.businessCode},
|
||||
#{item.businessName},
|
||||
#{item.switchName}, #{item.interfaceDeviceType}, #{item.serverPort}, #{item.switchSn},
|
||||
NOW(),
|
||||
NOW()
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 检查接口名称是否存在 -->
|
||||
<select id="getAllDeviceSn" parameterType="AllInterfaceName" resultType="AllInterfaceName">
|
||||
SELECT
|
||||
device_sn AS deviceSn
|
||||
FROM
|
||||
all_interface_name
|
||||
<where>
|
||||
and resource_type = '1' and device_sn != ''
|
||||
</where>
|
||||
group by device_sn
|
||||
</select>
|
||||
<!-- 检查交换机接口名称是否存在 -->
|
||||
<select id="getAllSwitchSn" parameterType="AllInterfaceName" resultType="AllInterfaceName">
|
||||
SELECT
|
||||
switch_sn AS switchSn
|
||||
FROM
|
||||
all_interface_name
|
||||
<where>
|
||||
and resource_type = '2' and switch_sn != ''
|
||||
</where>
|
||||
group by switch_sn
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user