package com.css.simulation.resource.monitor.infra.mysql.mapper;

import api.common.pojo.po.home.SystemServerPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


@Mapper
public interface SystemServerMapper {


    @Select("delete from system_server where 1=1")
    void delete();

    @Select("insert into system_server(id, server_id, server_address, server_type, memory_usage, memory_available, memory_total,\n" +
            "                          disk_usage, disk_available, disk_total, cpu_usage, cpu_total, gpu_usage, gpu_total,\n" +
            "                          task_number, create_time, modify_time, create_user_id, modify_user_id, is_deleted)\n" +
            "values (#{po.id}, #{po.serverId}, #{po.serverAddress}, #{po.serverType}, #{po.memoryUsage}, #{po.memoryAvailable}, #{po.memoryTotal},\n" +
            "        #{po.diskUsage}, #{po.diskAvailable}, #{po.diskTotal}, #{po.cpuUsage}, #{po.cpuTotal}, #{po.gpuUsage}, #{po.gpuTotal},\n" +
            "        #{po.taskNumber}, #{po.createTime}, #{po.modifyTime}, #{po.createUserId}, #{po.modifyUserId}, #{po.isDeleted})")
    void insert(@Param("po") SystemServerPO systemServerPO);

}
