增加服务器下架处理,
服务器详情增加agent最新版本、cpu核数、内存字段。 开发pppoe主表及子表CRUD
This commit is contained in:
@@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="interrupt" column="interrupt" />
|
||||
<result property="uti" column="uti" />
|
||||
<result property="num" column="num" />
|
||||
<result property="cores" column="cores" />
|
||||
<result property="normal" column="normal" />
|
||||
<result property="idle" column="idle" />
|
||||
<result property="iowait" column="iowait" />
|
||||
@@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInitialCpuInfoVo">
|
||||
select id, client_id, avg1, avg5, avg15, interrupt, uti, num, normal, idle, iowait, system, noresp, user, create_by, update_by, create_time, update_time from initial_cpu_info
|
||||
select id, client_id, avg1, avg5, avg15, interrupt, uti, num, cores, normal, idle, iowait, system, noresp, user, create_by, update_by, create_time, update_time from initial_cpu_info
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialCpuInfoList" parameterType="InitialCpuInfo" resultMap="InitialCpuInfoResult">
|
||||
@@ -54,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="interrupt != null">interrupt,</if>
|
||||
<if test="uti != null">uti,</if>
|
||||
<if test="num != null">num,</if>
|
||||
<if test="cores != null">cores,</if>
|
||||
<if test="normal != null">normal,</if>
|
||||
<if test="idle != null">idle,</if>
|
||||
<if test="iowait != null">iowait,</if>
|
||||
@@ -73,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="interrupt != null">#{interrupt},</if>
|
||||
<if test="uti != null">#{uti},</if>
|
||||
<if test="num != null">#{num},</if>
|
||||
<if test="cores != null">#{cores},</if>
|
||||
<if test="normal != null">#{normal},</if>
|
||||
<if test="idle != null">#{idle},</if>
|
||||
<if test="iowait != null">#{iowait},</if>
|
||||
@@ -96,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="interrupt != null">interrupt = #{interrupt},</if>
|
||||
<if test="uti != null">uti = #{uti},</if>
|
||||
<if test="num != null">num = #{num},</if>
|
||||
<if test="cores != null">cores = #{cores},</if>
|
||||
<if test="normal != null">normal = #{normal},</if>
|
||||
<if test="idle != null">idle = #{idle},</if>
|
||||
<if test="iowait != null">iowait = #{iowait},</if>
|
||||
@@ -121,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertInitialCpuInfo" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
<insert id="batchInsertInitialCpuInfo" parameterType="java.util.List">
|
||||
INSERT IGNORE INTO initial_cpu_info
|
||||
(
|
||||
client_id,
|
||||
@@ -131,6 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
interrupt,
|
||||
uti,
|
||||
num,
|
||||
cores,
|
||||
normal,
|
||||
idle,
|
||||
iowait,
|
||||
@@ -152,6 +157,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{item.interrupt},
|
||||
#{item.uti},
|
||||
#{item.num},
|
||||
#{item.cores},
|
||||
#{item.normal},
|
||||
#{item.idle},
|
||||
#{item.iowait},
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
<?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.RmPppoeConfigMainMapper">
|
||||
|
||||
<resultMap type="RmPppoeConfigMain" id="RmPppoeConfigMainResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="pppoeEnabled" column="pppoe_enabled" />
|
||||
<result property="pppoeConfigMode" column="pppoe_config_mode" />
|
||||
<result property="pppoeInterface" column="pppoe_interface" />
|
||||
<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="selectRmPppoeConfigMainVo">
|
||||
select id, client_id, pppoe_enabled, pppoe_config_mode, pppoe_interface, create_time, update_time, create_by, update_by from rm_pppoe_config_main
|
||||
</sql>
|
||||
|
||||
<select id="selectRmPppoeConfigMainList" parameterType="RmPppoeConfigMain" resultMap="RmPppoeConfigMainResult">
|
||||
<include refid="selectRmPppoeConfigMainVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="pppoeEnabled != null "> and pppoe_enabled = #{pppoeEnabled}</if>
|
||||
<if test="pppoeConfigMode != null and pppoeConfigMode != ''"> and pppoe_config_mode = #{pppoeConfigMode}</if>
|
||||
<if test="pppoeInterface != null and pppoeInterface != ''"> and pppoe_interface = #{pppoeInterface}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmPppoeConfigMainById" parameterType="Long" resultMap="RmPppoeConfigMainResult">
|
||||
<include refid="selectRmPppoeConfigMainVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmPppoeConfigMain" parameterType="RmPppoeConfigMain" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_pppoe_config_main
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null">client_id,</if>
|
||||
<if test="pppoeEnabled != null">pppoe_enabled,</if>
|
||||
<if test="pppoeConfigMode != null">pppoe_config_mode,</if>
|
||||
<if test="pppoeInterface != null">pppoe_interface,</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">#{clientId},</if>
|
||||
<if test="pppoeEnabled != null">#{pppoeEnabled},</if>
|
||||
<if test="pppoeConfigMode != null">#{pppoeConfigMode},</if>
|
||||
<if test="pppoeInterface != null">#{pppoeInterface},</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>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
<trim suffixOverrides=",">
|
||||
<if test="pppoeEnabled != null">pppoe_enabled = VALUES(pppoe_enabled),</if>
|
||||
<if test="pppoeConfigMode != null">pppoe_config_mode = VALUES(pppoe_config_mode),</if>
|
||||
<if test="pppoeInterface != null">pppoe_interface = VALUES(pppoe_interface),</if>
|
||||
<if test="updateTime != null">update_time = VALUES(update_time),</if>
|
||||
<if test="updateBy != null">update_by = VALUES(update_by),</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmPppoeConfigMain" parameterType="RmPppoeConfigMain">
|
||||
update rm_pppoe_config_main
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null">client_id = #{clientId},</if>
|
||||
<if test="pppoeEnabled != null">pppoe_enabled = #{pppoeEnabled},</if>
|
||||
<if test="pppoeConfigMode != null">pppoe_config_mode = #{pppoeConfigMode},</if>
|
||||
<if test="pppoeInterface != null">pppoe_interface = #{pppoeInterface},</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="deleteRmPppoeConfigMainById" parameterType="Long">
|
||||
delete from rm_pppoe_config_main where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmPppoeConfigMainByIds" parameterType="String">
|
||||
delete from rm_pppoe_config_main where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,119 @@
|
||||
<?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">
|
||||
|
||||
<resultMap type="RmPppoeConfigSub" id="RmPppoeConfigSubResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="mainId" column="main_id" />
|
||||
<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" />
|
||||
<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="selectRmPppoeConfigSubVo">
|
||||
select id, main_id, serial_number, vlan_id, ipv4_address, ipv4_mask_bits, ipv4_gateway, create_time, update_time, create_by, update_by from rm_pppoe_config_sub
|
||||
</sql>
|
||||
|
||||
<select id="selectRmPppoeConfigSubList" parameterType="RmPppoeConfigSub" resultMap="RmPppoeConfigSubResult">
|
||||
<include refid="selectRmPppoeConfigSubVo"/>
|
||||
<where>
|
||||
<if test="mainId != null "> and main_id = #{mainId}</if>
|
||||
<if test="serialNumber != null "> and serial_number = #{serialNumber}</if>
|
||||
<if test="vlanId != null "> and vlan_id = #{vlanId}</if>
|
||||
<if test="ipv4Address != null and ipv4Address != ''"> and ipv4_address = #{ipv4Address}</if>
|
||||
<if test="ipv4MaskBits != null "> and ipv4_mask_bits = #{ipv4MaskBits}</if>
|
||||
<if test="ipv4Gateway != null and ipv4Gateway != ''"> and ipv4_gateway = #{ipv4Gateway}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<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="mainId != null">main_id,</if>
|
||||
<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>
|
||||
<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="mainId != null">#{mainId},</if>
|
||||
<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>
|
||||
<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="updateRmPppoeConfigSub" parameterType="RmPppoeConfigSub">
|
||||
update rm_pppoe_config_sub
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="mainId != null">main_id = #{mainId},</if>
|
||||
<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>
|
||||
<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="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
|
||||
(main_id, serial_number, vlan_id, ipv4_address, ipv4_mask_bits, ipv4_gateway, create_time, update_time, create_by, update_by)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.mainId},
|
||||
#{item.serialNumber},
|
||||
#{item.vlanId},
|
||||
#{item.ipv4Address},
|
||||
#{item.ipv4MaskBits},
|
||||
#{item.ipv4Gateway},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.createBy},
|
||||
#{item.updateBy}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<delete id="deleteRmPppoeConfigSubByMainId" parameterType="Long">
|
||||
delete from rm_pppoe_config_sub where main_id = #{mainId}
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user