feat(测试计划): 补充计划报告列表功能

This commit is contained in:
song-cc-rock 2024-05-14 18:25:14 +08:00 committed by 刘瑞斌
parent 3209249045
commit 98a7cc61a2
38 changed files with 5180 additions and 6 deletions

View File

@ -0,0 +1,145 @@
package io.metersphere.plan.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 lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
@Data
public class TestPlanReport implements Serializable {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report.id.not_blank}", groups = {Updated.class})
@Size(min = 1, max = 50, message = "{test_plan_report.id.length_range}", groups = {Created.class, Updated.class})
private String id;
@Schema(description = "测试计划ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report.test_plan_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{test_plan_report.test_plan_id.length_range}", groups = {Created.class, Updated.class})
private String testPlanId;
@Schema(description = "报告名称", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report.name.not_blank}", groups = {Created.class})
@Size(min = 1, max = 255, message = "{test_plan_report.name.length_range}", groups = {Created.class, Updated.class})
private String name;
@Schema(description = "创建人")
private String createUser;
@Schema(description = "创建时间")
private Long createTime;
@Schema(description = "开始时间")
private Long startTime;
@Schema(description = "结束时间")
private Long endTime;
@Schema(description = "触发类型")
private String triggerMode;
@Schema(description = "执行状态;未执行, 执行中, 已停止, 已完成;", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report.exec_status.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{test_plan_report.exec_status.length_range}", groups = {Created.class, Updated.class})
private String execStatus;
@Schema(description = "结果状态;成功, 失败, 阻塞, 误报")
private String resultStatus;
@Schema(description = "通过阈值", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report.pass_threshold.not_blank}", groups = {Created.class})
@Size(min = 1, max = 100, message = "{test_plan_report.pass_threshold.length_range}", groups = {Created.class, Updated.class})
private String passThreshold;
@Schema(description = "通过率")
private Long passRate;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
testPlanId("test_plan_id", "testPlanId", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
createUser("create_user", "createUser", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false),
startTime("start_time", "startTime", "BIGINT", false),
endTime("end_time", "endTime", "BIGINT", false),
triggerMode("trigger_mode", "triggerMode", "VARCHAR", false),
execStatus("exec_status", "execStatus", "VARCHAR", false),
resultStatus("result_status", "resultStatus", "VARCHAR", false),
passThreshold("pass_threshold", "passThreshold", "VARCHAR", false),
passRate("pass_rate", "passRate", "DECIMAL", 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();
}
}
}

View File

@ -0,0 +1,95 @@
package io.metersphere.plan.domain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
@Data
public class TestPlanReportBug implements Serializable {
@Schema(description = "ID")
private String id;
@Schema(description = "报告ID")
private String testPlanReportId;
@Schema(description = "缺陷ID")
private String bugId;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
testPlanReportId("test_plan_report_id", "testPlanReportId", "VARCHAR", false),
bugId("bug_id", "bugId", "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();
}
}
}

View File

