<?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.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>