测试环境配置、新增mtr探测丢包率结果存储方法
This commit is contained in:
+131
@@ -0,0 +1,131 @@
|
||||
<?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.RmMtrProbeResultMapper">
|
||||
|
||||
<resultMap type="RmMtrProbeResult" id="RmMtrProbeResultResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="mtrClientId" column="mtr_client_id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="publicIp" column="public_ip" />
|
||||
<result property="packetLossRate" column="packet_loss_rate" />
|
||||
<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="selectRmMtrProbeResultVo">
|
||||
select id, mtr_client_id, client_id, public_ip, packet_loss_rate, create_time, update_time, create_by, update_by from rm_mtr_probe_result
|
||||
</sql>
|
||||
|
||||
<select id="selectRmMtrProbeResultList" parameterType="RmMtrProbeResult" resultMap="RmMtrProbeResultResult">
|
||||
<include refid="selectRmMtrProbeResultVo"/>
|
||||
<where>
|
||||
<if test="mtrClientId != null and mtrClientId != ''"> and mtr_client_id = #{mtrClientId}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="publicIp != null and publicIp != ''"> and public_ip = #{publicIp}</if>
|
||||
<if test="packetLossRate != null "> and packet_loss_rate = #{packetLossRate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmMtrProbeResultById" parameterType="Long" resultMap="RmMtrProbeResultResult">
|
||||
<include refid="selectRmMtrProbeResultVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmMtrProbeResult" parameterType="RmMtrProbeResult" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_mtr_probe_result
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="mtrClientId != null and mtrClientId != ''">mtr_client_id,</if>
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="publicIp != null and publicIp != ''">public_ip,</if>
|
||||
<if test="packetLossRate != null">packet_loss_rate,</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="clientId != null and clientId != ''">#{clientId},</if>
|
||||
<if test="publicIp != null and publicIp != ''">#{publicIp},</if>
|
||||
<if test="packetLossRate != null">#{packetLossRate},</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="updateRmMtrProbeResult" parameterType="RmMtrProbeResult">
|
||||
update rm_mtr_probe_result
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="mtrClientId != null and mtrClientId != ''">mtr_client_id = #{mtrClientId},</if>
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="publicIp != null and publicIp != ''">public_ip = #{publicIp},</if>
|
||||
<if test="packetLossRate != null">packet_loss_rate = #{packetLossRate},</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="deleteRmMtrProbeResultById" parameterType="Long">
|
||||
delete from rm_mtr_probe_result where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmMtrProbeResultByIds" parameterType="String">
|
||||
delete from rm_mtr_probe_result where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<insert id="batchInsertRmMtrProbeResult" parameterType="RmMtrProbeResult">
|
||||
INSERT INTO ${tableName}
|
||||
(
|
||||
mtr_client_id,
|
||||
client_id,
|
||||
public_ip,
|
||||
packet_loss_rate,
|
||||
create_time,
|
||||
update_time
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.mtrClientId},
|
||||
#{item.clientId},
|
||||
#{item.publicIp},
|
||||
#{item.packetLossRate},
|
||||
#{item.createTime},
|
||||
#{item.updateTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 在 RmMtrProbeResultMapper.xml 中添加 -->
|
||||
<select id="selectByCondition" parameterType="RmMtrProbeResult" resultMap="RmMtrProbeResultResult">
|
||||
SELECT
|
||||
id, mtr_client_id, client_id, public_ip, packet_loss_rate,
|
||||
create_time, update_time, create_by, update_by
|
||||
FROM ${tableName}
|
||||
<where>
|
||||
<if test="mtrClientId != null and mtrClientId != ''">
|
||||
AND mtr_client_id = #{mtrClientId}
|
||||
</if>
|
||||
<if test="clientId != null and clientId != ''">
|
||||
AND client_id = #{clientId}
|
||||
</if>
|
||||
<!-- 时间范围查询 -->
|
||||
<if test="startTime != null">
|
||||
AND create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
AND create_time <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user