feat(测试计划): 补充报告编辑功能

This commit is contained in:
song-cc-rock 2024-05-17 16:34:12 +08:00 committed by Craftsman
parent 0164319960
commit a5f5493e8e
23 changed files with 1372 additions and 217 deletions

View File

@ -1,6 +1,11 @@
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;
@ -9,21 +14,46 @@ import java.util.Arrays;
@Data
public class TestPlanReportBug implements Serializable {
@Schema(description = "ID")
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_bug.id.not_blank}", groups = {Updated.class})
@Size(min = 1, max = 50, message = "{test_plan_report_bug.id.length_range}", groups = {Created.class, Updated.class})
private String id;
@Schema(description = "报告ID")
@Schema(description = "测试计划报告ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_bug.test_plan_report_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{test_plan_report_bug.test_plan_report_id.length_range}", groups = {Created.class, Updated.class})
private String testPlanReportId;
@Schema(description = "缺陷ID")
@Schema(description = "缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_bug.bug_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{test_plan_report_bug.bug_id.length_range}", groups = {Created.class, Updated.class})
private String bugId;
@Schema(description = "缺陷业务ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{test_plan_report_bug.bug_num.not_blank}", groups = {Created.class})
private Long bugNum;
@Schema(description = "缺陷标题", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_bug.bug_title.not_blank}", groups = {Created.class})
@Size(min = 1, max = 255, message = "{test_plan_report_bug.bug_title.length_range}", groups = {Created.class, Updated.class})
private String bugTitle;
@Schema(description = "缺陷状态")
private String bugStatus;
@Schema(description = "缺陷处理人")
private String bugHandleUser;
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);
bugId("bug_id", "bugId", "VARCHAR", false),
bugNum("bug_num", "bugNum", "BIGINT", false),
bugTitle("bug_title", "bugTitle", "VARCHAR", false),
bugStatus("bug_status", "bugStatus", "VARCHAR", false),
bugHandleUser("bug_handle_user", "bugHandleUser", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";

View File

@ -313,6 +313,276 @@ public class TestPlanReportBugExample {
addCriterion("bug_id not between", value1, value2, "bugId");
return (Criteria) this;
}
public Criteria andBugNumIsNull() {
addCriterion("bug_num is null");
return (Criteria) this;
}
public Criteria andBugNumIsNotNull() {
addCriterion("bug_num is not null");
return (Criteria) this;
}
public Criteria andBugNumEqualTo(Long value) {
addCriterion("bug_num =", value, "bugNum");
return (Criteria) this;
}
public Criteria andBugNumNotEqualTo(Long value) {
addCriterion("bug_num <>", value, "bugNum");
return (Criteria) this;
}
public Criteria andBugNumGreaterThan(Long value) {
addCriterion("bug_num >", value, "bugNum");
return (Criteria) this;
}
public Criteria andBugNumGreaterThanOrEqualTo(Long value) {
addCriterion("bug_num >=", value, "bugNum");
return (Criteria) this;
}
public Criteria andBugNumLessThan(Long value) {
addCriterion("bug_num <", value, "bugNum");
return (Criteria) this;
}
public Criteria andBugNumLessThanOrEqualTo(Long value) {
addCriterion("bug_num <=", value, "bugNum");
return (Criteria) this;
}
public Criteria andBugNumIn(List<Long> values) {
addCriterion("bug_num in", values, "bugNum");
return (Criteria) this;
}
public Criteria andBugNumNotIn(List<Long> values) {
addCriterion("bug_num not in", values, "bugNum");
return (Criteria) this;
}
public Criteria andBugNumBetween(Long value1, Long value2) {
addCriterion("bug_num between", value1, value2, "bugNum");
return (Criteria) this;
}
public Criteria andBugNumNotBetween(Long value1, Long value2) {
addCriterion("bug_num not between", value1, value2, "bugNum");
return (Criteria) this;
}
public Criteria andBugTitleIsNull() {
addCriterion("bug_title is null");
return (Criteria) this;
}
public Criteria andBugTitleIsNotNull() {
addCriterion("bug_title is not null");
return (Criteria) this;
}
public Criteria andBugTitleEqualTo(String value) {
addCriterion("bug_title =", value, "bugTitle");
return (Criteria) this;
}
public Criteria andBugTitleNotEqualTo(String value) {
addCriterion("bug_title <>", value, "bugTitle");
return (Criteria) this;
}
public Criteria andBugTitleGreaterThan(String value) {
addCriterion("bug_title >", value, "bugTitle");
return (Criteria) this;
}
public Criteria andBugTitleGreaterThanOrEqualTo(String value) {
addCriterion("bug_title >=", value, "bugTitle");
return (Criteria) this;
}
public Criteria andBugTitleLessThan(String value) {
addCriterion("bug_title <", value, "bugTitle");
return (Criteria) this;
}
public Criteria andBugTitleLessThanOrEqualTo(String value) {
addCriterion("bug_title <=", value, "bugTitle");
return (Criteria) this;
}
public Criteria andBugTitleLike(String value) {
addCriterion("bug_title like", value, "bugTitle");
return (Criteria) this;
}
public Criteria andBugTitleNotLike(String value) {
addCriterion("bug_title not like", value, "bugTitle");
return (Criteria) this;
}
public Criteria andBugTitleIn(List<String> values) {
addCriterion("bug_title in", values, "bugTitle");
return (Criteria) this;
}
public Criteria andBugTitleNotIn(List<String> values) {
addCriterion("bug_title not in", values, "bugTitle");
return (Criteria) this;
}
public Criteria andBugTitleBetween(String value1, String value2) {
addCriterion("bug_title between", value1, value2, "bugTitle");
return (Criteria) this;
}
public Criteria andBugTitleNotBetween(String value1, String value2) {
addCriterion("bug_title not between", value1, value2, "bugTitle");
return (Criteria) this;
}
public Criteria andBugStatusIsNull() {
addCriterion("bug_status is null");
return (Criteria) this;
}
public Criteria andBugStatusIsNotNull() {
addCriterion("bug_status is not null");
return (Criteria) this;
}
public Criteria andBugStatusEqualTo(String value) {
addCriterion("bug_status =", value, "bugStatus");
return (Criteria) this;
}
public Criteria andBugStatusNotEqualTo(String value) {
addCriterion("bug_status <>", value, "bugStatus");
return (Criteria) this;
}
public Criteria andBugStatusGreaterThan(String value) {
addCriterion("bug_status >", value, "bugStatus");
return (Criteria) this;
}
public Criteria andBugStatusGreaterThanOrEqualTo(String value) {
addCriterion("bug_status >=", value, "bugStatus");
return (Criteria) this;
}
public Criteria andBugStatusLessThan(String value) {
addCriterion("bug_status <", value, "bugStatus");
return (Criteria) this;
}
public Criteria andBugStatusLessThanOrEqualTo(String value) {
addCriterion("bug_status <=", value, "bugStatus");
return (Criteria) this;
}
public Criteria andBugStatusLike(String value) {
addCriterion("bug_status like", value, "bugStatus");
return (Criteria) this;
}
public Criteria andBugStatusNotLike(String value) {
addCriterion("bug_status not like", value, "bugStatus");
return (Criteria) this;
}
public Criteria andBugStatusIn(List<String> values) {
addCriterion("bug_status in", values, "bugStatus");
return (Criteria) this;
}
public Criteria andBugStatusNotIn(List<String> values) {
addCriterion("bug_status not in", values, "bugStatus");
return (Criteria) this;
}
public Criteria andBugStatusBetween(String value1, String value2) {
addCriterion("bug_status between", value1, value2, "bugStatus");
return (Criteria) this;
}
public Criteria andBugStatusNotBetween(String value1, String value2) {
addCriterion("bug_status not between", value1, value2, "bugStatus");
return (Criteria) this;
}
public Criteria andBugHandleUserIsNull() {
addCriterion("bug_handle_user is null");
return (Criteria) this;
}
public Criteria andBugHandleUserIsNotNull() {
addCriterion("bug_handle_user is not null");
return (Criteria) this;
}
public Criteria andBugHandleUserEqualTo(String value) {
addCriterion("bug_handle_user =", value, "bugHandleUser");
return (Criteria) this;
}
public Criteria andBugHandleUserNotEqualTo(String value) {
addCriterion("bug_handle_user <>", value, "bugHandleUser");
return (Criteria) this;
}
public Criteria andBugHandleUserGreaterThan(String value) {
addCriterion("bug_handle_user >", value, "bugHandleUser");
return (Criteria) this;
}
public Criteria andBugHandleUserGreaterThanOrEqualTo(String value) {
addCriterion("bug_handle_user >=", value, "bugHandleUser");
return (Criteria) this;
}
public Criteria andBugHandleUserLessThan(String value) {
addCriterion("bug_handle_user <", value, "bugHandleUser");
return (Criteria) this;
}
public Criteria andBugHandleUserLessThanOrEqualTo(String value) {
addCriterion("bug_handle_user <=", value, "bugHandleUser");
return (Criteria) this;
}
public Criteria andBugHandleUserLike(String value) {
addCriterion("bug_handle_user like", value, "bugHandleUser");
return (Criteria) this;
}
public Criteria andBugHandleUserNotLike(String value) {
addCriterion("bug_handle_user not like", value, "bugHandleUser");
return (Criteria) this;
}
public Criteria andBugHandleUserIn(List<String> values) {
addCriterion("bug_handle_user in", values, "bugHandleUser");
return (Criteria) this;
}
public Criteria andBugHandleUserNotIn(List<String> values) {
addCriterion("bug_handle_user not in", values, "bugHandleUser");
return (Criteria) this;
}
public Criteria andBugHandleUserBetween(String value1, String value2) {
addCriterion("bug_handle_user between", value1, value2, "bugHandleUser");
return (Criteria) this;
}
public Criteria andBugHandleUserNotBetween(String value1, String value2) {
addCriterion("bug_handle_user not between", value1, value2, "bugHandleUser");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -4,6 +4,7 @@ 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;
@ -33,10 +34,31 @@ public class TestPlanReportFunctionCase implements Serializable {
@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 = "功能用例业务ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{test_plan_report_function_case.function_case_num.not_blank}", groups = {Created.class})
private Long functionCaseNum;
@Schema(description = "功能用例名称", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_function_case.function_case_name.not_blank}", groups = {Created.class})
@Size(min = 1, max = 255, message = "{test_plan_report_function_case.function_case_name.length_range}", groups = {Created.class, Updated.class})
private String functionCaseName;
@Schema(description = "功能用例所属模块")
private String functionCaseModule;
@Schema(description = "功能用例用例等级")
private String functionCasePriority;
@Schema(description = "功能用例执行人")
private String functionCaseExecuteUser;
@Schema(description = "功能用例关联缺陷数")
private String functionCaseBugCount;
@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;
@NotBlank(message = "{test_plan_report_function_case.function_case_execute_result.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{test_plan_report_function_case.function_case_execute_result.length_range}", groups = {Created.class, Updated.class})
private String functionCaseExecuteResult;
private static final long serialVersionUID = 1L;
@ -45,7 +67,13 @@ public class TestPlanReportFunctionCase implements Serializable {
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);
functionCaseNum("function_case_num", "functionCaseNum", "BIGINT", false),
functionCaseName("function_case_name", "functionCaseName", "VARCHAR", false),
functionCaseModule("function_case_module", "functionCaseModule", "VARCHAR", false),
functionCasePriority("function_case_priority", "functionCasePriority", "VARCHAR", false),
functionCaseExecuteUser("function_case_execute_user", "functionCaseExecuteUser", "VARCHAR", false),
functionCaseBugCount("function_case_bug_count", "functionCaseBugCount", "VARCHAR", false),
functionCaseExecuteResult("function_case_execute_result", "functionCaseExecuteResult", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";

View File

@ -384,73 +384,483 @@ public class TestPlanReportFunctionCaseExample {
return (Criteria) this;
}
public Criteria andExecuteResultIsNull() {
addCriterion("execute_result is null");
public Criteria andFunctionCaseNumIsNull() {
addCriterion("function_case_num is null");
return (Criteria) this;
}
public Criteria andExecuteResultIsNotNull() {
addCriterion("execute_result is not null");
public Criteria andFunctionCaseNumIsNotNull() {
addCriterion("function_case_num is not null");
return (Criteria) this;
}
public Criteria andExecuteResultEqualTo(String value) {
addCriterion("execute_result =", value, "executeResult");
public Criteria andFunctionCaseNumEqualTo(Long value) {
addCriterion("function_case_num =", value, "functionCaseNum");
return (Criteria) this;
}
public Criteria andExecuteResultNotEqualTo(String value) {
addCriterion("execute_result <>", value, "executeResult");
public Criteria andFunctionCaseNumNotEqualTo(Long value) {
addCriterion("function_case_num <>", value, "functionCaseNum");
return (Criteria) this;
}
public Criteria andExecuteResultGreaterThan(String value) {
addCriterion("execute_result >", value, "executeResult");
public Criteria andFunctionCaseNumGreaterThan(Long value) {
addCriterion("function_case_num >", value, "functionCaseNum");
return (Criteria) this;
}
public Criteria andExecuteResultGreaterThanOrEqualTo(String value) {
addCriterion("execute_result >=", value, "executeResult");
public Criteria andFunctionCaseNumGreaterThanOrEqualTo(Long value) {
addCriterion("function_case_num >=", value, "functionCaseNum");
return (Criteria) this;
}
public Criteria andExecuteResultLessThan(String value) {
addCriterion("execute_result <", value, "executeResult");
public Criteria andFunctionCaseNumLessThan(Long value) {
addCriterion("function_case_num <", value, "functionCaseNum");
return (Criteria) this;
}
public Criteria andExecuteResultLessThanOrEqualTo(String value) {
addCriterion("execute_result <=", value, "executeResult");
public Criteria andFunctionCaseNumLessThanOrEqualTo(Long value) {
addCriterion("function_case_num <=", value, "functionCaseNum");
return (Criteria) this;
}
public Criteria andExecuteResultLike(String value) {
addCriterion("execute_result like", value, "executeResult");
public Criteria andFunctionCaseNumIn(List<Long> values) {
addCriterion("function_case_num in", values, "functionCaseNum");
return (Criteria) this;
}
public Criteria andExecuteResultNotLike(String value) {
addCriterion("execute_result not like", value, "executeResult");
public Criteria andFunctionCaseNumNotIn(List<Long> values) {
addCriterion("function_case_num not in", values, "functionCaseNum");
return (Criteria) this;
}
public Criteria andExecuteResultIn(List<String> values) {
addCriterion("execute_result in", values, "executeResult");
public Criteria andFunctionCaseNumBetween(Long value1, Long value2) {
addCriterion("function_case_num between", value1, value2, "functionCaseNum");
return (Criteria) this;
}
public Criteria andExecuteResultNotIn(List<String> values) {
addCriterion("execute_result not in", values, "executeResult");
public Criteria andFunctionCaseNumNotBetween(Long value1, Long value2) {
addCriterion("function_case_num not between", value1, value2, "functionCaseNum");
return (Criteria) this;
}
public Criteria andExecuteResultBetween(String value1, String value2) {
addCriterion("execute_result between", value1, value2, "executeResult");
public Criteria andFunctionCaseNameIsNull() {
addCriterion("function_case_name is null");
return (Criteria) this;
}
public Criteria andExecuteResultNotBetween(String value1, String value2) {
addCriterion("execute_result not between", value1, value2, "executeResult");
public Criteria andFunctionCaseNameIsNotNull() {
addCriterion("function_case_name is not null");
return (Criteria) this;
}
public Criteria andFunctionCaseNameEqualTo(String value) {
addCriterion("function_case_name =", value, "functionCaseName");
return (Criteria) this;
}
public Criteria andFunctionCaseNameNotEqualTo(String value) {
addCriterion("function_case_name <>", value, "functionCaseName");
return (Criteria) this;
}
public Criteria andFunctionCaseNameGreaterThan(String value) {
addCriterion("function_case_name >", value, "functionCaseName");
return (Criteria) this;
}
public Criteria andFunctionCaseNameGreaterThanOrEqualTo(String value) {
addCriterion("function_case_name >=", value, "functionCaseName");
return (Criteria) this;
}
public Criteria andFunctionCaseNameLessThan(String value) {
addCriterion("function_case_name <", value, "functionCaseName");
return (Criteria) this;
}
public Criteria andFunctionCaseNameLessThanOrEqualTo(String value) {
addCriterion("function_case_name <=", value, "functionCaseName");
return (Criteria) this;
}
public Criteria andFunctionCaseNameLike(String value) {
addCriterion("function_case_name like", value, "functionCaseName");
return (Criteria) this;
}
public Criteria andFunctionCaseNameNotLike(String value) {
addCriterion("function_case_name not like", value, "functionCaseName");
return (Criteria) this;
}
public Criteria andFunctionCaseNameIn(List<String> values) {
addCriterion("function_case_name in", values, "functionCaseName");
return (Criteria) this;
}
public Criteria andFunctionCaseNameNotIn(List<String> values) {
addCriterion("function_case_name not in", values, "functionCaseName");
return (Criteria) this;
}
public Criteria andFunctionCaseNameBetween(String value1, String value2) {
addCriterion("function_case_name between", value1, value2, "functionCaseName");
return (Criteria) this;
}
public Criteria andFunctionCaseNameNotBetween(String value1, String value2) {
addCriterion("function_case_name not between", value1, value2, "functionCaseName");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleIsNull() {
addCriterion("function_case_module is null");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleIsNotNull() {
addCriterion("function_case_module is not null");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleEqualTo(String value) {
addCriterion("function_case_module =", value, "functionCaseModule");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleNotEqualTo(String value) {
addCriterion("function_case_module <>", value, "functionCaseModule");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleGreaterThan(String value) {
addCriterion("function_case_module >", value, "functionCaseModule");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleGreaterThanOrEqualTo(String value) {
addCriterion("function_case_module >=", value, "functionCaseModule");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleLessThan(String value) {
addCriterion("function_case_module <", value, "functionCaseModule");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleLessThanOrEqualTo(String value) {
addCriterion("function_case_module <=", value, "functionCaseModule");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleLike(String value) {
addCriterion("function_case_module like", value, "functionCaseModule");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleNotLike(String value) {
addCriterion("function_case_module not like", value, "functionCaseModule");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleIn(List<String> values) {
addCriterion("function_case_module in", values, "functionCaseModule");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleNotIn(List<String> values) {
addCriterion("function_case_module not in", values, "functionCaseModule");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleBetween(String value1, String value2) {
addCriterion("function_case_module between", value1, value2, "functionCaseModule");
return (Criteria) this;
}
public Criteria andFunctionCaseModuleNotBetween(String value1, String value2) {
addCriterion("function_case_module not between", value1, value2, "functionCaseModule");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityIsNull() {
addCriterion("function_case_priority is null");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityIsNotNull() {
addCriterion("function_case_priority is not null");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityEqualTo(String value) {
addCriterion("function_case_priority =", value, "functionCasePriority");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityNotEqualTo(String value) {
addCriterion("function_case_priority <>", value, "functionCasePriority");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityGreaterThan(String value) {
addCriterion("function_case_priority >", value, "functionCasePriority");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityGreaterThanOrEqualTo(String value) {
addCriterion("function_case_priority >=", value, "functionCasePriority");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityLessThan(String value) {
addCriterion("function_case_priority <", value, "functionCasePriority");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityLessThanOrEqualTo(String value) {
addCriterion("function_case_priority <=", value, "functionCasePriority");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityLike(String value) {
addCriterion("function_case_priority like", value, "functionCasePriority");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityNotLike(String value) {
addCriterion("function_case_priority not like", value, "functionCasePriority");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityIn(List<String> values) {
addCriterion("function_case_priority in", values, "functionCasePriority");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityNotIn(List<String> values) {
addCriterion("function_case_priority not in", values, "functionCasePriority");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityBetween(String value1, String value2) {
addCriterion("function_case_priority between", value1, value2, "functionCasePriority");
return (Criteria) this;
}
public Criteria andFunctionCasePriorityNotBetween(String value1, String value2) {
addCriterion("function_case_priority not between", value1, value2, "functionCasePriority");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserIsNull() {
addCriterion("function_case_execute_user is null");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserIsNotNull() {
addCriterion("function_case_execute_user is not null");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserEqualTo(String value) {
addCriterion("function_case_execute_user =", value, "functionCaseExecuteUser");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserNotEqualTo(String value) {
addCriterion("function_case_execute_user <>", value, "functionCaseExecuteUser");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserGreaterThan(String value) {
addCriterion("function_case_execute_user >", value, "functionCaseExecuteUser");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserGreaterThanOrEqualTo(String value) {
addCriterion("function_case_execute_user >=", value, "functionCaseExecuteUser");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserLessThan(String value) {
addCriterion("function_case_execute_user <", value, "functionCaseExecuteUser");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserLessThanOrEqualTo(String value) {
addCriterion("function_case_execute_user <=", value, "functionCaseExecuteUser");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserLike(String value) {
addCriterion("function_case_execute_user like", value, "functionCaseExecuteUser");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserNotLike(String value) {
addCriterion("function_case_execute_user not like", value, "functionCaseExecuteUser");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserIn(List<String> values) {
addCriterion("function_case_execute_user in", values, "functionCaseExecuteUser");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserNotIn(List<String> values) {
addCriterion("function_case_execute_user not in", values, "functionCaseExecuteUser");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserBetween(String value1, String value2) {
addCriterion("function_case_execute_user between", value1, value2, "functionCaseExecuteUser");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteUserNotBetween(String value1, String value2) {
addCriterion("function_case_execute_user not between", value1, value2, "functionCaseExecuteUser");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountIsNull() {
addCriterion("function_case_bug_count is null");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountIsNotNull() {
addCriterion("function_case_bug_count is not null");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountEqualTo(String value) {
addCriterion("function_case_bug_count =", value, "functionCaseBugCount");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountNotEqualTo(String value) {
addCriterion("function_case_bug_count <>", value, "functionCaseBugCount");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountGreaterThan(String value) {
addCriterion("function_case_bug_count >", value, "functionCaseBugCount");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountGreaterThanOrEqualTo(String value) {
addCriterion("function_case_bug_count >=", value, "functionCaseBugCount");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountLessThan(String value) {
addCriterion("function_case_bug_count <", value, "functionCaseBugCount");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountLessThanOrEqualTo(String value) {
addCriterion("function_case_bug_count <=", value, "functionCaseBugCount");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountLike(String value) {
addCriterion("function_case_bug_count like", value, "functionCaseBugCount");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountNotLike(String value) {
addCriterion("function_case_bug_count not like", value, "functionCaseBugCount");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountIn(List<String> values) {
addCriterion("function_case_bug_count in", values, "functionCaseBugCount");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountNotIn(List<String> values) {
addCriterion("function_case_bug_count not in", values, "functionCaseBugCount");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountBetween(String value1, String value2) {
addCriterion("function_case_bug_count between", value1, value2, "functionCaseBugCount");
return (Criteria) this;
}
public Criteria andFunctionCaseBugCountNotBetween(String value1, String value2) {
addCriterion("function_case_bug_count not between", value1, value2, "functionCaseBugCount");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultIsNull() {
addCriterion("function_case_execute_result is null");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultIsNotNull() {
addCriterion("function_case_execute_result is not null");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultEqualTo(String value) {
addCriterion("function_case_execute_result =", value, "functionCaseExecuteResult");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultNotEqualTo(String value) {
addCriterion("function_case_execute_result <>", value, "functionCaseExecuteResult");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultGreaterThan(String value) {
addCriterion("function_case_execute_result >", value, "functionCaseExecuteResult");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultGreaterThanOrEqualTo(String value) {
addCriterion("function_case_execute_result >=", value, "functionCaseExecuteResult");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultLessThan(String value) {
addCriterion("function_case_execute_result <", value, "functionCaseExecuteResult");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultLessThanOrEqualTo(String value) {
addCriterion("function_case_execute_result <=", value, "functionCaseExecuteResult");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultLike(String value) {
addCriterion("function_case_execute_result like", value, "functionCaseExecuteResult");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultNotLike(String value) {
addCriterion("function_case_execute_result not like", value, "functionCaseExecuteResult");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultIn(List<String> values) {
addCriterion("function_case_execute_result in", values, "functionCaseExecuteResult");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultNotIn(List<String> values) {
addCriterion("function_case_execute_result not in", values, "functionCaseExecuteResult");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultBetween(String value1, String value2) {
addCriterion("function_case_execute_result between", value1, value2, "functionCaseExecuteResult");
return (Criteria) this;
}
public Criteria andFunctionCaseExecuteResultNotBetween(String value1, String value2) {
addCriterion("function_case_execute_result not between", value1, value2, "functionCaseExecuteResult");
return (Criteria) this;
}
}

View File

@ -11,16 +11,24 @@ public interface TestPlanReportBugMapper {
int deleteByExample(TestPlanReportBugExample example);
int deleteByPrimaryKey(String id);
int insert(TestPlanReportBug record);
int insertSelective(TestPlanReportBug record);
List<TestPlanReportBug> selectByExample(TestPlanReportBugExample example);
TestPlanReportBug selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") TestPlanReportBug record, @Param("example") TestPlanReportBugExample example);
int updateByExample(@Param("record") TestPlanReportBug record, @Param("example") TestPlanReportBugExample example);
int updateByPrimaryKeySelective(TestPlanReportBug record);
int updateByPrimaryKey(TestPlanReportBug record);
int batchInsert(@Param("list") List<TestPlanReportBug> list);
int batchInsertSelective(@Param("list") List<TestPlanReportBug> list, @Param("selective") TestPlanReportBug.Column ... selective);

View File

@ -2,9 +2,13 @@
<!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" />
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="test_plan_report_id" jdbcType="VARCHAR" property="testPlanReportId" />
<result column="bug_id" jdbcType="VARCHAR" property="bugId" />
<result column="bug_num" jdbcType="BIGINT" property="bugNum" />
<result column="bug_title" jdbcType="VARCHAR" property="bugTitle" />
<result column="bug_status" jdbcType="VARCHAR" property="bugStatus" />
<result column="bug_handle_user" jdbcType="VARCHAR" property="bugHandleUser" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -65,7 +69,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, test_plan_report_id, bug_id
id, test_plan_report_id, bug_id, bug_num, bug_title, bug_status, bug_handle_user
</sql>
<select id="selectByExample" parameterType="io.metersphere.plan.domain.TestPlanReportBugExample" resultMap="BaseResultMap">
select
@ -81,6 +85,16 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from test_plan_report_bug
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from test_plan_report_bug
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.plan.domain.TestPlanReportBugExample">
delete from test_plan_report_bug
<if test="_parameter != null">
@ -88,10 +102,12 @@
</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 into test_plan_report_bug (id, test_plan_report_id, bug_id,
bug_num, bug_title, bug_status,
bug_handle_user)
values (#{id,jdbcType=VARCHAR}, #{testPlanReportId,jdbcType=VARCHAR}, #{bugId,jdbcType=VARCHAR},
#{bugNum,jdbcType=BIGINT}, #{bugTitle,jdbcType=VARCHAR}, #{bugStatus,jdbcType=VARCHAR},
#{bugHandleUser,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.plan.domain.TestPlanReportBug">
insert into test_plan_report_bug
@ -105,6 +121,18 @@
<if test="bugId != null">
bug_id,
</if>
<if test="bugNum != null">
bug_num,
</if>
<if test="bugTitle != null">
bug_title,
</if>
<if test="bugStatus != null">
bug_status,
</if>
<if test="bugHandleUser != null">
bug_handle_user,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -116,6 +144,18 @@
<if test="bugId != null">
#{bugId,jdbcType=VARCHAR},
</if>
<if test="bugNum != null">
#{bugNum,jdbcType=BIGINT},
</if>
<if test="bugTitle != null">
#{bugTitle,jdbcType=VARCHAR},
</if>
<if test="bugStatus != null">
#{bugStatus,jdbcType=VARCHAR},
</if>
<if test="bugHandleUser != null">
#{bugHandleUser,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.plan.domain.TestPlanReportBugExample" resultType="java.lang.Long">
@ -136,6 +176,18 @@
<if test="record.bugId != null">
bug_id = #{record.bugId,jdbcType=VARCHAR},
</if>
<if test="record.bugNum != null">
bug_num = #{record.bugNum,jdbcType=BIGINT},
</if>
<if test="record.bugTitle != null">
bug_title = #{record.bugTitle,jdbcType=VARCHAR},
</if>
<if test="record.bugStatus != null">
bug_status = #{record.bugStatus,jdbcType=VARCHAR},
</if>
<if test="record.bugHandleUser != null">
bug_handle_user = #{record.bugHandleUser,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -145,18 +197,58 @@
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}
bug_id = #{record.bugId,jdbcType=VARCHAR},
bug_num = #{record.bugNum,jdbcType=BIGINT},
bug_title = #{record.bugTitle,jdbcType=VARCHAR},
bug_status = #{record.bugStatus,jdbcType=VARCHAR},
bug_handle_user = #{record.bugHandleUser,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.plan.domain.TestPlanReportBug">
update test_plan_report_bug
<set>
<if test="testPlanReportId != null">
test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR},
</if>
<if test="bugId != null">
bug_id = #{bugId,jdbcType=VARCHAR},
</if>
<if test="bugNum != null">
bug_num = #{bugNum,jdbcType=BIGINT},
</if>
<if test="bugTitle != null">
bug_title = #{bugTitle,jdbcType=VARCHAR},
</if>
<if test="bugStatus != null">
bug_status = #{bugStatus,jdbcType=VARCHAR},
</if>
<if test="bugHandleUser != null">
bug_handle_user = #{bugHandleUser,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.plan.domain.TestPlanReportBug">
update test_plan_report_bug
set test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR},
bug_id = #{bugId,jdbcType=VARCHAR},
bug_num = #{bugNum,jdbcType=BIGINT},
bug_title = #{bugTitle,jdbcType=VARCHAR},
bug_status = #{bugStatus,jdbcType=VARCHAR},
bug_handle_user = #{bugHandleUser,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into test_plan_report_bug
(id, test_plan_report_id, bug_id)
(id, test_plan_report_id, bug_id, bug_num, bug_title, bug_status, bug_handle_user
)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.testPlanReportId,jdbcType=VARCHAR}, #{item.bugId,jdbcType=VARCHAR}
)
(#{item.id,jdbcType=VARCHAR}, #{item.testPlanReportId,jdbcType=VARCHAR}, #{item.bugId,jdbcType=VARCHAR},
#{item.bugNum,jdbcType=BIGINT}, #{item.bugTitle,jdbcType=VARCHAR}, #{item.bugStatus,jdbcType=VARCHAR},
#{item.bugHandleUser,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
@ -178,6 +270,18 @@
<if test="'bug_id'.toString() == column.value">
#{item.bugId,jdbcType=VARCHAR}
</if>
<if test="'bug_num'.toString() == column.value">
#{item.bugNum,jdbcType=BIGINT}
</if>
<if test="'bug_title'.toString() == column.value">
#{item.bugTitle,jdbcType=VARCHAR}
</if>
<if test="'bug_status'.toString() == column.value">
#{item.bugStatus,jdbcType=VARCHAR}
</if>
<if test="'bug_handle_user'.toString() == column.value">
#{item.bugHandleUser,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>

View File

@ -6,7 +6,13 @@
<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" />
<result column="function_case_num" jdbcType="BIGINT" property="functionCaseNum" />
<result column="function_case_name" jdbcType="VARCHAR" property="functionCaseName" />
<result column="function_case_module" jdbcType="VARCHAR" property="functionCaseModule" />
<result column="function_case_priority" jdbcType="VARCHAR" property="functionCasePriority" />
<result column="function_case_execute_user" jdbcType="VARCHAR" property="functionCaseExecuteUser" />
<result column="function_case_bug_count" jdbcType="VARCHAR" property="functionCaseBugCount" />
<result column="function_case_execute_result" jdbcType="VARCHAR" property="functionCaseExecuteResult" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -67,7 +73,9 @@
</where>
</sql>
<sql id="Base_Column_List">
id, test_plan_report_id, test_plan_function_case_id, function_case_id, execute_result
id, test_plan_report_id, test_plan_function_case_id, function_case_id, function_case_num,
function_case_name, function_case_module, function_case_priority, function_case_execute_user,
function_case_bug_count, function_case_execute_result
</sql>
<select id="selectByExample" parameterType="io.metersphere.plan.domain.TestPlanReportFunctionCaseExample" resultMap="BaseResultMap">
select
@ -101,9 +109,15 @@
</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)
function_case_id, function_case_num, function_case_name,
function_case_module, function_case_priority,
function_case_execute_user, function_case_bug_count,
function_case_execute_result)
values (#{id,jdbcType=VARCHAR}, #{testPlanReportId,jdbcType=VARCHAR}, #{testPlanFunctionCaseId,jdbcType=VARCHAR},
#{functionCaseId,jdbcType=VARCHAR}, #{executeResult,jdbcType=VARCHAR})
#{functionCaseId,jdbcType=VARCHAR}, #{functionCaseNum,jdbcType=BIGINT}, #{functionCaseName,jdbcType=VARCHAR},
#{functionCaseModule,jdbcType=VARCHAR}, #{functionCasePriority,jdbcType=VARCHAR},
#{functionCaseExecuteUser,jdbcType=VARCHAR}, #{functionCaseBugCount,jdbcType=VARCHAR},
#{functionCaseExecuteResult,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.plan.domain.TestPlanReportFunctionCase">
insert into test_plan_report_function_case
@ -120,8 +134,26 @@
<if test="functionCaseId != null">
function_case_id,
</if>
<if test="executeResult != null">
execute_result,
<if test="functionCaseNum != null">
function_case_num,
</if>
<if test="functionCaseName != null">
function_case_name,
</if>
<if test="functionCaseModule != null">
function_case_module,
</if>
<if test="functionCasePriority != null">
function_case_priority,
</if>
<if test="functionCaseExecuteUser != null">
function_case_execute_user,
</if>
<if test="functionCaseBugCount != null">
function_case_bug_count,
</if>
<if test="functionCaseExecuteResult != null">
function_case_execute_result,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -137,8 +169,26 @@
<if test="functionCaseId != null">
#{functionCaseId,jdbcType=VARCHAR},
</if>
<if test="executeResult != null">
#{executeResult,jdbcType=VARCHAR},
<if test="functionCaseNum != null">
#{functionCaseNum,jdbcType=BIGINT},
</if>
<if test="functionCaseName != null">
#{functionCaseName,jdbcType=VARCHAR},
</if>
<if test="functionCaseModule != null">
#{functionCaseModule,jdbcType=VARCHAR},
</if>
<if test="functionCasePriority != null">
#{functionCasePriority,jdbcType=VARCHAR},
</if>
<if test="functionCaseExecuteUser != null">
#{functionCaseExecuteUser,jdbcType=VARCHAR},
</if>
<if test="functionCaseBugCount != null">
#{functionCaseBugCount,jdbcType=VARCHAR},
</if>
<if test="functionCaseExecuteResult != null">
#{functionCaseExecuteResult,jdbcType=VARCHAR},
</if>
</trim>
</insert>
@ -163,8 +213,26 @@
<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 test="record.functionCaseNum != null">
function_case_num = #{record.functionCaseNum,jdbcType=BIGINT},
</if>
<if test="record.functionCaseName != null">
function_case_name = #{record.functionCaseName,jdbcType=VARCHAR},
</if>
<if test="record.functionCaseModule != null">
function_case_module = #{record.functionCaseModule,jdbcType=VARCHAR},
</if>
<if test="record.functionCasePriority != null">
function_case_priority = #{record.functionCasePriority,jdbcType=VARCHAR},
</if>
<if test="record.functionCaseExecuteUser != null">
function_case_execute_user = #{record.functionCaseExecuteUser,jdbcType=VARCHAR},
</if>
<if test="record.functionCaseBugCount != null">
function_case_bug_count = #{record.functionCaseBugCount,jdbcType=VARCHAR},
</if>
<if test="record.functionCaseExecuteResult != null">
function_case_execute_result = #{record.functionCaseExecuteResult,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
@ -177,7 +245,13 @@
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}
function_case_num = #{record.functionCaseNum,jdbcType=BIGINT},
function_case_name = #{record.functionCaseName,jdbcType=VARCHAR},
function_case_module = #{record.functionCaseModule,jdbcType=VARCHAR},
function_case_priority = #{record.functionCasePriority,jdbcType=VARCHAR},
function_case_execute_user = #{record.functionCaseExecuteUser,jdbcType=VARCHAR},
function_case_bug_count = #{record.functionCaseBugCount,jdbcType=VARCHAR},
function_case_execute_result = #{record.functionCaseExecuteResult,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -194,8 +268,26 @@
<if test="functionCaseId != null">
function_case_id = #{functionCaseId,jdbcType=VARCHAR},
</if>
<if test="executeResult != null">
execute_result = #{executeResult,jdbcType=VARCHAR},
<if test="functionCaseNum != null">
function_case_num = #{functionCaseNum,jdbcType=BIGINT},
</if>
<if test="functionCaseName != null">
function_case_name = #{functionCaseName,jdbcType=VARCHAR},
</if>
<if test="functionCaseModule != null">
function_case_module = #{functionCaseModule,jdbcType=VARCHAR},
</if>
<if test="functionCasePriority != null">
function_case_priority = #{functionCasePriority,jdbcType=VARCHAR},
</if>
<if test="functionCaseExecuteUser != null">
function_case_execute_user = #{functionCaseExecuteUser,jdbcType=VARCHAR},
</if>
<if test="functionCaseBugCount != null">
function_case_bug_count = #{functionCaseBugCount,jdbcType=VARCHAR},
</if>
<if test="functionCaseExecuteResult != null">
function_case_execute_result = #{functionCaseExecuteResult,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
@ -205,17 +297,27 @@
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}
function_case_num = #{functionCaseNum,jdbcType=BIGINT},
function_case_name = #{functionCaseName,jdbcType=VARCHAR},
function_case_module = #{functionCaseModule,jdbcType=VARCHAR},
function_case_priority = #{functionCasePriority,jdbcType=VARCHAR},
function_case_execute_user = #{functionCaseExecuteUser,jdbcType=VARCHAR},
function_case_bug_count = #{functionCaseBugCount,jdbcType=VARCHAR},
function_case_execute_result = #{functionCaseExecuteResult,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
)
(id, test_plan_report_id, test_plan_function_case_id, function_case_id, function_case_num,
function_case_name, function_case_module, function_case_priority, function_case_execute_user,
function_case_bug_count, function_case_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}
#{item.functionCaseId,jdbcType=VARCHAR}, #{item.functionCaseNum,jdbcType=BIGINT},
#{item.functionCaseName,jdbcType=VARCHAR}, #{item.functionCaseModule,jdbcType=VARCHAR},
#{item.functionCasePriority,jdbcType=VARCHAR}, #{item.functionCaseExecuteUser,jdbcType=VARCHAR},
#{item.functionCaseBugCount,jdbcType=VARCHAR}, #{item.functionCaseExecuteResult,jdbcType=VARCHAR}
)
</foreach>
</insert>
@ -241,8 +343,26 @@
<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 test="'function_case_num'.toString() == column.value">
#{item.functionCaseNum,jdbcType=BIGINT}
</if>
<if test="'function_case_name'.toString() == column.value">
#{item.functionCaseName,jdbcType=VARCHAR}
</if>
<if test="'function_case_module'.toString() == column.value">
#{item.functionCaseModule,jdbcType=VARCHAR}
</if>
<if test="'function_case_priority'.toString() == column.value">
#{item.functionCasePriority,jdbcType=VARCHAR}
</if>
<if test="'function_case_execute_user'.toString() == column.value">
#{item.functionCaseExecuteUser,jdbcType=VARCHAR}
</if>
<if test="'function_case_bug_count'.toString() == column.value">
#{item.functionCaseBugCount,jdbcType=VARCHAR}
</if>
<if test="'function_case_execute_result'.toString() == column.value">
#{item.functionCaseExecuteResult,jdbcType=VARCHAR}
</if>
</foreach>
)

View File

@ -115,9 +115,15 @@ CREATE UNIQUE INDEX idx_test_plan_report_id ON test_plan_report_summary(test_pla
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' ,
`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 '执行结果' ,
`function_case_num` BIGINT NOT NULL COMMENT '功能用例业务ID' ,
`function_case_name` VARCHAR(255) NOT NULL COMMENT '功能用例名称' ,
`function_case_module` VARCHAR(255) COMMENT '功能用例所属模块' ,
`function_case_priority` VARCHAR(50) COMMENT '功能用例用例等级' ,
`function_case_execute_user` VARCHAR(50) COMMENT '功能用例执行人' ,
`function_case_bug_count` VARCHAR(255) COMMENT '功能用例关联缺陷数' ,
`function_case_execute_result` VARCHAR(50) NOT NULL COMMENT '执行结果' ,
PRIMARY KEY (id)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试计划报告内容功能用例部分';
@ -127,6 +133,10 @@ CREATE TABLE IF NOT EXISTS test_plan_report_bug(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`test_plan_report_id` VARCHAR(50) NOT NULL COMMENT '测试计划报告ID' ,
`bug_id` VARCHAR(50) NOT NULL COMMENT '缺陷ID' ,
`bug_num` BIGINT NOT NULL COMMENT '缺陷业务ID' ,
`bug_title` VARCHAR(255) NOT NULL COMMENT '缺陷标题' ,
`bug_status` VARCHAR(50) COMMENT '缺陷状态' ,
`bug_handle_user` VARCHAR(50) COMMENT '缺陷处理人' ,
PRIMARY KEY (id)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试计划报告内容缺陷部分';

View File

@ -3,13 +3,10 @@ package io.metersphere.plan.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.bug.dto.response.BugDTO;
import io.metersphere.functional.dto.FunctionalCasePageDTO;
import io.metersphere.plan.constants.TestPlanResourceConfig;
import io.metersphere.plan.domain.TestPlanReport;
import io.metersphere.plan.dto.request.TestPlanReportBatchRequest;
import io.metersphere.plan.dto.request.TestPlanReportDetailPageRequest;
import io.metersphere.plan.dto.request.TestPlanReportGenRequest;
import io.metersphere.plan.dto.request.TestPlanReportPageRequest;
import io.metersphere.plan.dto.ReportDetailCasePageDTO;
import io.metersphere.plan.dto.request.*;
import io.metersphere.plan.dto.response.TestPlanReportDetailResponse;
import io.metersphere.plan.dto.response.TestPlanReportPageResponse;
import io.metersphere.plan.service.TestPlanManagementService;
@ -92,6 +89,8 @@ public class TestPlanReportController {
return testPlanReportService.genReportByManual(request, SessionUtils.getUserId());
}
// 报告详情开始
@GetMapping("/get/{id}")
@Operation(summary = "测试计划-报告-详情")
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ)
@ -100,13 +99,21 @@ public class TestPlanReportController {
return testPlanReportService.getReport(id);
}
@PostMapping("/edit")
@Operation(summary = "测试计划-报告-详情-报告内容更新")
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ_UPDATE)
@CheckOwner(resourceId = "#request.getId()", resourceType = "test_plan_report")
public TestPlanReportDetailResponse edit(@Validated @RequestBody TestPlanReportDetailEditRequest request) {
return testPlanReportService.edit(request);
}
@PostMapping("/detail/bug/page")
@Operation(summary = "测试计划-报告-详情-缺陷分页查询")
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ)
@CheckOwner(resourceId = "#request.getReportId()", resourceType = "test_plan_report")
public Pager<List<BugDTO>> pageBug(@Validated @RequestBody TestPlanReportDetailPageRequest request) {
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "b.num desc");
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tprb.bug_num, tprb.id desc");
return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailBugs(request));
}
@ -114,9 +121,9 @@ public class TestPlanReportController {
@Operation(summary = "测试计划-报告-详情-功能用例分页查询")
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ)
@CheckOwner(resourceId = "#request.getReportId()", resourceType = "test_plan_report")
public Pager<List<FunctionalCasePageDTO>> pageFunctionalCase(@Validated @RequestBody TestPlanReportDetailPageRequest request) {
public Pager<List<ReportDetailCasePageDTO>> pageFunctionalCase(@Validated @RequestBody TestPlanReportDetailPageRequest request) {
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "fc.num desc");
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tprfc.function_case_num, tprfc.id desc");
return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailFunctionalCases(request));
}
}

View File

@ -0,0 +1,46 @@
package io.metersphere.plan.dto;
import lombok.Data;
/**
* 报告详情用例分页返回对象 (功能, 接口, 场景)
*/
@Data
public class ReportDetailCasePageDTO {
// ID用例名称所属模块用例等级执行人执行结果缺陷数
/**
* 用例ID
*/
private String id;
/**
* 用例业务ID
*/
private Long num;
/**
* 用例名称
*/
private String name;
/**
* 所属模块
*/
private String moduleName;
/**
* 用例等级
*/
private String priority;
/**
* 执行结果
*/
private String executeResult;
/**
* 执行人
*/
private String executeUser;
/**
* 缺陷数
*/
private Long bugCount;
}

View File

@ -0,0 +1,16 @@
package io.metersphere.plan.dto.request;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
@Data
public class TestPlanReportDetailEditRequest {
@Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan_report_id.not_blank}")
private String id;
@Schema(description = "报告内容")
private String summary;
}

View File

@ -13,8 +13,4 @@ public class TestPlanReportDetailPageRequest extends BasePageRequest {
@Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan.report_id.not_blank}")
private String reportId;
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_plan.report_id.not_blank}")
private String projectId;
}

View File

@ -16,6 +16,8 @@ public class TestPlanReportDetailResponse {
private Long executeTime;
@Schema(description = "报告结束(执行)时间")
private Long ednTime;
@Schema(description = "报告内容")
private String summary;
/**
* 报告分析

View File

@ -0,0 +1,25 @@
package io.metersphere.plan.mapper;
import io.metersphere.bug.dto.response.BugDTO;
import io.metersphere.plan.domain.TestPlanReportBug;
import io.metersphere.plan.dto.request.TestPlanReportDetailPageRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtTestPlanReportBugMapper {
/**
* 获取计划的缺陷集合
* @param planId 计划ID
* @return 缺陷集合
*/
List<TestPlanReportBug> getPlanBugs(@Param("id") String planId);
/**
* 分页查询报告关联的缺陷
* @param request 请求参数
* @return 关联的缺陷集合
*/
List<BugDTO> list(@Param("request") TestPlanReportDetailPageRequest request);
}

View File

@ -0,0 +1,17 @@
<?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.ExtTestPlanReportBugMapper">
<select id="getPlanBugs" resultType="io.metersphere.plan.domain.TestPlanReportBug">
select b.id as bugId, b.num as bugNum, b.title as bugTitle, b.status bugStatus, b.handle_user bugHandleUser
from bug_relation_case brc join bug b
where brc.test_plan_id = #{id}
</select>
<select id="list" resultType="io.metersphere.bug.dto.response.BugDTO">
select distinct tprb.bug_id as id, tprb.bug_num as num, tprb.bug_title as title, tprb.bug_status as status, tprb.bug_handle_user as handleUser
from test_plan_report_bug tprb
where tprb.test_plan_report_id = #{request.reportId}
</select>
</mapper>

View File

@ -0,0 +1,43 @@
package io.metersphere.plan.mapper;
import io.metersphere.plan.domain.TestPlanReportFunctionCase;
import io.metersphere.plan.dto.CaseStatusCountMap;
import io.metersphere.plan.dto.ReportDetailCasePageDTO;
import io.metersphere.plan.dto.request.TestPlanReportDetailPageRequest;
import io.metersphere.plugin.platform.dto.SelectOption;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtTestPlanReportFunctionalCaseMapper {
/**
* 获取计划关联的功能用例
* @param planId 计划ID
* @return 功能用例列表
*/
List<TestPlanReportFunctionCase> getPlanExecuteCases(@Param("id") String planId);
List<SelectOption> getCasePriorityByIds(@Param("ids") List<String> caseIds);
/**
* 统计报告中执行通过的功能用例数量
* @param reportId 报告ID
* @return 用例数量
*/
Long countExecuteSuccessCase(@Param("id") String reportId);
/**
* 统计报告中功能用例执行情况
* @param reportId 报告ID
* @return 用例数量
*/
List<CaseStatusCountMap> countExecuteResult(@Param("id") String reportId);
/**
* 分页查询报告关联的用例
* @param request 请求参数
* @return 关联的用例集合
*/
List<ReportDetailCasePageDTO> list(@Param("request") TestPlanReportDetailPageRequest request);
}

View File

@ -0,0 +1,50 @@
<?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.ExtTestPlanReportFunctionalCaseMapper">
<select id="getPlanExecuteCases" resultType="io.metersphere.plan.domain.TestPlanReportFunctionCase">
select tpfc.id as testPlanFunctionCaseId, fc.id as functionCaseId, fc.num as functionCaseNum, fc.name as functionCaseName,
fcm.name as functionCaseModule, tpfc.execute_user as functionCaseExecuteUser,
count(brc.id) as functionCaseBugCount, ifnull(tpfc.last_exec_result, 'PENDING') as functionCaseExecuteResult
from test_plan_functional_case tpfc join functional_case fc on tpfc.functional_case_id = fc.id
left join functional_case_module fcm on fcm.id = fc.module_id
left join bug_relation_case brc on brc.test_plan_case_id = tpfc.id
where tpfc.test_plan_id = #{id}
</select>
<select id="getCasePriorityByIds" resultType="io.metersphere.plugin.platform.dto.SelectOption">
select distinct
fc.id as value,
fccf.`value` as text
from functional_case fc
left join functional_case_custom_field fccf ON fc.id = fccf.case_id
left join custom_field cf on cf.id = fccf.field_id
left join custom_field_option cfo on cfo.field_id = cf.id
where cf.`name` = 'functional_priority' and fc.id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="countExecuteSuccessCase" resultType="java.lang.Long">
select count(*) from test_plan_report_function_case tprfc
where tprfc.test_plan_report_id = #{id} and tprfc.function_case_execute_result = 'SUCCESS'
</select>
<select id="countExecuteResult" resultType="io.metersphere.plan.dto.CaseStatusCountMap">
select tprfc.function_case_execute_result as status, count(*) as count from test_plan_report_function_case tprfc
where tprfc.test_plan_report_id = #{id}
group by tprfc.function_case_execute_result
</select>
<select id="list" resultType="io.metersphere.plan.dto.ReportDetailCasePageDTO">
<!-- ID、用例名称、所属模块、用例等级、执行人、执行结果、缺陷数 -->
select distinct tprfc.function_case_id as id, tprfc.function_case_num as num, tprfc.function_case_name as name,
tprfc.function_case_module as moduleName, tprfc.function_case_priority as priority,
tprfc.function_case_execute_result as executeResult, tprfc.function_case_execute_user as executeUser,
tprfc.function_case_bug_count as bugCount
from test_plan_report_function_case tprfc
where tprfc.test_plan_report_id = #{request.reportId}
</select>
</mapper>

View File

@ -1,11 +1,7 @@
package io.metersphere.plan.mapper;
import io.metersphere.bug.dto.response.BugDTO;
import io.metersphere.functional.dto.FunctionalCasePageDTO;
import io.metersphere.plan.domain.TestPlanReport;
import io.metersphere.plan.dto.CaseStatusCountMap;
import io.metersphere.plan.dto.request.TestPlanReportBatchRequest;
import io.metersphere.plan.dto.request.TestPlanReportDetailPageRequest;
import io.metersphere.plan.dto.request.TestPlanReportPageRequest;
import io.metersphere.plan.dto.response.TestPlanReportPageResponse;
import io.metersphere.system.dto.sdk.ApiReportMessageDTO;
@ -31,41 +27,13 @@ public interface ExtTestPlanReportMapper {
*/
List<String> getReportBatchIdsByParam(@Param("request") TestPlanReportBatchRequest request);
/**
* 统计报告中执行通过的功能用例数量
* @param reportId 报告ID
* @return 用例数量
*/
Long countExecuteSuccessFunctionalCase(@Param("id") String reportId);
List<TestPlanReport> selectReportByIds(@Param("ids") List<String> ids);
List<ApiReportMessageDTO> getNoticeList(@Param("ids") List<String> subList);
/**
* 统计报告中功能用例执行情况
* @param reportId 报告ID
* @return 用例数量
*/
List<CaseStatusCountMap> countFunctionalCaseExecuteResult(@Param("id") String reportId);
long countReportByTime(@Param("time") long timeMills, @Param("projectId") String projectId);
/**
* 分页查询报告关联的缺陷
* @param request 请求参数
* @return 关联的缺陷集合
*/
List<BugDTO> listReportBugs(@Param("request")TestPlanReportDetailPageRequest request);
List<String> selectReportIdByProjectIdAndTime(@Param("time") long timeMills, @Param("projectId") String projectId);
/**
* 分页查询报告关联的用例
* @param request 请求参数
* @return 关联的用例集合
*/
List<FunctionalCasePageDTO> listReportFunctionalCases(@Param("request")TestPlanReportDetailPageRequest request);
long countReportByTime(@Param("time") long timeMills, @Param("projectId") String projectId);
List<String> selectReportIdByProjectIdAndTime(@Param("time") long timeMills, @Param("projectId") String projectId);
List<String> selectReportIdTestPlanIds(@Param("testPlanIds") List<String> testPlanIds);
List<String> selectReportIdTestPlanIds(@Param("testPlanIds") List<String> testPlanIds);
}

View File

@ -16,29 +16,6 @@
<include refid="queryWhereCondition"/>
</select>
<select id="countExecuteSuccessFunctionalCase" resultType="java.lang.Long">
select count(*) from test_plan_report_function_case tprfc
where tprfc.test_plan_report_id = #{id} and tprfc.execute_result = 'SUCCESS'
</select>
<select id="countFunctionalCaseExecuteResult" resultType="io.metersphere.plan.dto.CaseStatusCountMap">
select execute_result as status, count(*) as count from test_plan_report_function_case
where test_plan_report_id = #{id}
group by execute_result
</select>
<select id="listReportBugs" resultType="io.metersphere.bug.dto.response.BugDTO">
select distinct b.id as id, b.num as num, b.title as title, b.status as status, b.handle_user as handleUser
from test_plan_report_bug tprb inner join bug b on tprb.bug_id = b.id
where tprb.test_plan_report_id = #{request.reportId}
</select>
<select id="listReportFunctionalCases" resultType="io.metersphere.functional.dto.FunctionalCasePageDTO">
select distinct fc.id as id, fc.num as num, fc.name as name, tprfc.execute_result as lastExecuteResult
from test_plan_report_function_case tprfc inner join functional_case fc on tprfc.function_case_id = fc.id
where tprfc.test_plan_report_id = #{request.reportId}
</select>
<select id="selectReportByIds" resultType="io.metersphere.plan.domain.TestPlanReport">
select * from test_plan_report where id in
<foreach collection="ids" item="id" open="(" close=")" separator=",">

View File

@ -1,20 +1,18 @@
package io.metersphere.plan.service;
import io.metersphere.bug.dto.response.BugDTO;
import io.metersphere.bug.mapper.ExtBugRelateCaseMapper;
import io.metersphere.bug.service.BugService;
import io.metersphere.functional.dto.FunctionalCasePageDTO;
import io.metersphere.bug.service.BugCommonService;
import io.metersphere.plan.domain.*;
import io.metersphere.plan.dto.CaseStatusCountMap;
import io.metersphere.plan.dto.ReportDetailCasePageDTO;
import io.metersphere.plan.dto.TestPlanReportGenPreParam;
import io.metersphere.plan.dto.TestPlanReportPostParam;
import io.metersphere.plan.dto.request.TestPlanReportBatchRequest;
import io.metersphere.plan.dto.request.TestPlanReportDetailPageRequest;
import io.metersphere.plan.dto.request.TestPlanReportGenRequest;
import io.metersphere.plan.dto.request.TestPlanReportPageRequest;
import io.metersphere.plan.dto.request.*;
import io.metersphere.plan.dto.response.TestPlanReportDetailResponse;
import io.metersphere.plan.dto.response.TestPlanReportPageResponse;
import io.metersphere.plan.mapper.*;
import io.metersphere.plan.utils.RateCalculateUtils;
import io.metersphere.plugin.platform.dto.SelectOption;
import io.metersphere.sdk.constants.*;
import io.metersphere.sdk.exception.MSException;
import io.metersphere.sdk.util.BeanUtils;
@ -35,7 +33,6 @@ import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionUtils;
import org.springframework.stereotype.Service;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -51,7 +48,7 @@ public class TestPlanReportService {
@Resource
private SqlSessionFactory sqlSessionFactory;
@Resource
private BugService bugService;
private BugCommonService bugCommonService;
@Resource
private TestPlanMapper testPlanMapper;
@Resource
@ -59,18 +56,18 @@ public class TestPlanReportService {
@Resource
private TestPlanReportMapper testPlanReportMapper;
@Resource
private ExtBugRelateCaseMapper extBugRelateCaseMapper;
@Resource
private ExtTestPlanReportMapper extTestPlanReportMapper;
@Resource
private ExtTestPlanReportBugMapper extTestPlanReportBugMapper;
@Resource
private ExtTestPlanReportFunctionalCaseMapper extTestPlanReportFunctionalCaseMapper;
@Resource
private TestPlanReportLogService testPlanReportLogService;
@Resource
private TestPlanReportNoticeService testPlanReportNoticeService;
@Resource
private TestPlanReportSummaryMapper testPlanReportSummaryMapper;
@Resource
private TestPlanFunctionalCaseMapper testPlanFunctionalCaseMapper;
@Resource
private TestPlanReportFunctionCaseMapper testPlanReportFunctionCaseMapper;
@Resource
private TestPlanReportBugMapper testPlanReportBugMapper;
@ -134,7 +131,7 @@ public class TestPlanReportService {
/**
* 清空测试计划报告包括summary
*
* @param reportIdList
* @param reportIdList 报告ID集合
*/
public void cleanAndDeleteReport(List<String> reportIdList) {
if (CollectionUtils.isNotEmpty(reportIdList)) {
@ -233,20 +230,16 @@ public class TestPlanReportService {
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
String reportId = IDGenerator.nextStr();
// 功能用例
List<TestPlanReportFunctionCase> reportFunctionCases = new ArrayList<>();
TestPlanFunctionalCaseExample functionalCaseExample = new TestPlanFunctionalCaseExample();
functionalCaseExample.createCriteria().andTestPlanIdEqualTo(genParam.getTestPlanId());
List<TestPlanFunctionalCase> testPlanFunctionalCases = testPlanFunctionalCaseMapper.selectByExample(functionalCaseExample);
testPlanFunctionalCases.forEach(functionalCase -> {
TestPlanReportFunctionCase reportFunctionCase = new TestPlanReportFunctionCase();
reportFunctionCase.setId(IDGenerator.nextStr());
reportFunctionCase.setTestPlanReportId(reportId);
reportFunctionCase.setFunctionCaseId(functionalCase.getFunctionalCaseId());
reportFunctionCase.setTestPlanFunctionCaseId(functionalCase.getId());
reportFunctionCase.setExecuteResult(functionalCase.getLastExecResult());
reportFunctionCases.add(reportFunctionCase);
});
List<TestPlanReportFunctionCase> reportFunctionCases = extTestPlanReportFunctionalCaseMapper.getPlanExecuteCases(genParam.getTestPlanId());
if (CollectionUtils.isNotEmpty(reportFunctionCases)) {
List<String> ids = reportFunctionCases.stream().map(TestPlanReportFunctionCase::getFunctionCaseId).distinct().toList();
List<SelectOption> options = extTestPlanReportFunctionalCaseMapper.getCasePriorityByIds(ids);
Map<String, String> casePriorityMap = options.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText));
reportFunctionCases.forEach(reportFunctionalCase -> {
reportFunctionalCase.setId(IDGenerator.nextStr());
reportFunctionalCase.setTestPlanReportId(reportId);
reportFunctionalCase.setFunctionCasePriority(casePriorityMap.get(reportFunctionalCase.getFunctionCaseId()));
});
// 插入计划功能用例关联数据 -> 报告内容
TestPlanReportFunctionCaseMapper batchMapper = sqlSession.getMapper(TestPlanReportFunctionCaseMapper.class);
batchMapper.batchInsert(reportFunctionCases);
@ -255,14 +248,19 @@ public class TestPlanReportService {
// TODO: 接口用例, 场景报告内容 (与接口报告是否能一致)
// 计划报告缺陷内容
List<TestPlanReportBug> reportBugs = new ArrayList<>();
List<String> bugIds = extBugRelateCaseMapper.getPlanRelateBugIds(genParam.getTestPlanId());
bugIds.forEach(bugId -> {
TestPlanReportBug reportBug = new TestPlanReportBug();
List<TestPlanReportBug> reportBugs = extTestPlanReportBugMapper.getPlanBugs(genParam.getTestPlanId());
// MS处理人会与第三方的值冲突, 分开查询
List<SelectOption> headerOptions = bugCommonService.getHeaderHandlerOption(genParam.getProjectId());
Map<String, String> headerHandleUserMap = headerOptions.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText));
List<SelectOption> localOptions = bugCommonService.getLocalHandlerOption(genParam.getProjectId());
Map<String, String> localHandleUserMap = localOptions.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText));
Map<String, String> allStatusMap = bugCommonService.getAllStatusMap(genParam.getProjectId());
reportBugs.forEach(reportBug -> {
reportBug.setId(IDGenerator.nextStr());
reportBug.setTestPlanReportId(reportId);
reportBug.setBugId(bugId);
reportBugs.add(reportBug);
reportBug.setBugHandleUser(headerHandleUserMap.containsKey(reportBug.getBugHandleUser()) ?
headerHandleUserMap.get(reportBug.getBugHandleUser()) : localHandleUserMap.get(reportBug.getBugHandleUser()));
reportBug.setBugStatus(allStatusMap.get(reportBug.getBugStatus()));
});
if (CollectionUtils.isNotEmpty(reportBugs)) {
// 插入计划关联用例缺陷数据(去重) -> 报告内容
@ -312,26 +310,16 @@ public class TestPlanReportService {
TestPlanReportSummaryExample example = new TestPlanReportSummaryExample();
example.createCriteria().andTestPlanReportIdEqualTo(postParam.getReportId());
TestPlanReportSummary reportSummary = testPlanReportSummaryMapper.selectByExample(example).get(0);
DecimalFormat rateFormat = new DecimalFormat("#0.0000");
rateFormat.setMinimumFractionDigits(4);
rateFormat.setMaximumFractionDigits(4);
// 通过的功能用例数
// TODO: 接口用例, 场景用例
long functionalCasePassCount = extTestPlanReportMapper.countExecuteSuccessFunctionalCase(postParam.getReportId());
long functionalCasePassCount = extTestPlanReportFunctionalCaseMapper.countExecuteSuccessCase(postParam.getReportId());
// 用例总数
long caseTotal = reportSummary.getFunctionalCaseCount() + reportSummary.getApiCaseCount() + reportSummary.getApiScenarioCount();
// 通过率 {通过用例数/总用例数}
double passRate = (functionalCasePassCount == 0 || caseTotal == 0) ? 0.0000 :
Double.parseDouble(rateFormat.format((double) functionalCasePassCount / (double) caseTotal));
// FIXME: 后续替换成PASS_COUNT {保留该逻辑, 四舍五入导致的边界值数据展示偏差}
if (passRate == 0 && functionalCasePassCount > 0) {
passRate = 0.0001;
} else if (passRate == 100 && functionalCasePassCount < caseTotal) {
passRate = 0.9999;
}
planReport.setPassRate(passRate);
// FIXME: 后续替换成PASS_COUNT
planReport.setPassRate(RateCalculateUtils.divWithPrecision((int) functionalCasePassCount, (int) caseTotal, 2));
// 计划的(执行)结果状态: 通过率 >= 阈值 ? 成功 : 失败
planReport.setResultStatus(passRate >= planReport.getPassThreshold() ? ReportStatus.SUCCESS.name() : ReportStatus.ERROR.name());
planReport.setResultStatus(planReport.getPassRate() >= planReport.getPassThreshold() ? ReportStatus.SUCCESS.name() : ReportStatus.ERROR.name());
return planReport;
}
@ -350,20 +338,34 @@ public class TestPlanReportService {
int caseTotal = (int) (reportSummary.getFunctionalCaseCount() + reportSummary.getApiCaseCount() + reportSummary.getApiScenarioCount());
planReportDetail.setCaseTotal(caseTotal);
planReportDetail.setBugCount(reportSummary.getBugCount().intValue());
planReportDetail.setSummary(reportSummary.getSummary());
/*
* 统计用例执行数据
*/
return statisticsCase(planReportDetail);
}
/**
* 更新报告详情
* @param request 更新请求参数
* @return 报告详情
*/
public TestPlanReportDetailResponse edit(TestPlanReportDetailEditRequest request) {
TestPlanReport planReport = checkReport(request.getId());
TestPlanReportSummary reportSummary = new TestPlanReportSummary();
reportSummary.setId(planReport.getId());
reportSummary.setSummary(request.getSummary());
testPlanReportSummaryMapper.updateByPrimaryKeySelective(reportSummary);
return getReport(planReport.getId());
}
/**
* 分页查询报告详情-缺陷分页数据
* @param request 请求参数
* @return 缺陷分页数据
*/
public List<BugDTO> listReportDetailBugs(TestPlanReportDetailPageRequest request) {
List<BugDTO> bugs = extTestPlanReportMapper.listReportBugs(request);
return bugService.handleCustomField(bugs, request.getProjectId());
return extTestPlanReportBugMapper.list(request);
}
/**
@ -371,8 +373,8 @@ public class TestPlanReportService {
* @param request 请求参数
* @return 缺陷分页数据
*/
public List<FunctionalCasePageDTO> listReportDetailFunctionalCases(TestPlanReportDetailPageRequest request) {
return extTestPlanReportMapper.listReportFunctionalCases(request);
public List<ReportDetailCasePageDTO> listReportDetailFunctionalCases(TestPlanReportDetailPageRequest request) {
return extTestPlanReportFunctionalCaseMapper.list(request);
}
@ -382,7 +384,7 @@ public class TestPlanReportService {
*/
private TestPlanReportDetailResponse statisticsCase(TestPlanReportDetailResponse reportDetail) {
// 功能用例 (无误报状态)
List<CaseStatusCountMap> functionalCaseCountMap = extTestPlanReportMapper.countFunctionalCaseExecuteResult(reportDetail.getId());
List<CaseStatusCountMap> functionalCaseCountMap = extTestPlanReportFunctionalCaseMapper.countExecuteResult(reportDetail.getId());
Map<String, Long> functionalCaseResultMap = functionalCaseCountMap.stream().collect(Collectors.toMap(CaseStatusCountMap::getStatus, CaseStatusCountMap::getCount));
TestPlanReportDetailResponse.CaseCount functionalCaseCount = new TestPlanReportDetailResponse.CaseCount();
functionalCaseCount.setSuccess(functionalCaseResultMap.getOrDefault(FunctionalCaseExecuteResult.SUCCESS.name(), 0L).intValue());
@ -402,21 +404,8 @@ public class TestPlanReportService {
executeCaseCount.setBlock(functionalCaseCount.getBlock());
// 计算执行完成率
DecimalFormat rateFormat = new DecimalFormat("#0.00");
rateFormat.setMinimumFractionDigits(2);
rateFormat.setMaximumFractionDigits(2);
// 执行完成率 {已执行用例数/总用例数}
double executeRate = (executeCaseCount.getPending().equals(reportDetail.getCaseTotal()) || reportDetail.getCaseTotal() == 0) ? 0.00 :
Double.parseDouble(rateFormat.format((double) (reportDetail.getCaseTotal() - executeCaseCount.getPending()) / (double) reportDetail.getCaseTotal()));
// FIXME: 后续替换成PASS_COUNT {保留该逻辑, 四舍五入导致的边界值数据展示偏差}
if (executeRate == 0 && reportDetail.getCaseTotal() - executeCaseCount.getPending() > 0) {
executeRate = 0.01;
} else if (executeRate == 100 && executeCaseCount.getPending() > 0) {
executeRate = 99.99;
}
// 详情数据
reportDetail.setExecuteRate(executeRate);
reportDetail.setExecuteRate(RateCalculateUtils.divWithPrecision(reportDetail.getCaseTotal() - executeCaseCount.getPending(), reportDetail.getCaseTotal(), 2));
// 分析详情数据
reportDetail.setFunctionalCount(functionalCaseCount);
reportDetail.setExecuteCount(executeCaseCount);
return reportDetail;

View File

@ -6,12 +6,12 @@ import io.metersphere.plan.domain.TestPlanFunctionalCase;
import io.metersphere.plan.dto.response.TestPlanStatisticsResponse;
import io.metersphere.plan.mapper.ExtTestPlanFunctionalCaseMapper;
import io.metersphere.plan.mapper.TestPlanConfigMapper;
import io.metersphere.plan.utils.RateCalculateUtils;
import io.metersphere.sdk.constants.FunctionalCaseExecuteResult;
import jakarta.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -66,9 +66,6 @@ public class TestPlanStatisticsService {
* 1. 查询计划下的用例数据集合(目前只有功能用例)
* 2. 根据执行结果统计(结果小数保留两位)
*/
DecimalFormat rateFormat = new DecimalFormat("#0.00");
rateFormat.setMinimumFractionDigits(2);
rateFormat.setMaximumFractionDigits(2);
// 计划的更多配置
TestPlanConfigExample example = new TestPlanConfigExample();
@ -107,13 +104,8 @@ public class TestPlanStatisticsService {
// FIXME: CaseTotal后续会补充接口用例及场景的统计数据
statisticsResponse.setCaseTotal(statisticsResponse.getFunctionalCaseCount());
// 通过率 {通过用例数/总用例数} && 执行进度 {非未执行的用例数/总用例数}
double passRate = (statisticsResponse.getSuccessCount() == 0 || statisticsResponse.getCaseTotal() == 0) ? 0.00 :
Double.parseDouble(rateFormat.format((double) statisticsResponse.getSuccessCount() * 100 / (double) statisticsResponse.getCaseTotal()));
double executeRate = (statisticsResponse.getPendingCount().equals(statisticsResponse.getCaseTotal()) || statisticsResponse.getCaseTotal() == 0) ? 0.00 :
Double.parseDouble(rateFormat.format((double) (statisticsResponse.getCaseTotal() - statisticsResponse.getPendingCount()) * 100 / (double) statisticsResponse.getCaseTotal()));
// V2旧逻辑, 如果算出的结果(99.999%)由于精度问题四舍五入为100%, 且计算数量小于总数, 实际值设为99.99%
statisticsResponse.setPassRate((passRate == 100 && statisticsResponse.getSuccessCount() < statisticsResponse.getCaseTotal()) ? 99.99 : passRate);
statisticsResponse.setExecuteRate((executeRate == 100 && statisticsResponse.getPendingCount() > 0) ? 99.99 : executeRate);
statisticsResponse.setPassRate(RateCalculateUtils.divWithPrecision(statisticsResponse.getSuccessCount(), statisticsResponse.getCaseTotal(), 2));
statisticsResponse.setExecuteRate(RateCalculateUtils.divWithPrecision(statisticsResponse.getCaseTotal() - statisticsResponse.getPendingCount(), statisticsResponse.getCaseTotal(), 2));
planStatisticsResponses.add(statisticsResponse);
});
return planStatisticsResponses;

View File

@ -0,0 +1,39 @@
package io.metersphere.plan.utils;
import java.text.DecimalFormat;
/**
* 计划模块百分比计算工具类
*/
public class RateCalculateUtils {
public static final int MAX_BOUNDARY = 100;
public static final int MIN_BOUNDARY = 0;
/**
* 计算并保留精度
* @param molecular 分子
* @param denominator 分母
* @param precision 精度
* @return rate
*/
public static Double divWithPrecision(Integer molecular, Integer denominator, Integer precision) {
DecimalFormat rateFormat = new DecimalFormat("#.##");
rateFormat.setMinimumFractionDigits(precision);
rateFormat.setMaximumFractionDigits(precision);
double rate = (molecular == 0 || denominator == 0) ? 0 :
Double.parseDouble(rateFormat.format((double) molecular * 100 / (double) denominator));
/*
* V2旧逻辑(边界数据展示问题):
* 如果算出的结果由于精度问题四舍五入为100%, 且计算数量小于总数, 实际值设为99.99%
* 如果算出的结果由于精度问题四舍五入为0%, 实际计算数量 > 0, 实际值设为0.01%
*/
if (rate == MAX_BOUNDARY && molecular < denominator) {
return 99.99;
} else if (rate == MIN_BOUNDARY && molecular > 0) {
return 0.01;
}
return rate;
}
}

View File

@ -46,6 +46,7 @@ public class TestPlanReportControllerTests extends BaseTest {
private static final String BATCH_DELETE_PLAN_REPORT = "/test-plan/report/batch-delete";
private static final String GEN_PLAN_REPORT = "/test-plan/report/gen";
private static final String GET_PLAN_REPORT = "/test-plan/report/get";
private static final String EDIT_PLAN_REPORT = "/test-plan/report/edit";
private static final String GET_PLAN_REPORT_DETAIL_BUG_PAGE = "/test-plan/report/detail/bug/page";
private static final String GET_PLAN_REPORT_DETAIL_FUNCTIONAL_PAGE = "/test-plan/report/detail/functional/case/page";
private static final String GEN_AND_SHARE = "/test-plan/report/share/gen";
@ -222,7 +223,6 @@ public class TestPlanReportControllerTests extends BaseTest {
void testPageReportDetailBugSuccess() throws Exception {
TestPlanReportDetailPageRequest request = new TestPlanReportDetailPageRequest();
request.setReportId(GEN_REPORT_ID);
request.setProjectId("100001100001");
request.setCurrent(1);
request.setPageSize(10);
this.requestPostWithOk(GET_PLAN_REPORT_DETAIL_BUG_PAGE, request);
@ -235,7 +235,6 @@ public class TestPlanReportControllerTests extends BaseTest {
void testPageReportDetailFunctionalCaseSuccess() throws Exception {
TestPlanReportDetailPageRequest request = new TestPlanReportDetailPageRequest();
request.setReportId(GEN_REPORT_ID);
request.setProjectId("100001100001");
request.setCurrent(1);
request.setPageSize(10);
this.requestPostWithOk(GET_PLAN_REPORT_DETAIL_FUNCTIONAL_PAGE, request);
@ -243,6 +242,15 @@ public class TestPlanReportControllerTests extends BaseTest {
this.requestPostWithOk(GET_PLAN_REPORT_DETAIL_FUNCTIONAL_PAGE, request);
}
@Test
@Order(15)
void testEditReportDetail() throws Exception {
TestPlanReportDetailEditRequest request = new TestPlanReportDetailEditRequest();
request.setId(GEN_REPORT_ID);
request.setSummary("This is a summary for report detail");
this.requestPostWithOk(EDIT_PLAN_REPORT, request);
}
@Resource
private TestPlanReportSummaryMapper testPlanReportSummaryMapper;
@Resource