初始化v1.2
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
# Tomcat
|
||||
server:
|
||||
port: 9207
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: tongran-rocketmq
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 172.16.15.52:8848
|
||||
# server-addr: 172.16.15.103:8848
|
||||
namespace: ${spring.cloud.nacos.config.namespace}
|
||||
username: ${spring.cloud.nacos.config.username}
|
||||
password: ${spring.cloud.nacos.config.password}
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 172.16.15.52:8848
|
||||
# server-addr: 172.16.15.103:8848
|
||||
# namespace: saas-local
|
||||
namespace: public
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
redisson:
|
||||
singleServerConfig:
|
||||
address: redis://localhost:6379
|
||||
logging:
|
||||
level:
|
||||
com.tongran.app.mapper: DEBUG
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/tongran-rocketmq" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- RocketMQ业务日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- RocketMQ错误日志输出 -->
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- RocketMQ模块日志级别控制 -->
|
||||
<logger name="com.tongran.rocketmq" level="info" additivity="false">
|
||||
<appender-ref ref="console" /> <!-- 显式添加控制台 -->
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</logger>
|
||||
|
||||
<!-- Apache RocketMQ客户端日志控制 -->
|
||||
<logger name="org.apache.rocketmq" level="warn" />
|
||||
|
||||
<!-- Spring RocketMQ相关日志 -->
|
||||
<logger name="org.springframework.messaging" level="warn" />
|
||||
|
||||
<!-- 根日志配置 -->
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
</configuration>
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
<?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.InitialBandwidthTrafficMapper">
|
||||
|
||||
<resultMap type="InitialBandwidthTraffic" id="InitialBandwidthTrafficResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="mac" column="mac"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="ipV4" column="ipV4"/>
|
||||
<result property="inDropped" column="in_dropped"/>
|
||||
<result property="outDropped" column="out_dropped"/>
|
||||
<result property="inSpeed" column="in_speed"/>
|
||||
<result property="outSpeed" column="out_speed"/>
|
||||
<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="clientId" column="client_id"/>
|
||||
<result property="speed" column="speed"/>
|
||||
<result property="duplex" column="duplex"/>
|
||||
</resultMap>
|
||||
<sql id="selectInitialBandwidthTrafficVo"> select id, name, mac, status, type, ipV4, in_dropped, out_dropped, in_speed, out_speed, create_time, update_time, create_by, update_by, client_id from initial_bandwidth_traffic </sql>
|
||||
<select id="selectInitialBandwidthTrafficList" parameterType="InitialBandwidthTraffic" resultMap="InitialBandwidthTrafficResult">
|
||||
<include refid="selectInitialBandwidthTrafficVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="mac != null and mac != ''"> and mac = #{mac}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="ipV4 != null and ipV4 != ''"> and ipV4 = #{ipV4}</if>
|
||||
<if test="inDropped != null "> and in_dropped = #{inDropped}</if>
|
||||
<if test="outDropped != null "> and out_dropped = #{outDropped}</if>
|
||||
<if test="inSpeed != null and inSpeed != ''"> and in_speed = #{inSpeed}</if>
|
||||
<if test="outSpeed != null and outSpeed != ''"> and out_speed = #{outSpeed}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectInitialBandwidthTrafficById" parameterType="Long" resultMap="InitialBandwidthTrafficResult">
|
||||
<include refid="selectInitialBandwidthTrafficVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<insert id="insertInitialBandwidthTraffic" parameterType="InitialBandwidthTraffic" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into initial_bandwidth_traffic
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="mac != null">mac,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="ipV4 != null">ipV4,</if>
|
||||
<if test="inDropped != null">in_dropped,</if>
|
||||
<if test="outDropped != null">out_dropped,</if>
|
||||
<if test="inSpeed != null">in_speed,</if>
|
||||
<if test="outSpeed != null">out_speed,</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="clientId != null">client_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="mac != null">#{mac},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="ipV4 != null">#{ipV4},</if>
|
||||
<if test="inDropped != null">#{inDropped},</if>
|
||||
<if test="outDropped != null">#{outDropped},</if>
|
||||
<if test="inSpeed != null">#{inSpeed},</if>
|
||||
<if test="outSpeed != null">#{outSpeed},</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="clientId != null">#{clientId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateInitialBandwidthTraffic" parameterType="InitialBandwidthTraffic">
|
||||
update initial_bandwidth_traffic
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="mac != null">mac = #{mac},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="ipV4 != null">ipV4 = #{ipV4},</if>
|
||||
<if test="inDropped != null">in_dropped = #{inDropped},</if>
|
||||
<if test="outDropped != null">out_dropped = #{outDropped},</if>
|
||||
<if test="inSpeed != null">in_speed = #{inSpeed},</if>
|
||||
<if test="outSpeed != null">out_speed = #{outSpeed},</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="clientId != null">client_id = #{clientId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="deleteInitialBandwidthTrafficById" parameterType="Long"> delete from initial_bandwidth_traffic where id = #{id} </delete>
|
||||
<delete id="deleteInitialBandwidthTrafficByIds" parameterType="String">
|
||||
delete from initial_bandwidth_traffic where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach>
|
||||
</delete>
|
||||
<!-- 单条插入 -->
|
||||
<insert id="insert" parameterType="InitialBandwidthTraffic">
|
||||
INSERT INTO ${tableName} (
|
||||
`name`, `mac`, `status`, `type`, ipV4, `in_dropped`, `out_dropped`,
|
||||
`in_speed`, `out_speed`, `total_in_speed`, `total_out_speed`, duplex, speed,
|
||||
create_by, update_by, client_id, create_time
|
||||
) VALUES (
|
||||
#{name}, #{mac}, #{status}, #{type}, #{ipV4}, #{inDropped}, #{outDropped},
|
||||
#{inSpeed}, #{outSpeed}, #{totalInSpeed}, #{totalOutSpeed}, #{duplex}, #{speed},
|
||||
#{createBy}, #{updateBy}, #{clientId}, #{createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="batchInsert" parameterType="InitialBandwidthTraffic">
|
||||
INSERT IGNORE INTO ${tableName} (
|
||||
`name`, `mac`, `status`, `type`, ipV4, `in_dropped`, `out_dropped`,
|
||||
`in_speed`, `out_speed`, `total_in_speed`, `total_out_speed`, duplex, speed,
|
||||
create_by, update_by, client_id, create_time
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.name}, #{item.mac}, #{item.status}, #{item.type}, #{item.ipV4}, #{item.inDropped}, #{item.outDropped},
|
||||
#{item.inSpeed}, #{item.outSpeed}, #{item.totalInSpeed}, #{item.totalOutSpeed}, #{item.duplex}, #{item.speed},
|
||||
#{item.createBy}, #{item.updateBy}, #{item.clientId}, #{item.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getNetInterfaceDetailsMsg" parameterType="InitialBandwidthTraffic" resultMap="InitialBandwidthTrafficResult">
|
||||
select id, `name`, mac, status, `type`, ipV4, in_dropped, out_dropped, in_speed, out_speed,
|
||||
total_in_speed, total_out_speed, create_time, update_time, create_by, update_by,
|
||||
client_id, duplex, speed
|
||||
from ${tableName}
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="name != null and name != ''"> and name = #{name}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="getNetTrafficList" parameterType="InitialBandwidthTraffic" resultMap="InitialBandwidthTrafficResult">
|
||||
select id, `name`, mac, status, `type`, ipV4, in_dropped, out_dropped, in_speed, out_speed,
|
||||
total_in_speed, total_out_speed, create_time, update_time, create_by, update_by,
|
||||
client_id, duplex, speed
|
||||
from ${tableName}
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="name != null and name != ''"> and name = #{name}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
<?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.InitialBandwidthTrafficTempMapper">
|
||||
|
||||
<resultMap type="InitialBandwidthTrafficTemp" id="InitialBandwidthTrafficTempResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="mac" column="mac" />
|
||||
<result property="status" column="status" />
|
||||
<result property="type" column="type" />
|
||||
<result property="ipV4" column="ipV4" />
|
||||
<result property="inDropped" column="in_dropped" />
|
||||
<result property="outDropped" column="out_dropped" />
|
||||
<result property="inSpeed" column="in_speed" />
|
||||
<result property="outSpeed" column="out_speed" />
|
||||
<result property="speed" column="speed" />
|
||||
<result property="duplex" column="duplex" />
|
||||
<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="clientId" column="client_id" />
|
||||
<result property="totalInSpeed" column="total_in_speed" />
|
||||
<result property="totalOutSpeed" column="total_out_speed" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInitialBandwidthTrafficTempVo">
|
||||
select id, name, mac, status, type, ipV4, in_dropped, out_dropped, in_speed, out_speed, speed, duplex, create_time, update_time, create_by, update_by, client_id, total_in_speed, total_out_speed from initial_bandwidth_traffic_temp
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialBandwidthTrafficTempList" parameterType="InitialBandwidthTrafficTemp" resultMap="InitialBandwidthTrafficTempResult">
|
||||
<include refid="selectInitialBandwidthTrafficTempVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="mac != null and mac != ''"> and mac = #{mac}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="ipV4 != null and ipV4 != ''"> and ipV4 = #{ipV4}</if>
|
||||
<if test="inDropped != null "> and in_dropped = #{inDropped}</if>
|
||||
<if test="outDropped != null "> and out_dropped = #{outDropped}</if>
|
||||
<if test="inSpeed != null and inSpeed != ''"> and in_speed = #{inSpeed}</if>
|
||||
<if test="outSpeed != null and outSpeed != ''"> and out_speed = #{outSpeed}</if>
|
||||
<if test="speed != null and speed != ''"> and speed = #{speed}</if>
|
||||
<if test="duplex != null and duplex != ''"> and duplex = #{duplex}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="totalInSpeed != null and totalInSpeed != ''"> and total_in_speed = #{totalInSpeed}</if>
|
||||
<if test="totalOutSpeed != null and totalOutSpeed != ''"> and total_out_speed = #{totalOutSpeed}</if>
|
||||
<if test="createTime != null"> and create_time = #{createTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialBandwidthTrafficTempById" parameterType="Long" resultMap="InitialBandwidthTrafficTempResult">
|
||||
<include refid="selectInitialBandwidthTrafficTempVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialBandwidthTrafficTemp" parameterType="InitialBandwidthTrafficTemp" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_bandwidth_traffic_temp
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="mac != null">mac,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="ipV4 != null">ipV4,</if>
|
||||
<if test="inDropped != null">in_dropped,</if>
|
||||
<if test="outDropped != null">out_dropped,</if>
|
||||
<if test="inSpeed != null">in_speed,</if>
|
||||
<if test="outSpeed != null">out_speed,</if>
|
||||
<if test="speed != null">speed,</if>
|
||||
<if test="duplex != null">duplex,</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="clientId != null">client_id,</if>
|
||||
<if test="totalInSpeed != null">total_in_speed,</if>
|
||||
<if test="totalOutSpeed != null">total_out_speed,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="mac != null">#{mac},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="ipV4 != null">#{ipV4},</if>
|
||||
<if test="inDropped != null">#{inDropped},</if>
|
||||
<if test="outDropped != null">#{outDropped},</if>
|
||||
<if test="inSpeed != null">#{inSpeed},</if>
|
||||
<if test="outSpeed != null">#{outSpeed},</if>
|
||||
<if test="speed != null">#{speed},</if>
|
||||
<if test="duplex != null">#{duplex},</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="clientId != null">#{clientId},</if>
|
||||
<if test="totalInSpeed != null">#{totalInSpeed},</if>
|
||||
<if test="totalOutSpeed != null">#{totalOutSpeed},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInitialBandwidthTrafficTemp" parameterType="InitialBandwidthTrafficTemp">
|
||||
update initial_bandwidth_traffic_temp
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="mac != null">mac = #{mac},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="ipV4 != null">ipV4 = #{ipV4},</if>
|
||||
<if test="inDropped != null">in_dropped = #{inDropped},</if>
|
||||
<if test="outDropped != null">out_dropped = #{outDropped},</if>
|
||||
<if test="inSpeed != null">in_speed = #{inSpeed},</if>
|
||||
<if test="outSpeed != null">out_speed = #{outSpeed},</if>
|
||||
<if test="speed != null">speed = #{speed},</if>
|
||||
<if test="duplex != null">duplex = #{duplex},</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="clientId != null">client_id = #{clientId},</if>
|
||||
<if test="totalInSpeed != null">total_in_speed = #{totalInSpeed},</if>
|
||||
<if test="totalOutSpeed != null">total_out_speed = #{totalOutSpeed},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInitialBandwidthTrafficTempById" parameterType="Long">
|
||||
delete from initial_bandwidth_traffic_temp where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialBandwidthTrafficTempByIds" parameterType="String">
|
||||
delete from initial_bandwidth_traffic_temp where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteTempMsgByClientId" parameterType="String">
|
||||
delete from initial_bandwidth_traffic_temp where client_id = #{clientId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertServerTemp" parameterType="java.util.List">
|
||||
insert IGNORE into initial_bandwidth_traffic_temp
|
||||
(
|
||||
name, mac, status, type, ipV4, in_dropped, out_dropped,
|
||||
in_speed, out_speed, speed, duplex, create_time, update_time,
|
||||
create_by, update_by, client_id, total_in_speed, total_out_speed
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(
|
||||
#{item.name}, #{item.mac}, #{item.status}, #{item.type}, #{item.ipV4},
|
||||
#{item.inDropped}, #{item.outDropped}, #{item.inSpeed}, #{item.outSpeed},
|
||||
#{item.speed}, #{item.duplex}, #{item.createTime}, #{item.updateTime},
|
||||
#{item.createBy}, #{item.updateBy}, #{item.clientId}, #{item.totalInSpeed},
|
||||
#{item.totalOutSpeed}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,188 @@
|
||||
<?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.InitialCpuInfoMapper">
|
||||
|
||||
<resultMap type="InitialCpuInfo" id="InitialCpuInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="avg1" column="avg1" />
|
||||
<result property="avg5" column="avg5" />
|
||||
<result property="avg15" column="avg15" />
|
||||
<result property="interrupt" column="interrupt" />
|
||||
<result property="uti" column="uti" />
|
||||
<result property="num" column="num" />
|
||||
<result property="normal" column="normal" />
|
||||
<result property="idle" column="idle" />
|
||||
<result property="iowait" column="iowait" />
|
||||
<result property="system" column="system" />
|
||||
<result property="noresp" column="noresp" />
|
||||
<result property="user" column="user" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</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
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialCpuInfoList" parameterType="InitialCpuInfo" resultMap="InitialCpuInfoResult">
|
||||
<include refid="selectInitialCpuInfoVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectInitialCpuInfoById" parameterType="Long" resultMap="InitialCpuInfoResult">
|
||||
<include refid="selectInitialCpuInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialCpuInfo" parameterType="InitialCpuInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_cpu_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="avg1 != null">avg1,</if>
|
||||
<if test="avg5 != null">avg5,</if>
|
||||
<if test="avg15 != null">avg15,</if>
|
||||
<if test="interrupt != null">interrupt,</if>
|
||||
<if test="uti != null">uti,</if>
|
||||
<if test="num != null">num,</if>
|
||||
<if test="normal != null">normal,</if>
|
||||
<if test="idle != null">idle,</if>
|
||||
<if test="iowait != null">iowait,</if>
|
||||
<if test="system != null">system,</if>
|
||||
<if test="noresp != null">noresp,</if>
|
||||
<if test="user != null">user,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">#{clientId},</if>
|
||||
<if test="avg1 != null">#{avg1},</if>
|
||||
<if test="avg5 != null">#{avg5},</if>
|
||||
<if test="avg15 != null">#{avg15},</if>
|
||||
<if test="interrupt != null">#{interrupt},</if>
|
||||
<if test="uti != null">#{uti},</if>
|
||||
<if test="num != null">#{num},</if>
|
||||
<if test="normal != null">#{normal},</if>
|
||||
<if test="idle != null">#{idle},</if>
|
||||
<if test="iowait != null">#{iowait},</if>
|
||||
<if test="system != null">#{system},</if>
|
||||
<if test="noresp != null">#{noresp},</if>
|
||||
<if test="user != null">#{user},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInitialCpuInfo" parameterType="InitialCpuInfo">
|
||||
update initial_cpu_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="avg1 != null">avg1 = #{avg1},</if>
|
||||
<if test="avg5 != null">avg5 = #{avg5},</if>
|
||||
<if test="avg15 != null">avg15 = #{avg15},</if>
|
||||
<if test="interrupt != null">interrupt = #{interrupt},</if>
|
||||
<if test="uti != null">uti = #{uti},</if>
|
||||
<if test="num != null">num = #{num},</if>
|
||||
<if test="normal != null">normal = #{normal},</if>
|
||||
<if test="idle != null">idle = #{idle},</if>
|
||||
<if test="iowait != null">iowait = #{iowait},</if>
|
||||
<if test="system != null">system = #{system},</if>
|
||||
<if test="noresp != null">noresp = #{noresp},</if>
|
||||
<if test="user != null">user = #{user},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInitialCpuInfoById" parameterType="Long">
|
||||
delete from initial_cpu_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialCpuInfoByIds" parameterType="String">
|
||||
delete from initial_cpu_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertInitialCpuInfo" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT IGNORE INTO initial_cpu_info
|
||||
(
|
||||
client_id,
|
||||
avg1,
|
||||
avg5,
|
||||
avg15,
|
||||
interrupt,
|
||||
uti,
|
||||
num,
|
||||
normal,
|
||||
idle,
|
||||
iowait,
|
||||
`system`,
|
||||
noresp,
|
||||
`user`,
|
||||
create_by,
|
||||
update_by,
|
||||
create_time,
|
||||
update_time
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.clientId},
|
||||
#{item.avg1},
|
||||
#{item.avg5},
|
||||
#{item.avg15},
|
||||
#{item.interrupt},
|
||||
#{item.uti},
|
||||
#{item.num},
|
||||
#{item.normal},
|
||||
#{item.idle},
|
||||
#{item.iowait},
|
||||
#{item.system},
|
||||
#{item.noresp},
|
||||
#{item.user},
|
||||
#{item.createBy},
|
||||
#{item.updateBy},
|
||||
<choose>
|
||||
<when test="item.createTime != null">
|
||||
#{item.createTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>,
|
||||
<choose>
|
||||
<when test="item.updateTime != null">
|
||||
#{item.updateTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<select id="getCpuInfoByClientId" parameterType="String" resultMap="InitialCpuInfoResult">
|
||||
<include refid="selectInitialCpuInfoVo"/>
|
||||
where client_id = #{clientId}
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,182 @@
|
||||
<?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.InitialDiskInfoMapper">
|
||||
|
||||
<resultMap type="InitialDiskInfo" id="InitialDiskInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="serial" column="serial" />
|
||||
<result property="total" column="total" />
|
||||
<result property="writeSpeed" column="write_speed" />
|
||||
<result property="readSpeed" column="read_speed" />
|
||||
<result property="writeTimes" column="write_times" />
|
||||
<result property="readTimes" column="read_times" />
|
||||
<result property="writeBytes" column="write_bytes" />
|
||||
<result property="readBytes" column="read_bytes" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInitialDiskInfoVo">
|
||||
select id, client_id, name, serial, total, write_speed, read_speed, write_times, read_times, write_bytes, read_bytes, create_by, update_by, create_time, update_time from initial_disk_info
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialDiskInfoList" parameterType="InitialDiskInfo" resultMap="InitialDiskInfoResult">
|
||||
<include refid="selectInitialDiskInfoVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="name != null and name != ''"> and name = #{name}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectInitialDiskInfoById" parameterType="Long" resultMap="InitialDiskInfoResult">
|
||||
<include refid="selectInitialDiskInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialDiskInfo" parameterType="InitialDiskInfo">
|
||||
insert IGNORE into initial_disk_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="serial != null">serial,</if>
|
||||
<if test="total != null">total,</if>
|
||||
<if test="writeSpeed != null">write_speed,</if>
|
||||
<if test="readSpeed != null">read_speed,</if>
|
||||
<if test="writeTimes != null">write_times,</if>
|
||||
<if test="readTimes != null">read_times,</if>
|
||||
<if test="writeBytes != null">write_bytes,</if>
|
||||
<if test="readBytes != null">read_bytes,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="clientId != null and clientId != ''">#{clientId},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="serial != null">#{serial},</if>
|
||||
<if test="total != null">#{total},</if>
|
||||
<if test="writeSpeed != null">#{writeSpeed},</if>
|
||||
<if test="readSpeed != null">#{readSpeed},</if>
|
||||
<if test="writeTimes != null">#{writeTimes},</if>
|
||||
<if test="readTimes != null">#{readTimes},</if>
|
||||
<if test="writeBytes != null">#{writeBytes},</if>
|
||||
<if test="readBytes != null">#{readBytes},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInitialDiskInfo" parameterType="InitialDiskInfo">
|
||||
update initial_disk_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="serial != null">serial = #{serial},</if>
|
||||
<if test="total != null">total = #{total},</if>
|
||||
<if test="writeSpeed != null">write_speed = #{writeSpeed},</if>
|
||||
<if test="readSpeed != null">read_speed = #{readSpeed},</if>
|
||||
<if test="writeTimes != null">write_times = #{writeTimes},</if>
|
||||
<if test="readTimes != null">read_times = #{readTimes},</if>
|
||||
<if test="writeBytes != null">write_bytes = #{writeBytes},</if>
|
||||
<if test="readBytes != null">read_bytes = #{readBytes},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInitialDiskInfoById" parameterType="Long">
|
||||
delete from initial_disk_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialDiskInfoByIds" parameterType="String">
|
||||
delete from initial_disk_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertInitialDiskInfo" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT IGNORE INTO initial_disk_info
|
||||
(
|
||||
id,
|
||||
client_id,
|
||||
`name`,
|
||||
serial,
|
||||
total,
|
||||
write_speed,
|
||||
read_speed,
|
||||
write_times,
|
||||
read_times,
|
||||
write_bytes,
|
||||
read_bytes,
|
||||
create_by,
|
||||
update_by,
|
||||
create_time,
|
||||
update_time
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.id},
|
||||
#{item.clientId},
|
||||
#{item.name},
|
||||
#{item.serial},
|
||||
#{item.total},
|
||||
#{item.writeSpeed},
|
||||
#{item.readSpeed},
|
||||
#{item.writeTimes},
|
||||
#{item.readTimes},
|
||||
#{item.writeBytes},
|
||||
#{item.readBytes},
|
||||
#{item.createBy},
|
||||
#{item.updateBy},
|
||||
<choose>
|
||||
<when test="item.createTime != null">
|
||||
#{item.createTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>,
|
||||
<choose>
|
||||
<when test="item.updateTime != null">
|
||||
#{item.updateTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<select id="getDistDetailsMsgByClientId" parameterType="InitialDiskInfo" resultMap="InitialDiskInfoResult">
|
||||
<include refid="selectInitialDiskInfoVo"/>
|
||||
where client_id = #{clientId} and `name`= #{name}
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
<select id="getAllDistName" parameterType="String" resultType="java.util.Map">
|
||||
select name from initial_disk_info
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
group by name
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,167 @@
|
||||
<?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.InitialDockerInfoMapper">
|
||||
|
||||
<resultMap type="InitialDockerInfo" id="InitialDockerInfoResult">
|
||||
<result property="autoId" column="auto_id" />
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="cpuUtil" column="cpu_util" />
|
||||
<result property="memUtil" column="mem_util" />
|
||||
<result property="netInSpeed" column="net_in_speed" />
|
||||
<result property="netOutSpeed" column="net_out_speed" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<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="selectInitialDockerInfoVo">
|
||||
select auto_id, id, name, status, cpu_util, mem_util, net_in_speed, net_out_speed, client_id, create_time, update_time, create_by, update_by from initial_docker_info
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialDockerInfoList" parameterType="InitialDockerInfo" resultMap="InitialDockerInfoResult">
|
||||
<include refid="selectInitialDockerInfoVo"/>
|
||||
<where>
|
||||
<if test="id != null"> and id = #{id}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectInitialDockerInfoById" parameterType="Long" resultMap="InitialDockerInfoResult">
|
||||
<include refid="selectInitialDockerInfoVo"/>
|
||||
where auto_id = #{autoId}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialDockerInfo" parameterType="InitialDockerInfo" useGeneratedKeys="true" keyProperty="auto_id">
|
||||
insert IGNORE into initial_docker_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="cpuUtil != null">cpu_util,</if>
|
||||
<if test="memUtil != null">mem_util,</if>
|
||||
<if test="netInSpeed != null">net_in_speed,</if>
|
||||
<if test="netOutSpeed != null">net_out_speed,</if>
|
||||
<if test="clientId != null">client_id,</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="id != null and id != ''">#{id},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="cpuUtil != null">#{cpuUtil},</if>
|
||||
<if test="memUtil != null">#{memUtil},</if>
|
||||
<if test="netInSpeed != null">#{netInSpeed},</if>
|
||||
<if test="netOutSpeed != null">#{netOutSpeed},</if>
|
||||
<if test="clientId != null">#{clientId},</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="updateInitialDockerInfo" parameterType="InitialDockerInfo">
|
||||
update initial_docker_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id = #{id},</if>
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="cpuUtil != null">cpu_util = #{cpuUtil},</if>
|
||||
<if test="memUtil != null">mem_util = #{memUtil},</if>
|
||||
<if test="netInSpeed != null">net_in_speed = #{netInSpeed},</if>
|
||||
<if test="netOutSpeed != null">net_out_speed = #{netOutSpeed},</if>
|
||||
<if test="clientId != null">client_id = #{clientId},</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="deleteInitialDockerInfoById" parameterType="Long">
|
||||
delete from initial_docker_info where auto_id = #{autoId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialDockerInfoByIds" parameterType="String">
|
||||
delete from initial_docker_info where auto_id in
|
||||
<foreach item="autoId" collection="array" open="(" separator="," close=")">
|
||||
#{autoId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertInitialDockerInfo" parameterType="java.util.List">
|
||||
INSERT IGNORE INTO initial_docker_info
|
||||
(
|
||||
`id`,
|
||||
`name`,
|
||||
status,
|
||||
cpu_util,
|
||||
mem_util,
|
||||
net_in_speed,
|
||||
net_out_speed,
|
||||
client_id,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.id},
|
||||
#{item.name},
|
||||
#{item.status},
|
||||
#{item.cpuUtil},
|
||||
#{item.memUtil},
|
||||
#{item.netInSpeed},
|
||||
#{item.netOutSpeed},
|
||||
#{item.clientId},
|
||||
<choose>
|
||||
<when test="item.createTime != null">
|
||||
#{item.createTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>,
|
||||
<choose>
|
||||
<when test="item.updateTime != null">
|
||||
#{item.updateTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>,
|
||||
#{item.createBy},
|
||||
#{item.updateBy}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getDockerDetailsMsg" parameterType="InitialDockerInfo" resultMap="InitialDockerInfoResult">
|
||||
<include refid="selectInitialDockerInfoVo"/>
|
||||
where client_id = #{clientId} and `id` = #{id}
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
<select id="getAllDockerId" parameterType="String" resultType="java.util.Map">
|
||||
select id from initial_docker_info
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
group by id
|
||||
</select>
|
||||
</mapper>
|
||||
+81
@@ -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.tongran.rocketmq.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,79 @@
|
||||
<?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.InitialHeartbeatListenMapper">
|
||||
|
||||
<resultMap type="InitialHeartbeatListen" id="InitialHeartbeatListenResult">
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="strength" column="strength" />
|
||||
<result property="timestamp" column="timestamp" />
|
||||
<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="selectInitialHeartbeatListenVo">
|
||||
select client_id, strength, timestamp, create_time, update_time, create_by, update_by from initial_heartbeat_listen
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialHeartbeatListenList" parameterType="InitialHeartbeatListen" resultMap="InitialHeartbeatListenResult">
|
||||
<include refid="selectInitialHeartbeatListenVo"/>
|
||||
<where>
|
||||
<if test="strength != null "> and strength = #{strength}</if>
|
||||
<if test="timestamp != null "> and timestamp = #{timestamp}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialHeartbeatListenByClientId" parameterType="String" resultMap="InitialHeartbeatListenResult">
|
||||
<include refid="selectInitialHeartbeatListenVo"/>
|
||||
where client_id = #{clientId}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialHeartbeatListen" parameterType="InitialHeartbeatListen">
|
||||
insert into initial_heartbeat_listen
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null">client_id,</if>
|
||||
<if test="strength != null">strength,</if>
|
||||
<if test="timestamp != null">timestamp,</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="strength != null">#{strength},</if>
|
||||
<if test="timestamp != null">#{timestamp},</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="updateInitialHeartbeatListen" parameterType="InitialHeartbeatListen">
|
||||
update initial_heartbeat_listen
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="strength != null">strength = #{strength},</if>
|
||||
<if test="timestamp != null">timestamp = #{timestamp},</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 client_id = #{clientId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInitialHeartbeatListenByClientId" parameterType="String">
|
||||
delete from initial_heartbeat_listen where client_id = #{clientId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialHeartbeatListenByClientIds" parameterType="String">
|
||||
delete from initial_heartbeat_listen where client_id in
|
||||
<foreach item="clientId" collection="array" open="(" separator="," close=")">
|
||||
#{clientId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,152 @@
|
||||
<?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.InitialMemoryInfoMapper">
|
||||
|
||||
<resultMap type="InitialMemoryInfo" id="InitialMemoryInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="swapSizeFree" column="swap_size_free" />
|
||||
<result property="untilzation" column="untilzation" />
|
||||
<result property="swapSizePercent" column="swap_size_percent" />
|
||||
<result property="available" column="available" />
|
||||
<result property="percent" column="percent" />
|
||||
<result property="total" column="total" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInitialMemoryInfoVo">
|
||||
select id, client_id, swap_size_free, untilzation, swap_size_percent, available, percent, total, create_by, update_by, create_time, update_time from initial_memory_info
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialMemoryInfoList" parameterType="InitialMemoryInfo" resultMap="InitialMemoryInfoResult">
|
||||
<include refid="selectInitialMemoryInfoVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectInitialMemoryInfoById" parameterType="Long" resultMap="InitialMemoryInfoResult">
|
||||
<include refid="selectInitialMemoryInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialMemoryInfo" parameterType="InitialMemoryInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_memory_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="swapSizeFree != null">swap_size_free,</if>
|
||||
<if test="untilzation != null">untilzation,</if>
|
||||
<if test="swapSizePercent != null">swap_size_percent,</if>
|
||||
<if test="available != null">available,</if>
|
||||
<if test="percent != null">percent,</if>
|
||||
<if test="total != null">total,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">#{clientId},</if>
|
||||
<if test="swapSizeFree != null">#{swapSizeFree},</if>
|
||||
<if test="untilzation != null">#{untilzation},</if>
|
||||
<if test="swapSizePercent != null">#{swapSizePercent},</if>
|
||||
<if test="available != null">#{available},</if>
|
||||
<if test="percent != null">#{percent},</if>
|
||||
<if test="total != null">#{total},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInitialMemoryInfo" parameterType="InitialMemoryInfo">
|
||||
update initial_memory_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="swapSizeFree != null">swap_size_free = #{swapSizeFree},</if>
|
||||
<if test="untilzation != null">untilzation = #{untilzation},</if>
|
||||
<if test="swapSizePercent != null">swap_size_percent = #{swapSizePercent},</if>
|
||||
<if test="available != null">available = #{available},</if>
|
||||
<if test="percent != null">percent = #{percent},</if>
|
||||
<if test="total != null">total = #{total},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInitialMemoryInfoById" parameterType="Long">
|
||||
delete from initial_memory_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialMemoryInfoByIds" parameterType="String">
|
||||
delete from initial_memory_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertInitialMemoryInfo" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT IGNORE INTO initial_memory_info
|
||||
(
|
||||
client_id,
|
||||
swap_size_free,
|
||||
untilzation,
|
||||
swap_size_percent,
|
||||
available,
|
||||
percent,
|
||||
total,
|
||||
create_by,
|
||||
update_by,
|
||||
create_time,
|
||||
update_time
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.clientId},
|
||||
#{item.swapSizeFree},
|
||||
#{item.untilzation},
|
||||
#{item.swapSizePercent},
|
||||
#{item.available},
|
||||
#{item.percent},
|
||||
#{item.total},
|
||||
#{item.createBy},
|
||||
#{item.updateBy},
|
||||
<choose>
|
||||
<when test="item.createTime != null">
|
||||
#{item.createTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>,
|
||||
<choose>
|
||||
<when test="item.updateTime != null">
|
||||
#{item.updateTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getMemoryInfoByClientId" parameterType="String" resultMap="InitialMemoryInfoResult">
|
||||
<include refid="selectInitialMemoryInfoVo"/>
|
||||
where client_id = #{clientId}
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,157 @@
|
||||
<?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.InitialMountPointInfoMapper">
|
||||
|
||||
<resultMap type="InitialMountPointInfo" id="InitialMountPointInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="mount" column="mount" />
|
||||
<result property="vfsType" column="vfs_type" />
|
||||
<result property="vfsFree" column="vfs_free" />
|
||||
<result property="vfsTotal" column="vfs_total" />
|
||||
<result property="vfsUtil" column="vfs_util" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInitialMountPointInfoVo">
|
||||
select id, client_id, mount, vfs_type, vfs_free, vfs_total, vfs_util, create_by, update_by, create_time, update_time from initial_mount_point_info
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialMountPointInfoList" parameterType="InitialMountPointInfo" resultMap="InitialMountPointInfoResult">
|
||||
<include refid="selectInitialMountPointInfoVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectInitialMountPointInfoById" parameterType="Long" resultMap="InitialMountPointInfoResult">
|
||||
<include refid="selectInitialMountPointInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialMountPointInfo" parameterType="InitialMountPointInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_mount_point_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="mount != null and mount != ''">mount,</if>
|
||||
<if test="vfsType != null">vfs_type,</if>
|
||||
<if test="vfsFree != null">vfs_free,</if>
|
||||
<if test="vfsTotal != null">vfs_total,</if>
|
||||
<if test="vfsUtil != null">vfs_util,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">#{clientId},</if>
|
||||
<if test="mount != null and mount != ''">#{mount},</if>
|
||||
<if test="vfsType != null">#{vfsType},</if>
|
||||
<if test="vfsFree != null">#{vfsFree},</if>
|
||||
<if test="vfsTotal != null">#{vfsTotal},</if>
|
||||
<if test="vfsUtil != null">#{vfsUtil},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInitialMountPointInfo" parameterType="InitialMountPointInfo">
|
||||
update initial_mount_point_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="mount != null and mount != ''">mount = #{mount},</if>
|
||||
<if test="vfsType != null">vfs_type = #{vfsType},</if>
|
||||
<if test="vfsFree != null">vfs_free = #{vfsFree},</if>
|
||||
<if test="vfsTotal != null">vfs_total = #{vfsTotal},</if>
|
||||
<if test="vfsUtil != null">vfs_util = #{vfsUtil},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInitialMountPointInfoById" parameterType="Long">
|
||||
delete from initial_mount_point_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialMountPointInfoByIds" parameterType="String">
|
||||
delete from initial_mount_point_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertInitialMountPointInfo" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT IGNORE INTO initial_mount_point_info
|
||||
(
|
||||
client_id,
|
||||
mount,
|
||||
vfs_type,
|
||||
vfs_free,
|
||||
vfs_total,
|
||||
vfs_util,
|
||||
create_by,
|
||||
update_by,
|
||||
create_time,
|
||||
update_time
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.clientId},
|
||||
#{item.mount},
|
||||
#{item.vfsType},
|
||||
#{item.vfsFree},
|
||||
#{item.vfsTotal},
|
||||
#{item.vfsUtil},
|
||||
#{item.createBy},
|
||||
#{item.updateBy},
|
||||
<choose>
|
||||
<when test="item.createTime != null">
|
||||
#{item.createTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>,
|
||||
<choose>
|
||||
<when test="item.updateTime != null">
|
||||
#{item.updateTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="pointDetailsMsg" parameterType="InitialMountPointInfo" resultMap="InitialMountPointInfoResult">
|
||||
<include refid="selectInitialMountPointInfoVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="mount != null and mount != ''"> and mount = #{mount}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
<select id="getAllMountName" parameterType="String" resultType="java.util.Map">
|
||||
select mount from initial_mount_point_info
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
group by mount
|
||||
</select>
|
||||
</mapper>
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
<?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.InitialOtherSystemMonitorDataMapper">
|
||||
|
||||
<resultMap type="InitialOtherSystemMonitorData" id="InitialOtherSystemMonitorDataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="systemSwapSizeFreeCollect" column="system_swap_size_free_collect" />
|
||||
<result property="systemSwapSizePercentCollect" column="system_swap_size_percent_collect" />
|
||||
<result property="memoryUtilizationCollect" column="memory_utilization_collect" />
|
||||
<result property="memorySizeAvailableCollect" column="memory_size_available_collect" />
|
||||
<result property="memorySizePercentCollect" column="memory_size_percent_collect" />
|
||||
<result property="memorySizeTotalCollect" column="memory_size_total_collect" />
|
||||
<result property="systemSwOsCollect" column="system_sw_os_collect" />
|
||||
<result property="systemSwArchCollect" column="system_sw_arch_collect" />
|
||||
<result property="kernelMaxprocCollect" column="kernel_maxproc_collect" />
|
||||
<result property="procNumRunCollect" column="proc_num_run_collect" />
|
||||
<result property="systemUsersNumCollect" column="system_users_num_collect" />
|
||||
<result property="systemDiskSizeTotalCollect" column="system_disk_size_total_collect" />
|
||||
<result property="systemBoottimeCollect" column="system_boottime_collect" />
|
||||
<result property="systemUnameCollect" column="system_uname_collect" />
|
||||
<result property="systemLocaltimeCollect" column="system_localtime_collect" />
|
||||
<result property="systemUptimeCollect" column="system_uptime_collect" />
|
||||
<result property="procNumCollect" column="proc_num_collect" />
|
||||
<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="selectInitialOtherSystemMonitorDataVo">
|
||||
select id, client_id, system_swap_size_free_collect, system_swap_size_percent_collect, memory_utilization_collect, memory_size_available_collect, memory_size_percent_collect, memory_size_total_collect, system_sw_os_collect, system_sw_arch_collect, kernel_maxproc_collect, proc_num_run_collect, system_users_num_collect, system_disk_size_total_collect, system_boottime_collect, system_uname_collect, system_localtime_collect, system_uptime_collect, proc_num_collect, create_time, update_time, create_by, update_by from initial_other_system_monitor_data
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialOtherSystemMonitorDataList" parameterType="InitialOtherSystemMonitorData" resultMap="InitialOtherSystemMonitorDataResult">
|
||||
<include refid="selectInitialOtherSystemMonitorDataVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="systemSwapSizeFreeCollect != null "> and system_swap_size_free_collect = #{systemSwapSizeFreeCollect}</if>
|
||||
<if test="systemSwapSizePercentCollect != null "> and system_swap_size_percent_collect = #{systemSwapSizePercentCollect}</if>
|
||||
<if test="memoryUtilizationCollect != null "> and memory_utilization_collect = #{memoryUtilizationCollect}</if>
|
||||
<if test="memorySizeAvailableCollect != null "> and memory_size_available_collect = #{memorySizeAvailableCollect}</if>
|
||||
<if test="memorySizePercentCollect != null "> and memory_size_percent_collect = #{memorySizePercentCollect}</if>
|
||||
<if test="memorySizeTotalCollect != null "> and memory_size_total_collect = #{memorySizeTotalCollect}</if>
|
||||
<if test="systemSwOsCollect != null and systemSwOsCollect != ''"> and system_sw_os_collect = #{systemSwOsCollect}</if>
|
||||
<if test="systemSwArchCollect != null and systemSwArchCollect != ''"> and system_sw_arch_collect = #{systemSwArchCollect}</if>
|
||||
<if test="kernelMaxprocCollect != null "> and kernel_maxproc_collect = #{kernelMaxprocCollect}</if>
|
||||
<if test="procNumRunCollect != null "> and proc_num_run_collect = #{procNumRunCollect}</if>
|
||||
<if test="systemUsersNumCollect != null "> and system_users_num_collect = #{systemUsersNumCollect}</if>
|
||||
<if test="systemDiskSizeTotalCollect != null "> and system_disk_size_total_collect = #{systemDiskSizeTotalCollect}</if>
|
||||
<if test="systemBoottimeCollect != null "> and system_boottime_collect = #{systemBoottimeCollect}</if>
|
||||
<if test="systemUnameCollect != null and systemUnameCollect != ''"> and system_uname_collect = #{systemUnameCollect}</if>
|
||||
<if test="systemLocaltimeCollect != null "> and system_localtime_collect = #{systemLocaltimeCollect}</if>
|
||||
<if test="systemUptimeCollect != null "> and system_uptime_collect = #{systemUptimeCollect}</if>
|
||||
<if test="procNumCollect != null "> and proc_num_collect = #{procNumCollect}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialOtherSystemMonitorDataById" parameterType="Long" resultMap="InitialOtherSystemMonitorDataResult">
|
||||
<include refid="selectInitialOtherSystemMonitorDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialOtherSystemMonitorData" parameterType="InitialOtherSystemMonitorData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into initial_other_system_monitor_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null">client_id,</if>
|
||||
<if test="systemSwapSizeFreeCollect != null">system_swap_size_free_collect,</if>
|
||||
<if test="systemSwapSizePercentCollect != null">system_swap_size_percent_collect,</if>
|
||||
<if test="memoryUtilizationCollect != null">memory_utilization_collect,</if>
|
||||
<if test="memorySizeAvailableCollect != null">memory_size_available_collect,</if>
|
||||
<if test="memorySizePercentCollect != null">memory_size_percent_collect,</if>
|
||||
<if test="memorySizeTotalCollect != null">memory_size_total_collect,</if>
|
||||
<if test="systemSwOsCollect != null">system_sw_os_collect,</if>
|
||||
<if test="systemSwArchCollect != null">system_sw_arch_collect,</if>
|
||||
<if test="kernelMaxprocCollect != null">kernel_maxproc_collect,</if>
|
||||
<if test="procNumRunCollect != null">proc_num_run_collect,</if>
|
||||
<if test="systemUsersNumCollect != null">system_users_num_collect,</if>
|
||||
<if test="systemDiskSizeTotalCollect != null">system_disk_size_total_collect,</if>
|
||||
<if test="systemBoottimeCollect != null">system_boottime_collect,</if>
|
||||
<if test="systemUnameCollect != null">system_uname_collect,</if>
|
||||
<if test="systemLocaltimeCollect != null">system_localtime_collect,</if>
|
||||
<if test="systemUptimeCollect != null">system_uptime_collect,</if>
|
||||
<if test="procNumCollect != null">proc_num_collect,</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="systemSwapSizeFreeCollect != null">#{systemSwapSizeFreeCollect},</if>
|
||||
<if test="systemSwapSizePercentCollect != null">#{systemSwapSizePercentCollect},</if>
|
||||
<if test="memoryUtilizationCollect != null">#{memoryUtilizationCollect},</if>
|
||||
<if test="memorySizeAvailableCollect != null">#{memorySizeAvailableCollect},</if>
|
||||
<if test="memorySizePercentCollect != null">#{memorySizePercentCollect},</if>
|
||||
<if test="memorySizeTotalCollect != null">#{memorySizeTotalCollect},</if>
|
||||
<if test="systemSwOsCollect != null">#{systemSwOsCollect},</if>
|
||||
<if test="systemSwArchCollect != null">#{systemSwArchCollect},</if>
|
||||
<if test="kernelMaxprocCollect != null">#{kernelMaxprocCollect},</if>
|
||||
<if test="procNumRunCollect != null">#{procNumRunCollect},</if>
|
||||
<if test="systemUsersNumCollect != null">#{systemUsersNumCollect},</if>
|
||||
<if test="systemDiskSizeTotalCollect != null">#{systemDiskSizeTotalCollect},</if>
|
||||
<if test="systemBoottimeCollect != null">#{systemBoottimeCollect},</if>
|
||||
<if test="systemUnameCollect != null">#{systemUnameCollect},</if>
|
||||
<if test="systemLocaltimeCollect != null">#{systemLocaltimeCollect},</if>
|
||||
<if test="systemUptimeCollect != null">#{systemUptimeCollect},</if>
|
||||
<if test="procNumCollect != null">#{procNumCollect},</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="updateInitialOtherSystemMonitorData" parameterType="InitialOtherSystemMonitorData">
|
||||
update initial_other_system_monitor_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null">client_id = #{clientId},</if>
|
||||
<if test="systemSwapSizeFreeCollect != null">system_swap_size_free_collect = #{systemSwapSizeFreeCollect},</if>
|
||||
<if test="systemSwapSizePercentCollect != null">system_swap_size_percent_collect = #{systemSwapSizePercentCollect},</if>
|
||||
<if test="memoryUtilizationCollect != null">memory_utilization_collect = #{memoryUtilizationCollect},</if>
|
||||
<if test="memorySizeAvailableCollect != null">memory_size_available_collect = #{memorySizeAvailableCollect},</if>
|
||||
<if test="memorySizePercentCollect != null">memory_size_percent_collect = #{memorySizePercentCollect},</if>
|
||||
<if test="memorySizeTotalCollect != null">memory_size_total_collect = #{memorySizeTotalCollect},</if>
|
||||
<if test="systemSwOsCollect != null">system_sw_os_collect = #{systemSwOsCollect},</if>
|
||||
<if test="systemSwArchCollect != null">system_sw_arch_collect = #{systemSwArchCollect},</if>
|
||||
<if test="kernelMaxprocCollect != null">kernel_maxproc_collect = #{kernelMaxprocCollect},</if>
|
||||
<if test="procNumRunCollect != null">proc_num_run_collect = #{procNumRunCollect},</if>
|
||||
<if test="systemUsersNumCollect != null">system_users_num_collect = #{systemUsersNumCollect},</if>
|
||||
<if test="systemDiskSizeTotalCollect != null">system_disk_size_total_collect = #{systemDiskSizeTotalCollect},</if>
|
||||
<if test="systemBoottimeCollect != null">system_boottime_collect = #{systemBoottimeCollect},</if>
|
||||
<if test="systemUnameCollect != null">system_uname_collect = #{systemUnameCollect},</if>
|
||||
<if test="systemLocaltimeCollect != null">system_localtime_collect = #{systemLocaltimeCollect},</if>
|
||||
<if test="systemUptimeCollect != null">system_uptime_collect = #{systemUptimeCollect},</if>
|
||||
<if test="procNumCollect != null">proc_num_collect = #{procNumCollect},</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="deleteInitialOtherSystemMonitorDataById" parameterType="Long">
|
||||
delete from initial_other_system_monitor_data where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialOtherSystemMonitorDataByIds" parameterType="String">
|
||||
delete from initial_other_system_monitor_data where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,133 @@
|
||||
<?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.InitialSwitchFanInfoMapper">
|
||||
|
||||
<resultMap type="InitialSwitchFanInfo" id="InitialSwitchFanInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="fanEntIndex" column="fan_ent_index" />
|
||||
<result property="fanName" column="fan_name" />
|
||||
<result property="fanEntityFanState" column="fan_entity_fan_state" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<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="selectInitialSwitchFanInfoVo">
|
||||
select id, fan_ent_index, fan_name, fan_entity_fan_state, client_id, create_time, update_time, create_by, update_by from initial_switch_fan_info
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialSwitchFanInfoList" parameterType="InitialSwitchFanInfo" resultMap="InitialSwitchFanInfoResult">
|
||||
<include refid="selectInitialSwitchFanInfoVo"/>
|
||||
<where>
|
||||
<if test="fanEntIndex != null and fanEntIndex != ''"> and fan_ent_index = #{fanEntIndex}</if>
|
||||
<if test="fanName != null and fanName != ''"> and fan_name like concat('%', #{fanName}, '%')</if>
|
||||
<if test="fanEntityFanState != null and fanEntityFanState != ''"> and fan_entity_fan_state = #{fanEntityFanState}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialSwitchFanInfoById" parameterType="Long" resultMap="InitialSwitchFanInfoResult">
|
||||
<include refid="selectInitialSwitchFanInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialSwitchFanInfo" parameterType="InitialSwitchFanInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_switch_fan_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="fanEntIndex != null">fan_ent_index,</if>
|
||||
<if test="fanName != null">fan_name,</if>
|
||||
<if test="fanEntityFanState != null">fan_entity_fan_state,</if>
|
||||
<if test="clientId != null">client_id,</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="fanEntIndex != null">#{fanEntIndex},</if>
|
||||
<if test="fanName != null">#{fanName},</if>
|
||||
<if test="fanEntityFanState != null">#{fanEntityFanState},</if>
|
||||
<if test="clientId != null">#{clientId},</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="updateInitialSwitchFanInfo" parameterType="InitialSwitchFanInfo">
|
||||
update initial_switch_fan_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="fanEntIndex != null">fan_ent_index = #{fanEntIndex},</if>
|
||||
<if test="fanName != null">fan_name = #{fanName},</if>
|
||||
<if test="fanEntityFanState != null">fan_entity_fan_state = #{fanEntityFanState},</if>
|
||||
<if test="clientId != null">client_id = #{clientId},</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="deleteInitialSwitchFanInfoById" parameterType="Long">
|
||||
delete from initial_switch_fan_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialSwitchFanInfoByIds" parameterType="String">
|
||||
delete from initial_switch_fan_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<insert id="insertBatchInitialSwitchFanInfo" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_switch_fan_info
|
||||
(
|
||||
fan_ent_index,
|
||||
fan_name,
|
||||
fan_entity_fan_state,
|
||||
client_id,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.fanEntIndex},
|
||||
#{item.fanName},
|
||||
#{item.fanEntityFanState},
|
||||
#{item.clientId},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.createBy},
|
||||
#{item.updateBy}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<select id="getAllFanName" parameterType="InitialSwitchFanInfo" resultType="java.util.Map">
|
||||
select fan_name fanName from initial_switch_fan_info
|
||||
<where>
|
||||
<if test="fanEntIndex != null and fanEntIndex != ''"> and fan_ent_index = #{fanEntIndex}</if>
|
||||
<if test="fanName != null and fanName != ''"> and fan_name like concat('%', #{fanName}, '%')</if>
|
||||
<if test="fanEntityFanState != null and fanEntityFanState != ''"> and fan_entity_fan_state = #{fanEntityFanState}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
group by fan_name
|
||||
</select>
|
||||
<select id="getFanMsg" parameterType="InitialSwitchFanInfo" resultMap="InitialSwitchFanInfoResult">
|
||||
<include refid="selectInitialSwitchFanInfoVo"/>
|
||||
<where>
|
||||
<if test="fanEntIndex != null and fanEntIndex != ''"> and fan_ent_index = #{fanEntIndex}</if>
|
||||
<if test="fanName != null and fanName != ''"> and fan_name like concat('%', #{fanName}, '%')</if>
|
||||
<if test="fanEntityFanState != null and fanEntityFanState != ''"> and fan_entity_fan_state = #{fanEntityFanState}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
order by create_time desc limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,265 @@
|
||||
<?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.InitialSwitchInfoMapper">
|
||||
|
||||
<resultMap type="InitialSwitchInfo" id="InitialSwitchInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="inBytes" column="in_bytes" />
|
||||
<result property="outBytes" column="out_bytes" />
|
||||
<result property="status" column="status" />
|
||||
<result property="type" column="type" />
|
||||
<result property="inSpeed" column="in_speed" />
|
||||
<result property="outSpeed" column="out_speed" />
|
||||
<result property="switchIp" column="switch_ip" />
|
||||
<result property="ifIndex" column="if_index" />
|
||||
<result property="ifSpeed" column="if_speed" />
|
||||
<result property="ifInDiscards" column="if_in_discards" />
|
||||
<result property="ifOutDiscards" column="if_out_discards" />
|
||||
<result property="ifInErrors" column="if_in_errors" />
|
||||
<result property="ifOutErrors" column="if_out_errors" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInitialSwitchInfoVo">
|
||||
select id, client_id, name, in_bytes, out_bytes,
|
||||
CASE
|
||||
WHEN status = 1 THEN 'up'
|
||||
WHEN status = 2 THEN 'down'
|
||||
ELSE `status`
|
||||
END AS status,
|
||||
type, in_speed, out_speed, switch_ip, if_index,
|
||||
if_speed, if_in_discards, if_out_discards, if_in_errors, if_out_errors, create_by, update_by, create_time,
|
||||
update_time from initial_switch_info
|
||||
</sql>
|
||||
<sql id="selectInitialSwitchInfoVoSharding">
|
||||
select id, client_id, name, in_bytes, out_bytes,
|
||||
CASE
|
||||
WHEN status = 1 THEN 'up'
|
||||
WHEN status = 2 THEN 'down'
|
||||
ELSE `status`
|
||||
END AS status,
|
||||
type, in_speed, out_speed, switch_ip, if_index,
|
||||
if_speed, if_in_discards, if_out_discards, if_in_errors, if_out_errors, create_by, update_by, create_time,
|
||||
update_time from ${tableName}
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialSwitchInfoList" parameterType="InitialSwitchInfo" resultMap="InitialSwitchInfoResult">
|
||||
<include refid="selectInitialSwitchInfoVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="name != null and name != ''"> and name = #{name}</if>
|
||||
<if test="inBytes != null "> and in_bytes = #{inBytes}</if>
|
||||
<if test="outBytes != null "> and out_bytes = #{outBytes}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="inSpeed != null "> and in_speed = #{inSpeed}</if>
|
||||
<if test="outSpeed != null "> and out_speed = #{outSpeed}</if>
|
||||
<if test="switchIp != null and switchIp != ''"> and switch_ip = #{switchIp}</if>
|
||||
<if test="ifIndex != null and ifIndex != ''"> and if_index = #{ifIndex}</if>
|
||||
<if test="ifSpeed != null "> and if_speed = #{ifSpeed}</if>
|
||||
<if test="ifInDiscards != null "> and if_in_discards = #{ifInDiscards}</if>
|
||||
<if test="ifOutDiscards != null "> and if_out_discards = #{ifOutDiscards}</if>
|
||||
<if test="ifInErrors != null "> and if_in_errors = #{ifInErrors}</if>
|
||||
<if test="ifOutErrors != null "> and if_out_errors = #{ifOutErrors}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialSwitchInfoById" parameterType="Long" resultMap="InitialSwitchInfoResult">
|
||||
<include refid="selectInitialSwitchInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialSwitchInfo" parameterType="InitialSwitchInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into initial_switch_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="inBytes != null">in_bytes,</if>
|
||||
<if test="outBytes != null">out_bytes,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="inSpeed != null">in_speed,</if>
|
||||
<if test="outSpeed != null">out_speed,</if>
|
||||
<if test="switchIp != null and switchIp != ''">switch_ip,</if>
|
||||
<if test="ifIndex != null and ifIndex != ''">if_index,</if>
|
||||
<if test="ifSpeed != null">if_speed,</if>
|
||||
<if test="ifInDiscards != null">if_in_discards,</if>
|
||||
<if test="ifOutDiscards != null">if_out_discards,</if>
|
||||
<if test="ifInErrors != null">if_in_errors,</if>
|
||||
<if test="ifOutErrors != null">if_out_errors,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">#{clientId},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="inBytes != null">#{inBytes},</if>
|
||||
<if test="outBytes != null">#{outBytes},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="inSpeed != null">#{inSpeed},</if>
|
||||
<if test="outSpeed != null">#{outSpeed},</if>
|
||||
<if test="switchIp != null and switchIp != ''">#{switchIp},</if>
|
||||
<if test="ifIndex != null and ifIndex != ''">#{ifIndex},</if>
|
||||
<if test="ifSpeed != null">#{ifSpeed},</if>
|
||||
<if test="ifInDiscards != null">#{ifInDiscards},</if>
|
||||
<if test="ifOutDiscards != null">#{ifOutDiscards},</if>
|
||||
<if test="ifInErrors != null">#{ifInErrors},</if>
|
||||
<if test="ifOutErrors != null">#{ifOutErrors},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInitialSwitchInfo" parameterType="InitialSwitchInfo">
|
||||
update initial_switch_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="inBytes != null">in_bytes = #{inBytes},</if>
|
||||
<if test="outBytes != null">out_bytes = #{outBytes},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="inSpeed != null">in_speed = #{inSpeed},</if>
|
||||
<if test="outSpeed != null">out_speed = #{outSpeed},</if>
|
||||
<if test="switchIp != null and switchIp != ''">switch_ip = #{switchIp},</if>
|
||||
<if test="ifIndex != null and ifIndex != ''">if_index = #{ifIndex},</if>
|
||||
<if test="ifSpeed != null">if_speed = #{ifSpeed},</if>
|
||||
<if test="ifInDiscards != null">if_in_discards = #{ifInDiscards},</if>
|
||||
<if test="ifOutDiscards != null">if_out_discards = #{ifOutDiscards},</if>
|
||||
<if test="ifInErrors != null">if_in_errors = #{ifInErrors},</if>
|
||||
<if test="ifOutErrors != null">if_out_errors = #{ifOutErrors},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInitialSwitchInfoById" parameterType="Long">
|
||||
delete from initial_switch_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialSwitchInfoByIds" parameterType="String">
|
||||
delete from initial_switch_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertInitialSwitchInfo" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT IGNORE INTO initial_switch_info
|
||||
(
|
||||
client_id, `name`, in_bytes, out_bytes, status, `type`, in_speed, out_speed, switch_ip,
|
||||
if_index, if_speed, if_in_discards, if_out_discards, if_in_errors, if_out_errors,
|
||||
create_by, update_by, create_time, update_time
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.clientId}, #{item.name}, #{item.inBytes}, #{item.outBytes},
|
||||
#{item.status}, #{item.type}, #{item.inSpeed}, #{item.outSpeed}, #{item.switchIp},
|
||||
#{item.ifIndex}, #{item.ifSpeed}, #{item.ifInDiscards},#{item.ifOutDiscards},#{item.ifInErrors},#{item.ifOutErrors},
|
||||
#{item.createBy}, #{item.updateBy},
|
||||
<choose>
|
||||
<when test="item.createTime != null">
|
||||
#{item.createTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>,
|
||||
<choose>
|
||||
<when test="item.updateTime != null">
|
||||
#{item.updateTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getSwitchNetDetailsMsg" parameterType="String" resultMap="InitialSwitchInfoResult">
|
||||
<include refid="selectInitialSwitchInfoVo"/>
|
||||
where client_id = #{clientId} and name = #{name}
|
||||
limit 1
|
||||
</select>
|
||||
<select id="getSwitchNetDetailsMsgSharding" parameterType="String" resultMap="InitialSwitchInfoResult">
|
||||
<include refid="selectInitialSwitchInfoVoSharding"/>
|
||||
where client_id = #{clientId} and name = #{name}
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="batchInsertInitialSwitchInfoSharding" parameterType="InitialSwitchInfo">
|
||||
INSERT IGNORE INTO ${tableName}
|
||||
(
|
||||
client_id, `name`, in_bytes, out_bytes, status, `type`, in_speed, out_speed, switch_ip,
|
||||
if_index, if_speed, if_in_discards, if_out_discards, if_in_errors, if_out_errors,
|
||||
create_by, update_by, create_time, update_time
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.clientId}, #{item.name}, #{item.inBytes}, #{item.outBytes},
|
||||
#{item.status}, #{item.type}, #{item.inSpeed}, #{item.outSpeed}, #{item.switchIp},
|
||||
#{item.ifIndex}, #{item.ifSpeed}, #{item.ifInDiscards},#{item.ifOutDiscards},#{item.ifInErrors},#{item.ifOutErrors},
|
||||
#{item.createBy}, #{item.updateBy},
|
||||
<choose>
|
||||
<when test="item.createTime != null">
|
||||
#{item.createTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>,
|
||||
<choose>
|
||||
<when test="item.updateTime != null">
|
||||
#{item.updateTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<select id="selectInitialSwitchInfoListSharding" parameterType="InitialSwitchInfo" resultMap="InitialSwitchInfoResult">
|
||||
<include refid="selectInitialSwitchInfoVoSharding"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="name != null and name != ''"> and name = #{name}</if>
|
||||
<if test="inBytes != null "> and in_bytes = #{inBytes}</if>
|
||||
<if test="outBytes != null "> and out_bytes = #{outBytes}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="inSpeed != null "> and in_speed = #{inSpeed}</if>
|
||||
<if test="outSpeed != null "> and out_speed = #{outSpeed}</if>
|
||||
<if test="switchIp != null and switchIp != ''"> and switch_ip = #{switchIp}</if>
|
||||
<if test="ifIndex != null and ifIndex != ''"> and if_index = #{ifIndex}</if>
|
||||
<if test="ifSpeed != null "> and if_speed = #{ifSpeed}</if>
|
||||
<if test="ifInDiscards != null "> and if_in_discards = #{ifInDiscards}</if>
|
||||
<if test="ifOutDiscards != null "> and if_out_discards = #{ifOutDiscards}</if>
|
||||
<if test="ifInErrors != null "> and if_in_errors = #{ifInErrors}</if>
|
||||
<if test="ifOutErrors != null "> and if_out_errors = #{ifOutErrors}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,190 @@
|
||||
<?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.InitialSwitchInfoTempMapper">
|
||||
|
||||
<resultMap type="InitialSwitchInfoTemp" id="InitialSwitchInfoTempResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="inBytes" column="in_bytes" />
|
||||
<result property="outBytes" column="out_bytes" />
|
||||
<result property="status" column="status" />
|
||||
<result property="type" column="type" />
|
||||
<result property="inSpeed" column="in_speed" />
|
||||
<result property="outSpeed" column="out_speed" />
|
||||
<result property="switchIp" column="switch_ip" />
|
||||
<result property="ifIndex" column="if_index" />
|
||||
<result property="ifSpeed" column="if_speed" />
|
||||
<result property="ifInDiscards" column="if_in_discards" />
|
||||
<result property="ifOutDiscards" column="if_out_discards" />
|
||||
<result property="ifInErrors" column="if_in_errors" />
|
||||
<result property="ifOutErrors" column="if_out_errors" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInitialSwitchInfoTempVo">
|
||||
select id, client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, switch_ip, if_index, if_speed, if_in_discards, if_out_discards, if_in_errors, if_out_errors, create_by, update_by, create_time, update_time from initial_switch_info_temp
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialSwitchInfoTempList" parameterType="InitialSwitchInfoTemp" resultMap="InitialSwitchInfoTempResult">
|
||||
<include refid="selectInitialSwitchInfoTempVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="inBytes != null "> and in_bytes = #{inBytes}</if>
|
||||
<if test="outBytes != null "> and out_bytes = #{outBytes}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="inSpeed != null "> and in_speed = #{inSpeed}</if>
|
||||
<if test="outSpeed != null "> and out_speed = #{outSpeed}</if>
|
||||
<if test="switchIp != null and switchIp != ''"> and switch_ip = #{switchIp}</if>
|
||||
<if test="ifIndex != null and ifIndex != ''"> and if_index = #{ifIndex}</if>
|
||||
<if test="ifSpeed != null "> and if_speed = #{ifSpeed}</if>
|
||||
<if test="ifInDiscards != null "> and if_in_discards = #{ifInDiscards}</if>
|
||||
<if test="ifOutDiscards != null "> and if_out_discards = #{ifOutDiscards}</if>
|
||||
<if test="ifInErrors != null "> and if_in_errors = #{ifInErrors}</if>
|
||||
<if test="ifOutErrors != null "> and if_out_errors = #{ifOutErrors}</if>
|
||||
<if test="createTime != null "> and create_time = #{createTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialSwitchInfoTempById" parameterType="Long" resultMap="InitialSwitchInfoTempResult">
|
||||
<include refid="selectInitialSwitchInfoTempVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialSwitchInfoTemp" parameterType="InitialSwitchInfoTemp" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into initial_switch_info_temp
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="inBytes != null">in_bytes,</if>
|
||||
<if test="outBytes != null">out_bytes,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="inSpeed != null">in_speed,</if>
|
||||
<if test="outSpeed != null">out_speed,</if>
|
||||
<if test="switchIp != null and switchIp != ''">switch_ip,</if>
|
||||
<if test="ifIndex != null and ifIndex != ''">if_index,</if>
|
||||
<if test="ifSpeed != null">if_speed,</if>
|
||||
<if test="ifInDiscards != null">if_in_discards,</if>
|
||||
<if test="ifOutDiscards != null">if_out_discards,</if>
|
||||
<if test="ifInErrors != null">if_in_errors,</if>
|
||||
<if test="ifOutErrors != null">if_out_errors,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">#{clientId},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="inBytes != null">#{inBytes},</if>
|
||||
<if test="outBytes != null">#{outBytes},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="inSpeed != null">#{inSpeed},</if>
|
||||
<if test="outSpeed != null">#{outSpeed},</if>
|
||||
<if test="switchIp != null and switchIp != ''">#{switchIp},</if>
|
||||
<if test="ifIndex != null and ifIndex != ''">#{ifIndex},</if>
|
||||
<if test="ifSpeed != null">#{ifSpeed},</if>
|
||||
<if test="ifInDiscards != null">#{ifInDiscards},</if>
|
||||
<if test="ifOutDiscards != null">#{ifOutDiscards},</if>
|
||||
<if test="ifInErrors != null">#{ifInErrors},</if>
|
||||
<if test="ifOutErrors != null">#{ifOutErrors},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInitialSwitchInfoTemp" parameterType="InitialSwitchInfoTemp">
|
||||
update initial_switch_info_temp
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="inBytes != null">in_bytes = #{inBytes},</if>
|
||||
<if test="outBytes != null">out_bytes = #{outBytes},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="inSpeed != null">in_speed = #{inSpeed},</if>
|
||||
<if test="outSpeed != null">out_speed = #{outSpeed},</if>
|
||||
<if test="switchIp != null and switchIp != ''">switch_ip = #{switchIp},</if>
|
||||
<if test="ifIndex != null and ifIndex != ''">if_index = #{ifIndex},</if>
|
||||
<if test="ifSpeed != null">if_speed = #{ifSpeed},</if>
|
||||
<if test="ifInDiscards != null">if_in_discards = #{ifInDiscards},</if>
|
||||
<if test="ifOutDiscards != null">if_out_discards = #{ifOutDiscards},</if>
|
||||
<if test="ifInErrors != null">if_in_errors = #{ifInErrors},</if>
|
||||
<if test="ifOutErrors != null">if_out_errors = #{ifOutErrors},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInitialSwitchInfoTempById" parameterType="Long">
|
||||
delete from initial_switch_info_temp where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialSwitchInfoTempByIds" parameterType="String">
|
||||
delete from initial_switch_info_temp where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertInitialSwitchInfoTemp" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT IGNORE INTO initial_switch_info_temp
|
||||
(
|
||||
client_id, `name`, in_bytes, out_bytes, status, `type`, in_speed, out_speed, switch_ip,
|
||||
if_index, if_speed, if_in_discards, if_out_discards, if_in_errors, if_out_errors,
|
||||
create_by, update_by, create_time, update_time
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.clientId}, #{item.name}, #{item.inBytes}, #{item.outBytes},
|
||||
#{item.status}, #{item.type}, #{item.inSpeed}, #{item.outSpeed}, #{item.switchIp},
|
||||
#{item.ifIndex}, #{item.ifSpeed}, #{item.ifInDiscards},#{item.ifOutDiscards},#{item.ifInErrors},#{item.ifOutErrors},
|
||||
#{item.createBy}, #{item.updateBy},
|
||||
<choose>
|
||||
<when test="item.createTime != null">
|
||||
#{item.createTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>,
|
||||
<choose>
|
||||
<when test="item.updateTime != null">
|
||||
#{item.updateTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="truncateSwitchInfoTemp" parameterType="String">
|
||||
DELETE FROM initial_switch_info_temp
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="clientId != null and clientId != ''">
|
||||
client_id = #{clientId}
|
||||
</when>
|
||||
<otherwise>
|
||||
1=0 <!-- 安全措施:条件不满足时不删除任何数据 -->
|
||||
</otherwise>
|
||||
</choose>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,162 @@
|
||||
<?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.InitialSwitchMpuInfoMapper">
|
||||
|
||||
<resultMap type="InitialSwitchMpuInfo" id="InitialSwitchMpuInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="mpuEntIndex" column="mpu_ent_index" />
|
||||
<result property="mpuName" column="mpu_name" />
|
||||
<result property="mpuEntityCpuUsage" column="mpu_entity_cpu_usage" />
|
||||
<result property="mpuEntityMemUsage" column="mpu_entity_mem_usage" />
|
||||
<result property="mpuPhysicalSoftwareRev" column="mpu_physical_software_rev" />
|
||||
<result property="mpuEntityTemperature" column="mpu_entity_temperature" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<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="selectInitialSwitchMpuInfoVo">
|
||||
select id, mpu_ent_index, mpu_name, mpu_entity_cpu_usage, mpu_entity_mem_usage, mpu_physical_software_rev, mpu_entity_temperature, client_id, create_time, update_time, create_by, update_by from initial_switch_mpu_info
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialSwitchMpuInfoList" parameterType="InitialSwitchMpuInfo" resultMap="InitialSwitchMpuInfoResult">
|
||||
<include refid="selectInitialSwitchMpuInfoVo"/>
|
||||
<where>
|
||||
<if test="mpuEntIndex != null and mpuEntIndex != ''"> and mpu_ent_index = #{mpuEntIndex}</if>
|
||||
<if test="mpuName != null and mpuName != ''"> and mpu_name like concat('%', #{mpuName}, '%')</if>
|
||||
<if test="mpuEntityCpuUsage != null "> and mpu_entity_cpu_usage = #{mpuEntityCpuUsage}</if>
|
||||
<if test="mpuEntityMemUsage != null "> and mpu_entity_mem_usage = #{mpuEntityMemUsage}</if>
|
||||
<if test="mpuPhysicalSoftwareRev != null and mpuPhysicalSoftwareRev != ''"> and mpu_physical_software_rev = #{mpuPhysicalSoftwareRev}</if>
|
||||
<if test="mpuEntityTemperature != null "> and mpu_entity_temperature = #{mpuEntityTemperature}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialSwitchMpuInfoById" parameterType="Long" resultMap="InitialSwitchMpuInfoResult">
|
||||
<include refid="selectInitialSwitchMpuInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialSwitchMpuInfo" parameterType="InitialSwitchMpuInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_switch_mpu_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="mpuEntIndex != null">mpu_ent_index,</if>
|
||||
<if test="mpuName != null">mpu_name,</if>
|
||||
<if test="mpuEntityCpuUsage != null">mpu_entity_cpu_usage,</if>
|
||||
<if test="mpuEntityMemUsage != null">mpu_entity_mem_usage,</if>
|
||||
<if test="mpuPhysicalSoftwareRev != null">mpu_physical_software_rev,</if>
|
||||
<if test="mpuEntityTemperature != null">mpu_entity_temperature,</if>
|
||||
<if test="clientId != null">client_id,</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="mpuEntIndex != null">#{mpuEntIndex},</if>
|
||||
<if test="mpuName != null">#{mpuName},</if>
|
||||
<if test="mpuEntityCpuUsage != null">#{mpuEntityCpuUsage},</if>
|
||||
<if test="mpuEntityMemUsage != null">#{mpuEntityMemUsage},</if>
|
||||
<if test="mpuPhysicalSoftwareRev != null">#{mpuPhysicalSoftwareRev},</if>
|
||||
<if test="mpuEntityTemperature != null">#{mpuEntityTemperature},</if>
|
||||
<if test="clientId != null">#{clientId},</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="updateInitialSwitchMpuInfo" parameterType="InitialSwitchMpuInfo">
|
||||
update initial_switch_mpu_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="mpuEntIndex != null">mpu_ent_index = #{mpuEntIndex},</if>
|
||||
<if test="mpuName != null">mpu_name = #{mpuName},</if>
|
||||
<if test="mpuEntityCpuUsage != null">mpu_entity_cpu_usage = #{mpuEntityCpuUsage},</if>
|
||||
<if test="mpuEntityMemUsage != null">mpu_entity_mem_usage = #{mpuEntityMemUsage},</if>
|
||||
<if test="mpuPhysicalSoftwareRev != null">mpu_physical_software_rev = #{mpuPhysicalSoftwareRev},</if>
|
||||
<if test="mpuEntityTemperature != null">mpu_entity_temperature = #{mpuEntityTemperature},</if>
|
||||
<if test="clientId != null">client_id = #{clientId},</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="deleteInitialSwitchMpuInfoById" parameterType="Long">
|
||||
delete from initial_switch_mpu_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialSwitchMpuInfoByIds" parameterType="String">
|
||||
delete from initial_switch_mpu_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<insert id="insertBatchInitialSwitchMpuInfo" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_switch_mpu_info
|
||||
(
|
||||
mpu_ent_index,
|
||||
mpu_name,
|
||||
mpu_entity_cpu_usage,
|
||||
mpu_entity_mem_usage,
|
||||
mpu_physical_software_rev,
|
||||
mpu_entity_temperature,
|
||||
client_id,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.mpuEntIndex},
|
||||
#{item.mpuName},
|
||||
#{item.mpuEntityCpuUsage},
|
||||
#{item.mpuEntityMemUsage},
|
||||
#{item.mpuPhysicalSoftwareRev},
|
||||
#{item.mpuEntityTemperature},
|
||||
#{item.clientId},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.createBy},
|
||||
#{item.updateBy}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<select id="getMpuMsg" parameterType="InitialSwitchMpuInfo" resultMap="InitialSwitchMpuInfoResult">
|
||||
<include refid="selectInitialSwitchMpuInfoVo"/>
|
||||
<where>
|
||||
<if test="mpuEntIndex != null and mpuEntIndex != ''"> and mpu_ent_index = #{mpuEntIndex}</if>
|
||||
<if test="mpuName != null and mpuName != ''"> and mpu_name like concat('%', #{mpuName}, '%')</if>
|
||||
<if test="mpuEntityCpuUsage != null "> and mpu_entity_cpu_usage = #{mpuEntityCpuUsage}</if>
|
||||
<if test="mpuEntityMemUsage != null "> and mpu_entity_mem_usage = #{mpuEntityMemUsage}</if>
|
||||
<if test="mpuPhysicalSoftwareRev != null and mpuPhysicalSoftwareRev != ''"> and mpu_physical_software_rev = #{mpuPhysicalSoftwareRev}</if>
|
||||
<if test="mpuEntityTemperature != null "> and mpu_entity_temperature = #{mpuEntityTemperature}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
order by create_time desc limit 1
|
||||
</select>
|
||||
<select id="getAllMpuName" parameterType="InitialSwitchMpuInfo" resultType="java.util.Map">
|
||||
select mpu_name mpuName from initial_switch_mpu_info
|
||||
<where>
|
||||
<if test="mpuEntIndex != null and mpuEntIndex != ''"> and mpu_ent_index = #{mpuEntIndex}</if>
|
||||
<if test="mpuName != null and mpuName != ''"> and mpu_name like concat('%', #{mpuName}, '%')</if>
|
||||
<if test="mpuEntityCpuUsage != null "> and mpu_entity_cpu_usage = #{mpuEntityCpuUsage}</if>
|
||||
<if test="mpuEntityMemUsage != null "> and mpu_entity_mem_usage = #{mpuEntityMemUsage}</if>
|
||||
<if test="mpuPhysicalSoftwareRev != null and mpuPhysicalSoftwareRev != ''"> and mpu_physical_software_rev = #{mpuPhysicalSoftwareRev}</if>
|
||||
<if test="mpuEntityTemperature != null "> and mpu_entity_temperature = #{mpuEntityTemperature}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
group by mpu_name
|
||||
</select>
|
||||
</mapper>
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
<?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.InitialSwitchOpticalModuleMapper">
|
||||
|
||||
<resultMap type="InitialSwitchOpticalModule" id="InitialSwitchOpticalModuleResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="fiberEntIndex" column="fiber_ent_index" />
|
||||
<result property="fiberPortName" column="fiber_port_name" />
|
||||
<result property="hwEntityOpticalTxLowThreshold" column="hw_entity_optical_tx_low_threshold" />
|
||||
<result property="hwEntityOpticalRxLowThreshold" column="hw_entity_optical_rx_low_threshold" />
|
||||
<result property="hwEntityOpticalRxPower" column="hw_entity_optical_rx_power" />
|
||||
<result property="hwEntityOpticalTxPower" column="hw_entity_optical_tx_power" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<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="selectInitialSwitchOpticalModuleVo">
|
||||
select id, fiber_ent_index, fiber_port_name, hw_entity_optical_tx_low_threshold, hw_entity_optical_rx_low_threshold, hw_entity_optical_rx_power, hw_entity_optical_tx_power, client_id, create_time, update_time, create_by, update_by from initial_switch_optical_module
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialSwitchOpticalModuleList" parameterType="InitialSwitchOpticalModule" resultMap="InitialSwitchOpticalModuleResult">
|
||||
<include refid="selectInitialSwitchOpticalModuleVo"/>
|
||||
<where>
|
||||
<if test="fiberEntIndex != null and fiberEntIndex != ''"> and fiber_ent_index = #{fiberEntIndex}</if>
|
||||
<if test="fiberPortName != null and fiberPortName != ''"> and fiber_port_name like concat('%', #{fiberPortName}, '%')</if>
|
||||
<if test="hwEntityOpticalTxLowThreshold != null "> and hw_entity_optical_tx_low_threshold = #{hwEntityOpticalTxLowThreshold}</if>
|
||||
<if test="hwEntityOpticalRxLowThreshold != null "> and hw_entity_optical_rx_low_threshold = #{hwEntityOpticalRxLowThreshold}</if>
|
||||
<if test="hwEntityOpticalRxPower != null "> and hw_entity_optical_rx_power = #{hwEntityOpticalRxPower}</if>
|
||||
<if test="hwEntityOpticalTxPower != null "> and hw_entity_optical_tx_power = #{hwEntityOpticalTxPower}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialSwitchOpticalModuleById" parameterType="Long" resultMap="InitialSwitchOpticalModuleResult">
|
||||
<include refid="selectInitialSwitchOpticalModuleVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialSwitchOpticalModule" parameterType="InitialSwitchOpticalModule" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_switch_optical_module
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="fiberEntIndex != null">fiber_ent_index,</if>
|
||||
<if test="fiberPortName != null">fiber_port_name,</if>
|
||||
<if test="hwEntityOpticalTxLowThreshold != null">hw_entity_optical_tx_low_threshold,</if>
|
||||
<if test="hwEntityOpticalRxLowThreshold != null">hw_entity_optical_rx_low_threshold,</if>
|
||||
<if test="hwEntityOpticalRxPower != null">hw_entity_optical_rx_power,</if>
|
||||
<if test="hwEntityOpticalTxPower != null">hw_entity_optical_tx_power,</if>
|
||||
<if test="clientId != null">client_id,</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="fiberEntIndex != null">#{fiberEntIndex},</if>
|
||||
<if test="fiberPortName != null">#{fiberPortName},</if>
|
||||
<if test="hwEntityOpticalTxLowThreshold != null">#{hwEntityOpticalTxLowThreshold},</if>
|
||||
<if test="hwEntityOpticalRxLowThreshold != null">#{hwEntityOpticalRxLowThreshold},</if>
|
||||
<if test="hwEntityOpticalRxPower != null">#{hwEntityOpticalRxPower},</if>
|
||||
<if test="hwEntityOpticalTxPower != null">#{hwEntityOpticalTxPower},</if>
|
||||
<if test="clientId != null">#{clientId},</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="updateInitialSwitchOpticalModule" parameterType="InitialSwitchOpticalModule">
|
||||
update initial_switch_optical_module
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="fiberEntIndex != null">fiber_ent_index = #{fiberEntIndex},</if>
|
||||
<if test="fiberPortName != null">fiber_port_name = #{fiberPortName},</if>
|
||||
<if test="hwEntityOpticalTxLowThreshold != null">hw_entity_optical_tx_low_threshold = #{hwEntityOpticalTxLowThreshold},</if>
|
||||
<if test="hwEntityOpticalRxLowThreshold != null">hw_entity_optical_rx_low_threshold = #{hwEntityOpticalRxLowThreshold},</if>
|
||||
<if test="hwEntityOpticalRxPower != null">hw_entity_optical_rx_power = #{hwEntityOpticalRxPower},</if>
|
||||
<if test="hwEntityOpticalTxPower != null">hw_entity_optical_tx_power = #{hwEntityOpticalTxPower},</if>
|
||||
<if test="clientId != null">client_id = #{clientId},</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="deleteInitialSwitchOpticalModuleById" parameterType="Long">
|
||||
delete from initial_switch_optical_module where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialSwitchOpticalModuleByIds" parameterType="String">
|
||||
delete from initial_switch_optical_module where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<insert id="batchInitialSwitchOpticalModule" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_switch_optical_module
|
||||
(
|
||||
fiber_ent_index,
|
||||
fiber_port_name,
|
||||
hw_entity_optical_tx_low_threshold,
|
||||
hw_entity_optical_rx_low_threshold,
|
||||
hw_entity_optical_rx_power,
|
||||
hw_entity_optical_tx_power,
|
||||
client_id,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.fiberEntIndex},
|
||||
#{item.fiberPortName},
|
||||
#{item.hwEntityOpticalTxLowThreshold},
|
||||
#{item.hwEntityOpticalRxLowThreshold},
|
||||
#{item.hwEntityOpticalRxPower},
|
||||
#{item.hwEntityOpticalTxPower},
|
||||
#{item.clientId},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.createBy},
|
||||
#{item.updateBy}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<select id="switchOpticalModuleMsg" parameterType="InitialSwitchOpticalModule" resultMap="InitialSwitchOpticalModuleResult">
|
||||
<include refid="selectInitialSwitchOpticalModuleVo"/>
|
||||
<where>
|
||||
<if test="fiberEntIndex != null and fiberEntIndex != ''"> and fiber_ent_index = #{fiberEntIndex}</if>
|
||||
<if test="fiberPortName != null and fiberPortName != ''"> and fiber_port_name like concat('%', #{fiberPortName}, '%')</if>
|
||||
<if test="hwEntityOpticalTxLowThreshold != null "> and hw_entity_optical_tx_low_threshold = #{hwEntityOpticalTxLowThreshold}</if>
|
||||
<if test="hwEntityOpticalRxLowThreshold != null "> and hw_entity_optical_rx_low_threshold = #{hwEntityOpticalRxLowThreshold}</if>
|
||||
<if test="hwEntityOpticalRxPower != null "> and hw_entity_optical_rx_power = #{hwEntityOpticalRxPower}</if>
|
||||
<if test="hwEntityOpticalTxPower != null "> and hw_entity_optical_tx_power = #{hwEntityOpticalTxPower}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
order by create_time desc limit 1
|
||||
</select>
|
||||
<select id="getAllModuleName" parameterType="InitialSwitchOpticalModule" resultType="java.util.Map">
|
||||
select fiber_port_name fiberPortName from initial_switch_optical_module
|
||||
<where>
|
||||
<if test="fiberEntIndex != null and fiberEntIndex != ''"> and fiber_ent_index = #{fiberEntIndex}</if>
|
||||
<if test="fiberPortName != null and fiberPortName != ''"> and fiber_port_name like concat('%', #{fiberPortName}, '%')</if>
|
||||
<if test="hwEntityOpticalTxLowThreshold != null "> and hw_entity_optical_tx_low_threshold = #{hwEntityOpticalTxLowThreshold}</if>
|
||||
<if test="hwEntityOpticalRxLowThreshold != null "> and hw_entity_optical_rx_low_threshold = #{hwEntityOpticalRxLowThreshold}</if>
|
||||
<if test="hwEntityOpticalRxPower != null "> and hw_entity_optical_rx_power = #{hwEntityOpticalRxPower}</if>
|
||||
<if test="hwEntityOpticalTxPower != null "> and hw_entity_optical_tx_power = #{hwEntityOpticalTxPower}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
group by fiber_port_name
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
<?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.InitialSwitchOtherCollectDataMapper">
|
||||
|
||||
<resultMap type="InitialSwitchOtherCollectData" id="InitialSwitchOtherCollectDataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="collectType" column="collect_type" />
|
||||
<result property="collectValue" column="collect_value" />
|
||||
<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="selectInitialSwitchOtherCollectDataVo">
|
||||
select id, client_id, collect_type, collect_value, create_time, update_time, create_by, update_by from initial_switch_other_collect_data
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialSwitchOtherCollectDataList" parameterType="InitialSwitchOtherCollectData" resultMap="InitialSwitchOtherCollectDataResult">
|
||||
<include refid="selectInitialSwitchOtherCollectDataVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="collectType != null and collectType != ''"> and collect_type = #{collectType}</if>
|
||||
<if test="collectValue != null and collectValue != ''"> and collect_value = #{collectValue}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialSwitchOtherCollectDataById" parameterType="Long" resultMap="InitialSwitchOtherCollectDataResult">
|
||||
<include refid="selectInitialSwitchOtherCollectDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialSwitchOtherCollectData" parameterType="InitialSwitchOtherCollectData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_switch_other_collect_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="collectType != null and collectType != ''">collect_type,</if>
|
||||
<if test="collectValue != null">collect_value,</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="collectType != null and collectType != ''">#{collectType},</if>
|
||||
<if test="collectValue != null">#{collectValue},</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="updateInitialSwitchOtherCollectData" parameterType="InitialSwitchOtherCollectData">
|
||||
update initial_switch_other_collect_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="collectType != null and collectType != ''">collect_type = #{collectType},</if>
|
||||
<if test="collectValue != null">collect_value = #{collectValue},</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="deleteInitialSwitchOtherCollectDataById" parameterType="Long">
|
||||
delete from initial_switch_other_collect_data where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialSwitchOtherCollectDataByIds" parameterType="String">
|
||||
delete from initial_switch_other_collect_data where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="getSwitchMonitorMsg" parameterType="InitialSwitchOtherCollectData" resultType="java.util.Map">
|
||||
SELECT
|
||||
MAX(CASE WHEN t.collect_type = 'sysDescr' THEN t.collect_value END) as sysDescr,
|
||||
MAX(CASE WHEN t.collect_type = 'sysObjectID' THEN t.collect_value END) as sysObjectID,
|
||||
MAX(CASE WHEN t.collect_type = 'sysUpTime' THEN t.collect_value END) as sysUpTime,
|
||||
MAX(CASE WHEN t.collect_type = 'sysContact' THEN t.collect_value END) as sysContact,
|
||||
MAX(CASE WHEN t.collect_type = 'sysName' THEN t.collect_value END) as sysName,
|
||||
MAX(CASE WHEN t.collect_type = 'sysLocation' THEN t.collect_value END) as sysLocation,
|
||||
MAX(CASE WHEN t.collect_type = 'hwStackSystemMac' THEN t.collect_value END) as hwStackSystemMac,
|
||||
MAX(CASE WHEN t.collect_type = 'entIndex' THEN t.collect_value END) as entIndex,
|
||||
MAX(CASE WHEN t.collect_type = 'entPhysicalName' THEN t.collect_value END) as entPhysicalName,
|
||||
MAX(CASE WHEN t.collect_type = 'entPhysicalSoftwareRev' THEN t.collect_value END) as entPhysicalSoftwareRev
|
||||
FROM `initial_switch_other_collect_data` t
|
||||
INNER JOIN (
|
||||
SELECT collect_type, MAX(create_time) as max_time
|
||||
FROM `initial_switch_other_collect_data`
|
||||
WHERE client_id = #{clientId}
|
||||
GROUP BY collect_type
|
||||
) latest ON t.collect_type = latest.collect_type AND t.create_time = latest.max_time
|
||||
WHERE t.client_id = #{clientId}
|
||||
</select>
|
||||
</mapper>
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
<?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.InitialSwitchPowerSupplyMapper">
|
||||
|
||||
<resultMap type="InitialSwitchPowerSupply" id="InitialSwitchPowerSupplyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="pwrEntIndex" column="pwr_ent_index" />
|
||||
<result property="pwrName" column="pwr_name" />
|
||||
<result property="pwrEntityPwrState" column="pwr_entity_pwr_state" />
|
||||
<result property="pwrEntityPwrCurrent" column="pwr_entity_pwr_current" />
|
||||
<result property="pwrEntityPwrVoltage" column="pwr_entity_pwr_voltage" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<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="selectInitialSwitchPowerSupplyVo">
|
||||
select id, pwr_ent_index, pwr_name, pwr_entity_pwr_state, pwr_entity_pwr_current, pwr_entity_pwr_voltage, client_id, create_time, update_time, create_by, update_by from initial_switch_power_supply
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialSwitchPowerSupplyList" parameterType="InitialSwitchPowerSupply" resultMap="InitialSwitchPowerSupplyResult">
|
||||
<include refid="selectInitialSwitchPowerSupplyVo"/>
|
||||
<where>
|
||||
<if test="pwrEntIndex != null and pwrEntIndex != ''"> and pwr_ent_index = #{pwrEntIndex}</if>
|
||||
<if test="pwrName != null and pwrName != ''"> and pwr_name like concat('%', #{pwrName}, '%')</if>
|
||||
<if test="pwrEntityPwrState != null and pwrEntityPwrState != ''"> and pwr_entity_pwr_state = #{pwrEntityPwrState}</if>
|
||||
<if test="pwrEntityPwrCurrent != null "> and pwr_entity_pwr_current = #{pwrEntityPwrCurrent}</if>
|
||||
<if test="pwrEntityPwrVoltage != null "> and pwr_entity_pwr_voltage = #{pwrEntityPwrVoltage}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialSwitchPowerSupplyById" parameterType="Long" resultMap="InitialSwitchPowerSupplyResult">
|
||||
<include refid="selectInitialSwitchPowerSupplyVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialSwitchPowerSupply" parameterType="InitialSwitchPowerSupply" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_switch_power_supply
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="pwrEntIndex != null">pwr_ent_index,</if>
|
||||
<if test="pwrName != null">pwr_name,</if>
|
||||
<if test="pwrEntityPwrState != null">pwr_entity_pwr_state,</if>
|
||||
<if test="pwrEntityPwrCurrent != null">pwr_entity_pwr_current,</if>
|
||||
<if test="pwrEntityPwrVoltage != null">pwr_entity_pwr_voltage,</if>
|
||||
<if test="clientId != null">client_id,</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="pwrEntIndex != null">#{pwrEntIndex},</if>
|
||||
<if test="pwrName != null">#{pwrName},</if>
|
||||
<if test="pwrEntityPwrState != null">#{pwrEntityPwrState},</if>
|
||||
<if test="pwrEntityPwrCurrent != null">#{pwrEntityPwrCurrent},</if>
|
||||
<if test="pwrEntityPwrVoltage != null">#{pwrEntityPwrVoltage},</if>
|
||||
<if test="clientId != null">#{clientId},</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="updateInitialSwitchPowerSupply" parameterType="InitialSwitchPowerSupply">
|
||||
update initial_switch_power_supply
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="pwrEntIndex != null">pwr_ent_index = #{pwrEntIndex},</if>
|
||||
<if test="pwrName != null">pwr_name = #{pwrName},</if>
|
||||
<if test="pwrEntityPwrState != null">pwr_entity_pwr_state = #{pwrEntityPwrState},</if>
|
||||
<if test="pwrEntityPwrCurrent != null">pwr_entity_pwr_current = #{pwrEntityPwrCurrent},</if>
|
||||
<if test="pwrEntityPwrVoltage != null">pwr_entity_pwr_voltage = #{pwrEntityPwrVoltage},</if>
|
||||
<if test="clientId != null">client_id = #{clientId},</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="deleteInitialSwitchPowerSupplyById" parameterType="Long">
|
||||
delete from initial_switch_power_supply where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialSwitchPowerSupplyByIds" parameterType="String">
|
||||
delete from initial_switch_power_supply where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<insert id="insertBatchInitialSwitchPowerSupply" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_switch_power_supply
|
||||
(
|
||||
pwr_ent_index,
|
||||
pwr_name,
|
||||
pwr_entity_pwr_state,
|
||||
pwr_entity_pwr_current,
|
||||
pwr_entity_pwr_voltage,
|
||||
client_id,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.pwrEntIndex},
|
||||
#{item.pwrName},
|
||||
#{item.pwrEntityPwrState},
|
||||
#{item.pwrEntityPwrCurrent},
|
||||
#{item.pwrEntityPwrVoltage},
|
||||
#{item.clientId},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.createBy},
|
||||
#{item.updateBy}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<select id="getAllPwrName" parameterType="InitialSwitchPowerSupply" resultType="java.util.Map">
|
||||
select pwr_name pwrName from initial_switch_power_supply
|
||||
<where>
|
||||
<if test="pwrEntIndex != null and pwrEntIndex != ''"> and pwr_ent_index = #{pwrEntIndex}</if>
|
||||
<if test="pwrName != null and pwrName != ''"> and pwr_name like concat('%', #{pwrName}, '%')</if>
|
||||
<if test="pwrEntityPwrState != null and pwrEntityPwrState != ''"> and pwr_entity_pwr_state = #{pwrEntityPwrState}</if>
|
||||
<if test="pwrEntityPwrCurrent != null "> and pwr_entity_pwr_current = #{pwrEntityPwrCurrent}</if>
|
||||
<if test="pwrEntityPwrVoltage != null "> and pwr_entity_pwr_voltage = #{pwrEntityPwrVoltage}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
group by pwr_name
|
||||
</select>
|
||||
<select id="getPwrMsg" parameterType="InitialSwitchPowerSupply" resultMap="InitialSwitchPowerSupplyResult">
|
||||
<include refid="selectInitialSwitchPowerSupplyVo"/>
|
||||
<where>
|
||||
<if test="pwrEntIndex != null and pwrEntIndex != ''"> and pwr_ent_index = #{pwrEntIndex}</if>
|
||||
<if test="pwrName != null and pwrName != ''"> and pwr_name like concat('%', #{pwrName}, '%')</if>
|
||||
<if test="pwrEntityPwrState != null and pwrEntityPwrState != ''"> and pwr_entity_pwr_state = #{pwrEntityPwrState}</if>
|
||||
<if test="pwrEntityPwrCurrent != null "> and pwr_entity_pwr_current = #{pwrEntityPwrCurrent}</if>
|
||||
<if test="pwrEntityPwrVoltage != null "> and pwr_entity_pwr_voltage = #{pwrEntityPwrVoltage}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
order by create_time desc limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,193 @@
|
||||
<?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.InitialSystemInfoMapper">
|
||||
|
||||
<resultMap type="InitialSystemInfo" id="InitialSystemInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="os" column="os" />
|
||||
<result property="arch" column="arch" />
|
||||
<result property="maxProc" column="max_proc" />
|
||||
<result property="runProcNum" column="run_proc_num" />
|
||||
<result property="usersNum" column="users_num" />
|
||||
<result property="diskSizeTotal" column="disk_size_total" />
|
||||
<result property="bootTime" column="boot_time" />
|
||||
<result property="uname" column="uname" />
|
||||
<result property="localTime" column="local_time" />
|
||||
<result property="upTime" column="up_time" />
|
||||
<result property="procNum" column="proc_num" />
|
||||
<result property="timeStamp" column="time_stamp" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="uuid" column="uuid" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInitialSystemInfoVo">
|
||||
select id, client_id, os, arch, max_proc, run_proc_num, users_num, disk_size_total, boot_time, uname, local_time, up_time, proc_num, time_stamp, create_by, update_by, create_time, update_time, uuid from initial_system_info
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialSystemInfoList" parameterType="InitialSystemInfo" resultMap="InitialSystemInfoResult">
|
||||
<include refid="selectInitialSystemInfoVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectInitialSystemInfoById" parameterType="Long" resultMap="InitialSystemInfoResult">
|
||||
<include refid="selectInitialSystemInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialSystemInfo" parameterType="InitialSystemInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into initial_system_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="os != null">os,</if>
|
||||
<if test="arch != null">arch,</if>
|
||||
<if test="maxProc != null">max_proc,</if>
|
||||
<if test="runProcNum != null">run_proc_num,</if>
|
||||
<if test="usersNum != null">users_num,</if>
|
||||
<if test="diskSizeTotal != null">disk_size_total,</if>
|
||||
<if test="bootTime != null">boot_time,</if>
|
||||
<if test="uname != null">uname,</if>
|
||||
<if test="localTime != null">local_time,</if>
|
||||
<if test="upTime != null">up_time,</if>
|
||||
<if test="procNum != null">proc_num,</if>
|
||||
<if test="timeStamp != null">time_stamp,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="uuid != null">uuid,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">#{clientId},</if>
|
||||
<if test="os != null">#{os},</if>
|
||||
<if test="arch != null">#{arch},</if>
|
||||
<if test="maxProc != null">#{maxProc},</if>
|
||||
<if test="runProcNum != null">#{runProcNum},</if>
|
||||
<if test="usersNum != null">#{usersNum},</if>
|
||||
<if test="diskSizeTotal != null">#{diskSizeTotal},</if>
|
||||
<if test="bootTime != null">#{bootTime},</if>
|
||||
<if test="uname != null">#{uname},</if>
|
||||
<if test="localTime != null">#{localTime},</if>
|
||||
<if test="upTime != null">#{upTime},</if>
|
||||
<if test="procNum != null">#{procNum},</if>
|
||||
<if test="timeStamp != null">#{timeStamp},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="uuid != null">#{uuid},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInitialSystemInfo" parameterType="InitialSystemInfo">
|
||||
update initial_system_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="os != null">os = #{os},</if>
|
||||
<if test="arch != null">arch = #{arch},</if>
|
||||
<if test="maxProc != null">max_proc = #{maxProc},</if>
|
||||
<if test="runProcNum != null">run_proc_num = #{runProcNum},</if>
|
||||
<if test="usersNum != null">users_num = #{usersNum},</if>
|
||||
<if test="diskSizeTotal != null">disk_size_total = #{diskSizeTotal},</if>
|
||||
<if test="bootTime != null">boot_time = #{bootTime},</if>
|
||||
<if test="uname != null">uname = #{uname},</if>
|
||||
<if test="localTime != null">local_time = #{localTime},</if>
|
||||
<if test="upTime != null">up_time = #{upTime},</if>
|
||||
<if test="procNum != null">proc_num = #{procNum},</if>
|
||||
<if test="timeStamp != null">time_stamp = #{timeStamp},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="uuid != null">uuid = #{uuid},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInitialSystemInfoById" parameterType="Long">
|
||||
delete from initial_system_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialSystemInfoByIds" parameterType="String">
|
||||
delete from initial_system_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<insert id="batchInsertInitialSystemInfo" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO initial_system_info
|
||||
(
|
||||
client_id,
|
||||
os,
|
||||
arch,
|
||||
max_proc,
|
||||
run_proc_num,
|
||||
users_num,
|
||||
disk_size_total,
|
||||
boot_time,
|
||||
uname,
|
||||
local_time,
|
||||
up_time,
|
||||
proc_num,
|
||||
time_stamp,
|
||||
create_by,
|
||||
update_by,
|
||||
create_time,
|
||||
update_time,
|
||||
uuid
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.clientId},
|
||||
#{item.os},
|
||||
#{item.arch},
|
||||
#{item.maxProc},
|
||||
#{item.runProcNum},
|
||||
#{item.usersNum},
|
||||
#{item.diskSizeTotal},
|
||||
#{item.bootTime},
|
||||
#{item.uname},
|
||||
#{item.localTime},
|
||||
#{item.upTime},
|
||||
#{item.procNum},
|
||||
#{item.timeStamp},
|
||||
#{item.createBy},
|
||||
#{item.updateBy},
|
||||
<choose>
|
||||
<when test="item.createTime != null">
|
||||
#{item.createTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>,
|
||||
<choose>
|
||||
<when test="item.updateTime != null">
|
||||
#{item.updateTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
NOW()
|
||||
</otherwise>
|
||||
</choose>,
|
||||
#{item.uuid}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getSystemMsgByClientId" parameterType="String" resultType="SystemMsgVo">
|
||||
select os os,arch arch,max_proc maxProc,disk_size_total diskSizeTotal,boot_time bootTime,uname uname,local_time `localTime`,up_time upTime from initial_system_info
|
||||
where client_id = #{clientId}
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
<?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.InitialSystemOtherCollectDataMapper">
|
||||
|
||||
<resultMap type="InitialSystemOtherCollectData" id="InitialSystemOtherCollectDataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="collectType" column="collect_type" />
|
||||
<result property="collectValue" column="collect_value" />
|
||||
<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="selectInitialSystemOtherCollectDataVo">
|
||||
select id, client_id, collect_type, collect_value, create_time, update_time, create_by, update_by from initial_system_other_collect_data
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialSystemOtherCollectDataList" parameterType="InitialSystemOtherCollectData" resultMap="InitialSystemOtherCollectDataResult">
|
||||
<include refid="selectInitialSystemOtherCollectDataVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="collectType != null and collectType != ''"> and collect_type = #{collectType}</if>
|
||||
<if test="collectValue != null and collectValue != ''"> and collect_value = #{collectValue}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialSystemOtherCollectDataById" parameterType="Long" resultMap="InitialSystemOtherCollectDataResult">
|
||||
<include refid="selectInitialSystemOtherCollectDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialSystemOtherCollectData" parameterType="InitialSystemOtherCollectData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert IGNORE into initial_system_other_collect_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="collectType != null and collectType != ''">collect_type,</if>
|
||||
<if test="collectValue != null">collect_value,</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="collectType != null and collectType != ''">#{collectType},</if>
|
||||
<if test="collectValue != null">#{collectValue},</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="updateInitialSystemOtherCollectData" parameterType="InitialSystemOtherCollectData">
|
||||
update initial_system_other_collect_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="collectType != null and collectType != ''">collect_type = #{collectType},</if>
|
||||
<if test="collectValue != null">collect_value = #{collectValue},</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="deleteInitialSystemOtherCollectDataById" parameterType="Long">
|
||||
delete from initial_system_other_collect_data where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialSystemOtherCollectDataByIds" parameterType="String">
|
||||
delete from initial_system_other_collect_data where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="getMonitorMsg" parameterType="InitialSystemOtherCollectData" resultType="java.util.Map">
|
||||
SELECT
|
||||
MAX(CASE WHEN t.collect_type = 'memorySizeTotalCollect' THEN t.collect_value END) as memorySizeTotalCollect,
|
||||
MAX(CASE WHEN t.collect_type = 'systemSwOsCollect' THEN t.collect_value END) as systemSwOsCollect,
|
||||
MAX(CASE WHEN t.collect_type = 'systemSwArchCollect' THEN t.collect_value END) as systemSwArchCollect,
|
||||
MAX(CASE WHEN t.collect_type = 'kernelMaxprocCollect' THEN t.collect_value END) as kernelMaxprocCollect,
|
||||
MAX(CASE WHEN t.collect_type = 'systemDiskSizeTotalCollect' THEN t.collect_value END) as systemDiskSizeTotalCollect,
|
||||
MAX(CASE WHEN t.collect_type = 'systemBoottimeCollect' THEN t.collect_value END) as systemBoottimeCollect,
|
||||
MAX(CASE WHEN t.collect_type = 'systemUnameCollect' THEN t.collect_value END) as systemUnameCollect,
|
||||
MAX(CASE WHEN t.collect_type = 'systemLocaltimeCollect' THEN t.collect_value END) as systemLocaltimeCollect,
|
||||
MAX(CASE WHEN t.collect_type = 'systemUptimeCollect' THEN t.collect_value END) as systemUptimeCollect
|
||||
FROM `initial_system_other_collect_data` t
|
||||
INNER JOIN (
|
||||
SELECT collect_type, MAX(create_time) as max_time
|
||||
FROM `initial_system_other_collect_data`
|
||||
WHERE client_id = #{clientId}
|
||||
GROUP BY collect_type
|
||||
) latest ON t.collect_type = latest.collect_type AND t.create_time = latest.max_time
|
||||
WHERE t.client_id = #{clientId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -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.tongran.rocketmq.mapper.RmAgentManagementMapper">
|
||||
|
||||
<resultMap type="RmAgentManagement" id="RmAgentManagementResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="hardwareSn" column="hardware_sn" />
|
||||
<result property="resourceName" column="resource_name" />
|
||||
<result property="internalIp" column="internal_ip" />
|
||||
<result property="status" column="status" />
|
||||
<result property="agentVersion" column="agent_version" />
|
||||
<result property="method" column="method" />
|
||||
<result property="scheduledUpdateTime" column="scheduled_update_time" />
|
||||
<result property="fileUrlType" column="file_url_type" />
|
||||
<result property="fileUrl" column="file_url" />
|
||||
<result property="fileDirectory" column="file_directory" />
|
||||
<result property="lastUpdateResult" column="last_update_result" />
|
||||
<result property="lastUpdateTime" column="last_update_time" />
|
||||
<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="fileMd5" column="file_md5" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="deployDevice" column="deploy_device" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmAgentManagementVo">
|
||||
select id, hardware_sn, resource_name, internal_ip, status, agent_version, method, scheduled_update_time, file_url_type, file_url, file_directory, last_update_result, last_update_time, create_time, update_time, create_by, update_by, file_md5, client_id, deploy_device from rm_agent_management
|
||||
</sql>
|
||||
|
||||
<select id="selectRmAgentManagementList" parameterType="RmAgentManagement" resultMap="RmAgentManagementResult">
|
||||
<include refid="selectRmAgentManagementVo"/>
|
||||
<where>
|
||||
<if test="hardwareSn != null and hardwareSn != ''"> and hardware_sn = #{hardwareSn}</if>
|
||||
<if test="resourceName != null and resourceName != ''"> and resource_name like concat('%', #{resourceName}, '%')</if>
|
||||
<if test="internalIp != null and internalIp != ''"> and internal_ip = #{internalIp}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="agentVersion != null and agentVersion != ''"> and agent_version = #{agentVersion}</if>
|
||||
<if test="method != null "> and method = #{method}</if>
|
||||
<if test="scheduledUpdateTime != null and scheduledUpdateTime != ''"> and scheduled_update_time = #{scheduledUpdateTime}</if>
|
||||
<if test="fileUrlType != null "> and file_url_type = #{fileUrlType}</if>
|
||||
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
|
||||
<if test="fileDirectory != null and fileDirectory != ''"> and file_directory = #{fileDirectory}</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="fileMd5 != null and fileMd5 != ''"> and file_md5 = #{fileMd5}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="deployDevice != null and deployDevice != ''"> and deploy_device = #{deployDevice}</if>
|
||||
<if test="queryName != null and queryName != '' "> and (resource_name like concat('%', #{resourceName}, '%') or internal_ip = #{internalIp})</if>
|
||||
</where>
|
||||
order by last_update_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectRmAgentManagementById" parameterType="Long" resultMap="RmAgentManagementResult">
|
||||
<include refid="selectRmAgentManagementVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmAgentManagement" parameterType="RmAgentManagement" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_agent_management
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="hardwareSn != null and hardwareSn != ''">hardware_sn,</if>
|
||||
<if test="resourceName != null and resourceName != ''">resource_name,</if>
|
||||
<if test="internalIp != null">internal_ip,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="agentVersion != null">agent_version,</if>
|
||||
<if test="method != null">method,</if>
|
||||
<if test="scheduledUpdateTime != null">scheduled_update_time,</if>
|
||||
<if test="fileUrlType != null">file_url_type,</if>
|
||||
<if test="fileUrl != null">file_url,</if>
|
||||
<if test="fileDirectory != null">file_directory,</if>
|
||||
<if test="lastUpdateResult != null">last_update_result,</if>
|
||||
<if test="lastUpdateTime != null">last_update_time,</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="fileMd5 != null">file_md5,</if>
|
||||
<if test="clientId != null">client_id,</if>
|
||||
<if test="deployDevice != null">deploy_device,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="hardwareSn != null and hardwareSn != ''">#{hardwareSn},</if>
|
||||
<if test="resourceName != null and resourceName != ''">#{resourceName},</if>
|
||||
<if test="internalIp != null">#{internalIp},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="agentVersion != null">#{agentVersion},</if>
|
||||
<if test="method != null">#{method},</if>
|
||||
<if test="scheduledUpdateTime != null">#{scheduledUpdateTime},</if>
|
||||
<if test="fileUrlType != null">#{fileUrlType},</if>
|
||||
<if test="fileUrl != null">#{fileUrl},</if>
|
||||
<if test="fileDirectory != null">#{fileDirectory},</if>
|
||||
<if test="lastUpdateResult != null">#{lastUpdateResult},</if>
|
||||
<if test="lastUpdateTime != null">#{lastUpdateTime},</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="fileMd5 != null">#{fileMd5},</if>
|
||||
<if test="clientId != null">#{clientId},</if>
|
||||
<if test="deployDevice != null">#{deployDevice},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmAgentManagement" parameterType="RmAgentManagement">
|
||||
update rm_agent_management
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="hardwareSn != null and hardwareSn != ''">hardware_sn = #{hardwareSn},</if>
|
||||
<if test="resourceName != null and resourceName != ''">resource_name = #{resourceName},</if>
|
||||
<if test="internalIp != null">internal_ip = #{internalIp},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="agentVersion != null">agent_version = #{agentVersion},</if>
|
||||
<if test="method != null">method = #{method},</if>
|
||||
<if test="scheduledUpdateTime != null">scheduled_update_time = #{scheduledUpdateTime},</if>
|
||||
<if test="fileUrlType != null">file_url_type = #{fileUrlType},</if>
|
||||
<if test="fileUrl != null">file_url = #{fileUrl},</if>
|
||||
<if test="fileDirectory != null">file_directory = #{fileDirectory},</if>
|
||||
<if test="lastUpdateResult != null">last_update_result = #{lastUpdateResult},</if>
|
||||
<if test="lastUpdateTime != null">last_update_time = #{lastUpdateTime},</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="fileMd5 != null">file_md5 = #{fileMd5},</if>
|
||||
<if test="clientId != null">client_id = #{clientId},</if>
|
||||
<if test="deployDevice != null">deploy_device = #{deployDevice},</if>
|
||||
</trim>
|
||||
<where>
|
||||
<choose>
|
||||
<when test="id != null">
|
||||
and id = #{id}
|
||||
</when>
|
||||
<when test="clientId != null and clientId != ''">
|
||||
and client_id = #{clientId}
|
||||
</when>
|
||||
<otherwise>
|
||||
and 1=0 <!-- 如果没有提供任何条件,则不更新任何记录 -->
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<delete id="deleteRmAgentManagementById" parameterType="Long">
|
||||
delete from rm_agent_management where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmAgentManagementByIds" parameterType="String">
|
||||
delete from rm_agent_management where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="updateRmAgentManagementBySn" parameterType="RmAgentManagement">
|
||||
update rm_agent_management
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="resourceName != null and resourceName != ''">resource_name = #{resourceName},</if>
|
||||
<if test="internalIp != null">internal_ip = #{internalIp},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="agentVersion != null">agent_version = #{agentVersion},</if>
|
||||
<if test="method != null">method = #{method},</if>
|
||||
<if test="scheduledUpdateTime != null">scheduled_update_time = #{scheduledUpdateTime},</if>
|
||||
<if test="fileUrlType != null">file_url_type = #{fileUrlType},</if>
|
||||
<if test="fileUrl != null">file_url = #{fileUrl},</if>
|
||||
<if test="fileDirectory != null">file_directory = #{fileDirectory},</if>
|
||||
<if test="lastUpdateResult != null">last_update_result = #{lastUpdateResult},</if>
|
||||
<if test="lastUpdateTime != null">last_update_time = #{lastUpdateTime},</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 clientId != ''">
|
||||
and client_id = #{clientId}
|
||||
</when>
|
||||
<when test="hardwareSn != null and hardwareSn != ''">
|
||||
and hardware_sn = #{hardwareSn}
|
||||
</when>
|
||||
<otherwise>
|
||||
and 1=0 <!-- 如果没有提供任何条件,则不更新任何记录 -->
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</update>
|
||||
</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.tongran.rocketmq.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,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.tongran.rocketmq.mapper.RmAlarmPolicyMapper">
|
||||
|
||||
<resultMap type="RmAlarmPolicy" id="RmAlarmPolicyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="alarmName" column="alarm_name" />
|
||||
<result property="alarmDescription" column="alarm_description" />
|
||||
<result property="resourceGroupId" column="resource_group_id" />
|
||||
<result property="status" column="status" />
|
||||
<result property="deployTime" column="deploy_time" />
|
||||
<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="selectRmAlarmPolicyVo">
|
||||
select id, alarm_name, alarm_description, resource_group_id, status, deploy_time, create_time, update_time, create_by, update_by from rm_alarm_policy
|
||||
</sql>
|
||||
|
||||
<select id="selectRmAlarmPolicyList" parameterType="RmAlarmPolicy" resultMap="RmAlarmPolicyResult">
|
||||
<include refid="selectRmAlarmPolicyVo"/>
|
||||
<where>
|
||||
<if test="alarmName != null and alarmName != ''"> and alarm_name like concat('%', #{alarmName}, '%')</if>
|
||||
<if test="alarmDescription != null and alarmDescription != ''"> and alarm_description = #{alarmDescription}</if>
|
||||
<if test="resourceGroupId != null "> and resource_group_id = #{resourceGroupId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="deployTime != null "> and deploy_time = #{deployTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmAlarmPolicyById" parameterType="Long" resultMap="RmAlarmPolicyResult">
|
||||
<include refid="selectRmAlarmPolicyVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmAlarmPolicy" parameterType="RmAlarmPolicy" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_alarm_policy
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="alarmName != null and alarmName != ''">alarm_name,</if>
|
||||
<if test="alarmDescription != null">alarm_description,</if>
|
||||
<if test="resourceGroupId != null">resource_group_id,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="deployTime != null">deploy_time,</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="alarmName != null and alarmName != ''">#{alarmName},</if>
|
||||
<if test="alarmDescription != null">#{alarmDescription},</if>
|
||||
<if test="resourceGroupId != null">#{resourceGroupId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="deployTime != null">#{deployTime},</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="updateRmAlarmPolicy" parameterType="RmAlarmPolicy">
|
||||
update rm_alarm_policy
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="alarmName != null and alarmName != ''">alarm_name = #{alarmName},</if>
|
||||
<if test="alarmDescription != null">alarm_description = #{alarmDescription},</if>
|
||||
<if test="resourceGroupId != null">resource_group_id = #{resourceGroupId},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="deployTime != null">deploy_time = #{deployTime},</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="deleteRmAlarmPolicyById" parameterType="Long">
|
||||
delete from rm_alarm_policy where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmAlarmPolicyByIds" parameterType="String">
|
||||
delete from rm_alarm_policy 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.tongran.rocketmq.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,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.tongran.rocketmq.mapper.RmAlarmRecordMapper">
|
||||
|
||||
<resultMap type="RmAlarmRecord" id="RmAlarmRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="resourceName" column="resource_name" />
|
||||
<result property="sourceIp" column="source_ip" />
|
||||
<result property="occurTime" column="occur_time" />
|
||||
<result property="content" column="content" />
|
||||
<result property="repeatCount" column="repeat_count" />
|
||||
<result property="status" column="status" />
|
||||
<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="selectRmAlarmRecordVo">
|
||||
select id, client_id, resource_name, source_ip, occur_time, content, repeat_count, status, create_time, update_time, create_by, update_by from rm_alarm_record
|
||||
</sql>
|
||||
|
||||
<select id="selectRmAlarmRecordList" parameterType="RmAlarmRecord" resultMap="RmAlarmRecordResult">
|
||||
<include refid="selectRmAlarmRecordVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="resourceName != null and resourceName != ''"> and resource_name like concat('%', #{resourceName}, '%')</if>
|
||||
<if test="sourceIp != null and sourceIp != ''"> and source_ip = #{sourceIp}</if>
|
||||
<if test="occurTime != null "> and occur_time = #{occurTime}</if>
|
||||
<if test="content != null and content != ''"> and content = #{content}</if>
|
||||
<if test="repeatCount != null "> and repeat_count = #{repeatCount}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmAlarmRecordById" parameterType="Long" resultMap="RmAlarmRecordResult">
|
||||
<include refid="selectRmAlarmRecordVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmAlarmRecord" parameterType="RmAlarmRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_alarm_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="resourceName != null and resourceName != ''">resource_name,</if>
|
||||
<if test="sourceIp != null and sourceIp != ''">source_ip,</if>
|
||||
<if test="occurTime != null">occur_time,</if>
|
||||
<if test="content != null and content != ''">content,</if>
|
||||
<if test="repeatCount != null">repeat_count,</if>
|
||||
<if test="status != null and status != ''">status,</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="resourceName != null and resourceName != ''">#{resourceName},</if>
|
||||
<if test="sourceIp != null and sourceIp != ''">#{sourceIp},</if>
|
||||
<if test="occurTime != null">#{occurTime},</if>
|
||||
<if test="content != null and content != ''">#{content},</if>
|
||||
<if test="repeatCount != null">#{repeatCount},</if>
|
||||
<if test="status != null and status != ''">#{status},</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="updateRmAlarmRecord" parameterType="RmAlarmRecord">
|
||||
update rm_alarm_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="resourceName != null and resourceName != ''">resource_name = #{resourceName},</if>
|
||||
<if test="sourceIp != null and sourceIp != ''">source_ip = #{sourceIp},</if>
|
||||
<if test="occurTime != null">occur_time = #{occurTime},</if>
|
||||
<if test="content != null and content != ''">content = #{content},</if>
|
||||
<if test="repeatCount != null">repeat_count = #{repeatCount},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</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="deleteRmAlarmRecordById" parameterType="Long">
|
||||
delete from rm_alarm_record where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmAlarmRecordByIds" parameterType="String">
|
||||
delete from rm_alarm_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,145 @@
|
||||
<?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.RmAlarmRuleMapper">
|
||||
|
||||
<resultMap type="RmAlarmRule" id="RmAlarmRuleResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="alarmPolicyId" column="alarm_policy_id" />
|
||||
<result property="ruleName" column="rule_name" />
|
||||
<result property="metricKey" column="metric_key" />
|
||||
<result property="operator" column="operator" />
|
||||
<result property="threshold" column="threshold" />
|
||||
<result property="resourceType" column="resource_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="portWhitelist" column="port_whitelist" />
|
||||
<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="selectRmAlarmRuleVo">
|
||||
select id, alarm_policy_id, rule_name, metric_key, operator, threshold, resource_type, status, port_whitelist, create_time, update_time, create_by, update_by from rm_alarm_rule
|
||||
</sql>
|
||||
|
||||
<select id="selectRmAlarmRuleList" parameterType="RmAlarmRule" resultMap="RmAlarmRuleResult">
|
||||
<include refid="selectRmAlarmRuleVo"/>
|
||||
<where>
|
||||
<if test="alarmPolicyId != null "> and alarm_policy_id = #{alarmPolicyId}</if>
|
||||
<if test="ruleName != null and ruleName != ''"> and rule_name like concat('%', #{ruleName}, '%')</if>
|
||||
<if test="metricKey != null and metricKey != ''"> and metric_key = #{metricKey}</if>
|
||||
<if test="operator != null and operator != ''"> and operator = #{operator}</if>
|
||||
<if test="threshold != null "> and threshold = #{threshold}</if>
|
||||
<if test="resourceType != null and resourceType != ''"> and resource_type = #{resourceType}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="portWhitelist != null and portWhitelist != ''"> and port_whitelist = #{portWhitelist}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmAlarmRuleById" parameterType="Long" resultMap="RmAlarmRuleResult">
|
||||
<include refid="selectRmAlarmRuleVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmAlarmRule" parameterType="RmAlarmRule" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_alarm_rule
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="alarmPolicyId != null">alarm_policy_id,</if>
|
||||
<if test="ruleName != null">rule_name,</if>
|
||||
<if test="metricKey != null">metric_key,</if>
|
||||
<if test="operator != null">operator,</if>
|
||||
<if test="threshold != null">threshold,</if>
|
||||
<if test="resourceType != null">resource_type,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="portWhitelist != null">port_whitelist,</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="alarmPolicyId != null">#{alarmPolicyId},</if>
|
||||
<if test="ruleName != null">#{ruleName},</if>
|
||||
<if test="metricKey != null">#{metricKey},</if>
|
||||
<if test="operator != null">#{operator},</if>
|
||||
<if test="threshold != null">#{threshold},</if>
|
||||
<if test="resourceType != null">#{resourceType},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="portWhitelist != null">#{portWhitelist},</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="updateRmAlarmRule" parameterType="RmAlarmRule">
|
||||
update rm_alarm_rule
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="alarmPolicyId != null">alarm_policy_id = #{alarmPolicyId},</if>
|
||||
<if test="ruleName != null">rule_name = #{ruleName},</if>
|
||||
<if test="metricKey != null">metric_key = #{metricKey},</if>
|
||||
<if test="operator != null">operator = #{operator},</if>
|
||||
<if test="threshold != null">threshold = #{threshold},</if>
|
||||
<if test="resourceType != null">resource_type = #{resourceType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="portWhitelist != null">port_whitelist = #{portWhitelist},</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="deleteRmAlarmRuleById" parameterType="Long">
|
||||
delete from rm_alarm_rule where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmAlarmRuleByIds" parameterType="String">
|
||||
delete from rm_alarm_rule where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteRmAlarmRuleByPolicyId" parameterType="Long">
|
||||
delete from rm_alarm_rule where alarm_policy_id #{id}
|
||||
</delete>
|
||||
<!-- 批量插入告警规则 -->
|
||||
<insert id="batchInsertRmAlarmRule" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO rm_alarm_rule
|
||||
(
|
||||
alarm_policy_id,
|
||||
rule_name,
|
||||
metric_key,
|
||||
operator,
|
||||
threshold,
|
||||
resource_type,
|
||||
status,
|
||||
port_whitelist,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.alarmPolicyId},
|
||||
#{item.ruleName},
|
||||
#{item.metricKey},
|
||||
#{item.operator},
|
||||
#{item.threshold},
|
||||
#{item.resourceType},
|
||||
#{item.status},
|
||||
#{item.portWhitelist},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.createBy},
|
||||
#{item.updateBy}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?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.RmAlarmRuleTemplateMapper">
|
||||
|
||||
<resultMap type="RmAlarmRuleTemplate" id="RmAlarmRuleTemplateResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="ruleName" column="rule_name" />
|
||||
<result property="metricKey" column="metric_key" />
|
||||
<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="selectRmAlarmRuleTemplateVo">
|
||||
select id, rule_name, metric_key, resource_type, create_time, update_time, create_by, update_by from rm_alarm_rule_template
|
||||
</sql>
|
||||
|
||||
<select id="selectRmAlarmRuleTemplateList" parameterType="RmAlarmRuleTemplate" resultMap="RmAlarmRuleTemplateResult">
|
||||
<include refid="selectRmAlarmRuleTemplateVo"/>
|
||||
<where>
|
||||
<if test="ruleName != null and ruleName != ''"> and rule_name like concat('%', #{ruleName}, '%')</if>
|
||||
<if test="metricKey != null and metricKey != ''"> and metric_key = #{metricKey}</if>
|
||||
<if test="resourceType != null and resourceType != ''"> and resource_type = #{resourceType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmAlarmRuleTemplateById" parameterType="Long" resultMap="RmAlarmRuleTemplateResult">
|
||||
<include refid="selectRmAlarmRuleTemplateVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmAlarmRuleTemplate" parameterType="RmAlarmRuleTemplate" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_alarm_rule_template
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ruleName != null">rule_name,</if>
|
||||
<if test="metricKey != null">metric_key,</if>
|
||||
<if test="resourceType != null">resource_type,</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="ruleName != null">#{ruleName},</if>
|
||||
<if test="metricKey != null">#{metricKey},</if>
|
||||
<if test="resourceType != null">#{resourceType},</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="updateRmAlarmRuleTemplate" parameterType="RmAlarmRuleTemplate">
|
||||
update rm_alarm_rule_template
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="ruleName != null">rule_name = #{ruleName},</if>
|
||||
<if test="metricKey != null">metric_key = #{metricKey},</if>
|
||||
<if test="resourceType != null">resource_type = #{resourceType},</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="deleteRmAlarmRuleTemplateById" parameterType="Long">
|
||||
delete from rm_alarm_rule_template where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmAlarmRuleTemplateByIds" parameterType="String">
|
||||
delete from rm_alarm_rule_template where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,172 @@
|
||||
<?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.RmDeploymentPolicyMapper">
|
||||
|
||||
<resultMap type="RmDeploymentPolicy" id="RmDeploymentPolicyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="policyName" column="policy_name" />
|
||||
<result property="description" column="description" />
|
||||
<result property="resourceGroupId" column="resource_group_id" />
|
||||
<result property="includedDevicesId" column="included_devices_id" />
|
||||
<result property="sourceFilePathType" column="source_file_path_type" />
|
||||
<result property="sourceFilePath" column="source_file_path" />
|
||||
<result property="targetDirectory" column="target_directory" />
|
||||
<result property="commandContent" column="command_content" />
|
||||
<result property="executionMethod" column="execution_method" />
|
||||
<result property="scheduledTime" column="scheduled_time" />
|
||||
<result property="policyStatus" column="policy_status" />
|
||||
<result property="deployTime" column="deploy_time" />
|
||||
<result property="scriptType" column="script_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" />
|
||||
<result property="deployDevice" column="deploy_device" />
|
||||
<result property="scriptId" column="script_id" />
|
||||
<result property="scriptName" column="script_name" />
|
||||
<result property="scriptPath" column="script_path" />
|
||||
<result property="defaultParams" column="default_params" />
|
||||
<result property="taskName" column="task_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmDeploymentPolicyVo">
|
||||
select id, policy_name, description, resource_group_id, included_devices_id, source_file_path_type, source_file_path, target_directory, command_content, execution_method, scheduled_time, policy_status, deploy_time, script_type, create_time, update_time, create_by, update_by, deploy_device, script_id, script_name, script_path, default_params, task_name from rm_deployment_policy
|
||||
</sql>
|
||||
|
||||
<select id="selectRmDeploymentPolicyList" parameterType="RmDeploymentPolicy" resultMap="RmDeploymentPolicyResult">
|
||||
<include refid="selectRmDeploymentPolicyVo"/>
|
||||
<where>
|
||||
<if test="policyName != null and policyName != ''"> and policy_name like concat('%', #{policyName}, '%')</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="resourceGroupId != null "> and resource_group_id = #{resourceGroupId}</if>
|
||||
<if test="includedDevicesId != null and includedDevicesId != ''"> and included_devices_id = #{includedDevicesId}</if>
|
||||
<if test="sourceFilePathType != null and sourceFilePathType != ''"> and source_file_path_type = #{sourceFilePathType}</if>
|
||||
<if test="sourceFilePath != null and sourceFilePath != ''"> and source_file_path = #{sourceFilePath}</if>
|
||||
<if test="targetDirectory != null and targetDirectory != ''"> and target_directory = #{targetDirectory}</if>
|
||||
<if test="commandContent != null and commandContent != ''"> and command_content = #{commandContent}</if>
|
||||
<if test="executionMethod != null "> and execution_method = #{executionMethod}</if>
|
||||
<if test="scheduledTime != null "> and scheduled_time = #{scheduledTime}</if>
|
||||
<if test="policyStatus != null and policyStatus != ''"> and policy_status = #{policyStatus}</if>
|
||||
<if test="deployTime != null "> and deploy_time = #{deployTime}</if>
|
||||
<if test="scriptType != null and scriptType != ''"> and script_type = #{scriptType}</if>
|
||||
<if test="deployDevice != null and deployDevice != ''"> and deploy_device = #{deployDevice}</if>
|
||||
<if test="scriptId != null "> and script_id = #{scriptId}</if>
|
||||
<if test="scriptName != null and scriptName != ''"> and script_name like concat('%', #{scriptName}, '%')</if>
|
||||
<if test="scriptPath != null and scriptPath != ''"> and script_path = #{scriptPath}</if>
|
||||
<if test="defaultParams != null and defaultParams != ''"> and default_params = #{defaultParams}</if>
|
||||
<if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectRmDeploymentPolicyById" parameterType="Long" resultMap="RmDeploymentPolicyResult">
|
||||
<include refid="selectRmDeploymentPolicyVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmDeploymentPolicy" parameterType="RmDeploymentPolicy" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_deployment_policy
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="policyName != null and policyName != ''">policy_name,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="resourceGroupId != null">resource_group_id,</if>
|
||||
<if test="includedDevicesId != null">included_devices_id,</if>
|
||||
<if test="sourceFilePathType != null">source_file_path_type,</if>
|
||||
<if test="sourceFilePath != null and sourceFilePath != ''">source_file_path,</if>
|
||||
<if test="targetDirectory != null and targetDirectory != ''">target_directory,</if>
|
||||
<if test="commandContent != null">command_content,</if>
|
||||
<if test="executionMethod != null">execution_method,</if>
|
||||
<if test="scheduledTime != null">scheduled_time,</if>
|
||||
<if test="policyStatus != null and policyStatus != ''">policy_status,</if>
|
||||
<if test="deployTime != null">deploy_time,</if>
|
||||
<if test="scriptType != null">script_type,</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="deployDevice != null">deploy_device,</if>
|
||||
<if test="scriptId != null">script_id,</if>
|
||||
<if test="scriptName != null">script_name,</if>
|
||||
<if test="scriptPath != null">script_path,</if>
|
||||
<if test="defaultParams != null">default_params,</if>
|
||||
<if test="taskName != null">task_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="policyName != null and policyName != ''">#{policyName},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="resourceGroupId != null">#{resourceGroupId},</if>
|
||||
<if test="includedDevicesId != null">#{includedDevicesId},</if>
|
||||
<if test="sourceFilePathType != null">#{sourceFilePathType},</if>
|
||||
<if test="sourceFilePath != null and sourceFilePath != ''">#{sourceFilePath},</if>
|
||||
<if test="targetDirectory != null and targetDirectory != ''">#{targetDirectory},</if>
|
||||
<if test="commandContent != null">#{commandContent},</if>
|
||||
<if test="executionMethod != null">#{executionMethod},</if>
|
||||
<if test="scheduledTime != null">#{scheduledTime},</if>
|
||||
<if test="policyStatus != null and policyStatus != ''">#{policyStatus},</if>
|
||||
<if test="deployTime != null">#{deployTime},</if>
|
||||
<if test="scriptType != null">#{scriptType},</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="deployDevice != null">#{deployDevice},</if>
|
||||
<if test="scriptId != null">#{scriptId},</if>
|
||||
<if test="scriptName != null">#{scriptName},</if>
|
||||
<if test="scriptPath != null">#{scriptPath},</if>
|
||||
<if test="defaultParams != null">#{defaultParams},</if>
|
||||
<if test="taskName != null">#{taskName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmDeploymentPolicy" parameterType="RmDeploymentPolicy">
|
||||
update rm_deployment_policy
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="policyName != null and policyName != ''">policy_name = #{policyName},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="resourceGroupId != null">resource_group_id = #{resourceGroupId},</if>
|
||||
<if test="includedDevicesId != null">included_devices_id = #{includedDevicesId},</if>
|
||||
<if test="sourceFilePathType != null">source_file_path_type = #{sourceFilePathType},</if>
|
||||
<if test="sourceFilePath != null and sourceFilePath != ''">source_file_path = #{sourceFilePath},</if>
|
||||
<if test="targetDirectory != null and targetDirectory != ''">target_directory = #{targetDirectory},</if>
|
||||
<if test="commandContent != null">command_content = #{commandContent},</if>
|
||||
<if test="executionMethod != null">execution_method = #{executionMethod},</if>
|
||||
<if test="scheduledTime != null">scheduled_time = #{scheduledTime},</if>
|
||||
<if test="policyStatus != null and policyStatus != ''">policy_status = #{policyStatus},</if>
|
||||
<if test="deployTime != null">deploy_time = #{deployTime},</if>
|
||||
<if test="scriptType != null">script_type = #{scriptType},</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="deployDevice != null">deploy_device = #{deployDevice},</if>
|
||||
<if test="scriptId != null">script_id = #{scriptId},</if>
|
||||
<if test="scriptName != null">script_name = #{scriptName},</if>
|
||||
<if test="scriptPath != null">script_path = #{scriptPath},</if>
|
||||
<if test="defaultParams != null">default_params = #{defaultParams},</if>
|
||||
<if test="taskName != null">task_name = #{taskName},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRmDeploymentPolicyById" parameterType="Long">
|
||||
delete from rm_deployment_policy where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmDeploymentPolicyByIds" parameterType="String">
|
||||
delete from rm_deployment_policy where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectRmDeploymentPolicyByClientId" parameterType="RmDeploymentPolicy" resultMap="RmDeploymentPolicyResult">
|
||||
<include refid="selectRmDeploymentPolicyVo"/>
|
||||
<where>
|
||||
<if test="policyStatus != null and policyStatus != ''"> and policy_status = #{policyStatus}</if>
|
||||
<if test="deployDevice != null ">
|
||||
and FIND_IN_SET(#{deployDevice}, REPLACE(deploy_device, '\n', ',')) > 0
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</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.tongran.rocketmq.mapper.RmFileInfoMapper">
|
||||
|
||||
<resultMap type="RmFileInfo" id="RmFileInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="description" column="description" />
|
||||
<result property="fileSize" column="file_size" />
|
||||
<result property="md5" column="md5" />
|
||||
<result property="path" column="path" />
|
||||
<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="selectRmFileInfoVo">
|
||||
select id, name, type, description, file_size, md5, path, create_time, update_time, create_by, update_by from rm_file_info
|
||||
</sql>
|
||||
|
||||
<select id="selectRmFileInfoList" parameterType="RmFileInfo" resultMap="RmFileInfoResult">
|
||||
<include refid="selectRmFileInfoVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="fileSize != null "> and file_size = #{fileSize}</if>
|
||||
<if test="md5 != null and md5 != ''"> and md5 = #{md5}</if>
|
||||
<if test="path != null and path != ''"> and path = #{path}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmFileInfoById" parameterType="Long" resultMap="RmFileInfoResult">
|
||||
<include refid="selectRmFileInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmFileInfo" parameterType="RmFileInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_file_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="fileSize != null">file_size,</if>
|
||||
<if test="md5 != null and md5 != ''">md5,</if>
|
||||
<if test="path != null and path != ''">path,</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="name != null and name != ''">#{name},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="fileSize != null">#{fileSize},</if>
|
||||
<if test="md5 != null and md5 != ''">#{md5},</if>
|
||||
<if test="path != null and path != ''">#{path},</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="updateRmFileInfo" parameterType="RmFileInfo">
|
||||
update rm_file_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="fileSize != null">file_size = #{fileSize},</if>
|
||||
<if test="md5 != null and md5 != ''">md5 = #{md5},</if>
|
||||
<if test="path != null and path != ''">path = #{path},</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="deleteRmFileInfoById" parameterType="Long">
|
||||
delete from rm_file_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmFileInfoByIds" parameterType="String">
|
||||
delete from rm_file_info 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.RmInitialMonitorItemMapper">
|
||||
|
||||
<resultMap type="RmInitialMonitorItem" id="RmInitialMonitorItemResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="itemType" column="item_type" />
|
||||
<result property="metricKey" column="metric_key" />
|
||||
<result property="metricName" column="metric_name" />
|
||||
<result property="oid" column="oid" />
|
||||
<result property="filterValue" column="filter_value" />
|
||||
<result property="monitorDescription" column="monitor_description" />
|
||||
<result property="dataType" column="data_type" />
|
||||
<result property="resourceType" column="resource_type" />
|
||||
<result property="collectionCycle" column="collection_cycle" />
|
||||
<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="selectRmInitialMonitorItemVo">
|
||||
select id, item_type, metric_key, metric_name, oid, filter_value, monitor_description, data_type, resource_type, collection_cycle, create_time, update_time, create_by, update_by from rm_initial_monitor_item
|
||||
</sql>
|
||||
|
||||
<select id="selectRmInitialMonitorItemList" parameterType="RmInitialMonitorItem" resultMap="RmInitialMonitorItemResult">
|
||||
<include refid="selectRmInitialMonitorItemVo"/>
|
||||
<where>
|
||||
<if test="itemType != null and itemType != ''"> and item_type = #{itemType}</if>
|
||||
<if test="metricKey != null and metricKey != ''"> and metric_key = #{metricKey}</if>
|
||||
<if test="metricName != null and metricName != ''"> and metric_name like concat('%', #{metricName}, '%')</if>
|
||||
<if test="oid != null and oid != ''"> and oid = #{oid}</if>
|
||||
<if test="filterValue != null and filterValue != ''"> and filter_value = #{filterValue}</if>
|
||||
<if test="monitorDescription != null and monitorDescription != ''"> and monitor_description = #{monitorDescription}</if>
|
||||
<if test="dataType != null and dataType != ''"> and data_type = #{dataType}</if>
|
||||
<if test="resourceType != null and resourceType != ''"> and resource_type = #{resourceType}</if>
|
||||
<if test="collectionCycle != null and collectionCycle != ''"> and collection_cycle = #{collectionCycle}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmInitialMonitorItemById" parameterType="Long" resultMap="RmInitialMonitorItemResult">
|
||||
<include refid="selectRmInitialMonitorItemVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmInitialMonitorItem" parameterType="RmInitialMonitorItem" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_initial_monitor_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="itemType != null and itemType != ''">item_type,</if>
|
||||
<if test="metricKey != null and metricKey != ''">metric_key,</if>
|
||||
<if test="metricName != null and metricName != ''">metric_name,</if>
|
||||
<if test="oid != null">oid,</if>
|
||||
<if test="filterValue != null">filter_value,</if>
|
||||
<if test="monitorDescription != null">monitor_description,</if>
|
||||
<if test="dataType != null and dataType != ''">data_type,</if>
|
||||
<if test="resourceType != null and resourceType != ''">resource_type,</if>
|
||||
<if test="collectionCycle != null">collection_cycle,</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="itemType != null and itemType != ''">#{itemType},</if>
|
||||
<if test="metricKey != null and metricKey != ''">#{metricKey},</if>
|
||||
<if test="metricName != null and metricName != ''">#{metricName},</if>
|
||||
<if test="oid != null">#{oid},</if>
|
||||
<if test="filterValue != null">#{filterValue},</if>
|
||||
<if test="monitorDescription != null">#{monitorDescription},</if>
|
||||
<if test="dataType != null and dataType != ''">#{dataType},</if>
|
||||
<if test="resourceType != null and resourceType != ''">#{resourceType},</if>
|
||||
<if test="collectionCycle != null">#{collectionCycle},</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="updateRmInitialMonitorItem" parameterType="RmInitialMonitorItem">
|
||||
update rm_initial_monitor_item
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="itemType != null and itemType != ''">item_type = #{itemType},</if>
|
||||
<if test="metricKey != null and metricKey != ''">metric_key = #{metricKey},</if>
|
||||
<if test="metricName != null and metricName != ''">metric_name = #{metricName},</if>
|
||||
<if test="oid != null">oid = #{oid},</if>
|
||||
<if test="filterValue != null">filter_value = #{filterValue},</if>
|
||||
<if test="monitorDescription != null">monitor_description = #{monitorDescription},</if>
|
||||
<if test="dataType != null and dataType != ''">data_type = #{dataType},</if>
|
||||
<if test="resourceType != null and resourceType != ''">resource_type = #{resourceType},</if>
|
||||
<if test="collectionCycle != null">collection_cycle = #{collectionCycle},</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="deleteRmInitialMonitorItemById" parameterType="Long">
|
||||
delete from rm_initial_monitor_item where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmInitialMonitorItemByIds" parameterType="String">
|
||||
delete from rm_initial_monitor_item where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectRmInitialMonitorItemByIds" parameterType="java.lang.Long" resultMap="RmInitialMonitorItemResult">
|
||||
<include refid="selectRmInitialMonitorItemVo"/>
|
||||
where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,136 @@
|
||||
<?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.RmMonitorPolicyMapper">
|
||||
|
||||
<resultMap type="RmMonitorPolicy" id="RmMonitorPolicyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="templateId" column="template_id" />
|
||||
<result property="resourceGroupId" column="resource_group_id" />
|
||||
<result property="policyName" column="policy_name" />
|
||||
<result property="description" column="description" />
|
||||
<result property="status" column="status" />
|
||||
<result property="deployTime" column="deploy_time" />
|
||||
<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="switchType" column="switch_type" />
|
||||
<result property="deployDevice" column="deploy_device" />
|
||||
<result property="resourceType" column="resource_type" />
|
||||
<result property="priority" column="priority" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmMonitorPolicyVo">
|
||||
select id, template_id, resource_group_id, policy_name, description, status, deploy_time, create_time, update_time, create_by, update_by, switch_type, deploy_device, resource_type, priority from rm_monitor_policy
|
||||
</sql>
|
||||
|
||||
<select id="selectRmMonitorPolicyList" parameterType="RmMonitorPolicy" resultMap="RmMonitorPolicyResult">
|
||||
<include refid="selectRmMonitorPolicyVo"/>
|
||||
<where>
|
||||
<if test="templateId != null "> and template_id = #{templateId}</if>
|
||||
<if test="resourceType != null "> and resource_type = #{resourceType}</if>
|
||||
<if test="resourceGroupId != null "> and resource_group_id = #{resourceGroupId}</if>
|
||||
<if test="policyName != null and policyName != ''"> and policy_name like concat('%', #{policyName}, '%')</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="deployTime != null "> and deploy_time = #{deployTime}</if>
|
||||
<if test="priority != null "> and priority = #{priority}</if>
|
||||
<if test="queryName != null and queryName != ''">
|
||||
and (policy_name like concat('%', #{queryName}, '%')
|
||||
or
|
||||
<foreach item="item" index="index" collection="queryName.split(',')" open="(" close=")" separator="or">
|
||||
FIND_IN_SET(#{item}, REPLACE(deploy_device, '\n', ',')) > 0
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectRmMonitorPolicyById" parameterType="Long" resultMap="RmMonitorPolicyResult">
|
||||
<include refid="selectRmMonitorPolicyVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmMonitorPolicy" parameterType="RmMonitorPolicy" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_monitor_policy
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="templateId != null">template_id,</if>
|
||||
<if test="resourceGroupId != null">resource_group_id,</if>
|
||||
<if test="policyName != null and policyName != ''">policy_name,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="deployTime != null">deploy_time,</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="switchType != null">switch_type,</if>
|
||||
<if test="deployDevice != null">deploy_device,</if>
|
||||
<if test="resourceType != null">resource_type,</if>
|
||||
<if test="priority != null">priority,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="templateId != null">#{templateId},</if>
|
||||
<if test="resourceGroupId != null">#{resourceGroupId},</if>
|
||||
<if test="policyName != null and policyName != ''">#{policyName},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="deployTime != null">#{deployTime},</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="switchType != null">#{switchType},</if>
|
||||
<if test="deployDevice != null">#{deployDevice},</if>
|
||||
<if test="resourceType != null">#{resourceType},</if>
|
||||
<if test="priority != null">#{priority},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmMonitorPolicy" parameterType="RmMonitorPolicy">
|
||||
update rm_monitor_policy
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="templateId != null">template_id = #{templateId},</if>
|
||||
<if test="resourceGroupId != null">resource_group_id = #{resourceGroupId},</if>
|
||||
<if test="policyName != null and policyName != ''">policy_name = #{policyName},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="deployTime != null">deploy_time = #{deployTime},</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="switchType != null">switch_type = #{switchType},</if>
|
||||
<if test="deployDevice != null">deploy_device = #{deployDevice},</if>
|
||||
<if test="resourceType != null">resource_type = #{resourceType},</if>
|
||||
<if test="priority != null">priority = #{priority},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRmMonitorPolicyById" parameterType="Long">
|
||||
delete from rm_monitor_policy where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmMonitorPolicyByIds" parameterType="String">
|
||||
delete from rm_monitor_policy where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectRmMonitorPolicyByClientId" parameterType="RmMonitorPolicy" resultMap="RmMonitorPolicyResult">
|
||||
<include refid="selectRmMonitorPolicyVo"/>
|
||||
<where>
|
||||
<if test="resourceType != null "> and resource_type = #{resourceType}</if>
|
||||
<if test="priority != null "> and priority = #{priority}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="deployDevice != null ">
|
||||
and FIND_IN_SET(#{deployDevice}, REPLACE(deploy_device, '\n', ',')) > 0
|
||||
</if>
|
||||
</where>
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?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.RmMonitorTemplateMapper">
|
||||
|
||||
<resultMap type="RmMonitorTemplate" id="RmMonitorTemplateResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="templateName" column="template_name" />
|
||||
<result property="description" column="description" />
|
||||
<result property="monitorItems" column="monitor_items" />
|
||||
<result property="discoveryRules" column="discovery_rules" />
|
||||
<result property="resourceGroupId" column="resource_group_id" />
|
||||
<result property="resourcyType" column="resourcy_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="selectRmMonitorTemplateVo">
|
||||
select id, template_name, description, monitor_items, discovery_rules, resource_group_id, resourcy_type, create_time, update_time, create_by, update_by from rm_monitor_template
|
||||
</sql>
|
||||
|
||||
<select id="selectRmMonitorTemplateList" parameterType="RmMonitorTemplate" resultMap="RmMonitorTemplateResult">
|
||||
<include refid="selectRmMonitorTemplateVo"/>
|
||||
<where>
|
||||
<if test="templateName != null and templateName != ''"> and template_name like concat('%', #{templateName}, '%')</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="monitorItems != null and monitorItems != ''"> and monitor_items = #{monitorItems}</if>
|
||||
<if test="discoveryRules != null and discoveryRules != ''"> and discovery_rules = #{discoveryRules}</if>
|
||||
<if test="resourceGroupId != null "> and resource_group_id = #{resourceGroupId}</if>
|
||||
<if test="resourcyType != null and resourcyType != ''"> and resourcy_type = #{resourcyType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmMonitorTemplateById" parameterType="Long" resultMap="RmMonitorTemplateResult">
|
||||
<include refid="selectRmMonitorTemplateVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmMonitorTemplate" parameterType="RmMonitorTemplate" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_monitor_template
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="templateName != null and templateName != ''">template_name,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="monitorItems != null">monitor_items,</if>
|
||||
<if test="discoveryRules != null">discovery_rules,</if>
|
||||
<if test="resourceGroupId != null">resource_group_id,</if>
|
||||
<if test="resourcyType != null">resourcy_type,</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="templateName != null and templateName != ''">#{templateName},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="monitorItems != null">#{monitorItems},</if>
|
||||
<if test="discoveryRules != null">#{discoveryRules},</if>
|
||||
<if test="resourceGroupId != null">#{resourceGroupId},</if>
|
||||
<if test="resourcyType != null">#{resourcyType},</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="updateRmMonitorTemplate" parameterType="RmMonitorTemplate">
|
||||
update rm_monitor_template
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="templateName != null and templateName != ''">template_name = #{templateName},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="monitorItems != null">monitor_items = #{monitorItems},</if>
|
||||
<if test="discoveryRules != null">discovery_rules = #{discoveryRules},</if>
|
||||
<if test="resourceGroupId != null">resource_group_id = #{resourceGroupId},</if>
|
||||
<if test="resourcyType != null">resourcy_type = #{resourcyType},</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="deleteRmMonitorTemplateById" parameterType="Long">
|
||||
delete from rm_monitor_template where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmMonitorTemplateByIds" parameterType="String">
|
||||
delete from rm_monitor_template where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getAllTemplate" resultType="java.util.Map">
|
||||
select id, template_name templateName,resourcy_type resourceType from rm_monitor_template
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,155 @@
|
||||
<?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.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>
|
||||
<if test="clientIds != '' and clientIds != null">
|
||||
and (bind_ip='1' or bind_ip='3') and new_flag=1
|
||||
and client_id in
|
||||
<foreach collection="clientIds.split(',')" item="clientId" open="(" separator="," close=")">
|
||||
#{clientId}
|
||||
</foreach>
|
||||
</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>
|
||||
@@ -0,0 +1,99 @@
|
||||
<?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.RmPolicyDeviceDetailsMapper">
|
||||
|
||||
<resultMap type="RmPolicyDeviceDetails" id="RmPolicyDeviceDetailsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="policyId" column="policy_id" />
|
||||
<result property="scriptId" column="script_id" />
|
||||
<result property="versionId" column="version_id" />
|
||||
<result property="policyStatus" column="policy_status" />
|
||||
<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="selectRmPolicyDeviceDetailsVo">
|
||||
select id, client_id, policy_id, script_id, version_id, policy_status, create_time, update_time, create_by, update_by from rm_policy_device_details
|
||||
</sql>
|
||||
|
||||
<select id="selectRmPolicyDeviceDetailsList" parameterType="RmPolicyDeviceDetails" resultMap="RmPolicyDeviceDetailsResult">
|
||||
<include refid="selectRmPolicyDeviceDetailsVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="policyId != null and policyId != ''"> and policy_id = #{policyId}</if>
|
||||
<if test="scriptId != null and scriptId != ''"> and script_id = #{scriptId}</if>
|
||||
<if test="versionId != null and versionId != ''"> and version_id = #{versionId}</if>
|
||||
<if test="policyStatus != null and policyStatus != ''"> and policy_status = #{policyStatus}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmPolicyDeviceDetailsById" parameterType="Long" resultMap="RmPolicyDeviceDetailsResult">
|
||||
<include refid="selectRmPolicyDeviceDetailsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmPolicyDeviceDetails" parameterType="RmPolicyDeviceDetails" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_policy_device_details
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="policyId != null and policyId != ''">policy_id,</if>
|
||||
<if test="scriptId != null">script_id,</if>
|
||||
<if test="versionId != null">version_id,</if>
|
||||
<if test="policyStatus != null and policyStatus != ''">policy_status,</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="policyId != null and policyId != ''">#{policyId},</if>
|
||||
<if test="scriptId != null">#{scriptId},</if>
|
||||
<if test="versionId != null">#{versionId},</if>
|
||||
<if test="policyStatus != null and policyStatus != ''">#{policyStatus},</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="updateRmPolicyDeviceDetails" parameterType="RmPolicyDeviceDetails">
|
||||
update rm_policy_device_details
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="policyStatus != null and policyStatus != ''">policy_status = #{policyStatus},</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">
|
||||
id = #{id}
|
||||
</when>
|
||||
<when test="policyId != null and policyId != '' and clientId != null and clientId != ''">
|
||||
policy_id = #{policyId} and client_id = #{clientId}
|
||||
</when>
|
||||
<otherwise>
|
||||
1=0 <!-- 如果没有提供任何条件,则不更新任何记录 -->
|
||||
</otherwise>
|
||||
</choose>
|
||||
</update>
|
||||
|
||||
<delete id="deleteRmPolicyDeviceDetailsById" parameterType="Long">
|
||||
delete from rm_policy_device_details where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmPolicyDeviceDetailsByIds" parameterType="String">
|
||||
delete from rm_policy_device_details where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,135 @@
|
||||
<?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.RmResourceRemoteMapper">
|
||||
|
||||
<resultMap type="RmResourceRemote" id="RmResourceRemoteResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="hardwareSn" column="hardware_sn" />
|
||||
<result property="resourceType" column="resource_type" />
|
||||
<result property="resourceName" column="resource_name" />
|
||||
<result property="description" column="description" />
|
||||
<result property="internalIp" column="internal_ip" />
|
||||
<result property="externalIp" column="external_ip" />
|
||||
<result property="managementPort" column="management_port" />
|
||||
<result property="onlineStatus" column="online_status" />
|
||||
<result property="connectionMethod" column="connection_method" />
|
||||
<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="clientId" column="client_id" />
|
||||
<result property="resultFlag" column="result_flag" />
|
||||
<result property="scriptId" column="script_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmResourceRemoteVo">
|
||||
select id, hardware_sn, resource_type, resource_name, description, internal_ip, external_ip, management_port, online_status, connection_method, create_time, update_time, create_by, update_by, client_id, result_flag, script_id from rm_resource_remote
|
||||
</sql>
|
||||
|
||||
<select id="selectRmResourceRemoteList" parameterType="RmResourceRemote" resultMap="RmResourceRemoteResult">
|
||||
<include refid="selectRmResourceRemoteVo"/>
|
||||
<where>
|
||||
<if test="hardwareSn != null and hardwareSn != ''"> and hardware_sn = #{hardwareSn}</if>
|
||||
<if test="resourceType != null and resourceType != ''"> and resource_type = #{resourceType}</if>
|
||||
<if test="resourceName != null and resourceName != ''"> and resource_name like concat('%', #{resourceName}, '%')</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="internalIp != null and internalIp != ''"> and internal_ip = #{internalIp}</if>
|
||||
<if test="externalIp != null and externalIp != ''"> and external_ip = #{externalIp}</if>
|
||||
<if test="managementPort != null "> and management_port = #{managementPort}</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''"> and online_status = #{onlineStatus}</if>
|
||||
<if test="connectionMethod != null and connectionMethod != ''"> and connection_method = #{connectionMethod}</if>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="resultFlag != null "> and result_flag = #{resultFlag}</if>
|
||||
<if test="scriptId != null "> and script_id = #{scriptId}</if>
|
||||
</where>
|
||||
<choose>
|
||||
<when test="clientId != null and clientId != ''">
|
||||
order by create_time desc
|
||||
</when>
|
||||
<otherwise>
|
||||
order by result_flag asc,create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="selectRmResourceRemoteById" parameterType="Long" resultMap="RmResourceRemoteResult">
|
||||
<include refid="selectRmResourceRemoteVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmResourceRemote" parameterType="RmResourceRemote" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_resource_remote
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="hardwareSn != null and hardwareSn != ''">hardware_sn,</if>
|
||||
<if test="resourceType != null and resourceType != ''">resource_type,</if>
|
||||
<if test="resourceName != null and resourceName != ''">resource_name,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="internalIp != null">internal_ip,</if>
|
||||
<if test="externalIp != null">external_ip,</if>
|
||||
<if test="managementPort != null">management_port,</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''">online_status,</if>
|
||||
<if test="connectionMethod != null">connection_method,</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="clientId != null">client_id,</if>
|
||||
<if test="resultFlag != null">result_flag,</if>
|
||||
<if test="scriptId != null">script_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="hardwareSn != null and hardwareSn != ''">#{hardwareSn},</if>
|
||||
<if test="resourceType != null and resourceType != ''">#{resourceType},</if>
|
||||
<if test="resourceName != null and resourceName != ''">#{resourceName},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="internalIp != null">#{internalIp},</if>
|
||||
<if test="externalIp != null">#{externalIp},</if>
|
||||
<if test="managementPort != null">#{managementPort},</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''">#{onlineStatus},</if>
|
||||
<if test="connectionMethod != null">#{connectionMethod},</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="clientId != null">#{clientId},</if>
|
||||
<if test="resultFlag != null">#{resultFlag},</if>
|
||||
<if test="scriptId != null">#{scriptId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmResourceRemote" parameterType="RmResourceRemote">
|
||||
update rm_resource_remote
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="hardwareSn != null and hardwareSn != ''">hardware_sn = #{hardwareSn},</if>
|
||||
<if test="resourceType != null and resourceType != ''">resource_type = #{resourceType},</if>
|
||||
<if test="resourceName != null and resourceName != ''">resource_name = #{resourceName},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="internalIp != null">internal_ip = #{internalIp},</if>
|
||||
<if test="externalIp != null">external_ip = #{externalIp},</if>
|
||||
<if test="managementPort != null">management_port = #{managementPort},</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''">online_status = #{onlineStatus},</if>
|
||||
<if test="connectionMethod != null">connection_method = #{connectionMethod},</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="clientId != null">client_id = #{clientId},</if>
|
||||
<if test="resultFlag != null">result_flag = #{resultFlag},</if>
|
||||
<if test="scriptId != null">script_id = #{scriptId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRmResourceRemoteById" parameterType="Long">
|
||||
delete from rm_resource_remote where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmResourceRemoteByIds" parameterType="String">
|
||||
delete from rm_resource_remote where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,144 @@
|
||||
<?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.RmTemplateLinuxMapper">
|
||||
|
||||
<resultMap type="RmTemplateLinux" id="RmTemplateLinuxResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="templateId" column="template_id" />
|
||||
<result property="policyId" column="policy_id" />
|
||||
<result property="itemType" column="item_type" />
|
||||
<result property="metricKey" column="metric_key" />
|
||||
<result property="metricName" column="metric_name" />
|
||||
<result property="dataType" column="data_type" />
|
||||
<result property="monitorStatus" column="monitor_status" />
|
||||
<result property="collectionCycle" column="collection_cycle" />
|
||||
<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="selectRmTemplateLinuxVo">
|
||||
select id, template_id, policy_id, item_type, metric_key, metric_name, data_type, monitor_status, collection_cycle, create_time, update_time, create_by, update_by from rm_template_linux
|
||||
</sql>
|
||||
|
||||
<select id="selectRmTemplateLinuxList" parameterType="RmTemplateLinux" resultMap="RmTemplateLinuxResult">
|
||||
<include refid="selectRmTemplateLinuxVo"/>
|
||||
<where>
|
||||
<if test="templateId != null "> and template_id = #{templateId}</if>
|
||||
<if test="policyId != null "> and policy_id = #{policyId}</if>
|
||||
<if test="itemType != null and itemType != ''"> and item_type = #{itemType}</if>
|
||||
<if test="metricKey != null and metricKey != ''"> and metric_key = #{metricKey}</if>
|
||||
<if test="metricName != null and metricName != ''"> and metric_name like concat('%', #{metricName}, '%')</if>
|
||||
<if test="dataType != null and dataType != ''"> and data_type = #{dataType}</if>
|
||||
<if test="monitorStatus != null and monitorStatus != ''"> and monitor_status = #{monitorStatus}</if>
|
||||
<if test="collectionCycle != null and collectionCycle != ''"> and collection_cycle = #{collectionCycle}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmTemplateLinuxById" parameterType="Long" resultMap="RmTemplateLinuxResult">
|
||||
<include refid="selectRmTemplateLinuxVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmTemplateLinux" parameterType="RmTemplateLinux" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_template_linux
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="templateId != null">template_id,</if>
|
||||
<if test="policyId != null">policy_id,</if>
|
||||
<if test="itemType != null and itemType != ''">item_type,</if>
|
||||
<if test="metricKey != null and metricKey != ''">metric_key,</if>
|
||||
<if test="metricName != null and metricName != ''">metric_name,</if>
|
||||
<if test="dataType != null and dataType != ''">data_type,</if>
|
||||
<if test="monitorStatus != null">monitor_status,</if>
|
||||
<if test="collectionCycle != null">collection_cycle,</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="templateId != null">#{templateId},</if>
|
||||
<if test="policyId != null">#{policyId},</if>
|
||||
<if test="itemType != null and itemType != ''">#{itemType},</if>
|
||||
<if test="metricKey != null and metricKey != ''">#{metricKey},</if>
|
||||
<if test="metricName != null and metricName != ''">#{metricName},</if>
|
||||
<if test="dataType != null and dataType != ''">#{dataType},</if>
|
||||
<if test="monitorStatus != null">#{monitorStatus},</if>
|
||||
<if test="collectionCycle != null">#{collectionCycle},</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="updateRmTemplateLinux" parameterType="RmTemplateLinux">
|
||||
update rm_template_linux
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="templateId != null">template_id = #{templateId},</if>
|
||||
<if test="policyId != null">policy_id = #{policyId},</if>
|
||||
<if test="itemType != null and itemType != ''">item_type = #{itemType},</if>
|
||||
<if test="metricKey != null and metricKey != ''">metric_key = #{metricKey},</if>
|
||||
<if test="metricName != null and metricName != ''">metric_name = #{metricName},</if>
|
||||
<if test="dataType != null and dataType != ''">data_type = #{dataType},</if>
|
||||
<if test="monitorStatus != null">monitor_status = #{monitorStatus},</if>
|
||||
<if test="collectionCycle != null">collection_cycle = #{collectionCycle},</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="deleteRmTemplateLinuxById" parameterType="Long">
|
||||
delete from rm_template_linux where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmTemplateLinuxByIds" parameterType="String">
|
||||
delete from rm_template_linux where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<insert id="batchInsertRmTemplateLinux" parameterType="list">
|
||||
insert into rm_template_linux
|
||||
(template_id, policy_id, item_type, metric_key, metric_name, data_type,
|
||||
monitor_status, create_time, update_time, create_by, update_by)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.templateId},
|
||||
#{item.policyId},
|
||||
#{item.itemType},
|
||||
#{item.metricKey},
|
||||
#{item.metricName},
|
||||
#{item.dataType},
|
||||
#{item.monitorStatus},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.createBy},
|
||||
#{item.updateBy}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByTemplateId" parameterType="Long">
|
||||
delete from rm_template_linux where template_id = #{templateId}
|
||||
</delete>
|
||||
|
||||
<update id="updateByTemplateId" parameterType="RmTemplateLinux">
|
||||
update rm_template_linux set collection_cycle = null
|
||||
where template_id = #{templateId}
|
||||
</update>
|
||||
<delete id="deleteByPolicyId" parameterType="Long">
|
||||
delete from rm_template_linux where policy_id = #{policyId}
|
||||
</delete>
|
||||
<update id="updateByPolicyId" parameterType="RmTemplateLinux">
|
||||
update rm_template_linux set collection_cycle = null
|
||||
where policy_id = #{policyId}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,175 @@
|
||||
<?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.RmTemplateSwitchMapper">
|
||||
|
||||
<resultMap type="RmTemplateSwitch" id="RmTemplateSwitchResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="templateId" column="template_id" />
|
||||
<result property="policyId" column="policy_id" />
|
||||
<result property="itemType" column="item_type" />
|
||||
<result property="metricKey" column="metric_key" />
|
||||
<result property="metricName" column="metric_name" />
|
||||
<result property="oid" column="oid" />
|
||||
<result property="filterValue" column="filter_value" />
|
||||
<result property="switchDescription" column="switch_description" />
|
||||
<result property="dataType" column="data_type" />
|
||||
<result property="monitorStatus" column="monitor_status" />
|
||||
<result property="collectionCycle" column="collection_cycle" />
|
||||
<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="selectRmTemplateSwitchVo">
|
||||
select id, template_id, policy_id, item_type, metric_key, metric_name, oid, filter_value, switch_description, data_type, monitor_status, collection_cycle, create_time, update_time, create_by, update_by from rm_template_switch
|
||||
</sql>
|
||||
|
||||
<select id="selectRmTemplateSwitchList" parameterType="RmTemplateSwitch" resultMap="RmTemplateSwitchResult">
|
||||
<include refid="selectRmTemplateSwitchVo"/>
|
||||
<where>
|
||||
<if test="templateId != null "> and template_id = #{templateId}</if>
|
||||
<if test="policyId != null "> and policy_id = #{policyId}</if>
|
||||
<if test="itemType != null and itemType != ''"> and item_type = #{itemType}</if>
|
||||
<if test="metricKey != null and metricKey != ''"> and metric_key = #{metricKey}</if>
|
||||
<if test="metricName != null and metricName != ''"> and metric_name like concat('%', #{metricName}, '%')</if>
|
||||
<if test="oid != null and oid != ''"> and oid = #{oid}</if>
|
||||
<if test="filterValue != null and filterValue != ''"> and filter_value = #{filterValue}</if>
|
||||
<if test="switchDescription != null and switchDescription != ''"> and switch_description = #{switchDescription}</if>
|
||||
<if test="dataType != null and dataType != ''"> and data_type = #{dataType}</if>
|
||||
<if test="monitorStatus != null and monitorStatus != ''"> and monitor_status = #{monitorStatus}</if>
|
||||
<if test="collectionCycle != null and collectionCycle != ''"> and collection_cycle = #{collectionCycle}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmTemplateSwitchById" parameterType="Long" resultMap="RmTemplateSwitchResult">
|
||||
<include refid="selectRmTemplateSwitchVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmTemplateSwitch" parameterType="RmTemplateSwitch" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_template_switch
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="templateId != null">template_id,</if>
|
||||
<if test="policyId != null">policy_id,</if>
|
||||
<if test="itemType != null and itemType != ''">item_type,</if>
|
||||
<if test="metricKey != null and metricKey != ''">metric_key,</if>
|
||||
<if test="metricName != null and metricName != ''">metric_name,</if>
|
||||
<if test="oid != null and oid != ''">oid,</if>
|
||||
<if test="filterValue != null">filter_value,</if>
|
||||
<if test="switchDescription != null">switch_description,</if>
|
||||
<if test="dataType != null and dataType != ''">data_type,</if>
|
||||
<if test="monitorStatus != null">monitor_status,</if>
|
||||
<if test="collectionCycle != null">collection_cycle,</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="templateId != null">#{templateId},</if>
|
||||
<if test="policyId != null">#{policyId},</if>
|
||||
<if test="itemType != null and itemType != ''">#{itemType},</if>
|
||||
<if test="metricKey != null and metricKey != ''">#{metricKey},</if>
|
||||
<if test="metricName != null and metricName != ''">#{metricName},</if>
|
||||
<if test="oid != null and oid != ''">#{oid},</if>
|
||||
<if test="filterValue != null">#{filterValue},</if>
|
||||
<if test="switchDescription != null">#{switchDescription},</if>
|
||||
<if test="dataType != null and dataType != ''">#{dataType},</if>
|
||||
<if test="monitorStatus != null">#{monitorStatus},</if>
|
||||
<if test="collectionCycle != null">#{collectionCycle},</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="updateRmTemplateSwitch" parameterType="RmTemplateSwitch">
|
||||
update rm_template_switch
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="templateId != null">template_id = #{templateId},</if>
|
||||
<if test="policyId != null">policy_id = #{policyId},</if>
|
||||
<if test="itemType != null and itemType != ''">item_type = #{itemType},</if>
|
||||
<if test="metricKey != null and metricKey != ''">metric_key = #{metricKey},</if>
|
||||
<if test="metricName != null and metricName != ''">metric_name = #{metricName},</if>
|
||||
<if test="oid != null and oid != ''">oid = #{oid},</if>
|
||||
<if test="filterValue != null">filter_value = #{filterValue},</if>
|
||||
<if test="switchDescription != null">switch_description = #{switchDescription},</if>
|
||||
<if test="dataType != null and dataType != ''">data_type = #{dataType},</if>
|
||||
<if test="monitorStatus != null">monitor_status = #{monitorStatus},</if>
|
||||
<if test="collectionCycle != null">collection_cycle = #{collectionCycle},</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="deleteRmTemplateSwitchById" parameterType="Long">
|
||||
delete from rm_template_switch where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmTemplateSwitchByIds" parameterType="String">
|
||||
delete from rm_template_switch where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<insert id="batchInsertRmTemplateSwitch" parameterType="list">
|
||||
INSERT INTO rm_template_switch
|
||||
(
|
||||
template_id,
|
||||
policy_id,
|
||||
item_type,
|
||||
metric_key,
|
||||
metric_name,
|
||||
oid,
|
||||
filter_value,
|
||||
switch_description,
|
||||
data_type,
|
||||
monitor_status,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.templateId},
|
||||
#{item.policyId},
|
||||
#{item.itemType},
|
||||
#{item.metricKey},
|
||||
#{item.metricName},
|
||||
#{item.oid},
|
||||
#{item.filterValue},
|
||||
#{item.switchDescription},
|
||||
#{item.dataType},
|
||||
#{item.monitorStatus},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.createBy},
|
||||
#{item.updateBy}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByTemplateId" parameterType="Long">
|
||||
delete from rm_template_switch where template_id = #{templateId}
|
||||
</delete>
|
||||
<update id="updateByTemplateId" parameterType="RmTemplateLinux">
|
||||
update rm_template_switch set collection_cycle = null
|
||||
where template_id = #{templateId}
|
||||
</update>
|
||||
<delete id="deleteByPolicyId" parameterType="Long">
|
||||
delete from rm_template_switch where policy_id = #{policyId}
|
||||
</delete>
|
||||
<update id="updateByPolicyId" parameterType="RmTemplateLinux">
|
||||
update rm_template_switch set collection_cycle = null
|
||||
where policy_id = #{policyId}
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user