@ -0,0 +1,410 @@
package io.metersphere.plan.domain;
import java.util.ArrayList;
import java.util.List;
public class TestPlanReportBugExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TestPlanReportBugExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTestPlanReportIdIsNull() {
addCriterion("test_plan_report_id is null");
return (Criteria) this;
}
public Criteria andTestPlanReportIdIsNotNull() {
addCriterion("test_plan_report_id is not null");
return (Criteria) this;
}
public Criteria andTestPlanReportIdEqualTo(String value) {
addCriterion("test_plan_report_id =", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdNotEqualTo(String value) {
addCriterion("test_plan_report_id <>", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdGreaterThan(String value) {
addCriterion("test_plan_report_id >", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdGreaterThanOrEqualTo(String value) {
addCriterion("test_plan_report_id >=", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdLessThan(String value) {
addCriterion("test_plan_report_id <", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdLessThanOrEqualTo(String value) {
addCriterion("test_plan_report_id <=", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdLike(String value) {
addCriterion("test_plan_report_id like", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdNotLike(String value) {
addCriterion("test_plan_report_id not like", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdIn(List<String> values) {
addCriterion("test_plan_report_id in", values, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdNotIn(List<String> values) {
addCriterion("test_plan_report_id not in", values, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdBetween(String value1, String value2) {
addCriterion("test_plan_report_id between", value1, value2, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdNotBetween(String value1, String value2) {
addCriterion("test_plan_report_id not between", value1, value2, "testPlanReportId");
return (Criteria) this;
}
public Criteria andBugIdIsNull() {
addCriterion("bug_id is null");
return (Criteria) this;
}
public Criteria andBugIdIsNotNull() {
addCriterion("bug_id is not null");
return (Criteria) this;
}
public Criteria andBugIdEqualTo(String value) {
addCriterion("bug_id =", value, "bugId");
return (Criteria) this;
}
public Criteria andBugIdNotEqualTo(String value) {
addCriterion("bug_id <>", value, "bugId");
return (Criteria) this;
}
public Criteria andBugIdGreaterThan(String value) {
addCriterion("bug_id >", value, "bugId");
return (Criteria) this;
}
public Criteria andBugIdGreaterThanOrEqualTo(String value) {
addCriterion("bug_id >=", value, "bugId");
return (Criteria) this;
}
public Criteria andBugIdLessThan(String value) {
addCriterion("bug_id <", value, "bugId");
return (Criteria) this;
}
public Criteria andBugIdLessThanOrEqualTo(String value) {
addCriterion("bug_id <=", value, "bugId");
return (Criteria) this;
}
public Criteria andBugIdLike(String value) {
addCriterion("bug_id like", value, "bugId");
return (Criteria) this;
}
public Criteria andBugIdNotLike(String value) {
addCriterion("bug_id not like", value, "bugId");
return (Criteria) this;
}
public Criteria andBugIdIn(List<String> values) {
addCriterion("bug_id in", values, "bugId");
return (Criteria) this;
}
public Criteria andBugIdNotIn(List<String> values) {
addCriterion("bug_id not in", values, "bugId");
return (Criteria) this;
}
public Criteria andBugIdBetween(String value1, String value2) {
addCriterion("bug_id between", value1, value2, "bugId");
return (Criteria) this;
}
public Criteria andBugIdNotBetween(String value1, String value2) {
addCriterion("bug_id not between", value1, value2, "bugId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,117 @@
package io.metersphere.plan.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 lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
@Data
public class TestPlanReportFunctionCase implements Serializable {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_function_case.id.not_blank}", groups = {Updated.class})
@Size(min = 1, max = 50, message = "{test_plan_report_function_case.id.length_range}", groups = {Created.class, Updated.class})
private String id;
@Schema(description = "测试计划报告ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_function_case.test_plan_report_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{test_plan_report_function_case.test_plan_report_id.length_range}", groups = {Created.class, Updated.class})
private String testPlanReportId;
@Schema(description = "测试计划功能用例关联ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_function_case.test_plan_function_case_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{test_plan_report_function_case.test_plan_function_case_id.length_range}", groups = {Created.class, Updated.class})
private String testPlanFunctionCaseId;
@Schema(description = "功能用例ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_function_case.function_case_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{test_plan_report_function_case.function_case_id.length_range}", groups = {Created.class, Updated.class})
private String functionCaseId;
@Schema(description = "执行结果", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_function_case.execute_result.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{test_plan_report_function_case.execute_result.length_range}", groups = {Created.class, Updated.class})
private String executeResult;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
testPlanReportId("test_plan_report_id", "testPlanReportId", "VARCHAR", false),
testPlanFunctionCaseId("test_plan_function_case_id", "testPlanFunctionCaseId", "VARCHAR", false),
functionCaseId("function_case_id", "functionCaseId", "VARCHAR", false),
executeResult("execute_result", "executeResult", "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();
}
}
}

View File

@ -0,0 +1,550 @@
package io.metersphere.plan.domain;
import java.util.ArrayList;
import java.util.List;
public class TestPlanReportFunctionCaseExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TestPlanReportFunctionCaseExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTestPlanReportIdIsNull() {
addCriterion("test_plan_report_id is null");
return (Criteria) this;
}
public Criteria andTestPlanReportIdIsNotNull() {
addCriterion("test_plan_report_id is not null");
return (Criteria) this;
}
public Criteria andTestPlanReportIdEqualTo(String value) {
addCriterion("test_plan_report_id =", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdNotEqualTo(String value) {
addCriterion("test_plan_report_id <>", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdGreaterThan(String value) {
addCriterion("test_plan_report_id >", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdGreaterThanOrEqualTo(String value) {
addCriterion("test_plan_report_id >=", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdLessThan(String value) {
addCriterion("test_plan_report_id <", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdLessThanOrEqualTo(String value) {
addCriterion("test_plan_report_id <=", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdLike(String value) {
addCriterion("test_plan_report_id like", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdNotLike(String value) {
addCriterion("test_plan_report_id not like", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdIn(List<String> values) {
addCriterion("test_plan_report_id in", values, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdNotIn(List<String> values) {
addCriterion("test_plan_report_id not in", values, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdBetween(String value1, String value2) {
addCriterion("test_plan_report_id between", value1, value2, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdNotBetween(String value1, String value2) {
addCriterion("test_plan_report_id not between", value1, value2, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdIsNull() {
addCriterion("test_plan_function_case_id is null");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdIsNotNull() {
addCriterion("test_plan_function_case_id is not null");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdEqualTo(String value) {
addCriterion("test_plan_function_case_id =", value, "testPlanFunctionCaseId");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdNotEqualTo(String value) {
addCriterion("test_plan_function_case_id <>", value, "testPlanFunctionCaseId");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdGreaterThan(String value) {
addCriterion("test_plan_function_case_id >", value, "testPlanFunctionCaseId");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdGreaterThanOrEqualTo(String value) {
addCriterion("test_plan_function_case_id >=", value, "testPlanFunctionCaseId");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdLessThan(String value) {
addCriterion("test_plan_function_case_id <", value, "testPlanFunctionCaseId");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdLessThanOrEqualTo(String value) {
addCriterion("test_plan_function_case_id <=", value, "testPlanFunctionCaseId");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdLike(String value) {
addCriterion("test_plan_function_case_id like", value, "testPlanFunctionCaseId");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdNotLike(String value) {
addCriterion("test_plan_function_case_id not like", value, "testPlanFunctionCaseId");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdIn(List<String> values) {
addCriterion("test_plan_function_case_id in", values, "testPlanFunctionCaseId");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdNotIn(List<String> values) {
addCriterion("test_plan_function_case_id not in", values, "testPlanFunctionCaseId");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdBetween(String value1, String value2) {
addCriterion("test_plan_function_case_id between", value1, value2, "testPlanFunctionCaseId");
return (Criteria) this;
}
public Criteria andTestPlanFunctionCaseIdNotBetween(String value1, String value2) {
addCriterion("test_plan_function_case_id not between", value1, value2, "testPlanFunctionCaseId");
return (Criteria) this;
}
public Criteria andFunctionCaseIdIsNull() {
addCriterion("function_case_id is null");
return (Criteria) this;
}
public Criteria andFunctionCaseIdIsNotNull() {
addCriterion("function_case_id is not null");
return (Criteria) this;
}
public Criteria andFunctionCaseIdEqualTo(String value) {
addCriterion("function_case_id =", value, "functionCaseId");
return (Criteria) this;
}
public Criteria andFunctionCaseIdNotEqualTo(String value) {
addCriterion("function_case_id <>", value, "functionCaseId");
return (Criteria) this;
}
public Criteria andFunctionCaseIdGreaterThan(String value) {
addCriterion("function_case_id >", value, "functionCaseId");
return (Criteria) this;
}
public Criteria andFunctionCaseIdGreaterThanOrEqualTo(String value) {
addCriterion("function_case_id >=", value, "functionCaseId");
return (Criteria) this;
}
public Criteria andFunctionCaseIdLessThan(String value) {
addCriterion("function_case_id <", value, "functionCaseId");
return (Criteria) this;
}
public Criteria andFunctionCaseIdLessThanOrEqualTo(String value) {
addCriterion("function_case_id <=", value, "functionCaseId");
return (Criteria) this;
}
public Criteria andFunctionCaseIdLike(String value) {
addCriterion("function_case_id like", value, "functionCaseId");
return (Criteria) this;
}
public Criteria andFunctionCaseIdNotLike(String value) {
addCriterion("function_case_id not like", value, "functionCaseId");
return (Criteria) this;
}
public Criteria andFunctionCaseIdIn(List<String> values) {
addCriterion("function_case_id in", values, "functionCaseId");
return (Criteria) this;
}
public Criteria andFunctionCaseIdNotIn(List<String> values) {
addCriterion("function_case_id not in", values, "functionCaseId");
return (Criteria) this;
}
public Criteria andFunctionCaseIdBetween(String value1, String value2) {
addCriterion("function_case_id between", value1, value2, "functionCaseId");
return (Criteria) this;
}
public Criteria andFunctionCaseIdNotBetween(String value1, String value2) {
addCriterion("function_case_id not between", value1, value2, "functionCaseId");
return (Criteria) this;
}
public Criteria andExecuteResultIsNull() {
addCriterion("execute_result is null");
return (Criteria) this;
}
public Criteria andExecuteResultIsNotNull() {
addCriterion("execute_result is not null");
return (Criteria) this;
}
public Criteria andExecuteResultEqualTo(String value) {
addCriterion("execute_result =", value, "executeResult");
return (Criteria) this;
}
public Criteria andExecuteResultNotEqualTo(String value) {
addCriterion("execute_result <>", value, "executeResult");
return (Criteria) this;
}
public Criteria andExecuteResultGreaterThan(String value) {
addCriterion("execute_result >", value, "executeResult");
return (Criteria) this;
}
public Criteria andExecuteResultGreaterThanOrEqualTo(String value) {
addCriterion("execute_result >=", value, "executeResult");
return (Criteria) this;
}
public Criteria andExecuteResultLessThan(String value) {
addCriterion("execute_result <", value, "executeResult");
return (Criteria) this;
}
public Criteria andExecuteResultLessThanOrEqualTo(String value) {
addCriterion("execute_result <=", value, "executeResult");
return (Criteria) this;
}
public Criteria andExecuteResultLike(String value) {
addCriterion("execute_result like", value, "executeResult");
return (Criteria) this;
}
public Criteria andExecuteResultNotLike(String value) {
addCriterion("execute_result not like", value, "executeResult");
return (Criteria) this;
}
public Criteria andExecuteResultIn(List<String> values) {
addCriterion("execute_result in", values, "executeResult");
return (Criteria) this;
}
public Criteria andExecuteResultNotIn(List<String> values) {
addCriterion("execute_result not in", values, "executeResult");
return (Criteria) this;
}
public Criteria andExecuteResultBetween(String value1, String value2) {
addCriterion("execute_result between", value1, value2, "executeResult");
return (Criteria) this;
}
public Criteria andExecuteResultNotBetween(String value1, String value2) {
addCriterion("execute_result not between", value1, value2, "executeResult");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,128 @@
package io.metersphere.plan.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.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
@Data
public class TestPlanReportSummary implements Serializable {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_summary.id.not_blank}", groups = {Updated.class})
@Size(min = 1, max = 50, message = "{test_plan_report_summary.id.length_range}", groups = {Created.class, Updated.class})
private String id;
@Schema(description = "功能用例数量", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{test_plan_report_summary.functional_case_count.not_blank}", groups = {Created.class})
private Long functionalCaseCount;
@Schema(description = "接口用例数量", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{test_plan_report_summary.api_case_count.not_blank}", groups = {Created.class})
private Long apiCaseCount;
@Schema(description = "场景用例数量", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{test_plan_report_summary.api_scenario_count.not_blank}", groups = {Created.class})
private Long apiScenarioCount;
@Schema(description = "缺陷数量", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{test_plan_report_summary.bug_count.not_blank}", groups = {Created.class})
private Long bugCount;
@Schema(description = "测试计划报告ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_summary.test_plan_report_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{test_plan_report_summary.test_plan_report_id.length_range}", groups = {Created.class, Updated.class})
private String testPlanReportId;
@Schema(description = "总结")
private String summary;
@Schema(description = "报告统计内容")
private byte[] reportCount;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
functionalCaseCount("functional_case_count", "functionalCaseCount", "BIGINT", false),
apiCaseCount("api_case_count", "apiCaseCount", "BIGINT", false),
apiScenarioCount("api_scenario_count", "apiScenarioCount", "BIGINT", false),
bugCount("bug_count", "bugCount", "BIGINT", false),
testPlanReportId("test_plan_report_id", "testPlanReportId", "VARCHAR", false),
summary("summary", "summary", "VARCHAR", false),
reportCount("report_count", "reportCount", "LONGVARBINARY", 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();
}
}
}

View File

@ -0,0 +1,650 @@
package io.metersphere.plan.domain;
import java.util.ArrayList;
import java.util.List;
public class TestPlanReportSummaryExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TestPlanReportSummaryExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andFunctionalCaseCountIsNull() {
addCriterion("functional_case_count is null");
return (Criteria) this;
}
public Criteria andFunctionalCaseCountIsNotNull() {
addCriterion("functional_case_count is not null");
return (Criteria) this;
}
public Criteria andFunctionalCaseCountEqualTo(Long value) {
addCriterion("functional_case_count =", value, "functionalCaseCount");
return (Criteria) this;
}
public Criteria andFunctionalCaseCountNotEqualTo(Long value) {
addCriterion("functional_case_count <>", value, "functionalCaseCount");
return (Criteria) this;
}
public Criteria andFunctionalCaseCountGreaterThan(Long value) {
addCriterion("functional_case_count >", value, "functionalCaseCount");
return (Criteria) this;
}
public Criteria andFunctionalCaseCountGreaterThanOrEqualTo(Long value) {
addCriterion("functional_case_count >=", value, "functionalCaseCount");
return (Criteria) this;
}
public Criteria andFunctionalCaseCountLessThan(Long value) {
addCriterion("functional_case_count <", value, "functionalCaseCount");
return (Criteria) this;
}
public Criteria andFunctionalCaseCountLessThanOrEqualTo(Long value) {
addCriterion("functional_case_count <=", value, "functionalCaseCount");
return (Criteria) this;
}
public Criteria andFunctionalCaseCountIn(List<Long> values) {
addCriterion("functional_case_count in", values, "functionalCaseCount");
return (Criteria) this;
}
public Criteria andFunctionalCaseCountNotIn(List<Long> values) {
addCriterion("functional_case_count not in", values, "functionalCaseCount");
return (Criteria) this;
}
public Criteria andFunctionalCaseCountBetween(Long value1, Long value2) {
addCriterion("functional_case_count between", value1, value2, "functionalCaseCount");
return (Criteria) this;
}
public Criteria andFunctionalCaseCountNotBetween(Long value1, Long value2) {
addCriterion("functional_case_count not between", value1, value2, "functionalCaseCount");
return (Criteria) this;
}
public Criteria andApiCaseCountIsNull() {
addCriterion("api_case_count is null");
return (Criteria) this;
}
public Criteria andApiCaseCountIsNotNull() {
addCriterion("api_case_count is not null");
return (Criteria) this;
}
public Criteria andApiCaseCountEqualTo(Long value) {
addCriterion("api_case_count =", value, "apiCaseCount");
return (Criteria) this;
}
public Criteria andApiCaseCountNotEqualTo(Long value) {
addCriterion("api_case_count <>", value, "apiCaseCount");
return (Criteria) this;
}
public Criteria andApiCaseCountGreaterThan(Long value) {
addCriterion("api_case_count >", value, "apiCaseCount");
return (Criteria) this;
}
public Criteria andApiCaseCountGreaterThanOrEqualTo(Long value) {
addCriterion("api_case_count >=", value, "apiCaseCount");
return (Criteria) this;
}
public Criteria andApiCaseCountLessThan(Long value) {
addCriterion("api_case_count <", value, "apiCaseCount");
return (Criteria) this;
}
public Criteria andApiCaseCountLessThanOrEqualTo(Long value) {
addCriterion("api_case_count <=", value, "apiCaseCount");
return (Criteria) this;
}
public Criteria andApiCaseCountIn(List<Long> values) {
addCriterion("api_case_count in", values, "apiCaseCount");
return (Criteria) this;
}
public Criteria andApiCaseCountNotIn(List<Long> values) {
addCriterion("api_case_count not in", values, "apiCaseCount");
return (Criteria) this;
}
public Criteria andApiCaseCountBetween(Long value1, Long value2) {
addCriterion("api_case_count between", value1, value2, "apiCaseCount");
return (Criteria) this;
}
public Criteria andApiCaseCountNotBetween(Long value1, Long value2) {
addCriterion("api_case_count not between", value1, value2, "apiCaseCount");
return (Criteria) this;
}
public Criteria andApiScenarioCountIsNull() {
addCriterion("api_scenario_count is null");
return (Criteria) this;
}
public Criteria andApiScenarioCountIsNotNull() {
addCriterion("api_scenario_count is not null");
return (Criteria) this;
}
public Criteria andApiScenarioCountEqualTo(Long value) {
addCriterion("api_scenario_count =", value, "apiScenarioCount");
return (Criteria) this;
}
public Criteria andApiScenarioCountNotEqualTo(Long value) {
addCriterion("api_scenario_count <>", value, "apiScenarioCount");
return (Criteria) this;
}
public Criteria andApiScenarioCountGreaterThan(Long value) {
addCriterion("api_scenario_count >", value, "apiScenarioCount");
return (Criteria) this;
}
public Criteria andApiScenarioCountGreaterThanOrEqualTo(Long value) {
addCriterion("api_scenario_count >=", value, "apiScenarioCount");
return (Criteria) this;
}
public Criteria andApiScenarioCountLessThan(Long value) {
addCriterion("api_scenario_count <", value, "apiScenarioCount");
return (Criteria) this;
}
public Criteria andApiScenarioCountLessThanOrEqualTo(Long value) {
addCriterion("api_scenario_count <=", value, "apiScenarioCount");
return (Criteria) this;
}
public Criteria andApiScenarioCountIn(List<Long> values) {
addCriterion("api_scenario_count in", values, "apiScenarioCount");
return (Criteria) this;
}
public Criteria andApiScenarioCountNotIn(List<Long> values) {
addCriterion("api_scenario_count not in", values, "apiScenarioCount");
return (Criteria) this;
}
public Criteria andApiScenarioCountBetween(Long value1, Long value2) {
addCriterion("api_scenario_count between", value1, value2, "apiScenarioCount");
return (Criteria) this;
}
public Criteria andApiScenarioCountNotBetween(Long value1, Long value2) {
addCriterion("api_scenario_count not between", value1, value2, "apiScenarioCount");
return (Criteria) this;
}
public Criteria andBugCountIsNull() {
addCriterion("bug_count is null");
return (Criteria) this;
}
public Criteria andBugCountIsNotNull() {
addCriterion("bug_count is not null");
return (Criteria) this;
}
public Criteria andBugCountEqualTo(Long value) {
addCriterion("bug_count =", value, "bugCount");
return (Criteria) this;
}
public Criteria andBugCountNotEqualTo(Long value) {
addCriterion("bug_count <>", value, "bugCount");
return (Criteria) this;
}
public Criteria andBugCountGreaterThan(Long value) {
addCriterion("bug_count >", value, "bugCount");
return (Criteria) this;
}
public Criteria andBugCountGreaterThanOrEqualTo(Long value) {
addCriterion("bug_count >=", value, "bugCount");
return (Criteria) this;
}
public Criteria andBugCountLessThan(Long value) {
addCriterion("bug_count <", value, "bugCount");
return (Criteria) this;
}
public Criteria andBugCountLessThanOrEqualTo(Long value) {
addCriterion("bug_count <=", value, "bugCount");
return (Criteria) this;
}
public Criteria andBugCountIn(List<Long> values) {
addCriterion("bug_count in", values, "bugCount");
return (Criteria) this;
}
public Criteria andBugCountNotIn(List<Long> values) {
addCriterion("bug_count not in", values, "bugCount");
return (Criteria) this;
}
public Criteria andBugCountBetween(Long value1, Long value2) {
addCriterion("bug_count between", value1, value2, "bugCount");
return (Criteria) this;
}
public Criteria andBugCountNotBetween(Long value1, Long value2) {
addCriterion("bug_count not between", value1, value2, "bugCount");
return (Criteria) this;
}
public Criteria andTestPlanReportIdIsNull() {
addCriterion("test_plan_report_id is null");
return (Criteria) this;
}
public Criteria andTestPlanReportIdIsNotNull() {
addCriterion("test_plan_report_id is not null");
return (Criteria) this;
}
public Criteria andTestPlanReportIdEqualTo(String value) {
addCriterion("test_plan_report_id =", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdNotEqualTo(String value) {
addCriterion("test_plan_report_id <>", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdGreaterThan(String value) {
addCriterion("test_plan_report_id >", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdGreaterThanOrEqualTo(String value) {
addCriterion("test_plan_report_id >=", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdLessThan(String value) {
addCriterion("test_plan_report_id <", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdLessThanOrEqualTo(String value) {
addCriterion("test_plan_report_id <=", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdLike(String value) {
addCriterion("test_plan_report_id like", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdNotLike(String value) {
addCriterion("test_plan_report_id not like", value, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdIn(List<String> values) {
addCriterion("test_plan_report_id in", values, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdNotIn(List<String> values) {
addCriterion("test_plan_report_id not in", values, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdBetween(String value1, String value2) {
addCriterion("test_plan_report_id between", value1, value2, "testPlanReportId");
return (Criteria) this;
}
public Criteria andTestPlanReportIdNotBetween(String value1, String value2) {
addCriterion("test_plan_report_id not between", value1, value2, "testPlanReportId");
return (Criteria) this;
}
public Criteria andSummaryIsNull() {
addCriterion("summary is null");
return (Criteria) this;
}
public Criteria andSummaryIsNotNull() {
addCriterion("summary is not null");
return (Criteria) this;
}
public Criteria andSummaryEqualTo(String value) {
addCriterion("summary =", value, "summary");
return (Criteria) this;
}
public Criteria andSummaryNotEqualTo(String value) {
addCriterion("summary <>", value, "summary");
return (Criteria) this;
}
public Criteria andSummaryGreaterThan(String value) {
addCriterion("summary >", value, "summary");
return (Criteria) this;
}
public Criteria andSummaryGreaterThanOrEqualTo(String value) {
addCriterion("summary >=", value, "summary");
return (Criteria) this;
}
public Criteria andSummaryLessThan(String value) {
addCriterion("summary <", value, "summary");
return (Criteria) this;
}
public Criteria andSummaryLessThanOrEqualTo(String value) {
addCriterion("summary <=", value, "summary");
return (Criteria) this;
}
public Criteria andSummaryLike(String value) {
addCriterion("summary like", value, "summary");
return (Criteria) this;
}
public Criteria andSummaryNotLike(String value) {
addCriterion("summary not like", value, "summary");
return (Criteria) this;
}
public Criteria andSummaryIn(List<String> values) {
addCriterion("summary in", values, "summary");
return (Criteria) this;
}
public Criteria andSummaryNotIn(List<String> values) {
addCriterion("summary not in", values, "summary");
return (Criteria) this;
}
public Criteria andSummaryBetween(String value1, String value2) {
addCriterion("summary between", value1, value2, "summary");
return (Criteria) this;
}
public Criteria andSummaryNotBetween(String value1, String value2) {
addCriterion("summary not between", value1, value2, "summary");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,27 @@
package io.metersphere.plan.mapper;
import io.metersphere.plan.domain.TestPlanReportBug;
import io.metersphere.plan.domain.TestPlanReportBugExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TestPlanReportBugMapper {
long countByExample(TestPlanReportBugExample example);
int deleteByExample(TestPlanReportBugExample example);
int insert(TestPlanReportBug record);
int insertSelective(TestPlanReportBug record);
List<TestPlanReportBug> selectByExample(TestPlanReportBugExample example);
int updateByExampleSelective(@Param("record") TestPlanReportBug record, @Param("example") TestPlanReportBugExample example);
int updateByExample(@Param("record") TestPlanReportBug record, @Param("example") TestPlanReportBugExample example);
int batchInsert(@Param("list") List<TestPlanReportBug> list);
int batchInsertSelective(@Param("list") List<TestPlanReportBug> list, @Param("selective") TestPlanReportBug.Column ... selective);
}

View File

@ -0,0 +1,185 @@
<?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.plan.mapper.TestPlanReportBugMapper">
<resultMap id="BaseResultMap" type="io.metersphere.plan.domain.TestPlanReportBug">
<result column="id" jdbcType="VARCHAR" property="id" />
<result column="test_plan_report_id" jdbcType="VARCHAR" property="testPlanReportId" />
<result column="bug_id" jdbcType="VARCHAR" property="bugId" />
</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, test_plan_report_id, bug_id
</sql>
<select id="selectByExample" parameterType="io.metersphere.plan.domain.TestPlanReportBugExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from test_plan_report_bug
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByExample" parameterType="io.metersphere.plan.domain.TestPlanReportBugExample">
delete from test_plan_report_bug
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.plan.domain.TestPlanReportBug">
insert into test_plan_report_bug (id, test_plan_report_id, bug_id
)
values (#{id,jdbcType=VARCHAR}, #{testPlanReportId,jdbcType=VARCHAR}, #{bugId,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.plan.domain.TestPlanReportBug">
insert into test_plan_report_bug
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="testPlanReportId != null">
test_plan_report_id,
</if>
<if test="bugId != null">
bug_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="testPlanReportId != null">
#{testPlanReportId,jdbcType=VARCHAR},
</if>
<if test="bugId != null">
#{bugId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.plan.domain.TestPlanReportBugExample" resultType="java.lang.Long">
select count(*) from test_plan_report_bug
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update test_plan_report_bug
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.testPlanReportId != null">
test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR},
</if>
<if test="record.bugId != null">
bug_id = #{record.bugId,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update test_plan_report_bug
set id = #{record.id,jdbcType=VARCHAR},
test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR},
bug_id = #{record.bugId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<insert id="batchInsert" parameterType="map">
insert into test_plan_report_bug
(id, test_plan_report_id, bug_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.testPlanReportId,jdbcType=VARCHAR}, #{item.bugId,jdbcType=VARCHAR}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into test_plan_report_bug (
<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="'test_plan_report_id'.toString() == column.value">
#{item.testPlanReportId,jdbcType=VARCHAR}
</if>
<if test="'bug_id'.toString() == column.value">
#{item.bugId,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,35 @@
package io.metersphere.plan.mapper;
import io.metersphere.plan.domain.TestPlanReportFunctionCase;
import io.metersphere.plan.domain.TestPlanReportFunctionCaseExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TestPlanReportFunctionCaseMapper {
long countByExample(TestPlanReportFunctionCaseExample example);
int deleteByExample(TestPlanReportFunctionCaseExample example);
int deleteByPrimaryKey(String id);
int insert(TestPlanReportFunctionCase record);
int insertSelective(TestPlanReportFunctionCase record);
List<TestPlanReportFunctionCase> selectByExample(TestPlanReportFunctionCaseExample example);
TestPlanReportFunctionCase selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") TestPlanReportFunctionCase record, @Param("example") TestPlanReportFunctionCaseExample example);
int updateByExample(@Param("record") TestPlanReportFunctionCase record, @Param("example") TestPlanReportFunctionCaseExample example);
int updateByPrimaryKeySelective(TestPlanReportFunctionCase record);
int updateByPrimaryKey(TestPlanReportFunctionCase record);
int batchInsert(@Param("list") List<TestPlanReportFunctionCase> list);
int batchInsertSelective(@Param("list") List<TestPlanReportFunctionCase> list, @Param("selective") TestPlanReportFunctionCase.Column ... selective);
}

View File

@ -0,0 +1,251 @@
<?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.plan.mapper.TestPlanReportFunctionCaseMapper">
<resultMap id="BaseResultMap" type="io.metersphere.plan.domain.TestPlanReportFunctionCase">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="test_plan_report_id" jdbcType="VARCHAR" property="testPlanReportId" />
<result column="test_plan_function_case_id" jdbcType="VARCHAR" property="testPlanFunctionCaseId" />
<result column="function_case_id" jdbcType="VARCHAR" property="functionCaseId" />
<result column="execute_result" jdbcType="VARCHAR" property="executeResult" />
</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, test_plan_report_id, test_plan_function_case_id, function_case_id, execute_result
</sql>
<select id="selectByExample" parameterType="io.metersphere.plan.domain.TestPlanReportFunctionCaseExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from test_plan_report_function_case
<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 test_plan_report_function_case
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from test_plan_report_function_case
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.plan.domain.TestPlanReportFunctionCaseExample">
delete from test_plan_report_function_case
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.plan.domain.TestPlanReportFunctionCase">
insert into test_plan_report_function_case (id, test_plan_report_id, test_plan_function_case_id,
function_case_id, execute_result)
values (#{id,jdbcType=VARCHAR}, #{testPlanReportId,jdbcType=VARCHAR}, #{testPlanFunctionCaseId,jdbcType=VARCHAR},
#{functionCaseId,jdbcType=VARCHAR}, #{executeResult,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.plan.domain.TestPlanReportFunctionCase">
insert into test_plan_report_function_case
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="testPlanReportId != null">
test_plan_report_id,
</if>
<if test="testPlanFunctionCaseId != null">
test_plan_function_case_id,
</if>
<if test="functionCaseId != null">
function_case_id,
</if>
<if test="executeResult != null">
execute_result,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="testPlanReportId != null">
#{testPlanReportId,jdbcType=VARCHAR},
</if>
<if test="testPlanFunctionCaseId != null">
#{testPlanFunctionCaseId,jdbcType=VARCHAR},
</if>
<if test="functionCaseId != null">
#{functionCaseId,jdbcType=VARCHAR},
</if>
<if test="executeResult != null">
#{executeResult,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.plan.domain.TestPlanReportFunctionCaseExample" resultType="java.lang.Long">
select count(*) from test_plan_report_function_case
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update test_plan_report_function_case
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.testPlanReportId != null">
test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR},
</if>
<if test="record.testPlanFunctionCaseId != null">
test_plan_function_case_id = #{record.testPlanFunctionCaseId,jdbcType=VARCHAR},
</if>
<if test="record.functionCaseId != null">
function_case_id = #{record.functionCaseId,jdbcType=VARCHAR},
</if>
<if test="record.executeResult != null">
execute_result = #{record.executeResult,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update test_plan_report_function_case
set id = #{record.id,jdbcType=VARCHAR},
test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR},
test_plan_function_case_id = #{record.testPlanFunctionCaseId,jdbcType=VARCHAR},
function_case_id = #{record.functionCaseId,jdbcType=VARCHAR},
execute_result = #{record.executeResult,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.plan.domain.TestPlanReportFunctionCase">
update test_plan_report_function_case
<set>
<if test="testPlanReportId != null">
test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR},
</if>
<if test="testPlanFunctionCaseId != null">
test_plan_function_case_id = #{testPlanFunctionCaseId,jdbcType=VARCHAR},
</if>
<if test="functionCaseId != null">
function_case_id = #{functionCaseId,jdbcType=VARCHAR},
</if>
<if test="executeResult != null">
execute_result = #{executeResult,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.plan.domain.TestPlanReportFunctionCase">
update test_plan_report_function_case
set test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR},
test_plan_function_case_id = #{testPlanFunctionCaseId,jdbcType=VARCHAR},
function_case_id = #{functionCaseId,jdbcType=VARCHAR},
execute_result = #{executeResult,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into test_plan_report_function_case
(id, test_plan_report_id, test_plan_function_case_id, function_case_id, execute_result
)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.testPlanReportId,jdbcType=VARCHAR}, #{item.testPlanFunctionCaseId,jdbcType=VARCHAR},
#{item.functionCaseId,jdbcType=VARCHAR}, #{item.executeResult,jdbcType=VARCHAR}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into test_plan_report_function_case (
<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="'test_plan_report_id'.toString() == column.value">
#{item.testPlanReportId,jdbcType=VARCHAR}
</if>
<if test="'test_plan_function_case_id'.toString() == column.value">
#{item.testPlanFunctionCaseId,jdbcType=VARCHAR}
</if>
<if test="'function_case_id'.toString() == column.value">
#{item.functionCaseId,jdbcType=VARCHAR}
</if>
<if test="'execute_result'.toString() == column.value">
#{item.executeResult,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,35 @@
package io.metersphere.plan.mapper;
import io.metersphere.plan.domain.TestPlanReport;
import io.metersphere.plan.domain.TestPlanReportExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TestPlanReportMapper {
long countByExample(TestPlanReportExample example);
int deleteByExample(TestPlanReportExample example);
int deleteByPrimaryKey(String id);
int insert(TestPlanReport record);
int insertSelective(TestPlanReport record);
List<TestPlanReport> selectByExample(TestPlanReportExample example);
TestPlanReport selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") TestPlanReport record, @Param("example") TestPlanReportExample example);
int updateByExample(@Param("record") TestPlanReport record, @Param("example") TestPlanReportExample example);
int updateByPrimaryKeySelective(TestPlanReport record);
int updateByPrimaryKey(TestPlanReport record);
int batchInsert(@Param("list") List<TestPlanReport> list);
int batchInsertSelective(@Param("list") List<TestPlanReport> list, @Param("selective") TestPlanReport.Column ... selective);
}

View File

@ -0,0 +1,386 @@
<?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.plan.mapper.TestPlanReportMapper">
<resultMap id="BaseResultMap" type="io.metersphere.plan.domain.TestPlanReport">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="test_plan_id" jdbcType="VARCHAR" property="testPlanId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="start_time" jdbcType="BIGINT" property="startTime" />
<result column="end_time" jdbcType="BIGINT" property="endTime" />
<result column="trigger_mode" jdbcType="VARCHAR" property="triggerMode" />
<result column="exec_status" jdbcType="VARCHAR" property="execStatus" />
<result column="result_status" jdbcType="VARCHAR" property="resultStatus" />
<result column="pass_threshold" jdbcType="VARCHAR" property="passThreshold" />
<result column="pass_rate" jdbcType="DECIMAL" property="passRate" />
</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, test_plan_id, `name`, create_user, create_time, start_time, end_time, trigger_mode,
exec_status, result_status, pass_threshold, pass_rate
</sql>
<select id="selectByExample" parameterType="io.metersphere.plan.domain.TestPlanReportExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from test_plan_report
<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 test_plan_report
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from test_plan_report
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.plan.domain.TestPlanReportExample">
delete from test_plan_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.plan.domain.TestPlanReport">
insert into test_plan_report (id, test_plan_id, `name`,
create_user, create_time, start_time,
end_time, trigger_mode, exec_status,
result_status, pass_threshold, pass_rate
)
values (#{id,jdbcType=VARCHAR}, #{testPlanId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{startTime,jdbcType=BIGINT},
#{endTime,jdbcType=BIGINT}, #{triggerMode,jdbcType=VARCHAR}, #{execStatus,jdbcType=VARCHAR},
#{resultStatus,jdbcType=VARCHAR}, #{passThreshold,jdbcType=VARCHAR}, #{passRate,jdbcType=DECIMAL}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.plan.domain.TestPlanReport">
insert into test_plan_report
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="testPlanId != null">
test_plan_id,
</if>
<if test="name != null">
`name`,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="triggerMode != null">
trigger_mode,
</if>
<if test="execStatus != null">
exec_status,
</if>
<if test="resultStatus != null">
result_status,
</if>
<if test="passThreshold != null">
pass_threshold,
</if>
<if test="passRate != null">
pass_rate,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="testPlanId != null">
#{testPlanId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="startTime != null">
#{startTime,jdbcType=BIGINT},
</if>
<if test="endTime != null">
#{endTime,jdbcType=BIGINT},
</if>
<if test="triggerMode != null">
#{triggerMode,jdbcType=VARCHAR},
</if>
<if test="execStatus != null">
#{execStatus,jdbcType=VARCHAR},
</if>
<if test="resultStatus != null">
#{resultStatus,jdbcType=VARCHAR},
</if>
<if test="passThreshold != null">
#{passThreshold,jdbcType=VARCHAR},
</if>
<if test="passRate != null">
#{passRate,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.plan.domain.TestPlanReportExample" resultType="java.lang.Long">
select count(*) from test_plan_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update test_plan_report
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.testPlanId != null">
test_plan_id = #{record.testPlanId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</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.triggerMode != null">
trigger_mode = #{record.triggerMode,jdbcType=VARCHAR},
</if>
<if test="record.execStatus != null">
exec_status = #{record.execStatus,jdbcType=VARCHAR},
</if>
<if test="record.resultStatus != null">
result_status = #{record.resultStatus,jdbcType=VARCHAR},
</if>
<if test="record.passThreshold != null">
pass_threshold = #{record.passThreshold,jdbcType=VARCHAR},
</if>
<if test="record.passRate != null">
pass_rate = #{record.passRate,jdbcType=DECIMAL},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update test_plan_report
set id = #{record.id,jdbcType=VARCHAR},
test_plan_id = #{record.testPlanId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
start_time = #{record.startTime,jdbcType=BIGINT},
end_time = #{record.endTime,jdbcType=BIGINT},
trigger_mode = #{record.triggerMode,jdbcType=VARCHAR},
exec_status = #{record.execStatus,jdbcType=VARCHAR},
result_status = #{record.resultStatus,jdbcType=VARCHAR},
pass_threshold = #{record.passThreshold,jdbcType=VARCHAR},
pass_rate = #{record.passRate,jdbcType=DECIMAL}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.plan.domain.TestPlanReport">
update test_plan_report
<set>
<if test="testPlanId != null">
test_plan_id = #{testPlanId,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=BIGINT},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=BIGINT},
</if>
<if test="triggerMode != null">
trigger_mode = #{triggerMode,jdbcType=VARCHAR},
</if>
<if test="execStatus != null">
exec_status = #{execStatus,jdbcType=VARCHAR},
</if>
<if test="resultStatus != null">
result_status = #{resultStatus,jdbcType=VARCHAR},
</if>
<if test="passThreshold != null">
pass_threshold = #{passThreshold,jdbcType=VARCHAR},
</if>
<if test="passRate != null">
pass_rate = #{passRate,jdbcType=DECIMAL},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.plan.domain.TestPlanReport">
update test_plan_report
set test_plan_id = #{testPlanId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
start_time = #{startTime,jdbcType=BIGINT},
end_time = #{endTime,jdbcType=BIGINT},
trigger_mode = #{triggerMode,jdbcType=VARCHAR},
exec_status = #{execStatus,jdbcType=VARCHAR},
result_status = #{resultStatus,jdbcType=VARCHAR},
pass_threshold = #{passThreshold,jdbcType=VARCHAR},
pass_rate = #{passRate,jdbcType=DECIMAL}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into test_plan_report
(id, test_plan_id, `name`, create_user, create_time, start_time, end_time, trigger_mode,
exec_status, result_status, pass_threshold, pass_rate)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.testPlanId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR},
#{item.createUser,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.startTime,jdbcType=BIGINT},
#{item.endTime,jdbcType=BIGINT}, #{item.triggerMode,jdbcType=VARCHAR}, #{item.execStatus,jdbcType=VARCHAR},
#{item.resultStatus,jdbcType=VARCHAR}, #{item.passThreshold,jdbcType=VARCHAR},
#{item.passRate,jdbcType=DECIMAL})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into test_plan_report (
<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="'test_plan_id'.toString() == column.value">
#{item.testPlanId,jdbcType=VARCHAR}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</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="'trigger_mode'.toString() == column.value">
#{item.triggerMode,jdbcType=VARCHAR}
</if>
<if test="'exec_status'.toString() == column.value">
#{item.execStatus,jdbcType=VARCHAR}
</if>
<if test="'result_status'.toString() == column.value">
#{item.resultStatus,jdbcType=VARCHAR}
</if>
<if test="'pass_threshold'.toString() == column.value">
#{item.passThreshold,jdbcType=VARCHAR}
</if>
<if test="'pass_rate'.toString() == column.value">
#{item.passRate,jdbcType=DECIMAL}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,41 @@
package io.metersphere.plan.mapper;
import io.metersphere.plan.domain.TestPlanReportSummary;
import io.metersphere.plan.domain.TestPlanReportSummaryExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TestPlanReportSummaryMapper {
long countByExample(TestPlanReportSummaryExample example);
int deleteByExample(TestPlanReportSummaryExample example);
int deleteByPrimaryKey(String id);
int insert(TestPlanReportSummary record);
int insertSelective(TestPlanReportSummary record);
List<TestPlanReportSummary> selectByExampleWithBLOBs(TestPlanReportSummaryExample example);
List<TestPlanReportSummary> selectByExample(TestPlanReportSummaryExample example);
TestPlanReportSummary selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") TestPlanReportSummary record, @Param("example") TestPlanReportSummaryExample example);
int updateByExampleWithBLOBs(@Param("record") TestPlanReportSummary record, @Param("example") TestPlanReportSummaryExample example);
int updateByExample(@Param("record") TestPlanReportSummary record, @Param("example") TestPlanReportSummaryExample example);
int updateByPrimaryKeySelective(TestPlanReportSummary record);
int updateByPrimaryKeyWithBLOBs(TestPlanReportSummary record);
int updateByPrimaryKey(TestPlanReportSummary record);
int batchInsert(@Param("list") List<TestPlanReportSummary> list);
int batchInsertSelective(@Param("list") List<TestPlanReportSummary> list, @Param("selective") TestPlanReportSummary.Column ... selective);
}

View File

@ -0,0 +1,354 @@
<?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.plan.mapper.TestPlanReportSummaryMapper">
<resultMap id="BaseResultMap" type="io.metersphere.plan.domain.TestPlanReportSummary">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="functional_case_count" jdbcType="BIGINT" property="functionalCaseCount" />
<result column="api_case_count" jdbcType="BIGINT" property="apiCaseCount" />
<result column="api_scenario_count" jdbcType="BIGINT" property="apiScenarioCount" />
<result column="bug_count" jdbcType="BIGINT" property="bugCount" />
<result column="test_plan_report_id" jdbcType="VARCHAR" property="testPlanReportId" />
<result column="summary" jdbcType="VARCHAR" property="summary" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.plan.domain.TestPlanReportSummary">
<result column="report_count" jdbcType="LONGVARBINARY" property="reportCount" />
</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, functional_case_count, api_case_count, api_scenario_count, bug_count, test_plan_report_id,
summary
</sql>
<sql id="Blob_Column_List">
report_count
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.plan.domain.TestPlanReportSummaryExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from test_plan_report_summary
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.metersphere.plan.domain.TestPlanReportSummaryExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from test_plan_report_summary
<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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from test_plan_report_summary
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from test_plan_report_summary
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.plan.domain.TestPlanReportSummaryExample">
delete from test_plan_report_summary
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.plan.domain.TestPlanReportSummary">
insert into test_plan_report_summary (id, functional_case_count, api_case_count,
api_scenario_count, bug_count, test_plan_report_id,
summary, report_count)
values (#{id,jdbcType=VARCHAR}, #{functionalCaseCount,jdbcType=BIGINT}, #{apiCaseCount,jdbcType=BIGINT},
#{apiScenarioCount,jdbcType=BIGINT}, #{bugCount,jdbcType=BIGINT}, #{testPlanReportId,jdbcType=VARCHAR},
#{summary,jdbcType=VARCHAR}, #{reportCount,jdbcType=LONGVARBINARY})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.plan.domain.TestPlanReportSummary">
insert into test_plan_report_summary
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="functionalCaseCount != null">
functional_case_count,
</if>
<if test="apiCaseCount != null">
api_case_count,
</if>
<if test="apiScenarioCount != null">
api_scenario_count,
</if>
<if test="bugCount != null">
bug_count,
</if>
<if test="testPlanReportId != null">
test_plan_report_id,
</if>
<if test="summary != null">
summary,
</if>
<if test="reportCount != null">
report_count,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="functionalCaseCount != null">
#{functionalCaseCount,jdbcType=BIGINT},
</if>
<if test="apiCaseCount != null">
#{apiCaseCount,jdbcType=BIGINT},
</if>
<if test="apiScenarioCount != null">
#{apiScenarioCount,jdbcType=BIGINT},
</if>
<if test="bugCount != null">
#{bugCount,jdbcType=BIGINT},
</if>
<if test="testPlanReportId != null">
#{testPlanReportId,jdbcType=VARCHAR},
</if>
<if test="summary != null">
#{summary,jdbcType=VARCHAR},
</if>
<if test="reportCount != null">
#{reportCount,jdbcType=LONGVARBINARY},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.plan.domain.TestPlanReportSummaryExample" resultType="java.lang.Long">
select count(*) from test_plan_report_summary
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update test_plan_report_summary
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.functionalCaseCount != null">
functional_case_count = #{record.functionalCaseCount,jdbcType=BIGINT},
</if>
<if test="record.apiCaseCount != null">
api_case_count = #{record.apiCaseCount,jdbcType=BIGINT},
</if>
<if test="record.apiScenarioCount != null">
api_scenario_count = #{record.apiScenarioCount,jdbcType=BIGINT},
</if>
<if test="record.bugCount != null">
bug_count = #{record.bugCount,jdbcType=BIGINT},
</if>
<if test="record.testPlanReportId != null">
test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR},
</if>
<if test="record.summary != null">
summary = #{record.summary,jdbcType=VARCHAR},
</if>
<if test="record.reportCount != null">
report_count = #{record.reportCount,jdbcType=LONGVARBINARY},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update test_plan_report_summary
set id = #{record.id,jdbcType=VARCHAR},
functional_case_count = #{record.functionalCaseCount,jdbcType=BIGINT},
api_case_count = #{record.apiCaseCount,jdbcType=BIGINT},
api_scenario_count = #{record.apiScenarioCount,jdbcType=BIGINT},
bug_count = #{record.bugCount,jdbcType=BIGINT},
test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR},
summary = #{record.summary,jdbcType=VARCHAR},
report_count = #{record.reportCount,jdbcType=LONGVARBINARY}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update test_plan_report_summary
set id = #{record.id,jdbcType=VARCHAR},
functional_case_count = #{record.functionalCaseCount,jdbcType=BIGINT},
api_case_count = #{record.apiCaseCount,jdbcType=BIGINT},
api_scenario_count = #{record.apiScenarioCount,jdbcType=BIGINT},
bug_count = #{record.bugCount,jdbcType=BIGINT},
test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR},
summary = #{record.summary,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.plan.domain.TestPlanReportSummary">
update test_plan_report_summary
<set>
<if test="functionalCaseCount != null">
functional_case_count = #{functionalCaseCount,jdbcType=BIGINT},
</if>
<if test="apiCaseCount != null">
api_case_count = #{apiCaseCount,jdbcType=BIGINT},
</if>
<if test="apiScenarioCount != null">
api_scenario_count = #{apiScenarioCount,jdbcType=BIGINT},
</if>
<if test="bugCount != null">
bug_count = #{bugCount,jdbcType=BIGINT},
</if>
<if test="testPlanReportId != null">
test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR},
</if>
<if test="summary != null">
summary = #{summary,jdbcType=VARCHAR},
</if>
<if test="reportCount != null">
report_count = #{reportCount,jdbcType=LONGVARBINARY},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.plan.domain.TestPlanReportSummary">
update test_plan_report_summary
set functional_case_count = #{functionalCaseCount,jdbcType=BIGINT},
api_case_count = #{apiCaseCount,jdbcType=BIGINT},
api_scenario_count = #{apiScenarioCount,jdbcType=BIGINT},
bug_count = #{bugCount,jdbcType=BIGINT},
test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR},
summary = #{summary,jdbcType=VARCHAR},
report_count = #{reportCount,jdbcType=LONGVARBINARY}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.plan.domain.TestPlanReportSummary">
update test_plan_report_summary
set functional_case_count = #{functionalCaseCount,jdbcType=BIGINT},
api_case_count = #{apiCaseCount,jdbcType=BIGINT},
api_scenario_count = #{apiScenarioCount,jdbcType=BIGINT},
bug_count = #{bugCount,jdbcType=BIGINT},
test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR},
summary = #{summary,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into test_plan_report_summary
(id, functional_case_count, api_case_count, api_scenario_count, bug_count, test_plan_report_id,
summary, report_count)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.functionalCaseCount,jdbcType=BIGINT}, #{item.apiCaseCount,jdbcType=BIGINT},
#{item.apiScenarioCount,jdbcType=BIGINT}, #{item.bugCount,jdbcType=BIGINT}, #{item.testPlanReportId,jdbcType=VARCHAR},
#{item.summary,jdbcType=VARCHAR}, #{item.reportCount,jdbcType=LONGVARBINARY})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into test_plan_report_summary (
<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="'functional_case_count'.toString() == column.value">
#{item.functionalCaseCount,jdbcType=BIGINT}
</if>
<if test="'api_case_count'.toString() == column.value">
#{item.apiCaseCount,jdbcType=BIGINT}
</if>
<if test="'api_scenario_count'.toString() == column.value">
#{item.apiScenarioCount,jdbcType=BIGINT}
</if>
<if test="'bug_count'.toString() == column.value">
#{item.bugCount,jdbcType=BIGINT}
</if>
<if test="'test_plan_report_id'.toString() == column.value">
#{item.testPlanReportId,jdbcType=VARCHAR}
</if>
<if test="'summary'.toString() == column.value">
#{item.summary,jdbcType=VARCHAR}
</if>
<if test="'report_count'.toString() == column.value">
#{item.reportCount,jdbcType=LONGVARBINARY}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -63,6 +63,64 @@ CREATE INDEX idx_test_plan_case_id ON test_plan_case_execute_history(test_plan_c
CREATE INDEX idx_status ON test_plan_case_execute_history(status); CREATE INDEX idx_status ON test_plan_case_execute_history(status);
CREATE INDEX idx_deleted ON test_plan_case_execute_history(deleted); CREATE INDEX idx_deleted ON test_plan_case_execute_history(deleted);
-- 计划报告
CREATE TABLE IF NOT EXISTS test_plan_report(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`test_plan_id` VARCHAR(50) NOT NULL COMMENT '测试计划ID' ,
`name` VARCHAR(255) NOT NULL COMMENT '报告名称' ,
`create_user` VARCHAR(50) NOT NULL COMMENT '创建人' ,
`create_time` BIGINT NOT NULL COMMENT '创建时间' ,
`start_time` BIGINT COMMENT '开始时间' ,
`end_time` BIGINT COMMENT '结束时间' ,
`trigger_mode` VARCHAR(50) COMMENT '触发类型' ,
`exec_status` VARCHAR(50) NOT NULL DEFAULT 'PENDING' COMMENT '执行状态: 未执行, 执行中, 已停止, 已完成;' ,
`result_status` VARCHAR(50) DEFAULT '-' COMMENT '结果状态: 成功, 失败, 阻塞, 误报' ,
`pass_threshold` VARCHAR(100) NOT NULL COMMENT '通过阈值' ,
`pass_rate` DECIMAL COMMENT '通过率' ,
PRIMARY KEY (id)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试计划报告';
CREATE INDEX idx_test_plan_id ON test_plan_report(test_plan_id);
CREATE INDEX idx_create_user ON test_plan_report(create_user);
CREATE INDEX idx_create_time ON test_plan_report(create_time);
CREATE INDEX idx_exec_status ON test_plan_report(exec_status);
CREATE INDEX idx_result_status ON test_plan_report(result_status);
CREATE INDEX idx_pass_rate ON test_plan_report(pass_rate);
CREATE TABLE IF NOT EXISTS test_plan_report_summary(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`functional_case_count` BIGINT NOT NULL DEFAULT 0 COMMENT '功能用例数量' ,
`api_case_count` BIGINT NOT NULL DEFAULT 0 COMMENT '接口用例数量' ,
`api_scenario_count` BIGINT NOT NULL DEFAULT 0 COMMENT '场景用例数量' ,
`bug_count` BIGINT(255) NOT NULL COMMENT '缺陷数量' ,
`test_plan_report_id` VARCHAR(50) NOT NULL COMMENT '测试计划报告ID' ,
`summary` VARCHAR(1000) COMMENT '总结' ,
`report_count` BLOB COMMENT '报告统计内容' ,
PRIMARY KEY (id)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试计划报告内容统计';
CREATE UNIQUE INDEX idx_test_plan_report_id ON test_plan_report_summary(test_plan_report_id);
CREATE TABLE IF NOT EXISTS test_plan_report_function_case(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`test_plan_report_id` VARCHAR(50) NOT NULL COMMENT '测试计划报告ID' ,
`test_plan_function_case_id` VARCHAR(50) NOT NULL COMMENT '测试计划功能用例关联ID' ,
`function_case_id` VARCHAR(50) NOT NULL COMMENT '功能用例ID' ,
`execute_result` VARCHAR(50) NOT NULL COMMENT '执行结果' ,
PRIMARY KEY (id)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试计划报告内容功能用例部分';
CREATE UNIQUE INDEX idx_test_plan_report_id ON test_plan_report_function_case(test_plan_report_id);
CREATE TABLE IF NOT EXISTS test_plan_report_bug(
`id` VARCHAR(50) COMMENT 'ID' ,
`test_plan_report_id` VARCHAR(50) COMMENT '报告ID' ,
`bug_id` VARCHAR(50) COMMENT '缺陷ID'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试计划报告内容缺陷部分';
CREATE UNIQUE INDEX idx_test_plan_report_id ON test_plan_report_bug(test_plan_report_id);
-- set innodb lock wait timeout to default -- set innodb lock wait timeout to default
SET SESSION innodb_lock_wait_timeout = DEFAULT; SET SESSION innodb_lock_wait_timeout = DEFAULT;

View File

@ -310,6 +310,11 @@ public class PermissionConstants {
public static final String TEST_PLAN_READ_DELETE = "PROJECT_TEST_PLAN:READ+DELETE"; public static final String TEST_PLAN_READ_DELETE = "PROJECT_TEST_PLAN:READ+DELETE";
public static final String TEST_PLAN_READ_EXECUTE = "PROJECT_TEST_PLAN:READ+EXECUTE"; public static final String TEST_PLAN_READ_EXECUTE = "PROJECT_TEST_PLAN:READ+EXECUTE";
public static final String TEST_PLAN_READ_ASSOCIATION = "PROJECT_TEST_PLAN:READ+ASSOCIATION"; public static final String TEST_PLAN_READ_ASSOCIATION = "PROJECT_TEST_PLAN:READ+ASSOCIATION";
public static final String TEST_PLAN_REPORT_READ = "PROJECT_TEST_PLAN_REPORT:READ";
public static final String TEST_PLAN_REPORT_READ_ADD = "PROJECT_TEST_PLAN_REPORT:READ+ADD";
public static final String TEST_PLAN_REPORT_READ_UPDATE = "PROJECT_TEST_PLAN_REPORT:READ+UPDATE";
public static final String TEST_PLAN_REPORT_READ_DELETE = "PROJECT_TEST_PLAN_REPORT:READ+DELETE";
/*------ end: TEST_PLAN ------*/ /*------ end: TEST_PLAN ------*/
/*------ start: SYSTEM_TASK_CENTER ------*/ /*------ start: SYSTEM_TASK_CENTER ------*/

View File

@ -86,4 +86,7 @@ test_plan_report_content.id.not_blank=测试计划报告内容id不能为空
test_plan_report_content.test_plan_report_id.length_range=测试计划报告id长度过长 test_plan_report_content.test_plan_report_id.length_range=测试计划报告id长度过长
test_plan_report_content.test_plan_report_id.not_blank=测试计划报告id不能为空 test_plan_report_content.test_plan_report_id.not_blank=测试计划报告id不能为空
test_plan_group.batch.log={0}测试计划组 test_plan_group.batch.log={0}测试计划组
test_plan.batch.log={0}测试计划 test_plan.batch.log={0}测试计划
test_plan_report_not_exist=测试计划报告不存在
test_plan_report_id.not_blank=测试计划报告id不能为空
test_plan_report_name.not_blank=测试计划报告名称不能为空

View File

@ -98,4 +98,7 @@ test_plan.type.not_blank=Test plan type cannot be empty
test_plan.group.not_plan=There are no archived plans in the current testing plan group test_plan.group.not_plan=There are no archived plans in the current testing plan group
test_plan_group.batch.log={0} test plan group test_plan_group.batch.log={0} test plan group
test_plan.batch.log={0} plan test_plan.batch.log={0} plan
test_plan_report_not_exist=The test plan report does not exist
test_plan_report_id.not_blank=The test plan report id cannot be empty
test_plan_report_name.not_blank=The test plan report name cannot be empty
run_functional_case=Run functional case run_functional_case=Run functional case

View File

@ -98,4 +98,7 @@ test_plan.type.not_blank=测试计划类型不能为空
test_plan.group.not_plan=当前测试计划组没有可归档计划 test_plan.group.not_plan=当前测试计划组没有可归档计划
test_plan_group.batch.log={0}测试计划组 test_plan_group.batch.log={0}测试计划组
test_plan.batch.log={0}测试计划 test_plan.batch.log={0}测试计划
test_plan_report_not_exist=测试计划报告不存在
test_plan_report_id.not_blank=测试计划报告id不能为空
test_plan_report_name.not_blank=测试计划报告名称不能为空
run_functional_case=执行功能用例 run_functional_case=执行功能用例

View File

@ -98,4 +98,7 @@ test_plan.type.not_blank=測試計劃類型不能為空
test_plan.group.not_plan=當前測試計劃組沒有可歸檔計劃 test_plan.group.not_plan=當前測試計劃組沒有可歸檔計劃
test_plan_group.batch.log={0}測試計劃組 test_plan_group.batch.log={0}測試計劃組
test_plan.batch.log={0}測試計劃 test_plan.batch.log={0}測試計劃
test_plan_report_not_exist=測試計劃報告不存在
test_plan_report_id.not_blank=測試計劃報告id不能爲空
test_plan_report_name.not_blank=測試計劃報告名稱不能爲空
run_functional_case=執行功能用例 run_functional_case=執行功能用例

View File

@ -0,0 +1,34 @@
package io.metersphere.system.dto.request;
import io.metersphere.system.dto.sdk.BaseCondition;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* Condition与BasePageRequest保持一致
* 复用SQL参数条件
*/
@Data
public class TableBatchRequest extends BaseCondition {
@Schema(description = "不处理的ID")
List<String> excludeIds = new ArrayList<>();
@Schema(description = "选择的ID", requiredMode = Schema.RequiredMode.REQUIRED)
@Valid
private List<
@NotBlank(message = "{id must not be blank}", groups = {Created.class, Updated.class})
String
> selectIds = new ArrayList<>();
@Schema(description = "是否选择所有数据")
private boolean selectAll;
}

View File

@ -16,6 +16,7 @@ import io.metersphere.system.dto.request.user.UserChangeEnableRequest;
import io.metersphere.system.dto.request.user.UserEditRequest; import io.metersphere.system.dto.request.user.UserEditRequest;
import io.metersphere.system.dto.sdk.BasePageRequest; import io.metersphere.system.dto.sdk.BasePageRequest;
import io.metersphere.system.dto.sdk.ExcelParseDTO; import io.metersphere.system.dto.sdk.ExcelParseDTO;
import io.metersphere.system.dto.sdk.OptionDTO;
import io.metersphere.system.dto.sdk.SessionUser; import io.metersphere.system.dto.sdk.SessionUser;
import io.metersphere.system.dto.table.TableBatchProcessDTO; import io.metersphere.system.dto.table.TableBatchProcessDTO;
import io.metersphere.system.dto.table.TableBatchProcessResponse; import io.metersphere.system.dto.table.TableBatchProcessResponse;
@ -593,4 +594,12 @@ public class UserService {
this.checkOldPassword(request.getId(), request.getOldPassword()); this.checkOldPassword(request.getId(), request.getOldPassword());
return extUserMapper.updatePasswordByUserId(request.getId(), request.getNewPassword()) > 0; return extUserMapper.updatePasswordByUserId(request.getId(), request.getNewPassword()) > 0;
} }
/**
* 根据ID获取用户ID, 名称集合
*/
public Map<String, String> getUserMapByIds(List<String> userIds) {
List<OptionDTO> userOptions = baseUserMapper.selectUserOptionByIds(userIds);
return userOptions.stream().collect(Collectors.toMap(OptionDTO::getId, OptionDTO::getName));
}
} }

View File

@ -0,0 +1,75 @@
package io.metersphere.plan.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.plan.constants.TestPlanResourceConfig;
import io.metersphere.plan.dto.request.TestPlanReportBatchRequest;
import io.metersphere.plan.dto.request.TestPlanReportDeleteRequest;
import io.metersphere.plan.dto.request.TestPlanReportEditRequest;
import io.metersphere.plan.dto.request.TestPlanReportPageRequest;
import io.metersphere.plan.dto.response.TestPlanReportPageResponse;
import io.metersphere.plan.service.TestPlanManagementService;
import io.metersphere.plan.service.TestPlanReportService;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.system.security.CheckOwner;
import io.metersphere.system.utils.PageUtils;
import io.metersphere.system.utils.Pager;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Collections;
import java.util.List;
@RestController
@RequestMapping("/test-plan/report")
@Tag(name = "测试计划-报告")
public class TestPlanReportController {
@Resource
private TestPlanManagementService testPlanManagementService;
@Resource
private TestPlanReportService testPlanReportService;
@PostMapping("/page")
@Operation(summary = "测试计划-报告-表格分页查询")
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ)
@CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project")
public Pager<List<TestPlanReportPageResponse>> page(@Validated @RequestBody TestPlanReportPageRequest request) {
testPlanManagementService.checkModuleIsOpen(request.getProjectId(), TestPlanResourceConfig.CHECK_TYPE_PROJECT, Collections.singletonList(TestPlanResourceConfig.CONFIG_TEST_PLAN));
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tpr.create_time desc");
return PageUtils.setPageInfo(page, testPlanReportService.page(request));
}
@PostMapping("/rename")
@Operation(summary = "测试计划-报告-重命名")
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ_UPDATE)
@CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project")
public void rename(@Validated @RequestBody TestPlanReportEditRequest request) {
testPlanReportService.rename(request);
}
@PostMapping("/delete")
@Operation(summary = "测试计划-报告-删除")
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ_DELETE)
@CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project")
public void delete(@Validated @RequestBody TestPlanReportDeleteRequest request) {
testPlanReportService.delete(request);
}
@PostMapping("/batch-delete")
@Operation(summary = "测试计划-报告-批量删除")
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ_DELETE)
@CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project")
public void batchDelete(@Validated @RequestBody TestPlanReportBatchRequest request) {
testPlanReportService.batchDelete(request);
}
}

View File

@ -0,0 +1,20 @@
package io.metersphere.plan.dto.request;
import io.metersphere.system.dto.request.TableBatchRequest;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class TestPlanReportBatchRequest extends TableBatchRequest {
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan.project_id.not_blank}")
private String projectId;
@Schema(description = "类型", allowableValues = {"ALL: 全部", "TEST_PLAN: 独立", "GROUP: 聚合"}, requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan.type.not_blank}")
private String type;
}

View File

@ -0,0 +1,19 @@
package io.metersphere.plan.dto.request;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class TestPlanReportDeleteRequest {
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan.project_id.not_blank}")
private String projectId;
@Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_id.not_blank}")
private String id;
}

View File

@ -0,0 +1,23 @@
package io.metersphere.plan.dto.request;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class TestPlanReportEditRequest {
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan.project_id.not_blank}")
private String projectId;
@Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_id.not_blank}")
private String id;
@Schema(description = "报告名称", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_name.not_blank}")
private String name;
}

View File

@ -0,0 +1,20 @@
package io.metersphere.plan.dto.request;
import io.metersphere.system.dto.sdk.BasePageRequest;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class TestPlanReportPageRequest extends BasePageRequest {
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan.project_id.not_blank}")
private String projectId;
@Schema(description = "类型", allowableValues = {"ALL: 全部", "TEST_PLAN: 独立", "GROUP: 聚合"}, requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan.type.not_blank}")
private String type;
}

View File

@ -40,10 +40,12 @@ public class TestPlanDetailResponse extends TestPlanStatisticsResponse implement
@Schema(description = "是否开启测试规划") @Schema(description = "是否开启测试规划")
private Boolean testPlanning; private Boolean testPlanning;
@Schema(description = "测试计划名称/测试计划组名称") @Schema(description = "测试计划名称/测试计划组名称")
private String name; private String name;
@Schema(description = "测试计划业务ID")
private Long num;
@Schema(description = "标签") @Schema(description = "标签")
private List<String> tags; private List<String> tags;

View File

@ -0,0 +1,34 @@
package io.metersphere.plan.dto.response;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class TestPlanReportPageResponse {
@Schema(description = "报告ID")
private String id;
@Schema(description = "报告名称")
private String name;
@Schema(description = "计划名称")
private String planName;
@Schema(description = "计划通过阈值")
private String planPassThreshold;
@Schema(description = "触发方式")
private String triggerMode;
@Schema(description = "执行状态")
private String executeStatus;
@Schema(description = "执行结果")
private String resultStatus;
@Schema(description = "通过率")
private Double passRate;
@Schema(description = "创建人")
private String createUser;
@Schema(description = "创建人名称")
private String createUserName;
@Schema(description = "创建时间")
private Long createTime;
}

View File

@ -0,0 +1,25 @@
package io.metersphere.plan.mapper;
import io.metersphere.plan.dto.request.TestPlanReportBatchRequest;
import io.metersphere.plan.dto.request.TestPlanReportPageRequest;
import io.metersphere.plan.dto.response.TestPlanReportPageResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtTestPlanReportMapper {
/**
* 分页获取计划列表
* @param request 分页请求参数
* @return 计划列表
*/
List<TestPlanReportPageResponse> list(@Param("request") TestPlanReportPageRequest request, @Param("sort") String sort);
/**
* 根据页面参数获取批量操作的报告ID
* @param request 请求参数
* @return 报告ID集合
*/
List<String> getReportBatchIdsByParam(@Param("request")TestPlanReportBatchRequest request);
}

View File

@ -0,0 +1,140 @@
<?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.plan.mapper.ExtTestPlanReportMapper">
<select id="list" resultType="io.metersphere.plan.dto.response.TestPlanReportPageResponse">
select tpr.id as id, tpr.name as name, tp.name as planName, tpr.pass_threshold planPassThreshold,
tpr.trigger_mode as triggerMode, tpr.exec_status as executeStatus, tpr.result_status as resultStatus,
tpr.pass_rate passRate, tpr.create_user createUser, tpr.create_time createTime
from test_plan_report tpr
join test_plan tp on tpr.test_plan_id = tp.id
<include refid="queryWhereCondition"/>
<if test="sort != null and sort != ''">
order by ${sort}
</if>
</select>
<select id="getReportBatchIdsByParam" resultType="java.lang.String">
select tpr.id from test_plan_report tpr
join test_plan tp on tpr.test_plan_id = tp.id
<include refid="queryWhereCondition"/>
</select>
<sql id="queryWhereCondition">
<where>
<if test="request.projectId != null and request.projectId != ''">
and tp.project_id = #{request.projectId}
</if>
<if test="request.type != null and request.type != '' and request.type != 'ALL'">
and tp.type = #{request.type}
</if>
<if test="request.keyword != null and request.keyword != ''">
and tpr.name like concat('%', #{request.keyword},'%')
</if>
<include refid="filter"/>
<include refid="combine">
<property name="condition" value="request.combine"/>
<property name="searchMode" value="request.searchMode"/>
<property name="combineTag" value="request.combine.tag"/>
</include>
</where>
</sql>
<sql id="filter">
<if test="request.filter != null and request.filter.size() > 0">
<foreach collection="request.filter.entrySet()" index="key" item="values">
<if test="values != null and values.size() > 0">
<choose>
<!-- 触发方式 -->
<when test="key == 'triggerMode'">
and tpr.trigger_mode in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when>
<!-- 执行状态 -->
<when test="key == 'executeStatus'">
and tpr.exec_status in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when>
<!-- 执行结果 -->
<when test="key == 'resultStatus'">
and tpr.result_status in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when>
</choose>
</if>
</foreach>
</if>
</sql>
<sql id="combine">
<if test="request.combine != null">
and (
<!-- 任意/所有拼接 -->
<include refid="prefixMode">
<property name="searchMode" value="${searchMode}"/>
</include>
<!-- 名称 -->
<if test='${condition}.name != null'>
<include refid="queryType">
<property name="searchMode" value="${searchMode}"/>
</include>
tpr.name
<include refid="io.metersphere.system.mapper.BaseMapper.condition">
<property name="object" value="${condition}.name"/>
</include>
</if>
<!-- 触发方式 -->
<if test='${condition}.triggerMode != null'>
<include refid="queryType">
<property name="searchMode" value="${searchMode}"/>
</include>
tpr.trigger_mode
<include refid="io.metersphere.system.mapper.BaseMapper.condition">
<property name="object" value="${condition}.triggerMode"/>
</include>
</if>
<!-- 执行状态 -->
<if test='${condition}.executeStatus != null'>
<include refid="queryType">
<property name="searchMode" value="${searchMode}"/>
</include>
tpr.exec_status
<include refid="io.metersphere.system.mapper.BaseMapper.condition">
<property name="object" value="${condition}.executeStatus"/>
</include>
</if>
<!-- 执行结果 -->
<if test='${condition}.resultStatus != null'>
<include refid="queryType">
<property name="searchMode" value="${searchMode}"/>
</include>
tpr.result_status
<include refid="io.metersphere.system.mapper.BaseMapper.condition">
<property name="object" value="${condition}.resultStatus"/>
</include>
</if>
)
</if>
</sql>
<sql id="prefixMode">
<choose>
<when test='${searchMode} == "AND"'>
1 = 1
</when>
<when test='${searchMode} == "OR"'>
1 = 2
</when>
</choose>
</sql>
<sql id="queryType">
<choose>
<when test='${searchMode} == "AND"'>
and
</when>
<when test='${searchMode} == "OR"'>
or
</when>
</choose>
</sql>
</mapper>

View File

@ -0,0 +1,135 @@
package io.metersphere.plan.service;
import io.metersphere.plan.domain.*;
import io.metersphere.plan.dto.request.TestPlanReportBatchRequest;
import io.metersphere.plan.dto.request.TestPlanReportDeleteRequest;
import io.metersphere.plan.dto.request.TestPlanReportEditRequest;
import io.metersphere.plan.dto.request.TestPlanReportPageRequest;
import io.metersphere.plan.dto.response.TestPlanReportPageResponse;
import io.metersphere.plan.mapper.*;
import io.metersphere.sdk.exception.MSException;
import io.metersphere.sdk.util.Translator;
import io.metersphere.system.service.UserService;
import jakarta.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
public class TestPlanReportService {
@Resource
private UserService userService;
@Resource
private TestPlanReportMapper testPlanReportMapper;
@Resource
private ExtTestPlanReportMapper extTestPlanReportMapper;
@Resource
private TestPlanReportSummaryMapper testPlanReportSummaryMapper;
@Resource
private TestPlanReportFunctionCaseMapper testPlanReportFunctionCaseMapper;
@Resource
private TestPlanReportBugMapper testPlanReportBugMapper;
/**
* 分页查询报告列表
* @param request 分页请求参数
* @return 报告列表
*/
public List<TestPlanReportPageResponse> page(TestPlanReportPageRequest request) {
List<TestPlanReportPageResponse> reportList = extTestPlanReportMapper.list(request, request.getSortString());
if (CollectionUtils.isEmpty(reportList)) {
return new ArrayList<>();
}
List<String> distinctUserIds = reportList.stream().map(TestPlanReportPageResponse::getCreateUser).distinct().toList();
Map<String, String> userMap = userService.getUserMapByIds(distinctUserIds);
reportList.forEach(report -> report.setCreateUserName(userMap.get(report.getCreateUser())));
return reportList;
}
/**
* 报告重命名
* @param request 请求参数
*/
public void rename(TestPlanReportEditRequest request) {
checkReport(request.getId());
TestPlanReport report = new TestPlanReport();
report.setId(request.getId());
report.setName(request.getName());
testPlanReportMapper.updateByPrimaryKeySelective(report);
}
/**
* 删除单个报告
* @param request 请求参数
*/
public void delete(TestPlanReportDeleteRequest request) {
checkReport(request.getId());
testPlanReportMapper.deleteByPrimaryKey(request.getId());
// 删除报告内容的关联资源表
cleanReportAssociateResource(List.of(request.getId()));
}
/**
* 批量参数报告
* @param request 请求参数
*/
public void batchDelete(TestPlanReportBatchRequest request) {
List<String> batchIds = getBatchIds(request);
if (CollectionUtils.isNotEmpty(batchIds)) {
TestPlanReportExample example = new TestPlanReportExample();
example.createCriteria().andIdIn(batchIds);
testPlanReportMapper.deleteByExample(example);
// 删除报告内容的关联资源表
cleanReportAssociateResource(batchIds);
}
}
/**
* 清理报告关联的资源
* @param reportIds 报告ID集合
*/
public void cleanReportAssociateResource(List<String> reportIds) {
// TODO: 删除报告关联的统计, 用例, 缺陷
TestPlanReportSummaryExample summaryExample = new TestPlanReportSummaryExample();
summaryExample.createCriteria().andTestPlanReportIdIn(reportIds);
testPlanReportSummaryMapper.deleteByExample(summaryExample);
TestPlanReportFunctionCaseExample functionCaseExample = new TestPlanReportFunctionCaseExample();
functionCaseExample.createCriteria().andTestPlanReportIdIn(reportIds);
testPlanReportFunctionCaseMapper.deleteByExample(functionCaseExample);
TestPlanReportBugExample bugExample = new TestPlanReportBugExample();
bugExample.createCriteria().andTestPlanReportIdIn(reportIds);
testPlanReportBugMapper.deleteByExample(bugExample);
}
/**
* 通过请求参数获取批量操作的ID集合
* @param request 请求参数
* @return ID集合
*/
private List<String> getBatchIds(TestPlanReportBatchRequest request) {
if (request.isSelectAll()) {
List<String> batchIds = extTestPlanReportMapper.getReportBatchIdsByParam(request);
if (CollectionUtils.isNotEmpty(request.getExcludeIds())) {
batchIds.removeIf(id -> request.getExcludeIds().contains(id));
}
return batchIds;
} else {
return request.getSelectIds();
}
}
/**
* 校验报告是否存在
* @param id 报告ID
*/
private void checkReport(String id) {
TestPlanReport testPlanReport = testPlanReportMapper.selectByPrimaryKey(id);
if (testPlanReport == null) {
throw new MSException(Translator.get("test_plan_report_not_exist"));
}
}
}

View File

@ -437,6 +437,8 @@ public class TestPlanService extends TestPlanBaseUtilsService {
String moduleName = getModuleName(testPlan.getModuleId()); String moduleName = getModuleName(testPlan.getModuleId());
//计划组只有几个参数 //计划组只有几个参数
response.setId(testPlan.getId()); response.setId(testPlan.getId());
response.setNum(testPlan.getNum());
response.setStatus(testPlan.getStatus());
response.setName(testPlan.getName()); response.setName(testPlan.getName());
response.setTags(testPlan.getTags()); response.setTags(testPlan.getTags());
response.setModuleId(testPlan.getModuleId()); response.setModuleId(testPlan.getModuleId());

View File

@ -77,10 +77,13 @@
<!-- typeHandler="io.metersphere.handler.ListTypeHandler"/>--> <!-- typeHandler="io.metersphere.handler.ListTypeHandler"/>-->
<!-- </table>--> <!-- </table>-->
<table tableName="test_plan_functional_case"/> <!-- <table tableName="test_plan_functional_case"/>-->
<table tableName="test_plan_api_case"/> <!-- <table tableName="test_plan_api_case"/>-->
<table tableName="test_plan_api_scenario"/> <!-- <table tableName="test_plan_api_scenario"/>-->
<table tableName="test_plan_bug"/> <!-- <table tableName="test_plan_report"/>-->
<!-- <table tableName="test_plan_report_summary"/>-->
<!-- <table tableName="test_plan_report_function_case"/>-->
<!-- <table tableName="test_plan_report_bug"/>-->
<!-- <table tableName="test_plan_config"/>--> <!-- <table tableName="test_plan_config"/>-->
<!-- 要忽略的字段--> <!-- 要忽略的字段-->
<!-- <table tableName="test_case"> <!-- <table tableName="test_case">

View File

@ -0,0 +1,135 @@
package io.metersphere.plan.controller;
import io.metersphere.plan.dto.request.TestPlanReportBatchRequest;
import io.metersphere.plan.dto.request.TestPlanReportDeleteRequest;
import io.metersphere.plan.dto.request.TestPlanReportEditRequest;
import io.metersphere.plan.dto.request.TestPlanReportPageRequest;
import io.metersphere.plan.dto.response.TestPlanReportPageResponse;
import io.metersphere.sdk.util.JSON;
import io.metersphere.system.base.BaseTest;
import io.metersphere.system.controller.handler.ResultHolder;
import io.metersphere.system.utils.Pager;
import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.*;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.jdbc.SqlConfig;
import org.springframework.test.web.servlet.MvcResult;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@AutoConfigureMockMvc
public class TestPlanReportControllerTests extends BaseTest {
private static final String LIST_PLAN_REPORT = "/test-plan/report/page";
private static final String RENAME_PLAN_REPORT = "/test-plan/report/rename";
private static final String DELETE_PLAN_REPORT = "/test-plan/report/delete";
private static final String BATCH_DELETE_PLAN_REPORT = "/test-plan/report/batch-delete";
@Test
@Order(1)
@Sql(scripts = {"/dml/init_test_plan_report.sql"}, config = @SqlConfig(encoding = "utf-8", transactionMode = SqlConfig.TransactionMode.ISOLATED))
void tesPagePlanReportSuccess() throws Exception {
TestPlanReportPageRequest request = new TestPlanReportPageRequest();
request.setProjectId("100001100001");
request.setType("ALL");
request.setCurrent(1);
request.setPageSize(10);
request.setKeyword("1");
MvcResult mvcResult = this.requestPostWithOkAndReturn(LIST_PLAN_REPORT, request);
// 获取返回值
String returnData = mvcResult.getResponse().getContentAsString(StandardCharsets.UTF_8);
ResultHolder resultHolder = JSON.parseObject(returnData, ResultHolder.class);
// 返回请求正常
Assertions.assertNotNull(resultHolder);
Pager<?> pageData = JSON.parseObject(JSON.toJSONString(resultHolder.getData()), Pager.class);
// 返回值不为空
Assertions.assertNotNull(pageData);
// 返回值的页码和当前页码相同
Assertions.assertEquals(pageData.getCurrent(), request.getCurrent());
// 返回的数据量不超过规定要返回的数据量相同
Assertions.assertTrue(JSON.parseArray(JSON.toJSONString(pageData.getList())).size() <= request.getPageSize());
// 返回值中取出第一条数据, 并判断是否包含关键字default
TestPlanReportPageResponse report = JSON.parseArray(JSON.toJSONString(pageData.getList()), TestPlanReportPageResponse.class).get(0);
Assertions.assertTrue(StringUtils.contains(report.getName(), request.getKeyword()));
// 覆盖排序, 及数据为空
request.setSort(Map.of("tpr.create_time", "asc"));
request.setKeyword("oasis");
this.requestPost(LIST_PLAN_REPORT, request);
}
@Test
@Order(2)
void testPagePlanReportError() throws Exception {
// 必填参数有误
TestPlanReportPageRequest request = new TestPlanReportPageRequest();
request.setCurrent(1);
request.setPageSize(10);
this.requestPost(LIST_PLAN_REPORT, request, status().isBadRequest());
// 页码有误
request.setProjectId("100001100001");
request.setType("ALL");
request.setCurrent(0);
request.setPageSize(10);
this.requestPost(LIST_PLAN_REPORT, request, status().isBadRequest());
// 页数有误
request.setCurrent(1);
request.setPageSize(1);
this.requestPost(LIST_PLAN_REPORT, request, status().isBadRequest());
}
@Test
@Order(3)
void testRenamePlanReportSuccess() throws Exception {
TestPlanReportEditRequest request = new TestPlanReportEditRequest();
request.setId("test-plan-report-id-1");
request.setName("oasis");
request.setProjectId("100001100001");
this.requestPostWithOk(RENAME_PLAN_REPORT, request);
}
@Test
@Order(4)
void testRenamePlanReportError() throws Exception {
TestPlanReportEditRequest request = new TestPlanReportEditRequest();
request.setId("test-plan-report-id-x");
request.setName("oasis");
request.setProjectId("100001100001");
this.requestPost(RENAME_PLAN_REPORT, request, status().is5xxServerError());
}
@Test
@Order(5)
void testDeletePlanReport() throws Exception {
TestPlanReportDeleteRequest request = new TestPlanReportDeleteRequest();
request.setId("test-plan-report-id-1");
request.setProjectId("100001100001");
this.requestPostWithOk(DELETE_PLAN_REPORT, request);
}
@Test
@Order(6)
void testBatchDeletePlanReport() throws Exception {
TestPlanReportBatchRequest request = new TestPlanReportBatchRequest();
request.setProjectId("100001100001");
request.setType("ALL");
// 勾选部分, 并删除
request.setSelectAll(false);
request.setSelectIds(List.of("test-plan-report-id-2"));
this.requestPostWithOk(BATCH_DELETE_PLAN_REPORT, request);
// 全选并排除所有, 为空
request.setSelectAll(true);
request.setExcludeIds(List.of("test-plan-report-id-3", "test-plan-report-id-4"));
this.requestPostWithOk(BATCH_DELETE_PLAN_REPORT, request);
// 全选不排除
request.setExcludeIds(null);
this.requestPostWithOk(BATCH_DELETE_PLAN_REPORT, request);
}
}

View File

@ -0,0 +1,14 @@
-- 计划测试数据
INSERT INTO `test_plan`(`id`, `num`, `project_id`, `group_id`, `module_id`, `name`, `status`, `type`, `tags`, `create_time`, `create_user`, `update_time`, `update_user`, `planned_start_time`, `planned_end_time`, `actual_start_time`, `actual_end_time`, `description`)
VALUES ('test-plan-id-for990', 100001, '100001100001', 'NONE', '1', '测试一下计划-990', 'PREPARED', 'TEST_PLAN', NULL, CURRENT_TIMESTAMP, 'admin', CURRENT_TIMESTAMP, 'admin', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '11');
INSERT INTO `test_plan`(`id`, `num`, `project_id`, `group_id`, `module_id`, `name`, `status`, `type`, `tags`, `create_time`, `create_user`, `update_time`, `update_user`, `planned_start_time`, `planned_end_time`, `actual_start_time`, `actual_end_time`, `description`)
VALUES ('test-plan-id-for991', 100002, '100001100001', 'NONE', '1', '测试一下计划-991', 'PREPARED', 'GROUP', NULL, CURRENT_TIMESTAMP, 'admin', CURRENT_TIMESTAMP, 'admin', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '11');
INSERT INTO `test_plan`(`id`, `num`, `project_id`, `group_id`, `module_id`, `name`, `status`, `type`, `tags`, `create_time`, `create_user`, `update_time`, `update_user`, `planned_start_time`, `planned_end_time`, `actual_start_time`, `actual_end_time`, `description`)
VALUES ('test-plan-id-for992', 100003, '100001100001', 'NONE', '1', '测试一下计划-992', 'PREPARED', 'TEST_PLAN', NULL, CURRENT_TIMESTAMP, 'admin', CURRENT_TIMESTAMP, 'admin', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '11');
-- 计划报告测试数据
INSERT INTO `test_plan_report`(`id`, `test_plan_id`, `name`, `create_user`, `create_time`, `start_time`, `end_time`, `trigger_mode`, `exec_status`, `result_status`, `pass_threshold`, `pass_rate`) VALUES
('test-plan-report-id-1', 'test-plan-id-for991', '测试一下计划报告1', 'admin', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'MANUAL', 'PENDING', '-', '99.99', 100.00),
('test-plan-report-id-2', 'test-plan-id-for991', '测试一下计划报告1', 'admin', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'MANUAL', 'PENDING', '-', '99.99', 100.00),
('test-plan-report-id-3', 'test-plan-id-for992', '测试一下计划报告3', 'admin', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'MANUAL', 'PENDING', '-', '99.99', 100.00),
('test-plan-report-id-4', 'test-plan-id-for992', '测试一下计划报告4', 'admin', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'MANUAL', 'PENDING', '-', '99.99', 100.00);