feat(任务中心): 任务中心表结构&domain
This commit is contained in:
parent
0ce40c4564
commit
b0f24ef72e
|
@ -0,0 +1,158 @@
|
||||||
|
package io.metersphere.system.domain;
|
||||||
|
|
||||||
|
import io.metersphere.validation.groups.Created;
|
||||||
|
import io.metersphere.validation.groups.Updated;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ExecTask implements Serializable {
|
||||||
|
@Schema(description = "任务ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task.id.not_blank}", groups = {Updated.class})
|
||||||
|
@Size(min = 1, max = 50, message = "{exec_task.id.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Long num;
|
||||||
|
|
||||||
|
@Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task.task_name.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 255, message = "{exec_task.task_name.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task.status.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 20, message = "{exec_task.status.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "用例数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task.case_count.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 19, message = "{exec_task.case_count.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private Long caseCount;
|
||||||
|
|
||||||
|
@Schema(description = "执行结果")
|
||||||
|
private String result;
|
||||||
|
|
||||||
|
@Schema(description = "任务类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task.task_type.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 50, message = "{exec_task.task_type.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String taskType;
|
||||||
|
|
||||||
|
@Schema(description = "执行模式", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task.trigger_mode.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 20, message = "{exec_task.trigger_mode.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String triggerMode;
|
||||||
|
|
||||||
|
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task.project_id.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 50, message = "{exec_task.project_id.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String projectId;
|
||||||
|
|
||||||
|
@Schema(description = "组织ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task.organization_id.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 50, message = "{exec_task.organization_id.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String organizationId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private Long createTime;
|
||||||
|
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String createUser;
|
||||||
|
|
||||||
|
@Schema(description = "开始时间")
|
||||||
|
private Long startTime;
|
||||||
|
|
||||||
|
@Schema(description = "结束时间")
|
||||||
|
private Long endTime;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public enum Column {
|
||||||
|
id("id", "id", "VARCHAR", false),
|
||||||
|
num("num", "num", "BIGINT", false),
|
||||||
|
taskName("task_name", "taskName", "VARCHAR", false),
|
||||||
|
status("status", "status", "VARCHAR", true),
|
||||||
|
caseCount("case_count", "caseCount", "BIGINT", false),
|
||||||
|
result("result", "result", "VARCHAR", true),
|
||||||
|
taskType("task_type", "taskType", "VARCHAR", false),
|
||||||
|
triggerMode("trigger_mode", "triggerMode", "VARCHAR", false),
|
||||||
|
projectId("project_id", "projectId", "VARCHAR", false),
|
||||||
|
organizationId("organization_id", "organizationId", "VARCHAR", false),
|
||||||
|
createTime("create_time", "createTime", "BIGINT", false),
|
||||||
|
createUser("create_user", "createUser", "VARCHAR", false),
|
||||||
|
startTime("start_time", "startTime", "BIGINT", false),
|
||||||
|
endTime("end_time", "endTime", "BIGINT", false);
|
||||||
|
|
||||||
|
private static final String BEGINNING_DELIMITER = "`";
|
||||||
|
|
||||||
|
private static final String ENDING_DELIMITER = "`";
|
||||||
|
|
||||||
|
private final String column;
|
||||||
|
|
||||||
|
private final boolean isColumnNameDelimited;
|
||||||
|
|
||||||
|
private final String javaProperty;
|
||||||
|
|
||||||
|
private final String jdbcType;
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return this.column;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return this.column;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJavaProperty() {
|
||||||
|
return this.javaProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJdbcType() {
|
||||||
|
return this.jdbcType;
|
||||||
|
}
|
||||||
|
|
||||||
|
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
|
||||||
|
this.column = column;
|
||||||
|
this.javaProperty = javaProperty;
|
||||||
|
this.jdbcType = jdbcType;
|
||||||
|
this.isColumnNameDelimited = isColumnNameDelimited;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String desc() {
|
||||||
|
return this.getEscapedColumnName() + " DESC";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asc() {
|
||||||
|
return this.getEscapedColumnName() + " ASC";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Column[] excludes(Column ... excludes) {
|
||||||
|
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
|
||||||
|
if (excludes != null && excludes.length > 0) {
|
||||||
|
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
|
||||||
|
}
|
||||||
|
return columns.toArray(new Column[]{});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Column[] all() {
|
||||||
|
return Column.values();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEscapedColumnName() {
|
||||||
|
if (this.isColumnNameDelimited) {
|
||||||
|
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
|
||||||
|
} else {
|
||||||
|
return this.column;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAliasedEscapedColumnName() {
|
||||||
|
return this.getEscapedColumnName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,164 @@
|
||||||
|
package io.metersphere.system.domain;
|
||||||
|
|
||||||
|
import io.metersphere.validation.groups.Created;
|
||||||
|
import io.metersphere.validation.groups.Updated;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ExecTaskItem implements Serializable {
|
||||||
|
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task_item.id.not_blank}", groups = {Updated.class})
|
||||||
|
@Size(min = 1, max = 50, message = "{exec_task_item.id.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "任务ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task_item.task_id.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 50, message = "{exec_task_item.task_id.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
@Schema(description = "资源ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task_item.resource_id.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 50, message = "{exec_task_item.resource_id.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String resourceId;
|
||||||
|
|
||||||
|
@Schema(description = "任务来源(任务组下的任务id)")
|
||||||
|
private String taskOrigin;
|
||||||
|
|
||||||
|
@Schema(description = "执行状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task_item.status.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 20, message = "{exec_task_item.status.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "执行结果")
|
||||||
|
private String result;
|
||||||
|
|
||||||
|
@Schema(description = "资源池ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task_item.resource_pool_id.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 50, message = "{exec_task_item.resource_pool_id.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String resourcePoolId;
|
||||||
|
|
||||||
|
@Schema(description = "节点")
|
||||||
|
private String resourcePoolNode;
|
||||||
|
|
||||||
|
@Schema(description = "资源类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task_item.resource_type.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 50, message = "{exec_task_item.resource_type.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String resourceType;
|
||||||
|
|
||||||
|
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task_item.project_id.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 50, message = "{exec_task_item.project_id.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String projectId;
|
||||||
|
|
||||||
|
@Schema(description = "组织ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task_item.organization_id.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 50, message = "{exec_task_item.organization_id.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String organizationId;
|
||||||
|
|
||||||
|
@Schema(description = "线程ID")
|
||||||
|
private String threadId;
|
||||||
|
|
||||||
|
@Schema(description = "执行开始时间")
|
||||||
|
private Long startTime;
|
||||||
|
|
||||||
|
@Schema(description = "执行完成时间")
|
||||||
|
private Long endTime;
|
||||||
|
|
||||||
|
@Schema(description = "执行人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "{exec_task_item.executor.not_blank}", groups = {Created.class})
|
||||||
|
@Size(min = 1, max = 50, message = "{exec_task_item.executor.length_range}", groups = {Created.class, Updated.class})
|
||||||
|
private String executor;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public enum Column {
|
||||||
|
id("id", "id", "VARCHAR", false),
|
||||||
|
taskId("task_id", "taskId", "VARCHAR", false),
|
||||||
|
resourceId("resource_id", "resourceId", "VARCHAR", false),
|
||||||
|
taskOrigin("task_origin", "taskOrigin", "VARCHAR", false),
|
||||||
|
status("status", "status", "VARCHAR", true),
|
||||||
|
result("result", "result", "VARCHAR", true),
|
||||||
|
resourcePoolId("resource_pool_id", "resourcePoolId", "VARCHAR", false),
|
||||||
|
resourcePoolNode("resource_pool_node", "resourcePoolNode", "VARCHAR", false),
|
||||||
|
resourceType("resource_type", "resourceType", "VARCHAR", false),
|
||||||
|
projectId("project_id", "projectId", "VARCHAR", false),
|
||||||
|
organizationId("organization_id", "organizationId", "VARCHAR", false),
|
||||||
|
threadId("thread_id", "threadId", "VARCHAR", false),
|
||||||
|
startTime("start_time", "startTime", "BIGINT", false),
|
||||||
|
endTime("end_time", "endTime", "BIGINT", false),
|
||||||
|
executor("executor", "executor", "VARCHAR", false);
|
||||||
|
|
||||||
|
private static final String BEGINNING_DELIMITER = "`";
|
||||||
|
|
||||||
|
private static final String ENDING_DELIMITER = "`";
|
||||||
|
|
||||||
|
private final String column;
|
||||||
|
|
||||||
|
private final boolean isColumnNameDelimited;
|
||||||
|
|
||||||
|
private final String javaProperty;
|
||||||
|
|
||||||
|
private final String jdbcType;
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return this.column;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return this.column;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJavaProperty() {
|
||||||
|
return this.javaProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJdbcType() {
|
||||||
|
return this.jdbcType;
|
||||||
|
}
|
||||||
|
|
||||||
|
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
|
||||||
|
this.column = column;
|
||||||
|
this.javaProperty = javaProperty;
|
||||||
|
this.jdbcType = jdbcType;
|
||||||
|
this.isColumnNameDelimited = isColumnNameDelimited;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String desc() {
|
||||||
|
return this.getEscapedColumnName() + " DESC";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asc() {
|
||||||
|
return this.getEscapedColumnName() + " ASC";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Column[] excludes(Column ... excludes) {
|
||||||
|
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
|
||||||
|
if (excludes != null && excludes.length > 0) {
|
||||||
|
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
|
||||||
|
}
|
||||||
|
return columns.toArray(new Column[]{});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Column[] all() {
|
||||||
|
return Column.values();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEscapedColumnName() {
|
||||||
|
if (this.isColumnNameDelimited) {
|
||||||
|
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
|
||||||
|
} else {
|
||||||
|
return this.column;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAliasedEscapedColumnName() {
|
||||||
|
return this.getEscapedColumnName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,34 @@
|
||||||
|
package io.metersphere.system.mapper;
|
||||||
|
|
||||||
|
import io.metersphere.system.domain.ExecTaskItem;
|
||||||
|
import io.metersphere.system.domain.ExecTaskItemExample;
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
public interface ExecTaskItemMapper {
|
||||||
|
long countByExample(ExecTaskItemExample example);
|
||||||
|
|
||||||
|
int deleteByExample(ExecTaskItemExample example);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(String id);
|
||||||
|
|
||||||
|
int insert(ExecTaskItem record);
|
||||||
|
|
||||||
|
int insertSelective(ExecTaskItem record);
|
||||||
|
|
||||||
|
List<ExecTaskItem> selectByExample(ExecTaskItemExample example);
|
||||||
|
|
||||||
|
ExecTaskItem selectByPrimaryKey(String id);
|
||||||
|
|
||||||
|
int updateByExampleSelective(@Param("record") ExecTaskItem record, @Param("example") ExecTaskItemExample example);
|
||||||
|
|
||||||
|
int updateByExample(@Param("record") ExecTaskItem record, @Param("example") ExecTaskItemExample example);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(ExecTaskItem record);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(ExecTaskItem record);
|
||||||
|
|
||||||
|
int batchInsert(@Param("list") List<ExecTaskItem> list);
|
||||||
|
|
||||||
|
int batchInsertSelective(@Param("list") List<ExecTaskItem> list, @Param("selective") ExecTaskItem.Column ... selective);
|
||||||
|
}
|
|
@ -0,0 +1,444 @@
|
||||||
|
<?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="io.metersphere.system.mapper.ExecTaskItemMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="io.metersphere.system.domain.ExecTaskItem">
|
||||||
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||||
|
<result column="task_id" jdbcType="VARCHAR" property="taskId" />
|
||||||
|
<result column="resource_id" jdbcType="VARCHAR" property="resourceId" />
|
||||||
|
<result column="task_origin" jdbcType="VARCHAR" property="taskOrigin" />
|
||||||
|
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||||
|
<result column="result" jdbcType="VARCHAR" property="result" />
|
||||||
|
<result column="resource_pool_id" jdbcType="VARCHAR" property="resourcePoolId" />
|
||||||
|
<result column="resource_pool_node" jdbcType="VARCHAR" property="resourcePoolNode" />
|
||||||
|
<result column="resource_type" jdbcType="VARCHAR" property="resourceType" />
|
||||||
|
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
|
||||||
|
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
|
||||||
|
<result column="thread_id" jdbcType="VARCHAR" property="threadId" />
|
||||||
|
<result column="start_time" jdbcType="BIGINT" property="startTime" />
|
||||||
|
<result column="end_time" jdbcType="BIGINT" property="endTime" />
|
||||||
|
<result column="executor" jdbcType="VARCHAR" property="executor" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Update_By_Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, task_id, resource_id, task_origin, `status`, `result`, resource_pool_id, resource_pool_node,
|
||||||
|
resource_type, project_id, organization_id, thread_id, start_time, end_time, executor
|
||||||
|
</sql>
|
||||||
|
<select id="selectByExample" parameterType="io.metersphere.system.domain.ExecTaskItemExample" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<if test="distinct">
|
||||||
|
distinct
|
||||||
|
</if>
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from exec_task_item
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
<if test="orderByClause != null">
|
||||||
|
order by ${orderByClause}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from exec_task_item
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||||
|
delete from exec_task_item
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteByExample" parameterType="io.metersphere.system.domain.ExecTaskItemExample">
|
||||||
|
delete from exec_task_item
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" parameterType="io.metersphere.system.domain.ExecTaskItem">
|
||||||
|
insert into exec_task_item (id, task_id, resource_id,
|
||||||
|
task_origin, `status`, `result`,
|
||||||
|
resource_pool_id, resource_pool_node, resource_type,
|
||||||
|
project_id, organization_id, thread_id,
|
||||||
|
start_time, end_time, executor
|
||||||
|
)
|
||||||
|
values (#{id,jdbcType=VARCHAR}, #{taskId,jdbcType=VARCHAR}, #{resourceId,jdbcType=VARCHAR},
|
||||||
|
#{taskOrigin,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR},
|
||||||
|
#{resourcePoolId,jdbcType=VARCHAR}, #{resourcePoolNode,jdbcType=VARCHAR}, #{resourceType,jdbcType=VARCHAR},
|
||||||
|
#{projectId,jdbcType=VARCHAR}, #{organizationId,jdbcType=VARCHAR}, #{threadId,jdbcType=VARCHAR},
|
||||||
|
#{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT}, #{executor,jdbcType=VARCHAR}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
<insert id="insertSelective" parameterType="io.metersphere.system.domain.ExecTaskItem">
|
||||||
|
insert into exec_task_item
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="taskId != null">
|
||||||
|
task_id,
|
||||||
|
</if>
|
||||||
|
<if test="resourceId != null">
|
||||||
|
resource_id,
|
||||||
|
</if>
|
||||||
|
<if test="taskOrigin != null">
|
||||||
|
task_origin,
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
`status`,
|
||||||
|
</if>
|
||||||
|
<if test="result != null">
|
||||||
|
`result`,
|
||||||
|
</if>
|
||||||
|
<if test="resourcePoolId != null">
|
||||||
|
resource_pool_id,
|
||||||
|
</if>
|
||||||
|
<if test="resourcePoolNode != null">
|
||||||
|
resource_pool_node,
|
||||||
|
</if>
|
||||||
|
<if test="resourceType != null">
|
||||||
|
resource_type,
|
||||||
|
</if>
|
||||||
|
<if test="projectId != null">
|
||||||
|
project_id,
|
||||||
|
</if>
|
||||||
|
<if test="organizationId != null">
|
||||||
|
organization_id,
|
||||||
|
</if>
|
||||||
|
<if test="threadId != null">
|
||||||
|
thread_id,
|
||||||
|
</if>
|
||||||
|
<if test="startTime != null">
|
||||||
|
start_time,
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null">
|
||||||
|
end_time,
|
||||||
|
</if>
|
||||||
|
<if test="executor != null">
|
||||||
|
executor,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
#{id,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="taskId != null">
|
||||||
|
#{taskId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="resourceId != null">
|
||||||
|
#{resourceId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="taskOrigin != null">
|
||||||
|
#{taskOrigin,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
#{status,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="result != null">
|
||||||
|
#{result,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="resourcePoolId != null">
|
||||||
|
#{resourcePoolId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="resourcePoolNode != null">
|
||||||
|
#{resourcePoolNode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="resourceType != null">
|
||||||
|
#{resourceType,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="projectId != null">
|
||||||
|
#{projectId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="organizationId != null">
|
||||||
|
#{organizationId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="threadId != null">
|
||||||
|
#{threadId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="startTime != null">
|
||||||
|
#{startTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null">
|
||||||
|
#{endTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="executor != null">
|
||||||
|
#{executor,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<select id="countByExample" parameterType="io.metersphere.system.domain.ExecTaskItemExample" resultType="java.lang.Long">
|
||||||
|
select count(*) from exec_task_item
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<update id="updateByExampleSelective" parameterType="map">
|
||||||
|
update exec_task_item
|
||||||
|
<set>
|
||||||
|
<if test="record.id != null">
|
||||||
|
id = #{record.id,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.taskId != null">
|
||||||
|
task_id = #{record.taskId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.resourceId != null">
|
||||||
|
resource_id = #{record.resourceId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.taskOrigin != null">
|
||||||
|
task_origin = #{record.taskOrigin,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.status != null">
|
||||||
|
`status` = #{record.status,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.result != null">
|
||||||
|
`result` = #{record.result,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.resourcePoolId != null">
|
||||||
|
resource_pool_id = #{record.resourcePoolId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.resourcePoolNode != null">
|
||||||
|
resource_pool_node = #{record.resourcePoolNode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.resourceType != null">
|
||||||
|
resource_type = #{record.resourceType,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.projectId != null">
|
||||||
|
project_id = #{record.projectId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.organizationId != null">
|
||||||
|
organization_id = #{record.organizationId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.threadId != null">
|
||||||
|
thread_id = #{record.threadId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.startTime != null">
|
||||||
|
start_time = #{record.startTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.endTime != null">
|
||||||
|
end_time = #{record.endTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.executor != null">
|
||||||
|
executor = #{record.executor,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByExample" parameterType="map">
|
||||||
|
update exec_task_item
|
||||||
|
set id = #{record.id,jdbcType=VARCHAR},
|
||||||
|
task_id = #{record.taskId,jdbcType=VARCHAR},
|
||||||
|
resource_id = #{record.resourceId,jdbcType=VARCHAR},
|
||||||
|
task_origin = #{record.taskOrigin,jdbcType=VARCHAR},
|
||||||
|
`status` = #{record.status,jdbcType=VARCHAR},
|
||||||
|
`result` = #{record.result,jdbcType=VARCHAR},
|
||||||
|
resource_pool_id = #{record.resourcePoolId,jdbcType=VARCHAR},
|
||||||
|
resource_pool_node = #{record.resourcePoolNode,jdbcType=VARCHAR},
|
||||||
|
resource_type = #{record.resourceType,jdbcType=VARCHAR},
|
||||||
|
project_id = #{record.projectId,jdbcType=VARCHAR},
|
||||||
|
organization_id = #{record.organizationId,jdbcType=VARCHAR},
|
||||||
|
thread_id = #{record.threadId,jdbcType=VARCHAR},
|
||||||
|
start_time = #{record.startTime,jdbcType=BIGINT},
|
||||||
|
end_time = #{record.endTime,jdbcType=BIGINT},
|
||||||
|
executor = #{record.executor,jdbcType=VARCHAR}
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.system.domain.ExecTaskItem">
|
||||||
|
update exec_task_item
|
||||||
|
<set>
|
||||||
|
<if test="taskId != null">
|
||||||
|
task_id = #{taskId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="resourceId != null">
|
||||||
|
resource_id = #{resourceId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="taskOrigin != null">
|
||||||
|
task_origin = #{taskOrigin,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
`status` = #{status,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="result != null">
|
||||||
|
`result` = #{result,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="resourcePoolId != null">
|
||||||
|
resource_pool_id = #{resourcePoolId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="resourcePoolNode != null">
|
||||||
|
resource_pool_node = #{resourcePoolNode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="resourceType != null">
|
||||||
|
resource_type = #{resourceType,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="projectId != null">
|
||||||
|
project_id = #{projectId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="organizationId != null">
|
||||||
|
organization_id = #{organizationId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="threadId != null">
|
||||||
|
thread_id = #{threadId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="startTime != null">
|
||||||
|
start_time = #{startTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null">
|
||||||
|
end_time = #{endTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="executor != null">
|
||||||
|
executor = #{executor,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKey" parameterType="io.metersphere.system.domain.ExecTaskItem">
|
||||||
|
update exec_task_item
|
||||||
|
set task_id = #{taskId,jdbcType=VARCHAR},
|
||||||
|
resource_id = #{resourceId,jdbcType=VARCHAR},
|
||||||
|
task_origin = #{taskOrigin,jdbcType=VARCHAR},
|
||||||
|
`status` = #{status,jdbcType=VARCHAR},
|
||||||
|
`result` = #{result,jdbcType=VARCHAR},
|
||||||
|
resource_pool_id = #{resourcePoolId,jdbcType=VARCHAR},
|
||||||
|
resource_pool_node = #{resourcePoolNode,jdbcType=VARCHAR},
|
||||||
|
resource_type = #{resourceType,jdbcType=VARCHAR},
|
||||||
|
project_id = #{projectId,jdbcType=VARCHAR},
|
||||||
|
organization_id = #{organizationId,jdbcType=VARCHAR},
|
||||||
|
thread_id = #{threadId,jdbcType=VARCHAR},
|
||||||
|
start_time = #{startTime,jdbcType=BIGINT},
|
||||||
|
end_time = #{endTime,jdbcType=BIGINT},
|
||||||
|
executor = #{executor,jdbcType=VARCHAR}
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</update>
|
||||||
|
<insert id="batchInsert" parameterType="map">
|
||||||
|
insert into exec_task_item
|
||||||
|
(id, task_id, resource_id, task_origin, `status`, `result`, resource_pool_id, resource_pool_node,
|
||||||
|
resource_type, project_id, organization_id, thread_id, start_time, end_time, executor
|
||||||
|
)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.id,jdbcType=VARCHAR}, #{item.taskId,jdbcType=VARCHAR}, #{item.resourceId,jdbcType=VARCHAR},
|
||||||
|
#{item.taskOrigin,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.result,jdbcType=VARCHAR},
|
||||||
|
#{item.resourcePoolId,jdbcType=VARCHAR}, #{item.resourcePoolNode,jdbcType=VARCHAR},
|
||||||
|
#{item.resourceType,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.organizationId,jdbcType=VARCHAR},
|
||||||
|
#{item.threadId,jdbcType=VARCHAR}, #{item.startTime,jdbcType=BIGINT}, #{item.endTime,jdbcType=BIGINT},
|
||||||
|
#{item.executor,jdbcType=VARCHAR})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
<insert id="batchInsertSelective" parameterType="map">
|
||||||
|
insert into exec_task_item (
|
||||||
|
<foreach collection="selective" item="column" separator=",">
|
||||||
|
${column.escapedColumnName}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(
|
||||||
|
<foreach collection="selective" item="column" separator=",">
|
||||||
|
<if test="'id'.toString() == column.value">
|
||||||
|
#{item.id,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'task_id'.toString() == column.value">
|
||||||
|
#{item.taskId,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'resource_id'.toString() == column.value">
|
||||||
|
#{item.resourceId,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'task_origin'.toString() == column.value">
|
||||||
|
#{item.taskOrigin,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'status'.toString() == column.value">
|
||||||
|
#{item.status,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'result'.toString() == column.value">
|
||||||
|
#{item.result,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'resource_pool_id'.toString() == column.value">
|
||||||
|
#{item.resourcePoolId,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'resource_pool_node'.toString() == column.value">
|
||||||
|
#{item.resourcePoolNode,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'resource_type'.toString() == column.value">
|
||||||
|
#{item.resourceType,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'project_id'.toString() == column.value">
|
||||||
|
#{item.projectId,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'organization_id'.toString() == column.value">
|
||||||
|
#{item.organizationId,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'thread_id'.toString() == column.value">
|
||||||
|
#{item.threadId,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'start_time'.toString() == column.value">
|
||||||
|
#{item.startTime,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
<if test="'end_time'.toString() == column.value">
|
||||||
|
#{item.endTime,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
<if test="'executor'.toString() == column.value">
|
||||||
|
#{item.executor,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,34 @@
|
||||||
|
package io.metersphere.system.mapper;
|
||||||
|
|
||||||
|
import io.metersphere.system.domain.ExecTask;
|
||||||
|
import io.metersphere.system.domain.ExecTaskExample;
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
public interface ExecTaskMapper {
|
||||||
|
long countByExample(ExecTaskExample example);
|
||||||
|
|
||||||
|
int deleteByExample(ExecTaskExample example);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(String id);
|
||||||
|
|
||||||
|
int insert(ExecTask record);
|
||||||
|
|
||||||
|
int insertSelective(ExecTask record);
|
||||||
|
|
||||||
|
List<ExecTask> selectByExample(ExecTaskExample example);
|
||||||
|
|
||||||
|
ExecTask selectByPrimaryKey(String id);
|
||||||
|
|
||||||
|
int updateByExampleSelective(@Param("record") ExecTask record, @Param("example") ExecTaskExample example);
|
||||||
|
|
||||||
|
int updateByExample(@Param("record") ExecTask record, @Param("example") ExecTaskExample example);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(ExecTask record);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(ExecTask record);
|
||||||
|
|
||||||
|
int batchInsert(@Param("list") List<ExecTask> list);
|
||||||
|
|
||||||
|
int batchInsertSelective(@Param("list") List<ExecTask> list, @Param("selective") ExecTask.Column ... selective);
|
||||||
|
}
|
|
@ -0,0 +1,422 @@
|
||||||
|
<?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="io.metersphere.system.mapper.ExecTaskMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="io.metersphere.system.domain.ExecTask">
|
||||||
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||||
|
<result column="num" jdbcType="BIGINT" property="num" />
|
||||||
|
<result column="task_name" jdbcType="VARCHAR" property="taskName" />
|
||||||
|
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||||
|
<result column="case_count" jdbcType="BIGINT" property="caseCount" />
|
||||||
|
<result column="result" jdbcType="VARCHAR" property="result" />
|
||||||
|
<result column="task_type" jdbcType="VARCHAR" property="taskType" />
|
||||||
|
<result column="trigger_mode" jdbcType="VARCHAR" property="triggerMode" />
|
||||||
|
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
|
||||||
|
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
|
||||||
|
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||||
|
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
|
||||||
|
<result column="start_time" jdbcType="BIGINT" property="startTime" />
|
||||||
|
<result column="end_time" jdbcType="BIGINT" property="endTime" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Update_By_Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, num, task_name, `status`, case_count, `result`, task_type, trigger_mode, project_id,
|
||||||
|
organization_id, create_time, create_user, start_time, end_time
|
||||||
|
</sql>
|
||||||
|
<select id="selectByExample" parameterType="io.metersphere.system.domain.ExecTaskExample" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<if test="distinct">
|
||||||
|
distinct
|
||||||
|
</if>
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from exec_task
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
<if test="orderByClause != null">
|
||||||
|
order by ${orderByClause}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from exec_task
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||||
|
delete from exec_task
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteByExample" parameterType="io.metersphere.system.domain.ExecTaskExample">
|
||||||
|
delete from exec_task
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" parameterType="io.metersphere.system.domain.ExecTask">
|
||||||
|
insert into exec_task (id, num, task_name,
|
||||||
|
`status`, case_count, `result`,
|
||||||
|
task_type, trigger_mode, project_id,
|
||||||
|
organization_id, create_time, create_user,
|
||||||
|
start_time, end_time)
|
||||||
|
values (#{id,jdbcType=VARCHAR}, #{num,jdbcType=BIGINT}, #{taskName,jdbcType=VARCHAR},
|
||||||
|
#{status,jdbcType=VARCHAR}, #{caseCount,jdbcType=BIGINT}, #{result,jdbcType=VARCHAR},
|
||||||
|
#{taskType,jdbcType=VARCHAR}, #{triggerMode,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
|
||||||
|
#{organizationId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR},
|
||||||
|
#{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT})
|
||||||
|
</insert>
|
||||||
|
<insert id="insertSelective" parameterType="io.metersphere.system.domain.ExecTask">
|
||||||
|
insert into exec_task
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="num != null">
|
||||||
|
num,
|
||||||
|
</if>
|
||||||
|
<if test="taskName != null">
|
||||||
|
task_name,
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
`status`,
|
||||||
|
</if>
|
||||||
|
<if test="caseCount != null">
|
||||||
|
case_count,
|
||||||
|
</if>
|
||||||
|
<if test="result != null">
|
||||||
|
`result`,
|
||||||
|
</if>
|
||||||
|
<if test="taskType != null">
|
||||||
|
task_type,
|
||||||
|
</if>
|
||||||
|
<if test="triggerMode != null">
|
||||||
|
trigger_mode,
|
||||||
|
</if>
|
||||||
|
<if test="projectId != null">
|
||||||
|
project_id,
|
||||||
|
</if>
|
||||||
|
<if test="organizationId != null">
|
||||||
|
organization_id,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="createUser != null">
|
||||||
|
create_user,
|
||||||
|
</if>
|
||||||
|
<if test="startTime != null">
|
||||||
|
start_time,
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null">
|
||||||
|
end_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
#{id,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="num != null">
|
||||||
|
#{num,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="taskName != null">
|
||||||
|
#{taskName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
#{status,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="caseCount != null">
|
||||||
|
#{caseCount,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="result != null">
|
||||||
|
#{result,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="taskType != null">
|
||||||
|
#{taskType,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="triggerMode != null">
|
||||||
|
#{triggerMode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="projectId != null">
|
||||||
|
#{projectId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="organizationId != null">
|
||||||
|
#{organizationId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="createUser != null">
|
||||||
|
#{createUser,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="startTime != null">
|
||||||
|
#{startTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null">
|
||||||
|
#{endTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<select id="countByExample" parameterType="io.metersphere.system.domain.ExecTaskExample" resultType="java.lang.Long">
|
||||||
|
select count(*) from exec_task
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<update id="updateByExampleSelective" parameterType="map">
|
||||||
|
update exec_task
|
||||||
|
<set>
|
||||||
|
<if test="record.id != null">
|
||||||
|
id = #{record.id,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.num != null">
|
||||||
|
num = #{record.num,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.taskName != null">
|
||||||
|
task_name = #{record.taskName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.status != null">
|
||||||
|
`status` = #{record.status,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.caseCount != null">
|
||||||
|
case_count = #{record.caseCount,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.result != null">
|
||||||
|
`result` = #{record.result,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.taskType != null">
|
||||||
|
task_type = #{record.taskType,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.triggerMode != null">
|
||||||
|
trigger_mode = #{record.triggerMode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.projectId != null">
|
||||||
|
project_id = #{record.projectId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.organizationId != null">
|
||||||
|
organization_id = #{record.organizationId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.createUser != null">
|
||||||
|
create_user = #{record.createUser,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.startTime != null">
|
||||||
|
start_time = #{record.startTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.endTime != null">
|
||||||
|
end_time = #{record.endTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByExample" parameterType="map">
|
||||||
|
update exec_task
|
||||||
|
set id = #{record.id,jdbcType=VARCHAR},
|
||||||
|
num = #{record.num,jdbcType=BIGINT},
|
||||||
|
task_name = #{record.taskName,jdbcType=VARCHAR},
|
||||||
|
`status` = #{record.status,jdbcType=VARCHAR},
|
||||||
|
case_count = #{record.caseCount,jdbcType=BIGINT},
|
||||||
|
`result` = #{record.result,jdbcType=VARCHAR},
|
||||||
|
task_type = #{record.taskType,jdbcType=VARCHAR},
|
||||||
|
trigger_mode = #{record.triggerMode,jdbcType=VARCHAR},
|
||||||
|
project_id = #{record.projectId,jdbcType=VARCHAR},
|
||||||
|
organization_id = #{record.organizationId,jdbcType=VARCHAR},
|
||||||
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
|
create_user = #{record.createUser,jdbcType=VARCHAR},
|
||||||
|
start_time = #{record.startTime,jdbcType=BIGINT},
|
||||||
|
end_time = #{record.endTime,jdbcType=BIGINT}
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.system.domain.ExecTask">
|
||||||
|
update exec_task
|
||||||
|
<set>
|
||||||
|
<if test="num != null">
|
||||||
|
num = #{num,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="taskName != null">
|
||||||
|
task_name = #{taskName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
`status` = #{status,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="caseCount != null">
|
||||||
|
case_count = #{caseCount,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="result != null">
|
||||||
|
`result` = #{result,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="taskType != null">
|
||||||
|
task_type = #{taskType,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="triggerMode != null">
|
||||||
|
trigger_mode = #{triggerMode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="projectId != null">
|
||||||
|
project_id = #{projectId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="organizationId != null">
|
||||||
|
organization_id = #{organizationId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="createUser != null">
|
||||||
|
create_user = #{createUser,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="startTime != null">
|
||||||
|
start_time = #{startTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null">
|
||||||
|
end_time = #{endTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKey" parameterType="io.metersphere.system.domain.ExecTask">
|
||||||
|
update exec_task
|
||||||
|
set num = #{num,jdbcType=BIGINT},
|
||||||
|
task_name = #{taskName,jdbcType=VARCHAR},
|
||||||
|
`status` = #{status,jdbcType=VARCHAR},
|
||||||
|
case_count = #{caseCount,jdbcType=BIGINT},
|
||||||
|
`result` = #{result,jdbcType=VARCHAR},
|
||||||
|
task_type = #{taskType,jdbcType=VARCHAR},
|
||||||
|
trigger_mode = #{triggerMode,jdbcType=VARCHAR},
|
||||||
|
project_id = #{projectId,jdbcType=VARCHAR},
|
||||||
|
organization_id = #{organizationId,jdbcType=VARCHAR},
|
||||||
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
|
create_user = #{createUser,jdbcType=VARCHAR},
|
||||||
|
start_time = #{startTime,jdbcType=BIGINT},
|
||||||
|
end_time = #{endTime,jdbcType=BIGINT}
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</update>
|
||||||
|
<insert id="batchInsert" parameterType="map">
|
||||||
|
insert into exec_task
|
||||||
|
(id, num, task_name, `status`, case_count, `result`, task_type, trigger_mode, project_id,
|
||||||
|
organization_id, create_time, create_user, start_time, end_time)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.id,jdbcType=VARCHAR}, #{item.num,jdbcType=BIGINT}, #{item.taskName,jdbcType=VARCHAR},
|
||||||
|
#{item.status,jdbcType=VARCHAR}, #{item.caseCount,jdbcType=BIGINT}, #{item.result,jdbcType=VARCHAR},
|
||||||
|
#{item.taskType,jdbcType=VARCHAR}, #{item.triggerMode,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR},
|
||||||
|
#{item.organizationId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR},
|
||||||
|
#{item.startTime,jdbcType=BIGINT}, #{item.endTime,jdbcType=BIGINT})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
<insert id="batchInsertSelective" parameterType="map">
|
||||||
|
insert into exec_task (
|
||||||
|
<foreach collection="selective" item="column" separator=",">
|
||||||
|
${column.escapedColumnName}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(
|
||||||
|
<foreach collection="selective" item="column" separator=",">
|
||||||
|
<if test="'id'.toString() == column.value">
|
||||||
|
#{item.id,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'num'.toString() == column.value">
|
||||||
|
#{item.num,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
<if test="'task_name'.toString() == column.value">
|
||||||
|
#{item.taskName,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'status'.toString() == column.value">
|
||||||
|
#{item.status,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'case_count'.toString() == column.value">
|
||||||
|
#{item.caseCount,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
<if test="'result'.toString() == column.value">
|
||||||
|
#{item.result,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'task_type'.toString() == column.value">
|
||||||
|
#{item.taskType,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'trigger_mode'.toString() == column.value">
|
||||||
|
#{item.triggerMode,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'project_id'.toString() == column.value">
|
||||||
|
#{item.projectId,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'organization_id'.toString() == column.value">
|
||||||
|
#{item.organizationId,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'create_time'.toString() == column.value">
|
||||||
|
#{item.createTime,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
<if test="'create_user'.toString() == column.value">
|
||||||
|
#{item.createUser,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="'start_time'.toString() == column.value">
|
||||||
|
#{item.startTime,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
<if test="'end_time'.toString() == column.value">
|
||||||
|
#{item.endTime,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
|
@ -0,0 +1 @@
|
||||||
|
select database();
|
|
@ -0,0 +1,74 @@
|
||||||
|
-- set innodb lock wait timeout
|
||||||
|
SET SESSION innodb_lock_wait_timeout = 7200;
|
||||||
|
|
||||||
|
-- 执行任务表
|
||||||
|
CREATE TABLE IF NOT EXISTS exec_task(
|
||||||
|
`id` VARCHAR(50) NOT NULL COMMENT '任务ID' ,
|
||||||
|
`num` BIGINT NOT NULL COMMENT '编号' ,
|
||||||
|
`task_name` VARCHAR(255) NOT NULL COMMENT '任务名称' ,
|
||||||
|
`status` VARCHAR(20) NOT NULL COMMENT '状态' ,
|
||||||
|
`case_count` BIGINT NOT NULL COMMENT '用例数量' ,
|
||||||
|
`result` VARCHAR(64) COMMENT '执行结果' ,
|
||||||
|
`task_type` VARCHAR(50) NOT NULL COMMENT '任务类型' ,
|
||||||
|
`trigger_mode` VARCHAR(20) NOT NULL COMMENT '执行模式' ,
|
||||||
|
`project_id` VARCHAR(50) NOT NULL COMMENT '项目ID' ,
|
||||||
|
`organization_id` VARCHAR(50) NOT NULL COMMENT '组织ID' ,
|
||||||
|
`create_time` BIGINT NOT NULL COMMENT '创建时间' ,
|
||||||
|
`create_user` VARCHAR(50) NOT NULL COMMENT '创建人' ,
|
||||||
|
`start_time` BIGINT COMMENT '开始时间' ,
|
||||||
|
`end_time` BIGINT COMMENT '结束时间' ,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4
|
||||||
|
COLLATE = utf8mb4_general_ci COMMENT = '执行任务表';
|
||||||
|
|
||||||
|
CREATE INDEX idx_num ON exec_task(num);
|
||||||
|
CREATE INDEX idx_name ON exec_task(task_name);
|
||||||
|
CREATE INDEX idx_status ON exec_task(status);
|
||||||
|
CREATE INDEX idx_result ON exec_task(result);
|
||||||
|
CREATE INDEX idx_project_id ON exec_task(project_id);
|
||||||
|
CREATE INDEX idx_organization_id ON exec_task(organization_id);
|
||||||
|
CREATE INDEX idx_create_time ON exec_task(create_time desc);
|
||||||
|
CREATE INDEX idx_create_user ON exec_task(create_user);
|
||||||
|
CREATE INDEX idx_start_time ON exec_task(start_time);
|
||||||
|
CREATE INDEX idx_end_time ON exec_task(end_time);
|
||||||
|
CREATE INDEX idx_trigger_mode ON exec_task(trigger_mode);
|
||||||
|
|
||||||
|
|
||||||
|
-- 执行任务详情表
|
||||||
|
CREATE TABLE IF NOT EXISTS exec_task_item(
|
||||||
|
`id` VARCHAR(50) NOT NULL COMMENT '主键ID' ,
|
||||||
|
`task_id` VARCHAR(50) NOT NULL COMMENT '任务ID' ,
|
||||||
|
`resource_id` VARCHAR(50) NOT NULL COMMENT '资源ID' ,
|
||||||
|
`task_origin` VARCHAR(50) COMMENT '任务来源(任务组下的任务id)' ,
|
||||||
|
`status` VARCHAR(20) NOT NULL COMMENT '执行状态' ,
|
||||||
|
`result` VARCHAR(255) COMMENT '执行结果' ,
|
||||||
|
`resource_pool_id` VARCHAR(50) NOT NULL COMMENT '资源池ID' ,
|
||||||
|
`resource_pool_node` VARCHAR(50) COMMENT '节点' ,
|
||||||
|
`resource_type` VARCHAR(50) NOT NULL COMMENT '资源类型' ,
|
||||||
|
`project_id` VARCHAR(50) NOT NULL COMMENT '项目ID' ,
|
||||||
|
`organization_id` VARCHAR(50) NOT NULL COMMENT '组织ID' ,
|
||||||
|
`thread_id` VARCHAR(50) COMMENT '线程ID' ,
|
||||||
|
`start_time` BIGINT COMMENT '执行开始时间' ,
|
||||||
|
`end_time` BIGINT COMMENT '执行完成时间' ,
|
||||||
|
`executor` VARCHAR(50) NOT NULL COMMENT '执行人' ,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4
|
||||||
|
COLLATE = utf8mb4_general_ci COMMENT = '执行任务详情表';
|
||||||
|
|
||||||
|
CREATE INDEX idx_task_id ON exec_task_item(task_id);
|
||||||
|
CREATE INDEX idx_resource_id ON exec_task_item(resource_id);
|
||||||
|
CREATE INDEX idx_status ON exec_task_item(status);
|
||||||
|
CREATE INDEX idx_result ON exec_task_item(result);
|
||||||
|
CREATE INDEX idx_resource_pool_id ON exec_task_item(resource_pool_id);
|
||||||
|
CREATE INDEX idx_resource_pool_node ON exec_task_item(resource_pool_node);
|
||||||
|
CREATE INDEX idx_project_id ON exec_task_item(project_id);
|
||||||
|
CREATE INDEX idx_organization_id ON exec_task_item(organization_id);
|
||||||
|
CREATE INDEX idx_thread_id ON exec_task_item(thread_id);
|
||||||
|
CREATE INDEX idx_start_time ON exec_task_item(start_time desc);
|
||||||
|
CREATE INDEX idx_end_time ON exec_task_item(end_time desc);
|
||||||
|
CREATE INDEX idx_executor ON exec_task_item(executor);
|
||||||
|
|
||||||
|
-- set innodb lock wait timeout to default
|
||||||
|
SET SESSION innodb_lock_wait_timeout = DEFAULT;
|
|
@ -0,0 +1,2 @@
|
||||||
|
-- set innodb lock wait timeout
|
||||||
|
SET SESSION innodb_lock_wait_timeout = 7200;
|
Loading…
Reference in New Issue