优化交换机分表、新增丢包率clientId记录
This commit is contained in:
+92
@@ -0,0 +1,92 @@
|
||||
<?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.AllMtrClientMapper">
|
||||
|
||||
<resultMap type="AllMtrClient" id="AllMtrClientResult">
|
||||
<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="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="selectAllMtrClientVo">
|
||||
select id, mtr_client_id, client_id, public_ip, create_time, update_time, create_by, update_by from all_mtr_client
|
||||
</sql>
|
||||
|
||||
<select id="selectAllMtrClientList" parameterType="AllMtrClient" resultMap="AllMtrClientResult">
|
||||
<include refid="selectAllMtrClientVo"/>
|
||||
<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>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAllMtrClientById" parameterType="Long" resultMap="AllMtrClientResult">
|
||||
<include refid="selectAllMtrClientVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAllMtrClient" parameterType="AllMtrClient" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into all_mtr_client
|
||||
<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="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="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="updateAllMtrClient" parameterType="AllMtrClient">
|
||||
update all_mtr_client
|
||||
<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="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="deleteAllMtrClientById" parameterType="Long">
|
||||
delete from all_mtr_client where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAllMtrClientByIds" parameterType="String">
|
||||
delete from all_mtr_client where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<insert id="batchInsertAllMtrClient" parameterType="java.util.List">
|
||||
insert into all_mtr_client
|
||||
(mtr_client_id, client_id, public_ip, create_by, update_by)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.mtrClientId}, #{item.clientId}, #{item.publicIp}, #{item.createBy}, #{item.updateBy})
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
public_ip = IF(VALUES(public_ip) != public_ip, VALUES(public_ip), public_ip)
|
||||
</insert>
|
||||
</mapper>
|
||||
+22
@@ -52,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="lastUpdateTime != null "> and last_update_time = #{lastUpdateTime}</if>
|
||||
<if test="networkInfo != null and networkInfo != ''"> and network_info = #{networkInfo}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectRmMtrClientRegistrationById" parameterType="Long" resultMap="RmMtrClientRegistrationResult">
|
||||
@@ -156,4 +157,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="getAllLogicalNode" parameterType="RmMtrClientRegistration" resultMap="RmMtrClientRegistrationResult">
|
||||
<include refid="selectRmMtrClientRegistrationVo"/>
|
||||
<where>
|
||||
and logical_node != ''
|
||||
</where>
|
||||
group by logical_node
|
||||
</select>
|
||||
<select id="getMsgByMtrClientId" 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>
|
||||
</where>
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user