优化查看脚本执行结果、mtragent管理初版

This commit is contained in:
gaoyutao
2025-11-18 18:21:04 +08:00
parent bd65b27605
commit c91504912b
42 changed files with 2975 additions and 0 deletions
@@ -0,0 +1,81 @@
<?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.mtragent.mapper.InitialHeartbeatListenLogMapper">
<resultMap type="InitialHeartbeatListenLog" id="InitialHeartbeatListenLogResult">
<result property="id" column="id" />
<result property="clientId" column="client_id" />
<result property="status" column="status" />
<result property="remark" column="remark" />
<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="selectInitialHeartbeatListenLogVo">
select id, client_id, status, remark, create_time, update_time, create_by, update_by from initial_heartbeat_listen_log
</sql>
<select id="selectInitialHeartbeatListenLogList" parameterType="InitialHeartbeatListenLog" resultMap="InitialHeartbeatListenLogResult">
<include refid="selectInitialHeartbeatListenLogVo"/>
<where>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectInitialHeartbeatListenLogById" parameterType="Long" resultMap="InitialHeartbeatListenLogResult">
<include refid="selectInitialHeartbeatListenLogVo"/>
where id = #{id}
</select>
<insert id="insertInitialHeartbeatListenLog" parameterType="InitialHeartbeatListenLog" useGeneratedKeys="true" keyProperty="id">
insert into initial_heartbeat_listen_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clientId != null">client_id,</if>
<if test="status != null">status,</if>
<if test="remark != null">remark,</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="status != null">#{status},</if>
<if test="remark != null">#{remark},</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="updateInitialHeartbeatListenLog" parameterType="InitialHeartbeatListenLog">
update initial_heartbeat_listen_log
<trim prefix="SET" suffixOverrides=",">
<if test="clientId != null">client_id = #{clientId},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</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="deleteInitialHeartbeatListenLogById" parameterType="Long">
delete from initial_heartbeat_listen_log where id = #{id}
</delete>
<delete id="deleteInitialHeartbeatListenLogByIds" parameterType="String">
delete from initial_heartbeat_listen_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
@@ -0,0 +1,102 @@
<?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.mtragent.mapper.RmAlarmLogMapper">
<resultMap type="RmAlarmLog" id="RmAlarmLogResult">
<result property="id" column="id" />
<result property="clientId" column="client_id" />
<result property="alarmTime" column="alarm_time" />
<result property="mgmPublicIp" column="mgm_public_ip" />
<result property="alarmType" column="alarm_type" />
<result property="alarmContent" column="alarm_content" />
<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="selectRmAlarmLogVo">
select id, client_id, alarm_time, mgm_public_ip, alarm_type, alarm_content, create_time, update_time, create_by, update_by from rm_alarm_log
</sql>
<select id="selectRmAlarmLogList" parameterType="RmAlarmLog" resultMap="RmAlarmLogResult">
<include refid="selectRmAlarmLogVo"/>
<where>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
<if test="alarmTime != null "> and alarm_time = #{alarmTime}</if>
<if test="mgmPublicIp != null and mgmPublicIp != ''"> and mgm_public_ip = #{mgmPublicIp}</if>
<if test="alarmType != null and alarmType != ''"> and alarm_type = #{alarmType}</if>
<if test="alarmContent != null and alarmContent != ''"> and alarm_content = #{alarmContent}</if>
</where>
order by alarm_time desc
</select>
<select id="selectRmAlarmLogById" parameterType="Long" resultMap="RmAlarmLogResult">
<include refid="selectRmAlarmLogVo"/>
where id = #{id}
</select>
<insert id="insertRmAlarmLog" parameterType="RmAlarmLog" useGeneratedKeys="true" keyProperty="id">
insert into rm_alarm_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">client_id,</if>
<if test="alarmTime != null">alarm_time,</if>
<if test="mgmPublicIp != null">mgm_public_ip,</if>
<if test="alarmType != null">alarm_type,</if>
<if test="alarmContent != null">alarm_content,</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="alarmTime != null">#{alarmTime},</if>
<if test="mgmPublicIp != null">#{mgmPublicIp},</if>
<if test="alarmType != null">#{alarmType},</if>
<if test="alarmContent != null">#{alarmContent},</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="updateRmAlarmLog" parameterType="RmAlarmLog">
update rm_alarm_log
<trim prefix="SET" suffixOverrides=",">
<if test="mgmPublicIp != null">mgm_public_ip = #{mgmPublicIp},</if>
<if test="alarmContent != null">alarm_content = #{alarmContent},</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>
<choose>
<when test="id != null">
and id = #[id]
</when>
<when test="clientId != null and alarmType != null">
and client_id = #{clientId} and alarm_type = #{alarmType}
</when>
<otherwise>
and 1=0
</otherwise>
</choose>
</where>
</update>
<delete id="deleteRmAlarmLogById" parameterType="Long">
delete from rm_alarm_log where id = #{id}
</delete>
<delete id="deleteRmAlarmLogByIds" parameterType="String">
delete from rm_alarm_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
@@ -0,0 +1,97 @@
<?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.mtragent.mapper.RmAlarmPushConfigMapper">
<resultMap type="RmAlarmPushConfig" id="RmAlarmPushConfigResult">
<result property="id" column="id" />
<result property="configName" column="config_name" />
<result property="pushMethod" column="push_method" />
<result property="pushAddress" column="push_address" />
<result property="pushAlarmTypes" column="push_alarm_types" />
<result property="messageContent" column="message_content" />
<result property="contactPhones" column="contact_phones" />
<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="selectRmAlarmPushConfigVo">
select id, config_name, push_method, push_address, push_alarm_types, message_content, contact_phones, create_time, update_time, create_by, update_by from rm_alarm_push_config
</sql>
<select id="selectRmAlarmPushConfigList" parameterType="RmAlarmPushConfig" resultMap="RmAlarmPushConfigResult">
<include refid="selectRmAlarmPushConfigVo"/>
<where>
<if test="configName != null and configName != ''"> and config_name like concat('%', #{configName}, '%')</if>
<if test="pushMethod != null and pushMethod != ''"> and push_method = #{pushMethod}</if>
<if test="pushAddress != null and pushAddress != ''"> and push_address = #{pushAddress}</if>
<if test="pushAlarmTypes != null and pushAlarmTypes != ''"> and push_alarm_types = #{pushAlarmTypes}</if>
<if test="messageContent != null and messageContent != ''"> and message_content = #{messageContent}</if>
<if test="contactPhones != null and contactPhones != ''"> and contact_phones = #{contactPhones}</if>
</where>
</select>
<select id="selectRmAlarmPushConfigById" parameterType="Long" resultMap="RmAlarmPushConfigResult">
<include refid="selectRmAlarmPushConfigVo"/>
where id = #{id}
</select>
<insert id="insertRmAlarmPushConfig" parameterType="RmAlarmPushConfig" useGeneratedKeys="true" keyProperty="id">
insert into rm_alarm_push_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="configName != null and configName != ''">config_name,</if>
<if test="pushMethod != null and pushMethod != ''">push_method,</if>
<if test="pushAddress != null and pushAddress != ''">push_address,</if>
<if test="pushAlarmTypes != null">push_alarm_types,</if>
<if test="messageContent != null">message_content,</if>
<if test="contactPhones != null">contact_phones,</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="configName != null and configName != ''">#{configName},</if>
<if test="pushMethod != null and pushMethod != ''">#{pushMethod},</if>
<if test="pushAddress != null and pushAddress != ''">#{pushAddress},</if>
<if test="pushAlarmTypes != null">#{pushAlarmTypes},</if>
<if test="messageContent != null">#{messageContent},</if>
<if test="contactPhones != null">#{contactPhones},</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="updateRmAlarmPushConfig" parameterType="RmAlarmPushConfig">
update rm_alarm_push_config
<trim prefix="SET" suffixOverrides=",">
<if test="configName != null and configName != ''">config_name = #{configName},</if>
<if test="pushMethod != null and pushMethod != ''">push_method = #{pushMethod},</if>
<if test="pushAddress != null and pushAddress != ''">push_address = #{pushAddress},</if>
<if test="pushAlarmTypes != null">push_alarm_types = #{pushAlarmTypes},</if>
<if test="messageContent != null">message_content = #{messageContent},</if>
<if test="contactPhones != null">contact_phones = #{contactPhones},</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="deleteRmAlarmPushConfigById" parameterType="Long">
delete from rm_alarm_push_config where id = #{id}
</delete>
<delete id="deleteRmAlarmPushConfigByIds" parameterType="String">
delete from rm_alarm_push_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
@@ -0,0 +1,159 @@
<?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.mtragent.mapper.RmMtrClientRegistrationMapper">
<resultMap type="RmMtrClientRegistration" id="RmMtrClientRegistrationResult">
<result property="id" column="id" />
<result property="mtrClientId" column="mtr_client_id" />
<result property="description" column="description" />
<result property="version" column="version" />
<result property="logicalNode" column="logical_node" />
<result property="registerTime" column="register_time" />
<result property="registerStatus" column="register_status" />
<result property="onlineStatus" column="online_status" />
<result property="heartbeatInterval" column="heartbeat_interval" />
<result property="heartbeatCount" column="heartbeat_count" />
<result property="method" column="method" />
<result property="scheduledUpdateTime" column="scheduled_update_time" />
<result property="filePath" column="file_path" />
<result property="fileMd5" column="file_md5" />
<result property="lastUpdateResult" column="last_update_result" />
<result property="lastUpdateTime" column="last_update_time" />
<result property="networkInfo" column="network_info" />
<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="selectRmMtrClientRegistrationVo">
select id, mtr_client_id, description, version, logical_node, register_time, register_status, online_status, heartbeat_interval, heartbeat_count, method, scheduled_update_time, file_path, file_md5, last_update_result, last_update_time, network_info, create_time, update_time, create_by, update_by from rm_mtr_client_registration
</sql>
<select id="selectRmMtrClientRegistrationList" parameterType="RmMtrClientRegistration" resultMap="RmMtrClientRegistrationResult">
<include refid="selectRmMtrClientRegistrationVo"/>
<where>
<if test="mtrClientId != null and mtrClientId != ''"> and mtr_client_id = #{mtrClientId}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="version != null and version != ''"> and version = #{version}</if>
<if test="logicalNode != null and logicalNode != ''"> and logical_node = #{logicalNode}</if>
<if test="registerTime != null "> and register_time = #{registerTime}</if>
<if test="registerStatus != null and registerStatus != ''"> and register_status = #{registerStatus}</if>
<if test="onlineStatus != null and onlineStatus != ''"> and online_status = #{onlineStatus}</if>
<if test="heartbeatInterval != null "> and heartbeat_interval = #{heartbeatInterval}</if>
<if test="heartbeatCount != null "> and heartbeat_count = #{heartbeatCount}</if>
<if test="method != null and method != ''"> and method = #{method}</if>
<if test="scheduledUpdateTime != null and scheduledUpdateTime != ''"> and scheduled_update_time = #{scheduledUpdateTime}</if>
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
<if test="fileMd5 != null and fileMd5 != ''"> and file_md5 = #{fileMd5}</if>
<if test="lastUpdateResult != null and lastUpdateResult != ''"> and last_update_result = #{lastUpdateResult}</if>
<if test="lastUpdateTime != null "> and last_update_time = #{lastUpdateTime}</if>
<if test="networkInfo != null and networkInfo != ''"> and network_info = #{networkInfo}</if>
</where>
</select>
<select id="selectRmMtrClientRegistrationById" parameterType="Long" resultMap="RmMtrClientRegistrationResult">
<include refid="selectRmMtrClientRegistrationVo"/>
where id = #{id}
</select>
<insert id="insertRmMtrClientRegistration" parameterType="RmMtrClientRegistration" useGeneratedKeys="true" keyProperty="id">
insert into rm_mtr_client_registration
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mtrClientId != null and mtrClientId != ''">mtr_client_id,</if>
<if test="description != null">description,</if>
<if test="version != null and version != ''">version,</if>
<if test="logicalNode != null">logical_node,</if>
<if test="registerTime != null">register_time,</if>
<if test="registerStatus != null and registerStatus != ''">register_status,</if>
<if test="onlineStatus != null and onlineStatus != ''">online_status,</if>
<if test="heartbeatInterval != null">heartbeat_interval,</if>
<if test="heartbeatCount != null">heartbeat_count,</if>
<if test="method != null">method,</if>
<if test="scheduledUpdateTime != null">scheduled_update_time,</if>
<if test="filePath != null">file_path,</if>
<if test="fileMd5 != null">file_md5,</if>
<if test="lastUpdateResult != null">last_update_result,</if>
<if test="lastUpdateTime != null">last_update_time,</if>
<if test="networkInfo != null">network_info,</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="mtrClientId != null and mtrClientId != ''">#{mtrClientId},</if>
<if test="description != null">#{description},</if>
<if test="version != null and version != ''">#{version},</if>
<if test="logicalNode != null">#{logicalNode},</if>
<if test="registerTime != null">#{registerTime},</if>
<if test="registerStatus != null and registerStatus != ''">#{registerStatus},</if>
<if test="onlineStatus != null and onlineStatus != ''">#{onlineStatus},</if>
<if test="heartbeatInterval != null">#{heartbeatInterval},</if>
<if test="heartbeatCount != null">#{heartbeatCount},</if>
<if test="method != null">#{method},</if>
<if test="scheduledUpdateTime != null">#{scheduledUpdateTime},</if>
<if test="filePath != null">#{filePath},</if>
<if test="fileMd5 != null">#{fileMd5},</if>
<if test="lastUpdateResult != null">#{lastUpdateResult},</if>
<if test="lastUpdateTime != null">#{lastUpdateTime},</if>
<if test="networkInfo != null">#{networkInfo},</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="updateRmMtrClientRegistration" parameterType="RmMtrClientRegistration">
update rm_mtr_client_registration
<trim prefix="SET" suffixOverrides=",">
<if test="mtrClientId != null and mtrClientId != ''">mtr_client_id = #{mtrClientId},</if>
<if test="description != null">description = #{description},</if>
<if test="version != null and version != ''">version = #{version},</if>
<if test="logicalNode != null">logical_node = #{logicalNode},</if>
<if test="registerTime != null">register_time = #{registerTime},</if>
<if test="registerStatus != null and registerStatus != ''">register_status = #{registerStatus},</if>
<if test="onlineStatus != null and onlineStatus != ''">online_status = #{onlineStatus},</if>
<if test="heartbeatInterval != null">heartbeat_interval = #{heartbeatInterval},</if>
<if test="heartbeatCount != null">heartbeat_count = #{heartbeatCount},</if>
<if test="method != null">method = #{method},</if>
<if test="scheduledUpdateTime != null">scheduled_update_time = #{scheduledUpdateTime},</if>
<if test="filePath != null">file_path = #{filePath},</if>
<if test="fileMd5 != null">file_md5 = #{fileMd5},</if>
<if test="lastUpdateResult != null">last_update_result = #{lastUpdateResult},</if>
<if test="lastUpdateTime != null">last_update_time = #{lastUpdateTime},</if>
<if test="networkInfo != null">network_info = #{networkInfo},</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>
<choose>
<when test="id != null">
and id=#{id}
</when>
<when test="mtrClientId">
and mtr_client_id = #{mtrClientId}
</when>
<otherwise>
and 1=0
</otherwise>
</choose>
</where>
</update>
<delete id="deleteRmMtrClientRegistrationById" parameterType="Long">
delete from rm_mtr_client_registration where id = #{id}
</delete>
<delete id="deleteRmMtrClientRegistrationByIds" parameterType="String">
delete from rm_mtr_client_registration where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
@@ -0,0 +1,112 @@
<?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.mtragent.mapper.RmMtrPolicyConfigMapper">
<resultMap type="RmMtrPolicyConfig" id="RmMtrPolicyConfigResult">
<result property="id" column="id" />
<result property="policyName" column="policy_name" />
<result property="priority" column="priority" />
<result property="mtrClientId" column="mtr_client_id" />
<result property="serverGroup" column="server_group" />
<result property="serveripGroup" column="serverip_group" />
<result property="probeFlag" column="probe_flag" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="probeFrequency" column="probe_frequency" />
<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="selectRmMtrPolicyConfigVo">
select id, policy_name, priority, mtr_client_id, server_group, serverip_group, probe_flag, start_time, end_time, probe_frequency, create_time, update_time, create_by, update_by from rm_mtr_policy_config
</sql>
<select id="selectRmMtrPolicyConfigList" parameterType="RmMtrPolicyConfig" resultMap="RmMtrPolicyConfigResult">
<include refid="selectRmMtrPolicyConfigVo"/>
<where>
<if test="policyName != null and policyName != ''"> and policy_name like concat('%', #{policyName}, '%')</if>
<if test="priority != null "> and priority = #{priority}</if>
<if test="mtrClientId != null and mtrClientId != ''"> and mtr_client_id = #{mtrClientId}</if>
<if test="serverGroup != null and serverGroup != ''"> and server_group = #{serverGroup}</if>
<if test="serveripGroup != null and serveripGroup != ''"> and serverip_group = #{serveripGroup}</if>
<if test="probeFlag != null "> and probe_flag = #{probeFlag}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="probeFrequency != null "> and probe_frequency = #{probeFrequency}</if>
</where>
</select>
<select id="selectRmMtrPolicyConfigById" parameterType="Long" resultMap="RmMtrPolicyConfigResult">
<include refid="selectRmMtrPolicyConfigVo"/>
where id = #{id}
</select>
<insert id="insertRmMtrPolicyConfig" parameterType="RmMtrPolicyConfig" useGeneratedKeys="true" keyProperty="id">
insert into rm_mtr_policy_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="policyName != null and policyName != ''">policy_name,</if>
<if test="priority != null">priority,</if>
<if test="mtrClientId != null and mtrClientId != ''">mtr_client_id,</if>
<if test="serverGroup != null">server_group,</if>
<if test="serveripGroup != null">serverip_group,</if>
<if test="probeFlag != null">probe_flag,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="probeFrequency != null">probe_frequency,</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="policyName != null and policyName != ''">#{policyName},</if>
<if test="priority != null">#{priority},</if>
<if test="mtrClientId != null and mtrClientId != ''">#{mtrClientId},</if>
<if test="serverGroup != null">#{serverGroup},</if>
<if test="serveripGroup != null">#{serveripGroup},</if>
<if test="probeFlag != null">#{probeFlag},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="probeFrequency != null">#{probeFrequency},</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="updateRmMtrPolicyConfig" parameterType="RmMtrPolicyConfig">
update rm_mtr_policy_config
<trim prefix="SET" suffixOverrides=",">
<if test="policyName != null and policyName != ''">policy_name = #{policyName},</if>
<if test="priority != null">priority = #{priority},</if>
<if test="mtrClientId != null and mtrClientId != ''">mtr_client_id = #{mtrClientId},</if>
<if test="serverGroup != null">server_group = #{serverGroup},</if>
<if test="serveripGroup != null">serverip_group = #{serveripGroup},</if>
<if test="probeFlag != null">probe_flag = #{probeFlag},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="probeFrequency != null">probe_frequency = #{probeFrequency},</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="deleteRmMtrPolicyConfigById" parameterType="Long">
delete from rm_mtr_policy_config where id = #{id}
</delete>
<delete id="deleteRmMtrPolicyConfigByIds" parameterType="String">
delete from rm_mtr_policy_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
@@ -0,0 +1,148 @@
<?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.mtragent.mapper.RmNetworkInterfaceMapper">
<resultMap type="RmNetworkInterface" id="RmNetworkInterfaceResult">
<result property="id" column="id" />
<result property="clientId" column="client_id" />
<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="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="selectRmNetworkInterfaceVo">
select id, client_id, isp, province, city, public_ip, interface_name, mac_address, interface_type, ipv4_address, gateway, create_time, update_time, create_by, update_by, bind_ip, new_flag from rm_network_interface
</sql>
<select id="selectRmNetworkInterfaceList" parameterType="RmNetworkInterface" resultMap="RmNetworkInterfaceResult">
<include refid="selectRmNetworkInterfaceVo"/>
<where>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</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="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="selectRmNetworkInterfaceById" parameterType="Long" resultMap="RmNetworkInterfaceResult">
<include refid="selectRmNetworkInterfaceVo"/>
where id = #{id}
</select>
<insert id="insertRmNetworkInterface" parameterType="RmNetworkInterface" useGeneratedKeys="true" keyProperty="id">
insert into rm_network_interface
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">client_id,</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 and interfaceName != ''">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="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 and clientId != ''">#{clientId},</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 and interfaceName != ''">#{interfaceName},</if>
<if test="macAddress != null">#{macAddress},</if>
<if test="interfaceType != null">#{interfaceType},</if>
<if test="ipv4Address != null">#{ipv4Address},</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="updateRmNetworkInterface" parameterType="RmNetworkInterface">
update rm_network_interface
<trim prefix="SET" suffixOverrides=",">
<if test="clientId != null and clientId != ''">client_id = #{clientId},</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 and interfaceName != ''">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="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 id = #{id}
</update>
<delete id="deleteRmNetworkInterfaceById" parameterType="Long">
delete from rm_network_interface where id = #{id}
</delete>
<delete id="deleteRmNetworkInterfaceByIds" parameterType="String">
delete from rm_network_interface where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="updateRmNetworkInterfaceByMac" parameterType="RmNetworkInterface">
update rm_network_interface
<trim prefix="SET" suffixOverrides=",">
<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 and interfaceName != ''">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="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 mac_address = #{macAddress} and clientId = #{clientId}
</update>
</mapper>