|
@@ -0,0 +1,58 @@
|
|
|
+package com.css.simulation.resource.scene.mapper;
|
|
|
+
|
|
|
+import api.common.pojo.vo.system.SystemServerVO;
|
|
|
+import org.apache.ibatis.annotations.Mapper;
|
|
|
+import org.apache.ibatis.annotations.Result;
|
|
|
+import org.apache.ibatis.annotations.Results;
|
|
|
+import org.apache.ibatis.annotations.Select;
|
|
|
+import org.apache.ibatis.type.JdbcType;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * create table if not exists simulation.system_server
|
|
|
+ * (
|
|
|
+ * id varchar(32) null,
|
|
|
+ * server_id varchar(64) null,
|
|
|
+ * server_address varchar(32) null,
|
|
|
+ * server_type varchar(32) null,
|
|
|
+ * cpu_useage varchar(32) null,
|
|
|
+ * memory_useage varchar(32) null,
|
|
|
+ * memory_available varchar(32) null comment '剩余内存,单位GB',
|
|
|
+ * disk_usage varchar(32) null,
|
|
|
+ * disk_abailable varchar(32) null comment '剩余磁盘,单位GB',
|
|
|
+ * task_number varchar(32) null comment '执行任务数量'
|
|
|
+ * )
|
|
|
+ * comment '服务器表';
|
|
|
+ */
|
|
|
+@Mapper
|
|
|
+public interface SystemServerMapper {
|
|
|
+ @Results(id = "server", value = {
|
|
|
+ @Result(column = "id", property = "id", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "server_id", property = "serverId", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "server_address", property = "serverAddress", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "server_type", property = "serverType", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "cpu_usage", property = "cpuUsage", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "memory_usage", property = "memoryUsage", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "memory_available", property = "memoryAvailable", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "disk_usage", property = "diskUsage", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "disk_available", property = "diskAvailable", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "task_number", property = "taskNumber", jdbcType = JdbcType.VARCHAR)
|
|
|
+ })
|
|
|
+
|
|
|
+ @Select("select id,\n" +
|
|
|
+ " server_id,\n" +
|
|
|
+ " server_address,\n" +
|
|
|
+ " server_type,\n" +
|
|
|
+ " cpu_usage,\n" +
|
|
|
+ " memory_usage,\n" +
|
|
|
+ " memory_available,\n" +
|
|
|
+ " disk_usage,\n" +
|
|
|
+ " disk_available,\n" +
|
|
|
+ " task_number\n" +
|
|
|
+ "from system_server\n" +
|
|
|
+ "where is_deleted = '0'")
|
|
|
+ List<SystemServerVO> selectAll();
|
|
|
+
|
|
|
+}
|