192 lines
8.1 KiB
XML
192 lines
8.1 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE mapper
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.ruoyi.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="avg1 != null "> and avg1 = #{avg1}</if>
|
|
<if test="avg5 != null "> and avg5 = #{avg5}</if>
|
|
<if test="avg15 != null "> and avg15 = #{avg15}</if>
|
|
<if test="interrupt != null "> and interrupt = #{interrupt}</if>
|
|
<if test="uti != null "> and uti = #{uti}</if>
|
|
<if test="num != null "> and num = #{num}</if>
|
|
<if test="normal != null "> and normal = #{normal}</if>
|
|
<if test="idle != null "> and idle = #{idle}</if>
|
|
<if test="iowait != null "> and iowait = #{iowait}</if>
|
|
<if test="system != null "> and system = #{system}</if>
|
|
<if test="noresp != null "> and noresp = #{noresp}</if>
|
|
<if test="user != null "> and user = #{user}</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 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 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>
|
|
</mapper> |