diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanBugCaseDTO.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanBugCaseDTO.java index 12e381e0cb..50cde15260 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanBugCaseDTO.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanBugCaseDTO.java @@ -12,6 +12,8 @@ public class TestPlanBugCaseDTO { private String id; @Schema(description = "用例业务ID") private String num; + @Schema(description = "用例类型") + private String type; @Schema(description = "缺陷ID") private String bugId; @Schema(description = "用例名称") diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanCaseBugDTO.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanCaseBugDTO.java new file mode 100644 index 0000000000..3bddeb9f97 --- /dev/null +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanCaseBugDTO.java @@ -0,0 +1,21 @@ +package io.metersphere.plan.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = false) +public class TestPlanCaseBugDTO { + + @Schema(description = "关联关系ID") + private String id; + @Schema(description = "缺陷业务ID") + private String num; + @Schema(description = "缺陷标题") + private String title; + @Schema(description = "缺陷状态") + private String status; + @Schema(description = "计划缺陷关系ID") + private String planCaseRefId; +} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiCasePageResponse.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiCasePageResponse.java index ea19fc3acd..1fbb0bcef7 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiCasePageResponse.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiCasePageResponse.java @@ -1,10 +1,12 @@ package io.metersphere.plan.dto.response; +import io.metersphere.plan.dto.TestPlanCaseBugDTO; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.io.Serial; import java.io.Serializable; +import java.util.List; /** * @author wx @@ -89,4 +91,10 @@ public class TestPlanApiCasePageResponse implements Serializable { @Schema(description = "更新时间") private Long updateTime; + + @Schema(description = "缺陷数量") + private Integer bugCount; + + @Schema(description = "关联的缺陷数据") + private List bugList; } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiScenarioPageResponse.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiScenarioPageResponse.java index 72a9983be9..c817402496 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiScenarioPageResponse.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiScenarioPageResponse.java @@ -1,10 +1,12 @@ package io.metersphere.plan.dto.response; +import io.metersphere.plan.dto.TestPlanCaseBugDTO; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.io.Serial; import java.io.Serializable; +import java.util.List; /** * @author wx @@ -85,4 +87,10 @@ public class TestPlanApiScenarioPageResponse implements Serializable { @Schema(description = "更新时间") private Long updateTime; + + @Schema(description = "缺陷数量") + private Integer bugCount; + + @Schema(description = "关联的缺陷数据") + private List bugList; } \ No newline at end of file diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanCasePageResponse.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanCasePageResponse.java index db0fcb7363..32e058ea3f 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanCasePageResponse.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanCasePageResponse.java @@ -1,7 +1,7 @@ package io.metersphere.plan.dto.response; -import io.metersphere.bug.dto.CaseRelateBugDTO; import io.metersphere.functional.dto.FunctionalCaseCustomFieldDTO; +import io.metersphere.plan.dto.TestPlanCaseBugDTO; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -87,10 +87,10 @@ public class TestPlanCasePageResponse implements Serializable { private String executeUserName; @Schema(description = "缺陷数量") - private int bugCount; + private Integer bugCount; @Schema(description = "关联的缺陷数据") - private List bugList; + private List bugList; @Schema(description = "用例的id") private String caseId; diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.java index 6a2333d820..fc45cb1f8c 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.java @@ -1,6 +1,7 @@ package io.metersphere.plan.mapper; import io.metersphere.plan.dto.TestPlanBugCaseDTO; +import io.metersphere.plan.dto.TestPlanCaseBugDTO; import io.metersphere.plan.dto.request.TestPlanBugPageRequest; import io.metersphere.plan.dto.response.TestPlanBugPageResponse; import org.apache.ibatis.annotations.Param; @@ -26,4 +27,11 @@ public interface ExtTestPlanBugMapper { List countBugByIds(@Param("planIds") List planIds); + + /** + * 根据用例关系ID集合获取计划下用例关联的缺陷集合 + * @param caseIds 用例ID集合 + * @return 缺陷集合 + */ + List getCaseRelatedBug(@Param("ids") List caseIds); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.xml index 1f8f361366..138dddc75f 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.xml @@ -41,10 +41,17 @@ + + diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java index 4d1101588b..eb061ee2ae 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java @@ -243,16 +243,18 @@ public class TestPlanApiCaseService extends TestPlanResourceService { return new ArrayList<>(); } List list = extTestPlanApiCaseMapper.relateApiCaseList(request, deleted); - buildApiCaseResponse(list, request.getTestPlanId()); + buildApiCaseResponse(list, request.getTestPlanId(), request.getProjectId()); return list; } - private void buildApiCaseResponse(List apiCaseList, String testPlanId) { + private void buildApiCaseResponse(List apiCaseList, String testPlanId, String projectId) { if (CollectionUtils.isNotEmpty(apiCaseList)) { Map projectMap = getProject(apiCaseList); Map userMap = getUserMap(apiCaseList); Map moduleNameMap = getModuleName(apiCaseList); - handleCaseAndEnv(apiCaseList, projectMap, userMap, testPlanId, moduleNameMap); + List associateIds = apiCaseList.stream().map(TestPlanApiCasePageResponse::getId).toList(); + Map> associateBugMap = queryCaseAssociateBug(associateIds, projectId); + handleCaseAndEnv(apiCaseList, projectMap, userMap, testPlanId, moduleNameMap, associateBugMap); } } @@ -263,7 +265,8 @@ public class TestPlanApiCaseService extends TestPlanResourceService { .collect(Collectors.toMap(ApiDefinitionModule::getId, ApiDefinitionModule::getName)); } - private void handleCaseAndEnv(List apiCaseList, Map projectMap, Map userMap, String testPlanId, Map moduleNameMap) { + private void handleCaseAndEnv(List apiCaseList, Map projectMap, Map userMap, + String testPlanId, Map moduleNameMap, Map> associateBugMap) { //获取二级节点环境 List secondEnv = extTestPlanCollectionMapper.selectSecondCollectionEnv(CaseType.API_CASE.getKey(), ModuleConstants.ROOT_NODE_PARENT_ID, testPlanId); Map secondEnvMap = secondEnv.stream().collect(Collectors.toMap(TestPlanCollectionEnvDTO::getId, item -> item)); @@ -289,6 +292,11 @@ public class TestPlanApiCaseService extends TestPlanResourceService { getRunEnv(collectEnv, caseEnvMap, item); } } + if (associateBugMap.containsKey(item.getId())) { + List associateBugs = associateBugMap.get(item.getId()); + item.setBugList(associateBugs); + item.setBugCount(associateBugs.size()); + } }); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiScenarioService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiScenarioService.java index a943e93539..a11bceed7e 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiScenarioService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiScenarioService.java @@ -382,17 +382,19 @@ public class TestPlanApiScenarioService extends TestPlanResourceService { public List hasRelateApiScenarioList(TestPlanApiScenarioRequest request, boolean deleted) { filterCaseRequest(request); List list = extTestPlanApiScenarioMapper.relateApiScenarioList(request, deleted); - buildApiScenarioResponse(list, request.getTestPlanId()); + buildApiScenarioResponse(list, request.getTestPlanId(), request.getProjectId()); return list; } - private void buildApiScenarioResponse(List apiScenarioList, String testPlanId) { + private void buildApiScenarioResponse(List apiScenarioList, String testPlanId, String projectId) { if (CollectionUtils.isNotEmpty(apiScenarioList)) { Map projectMap = getProject(apiScenarioList); Map userMap = getUserMap(apiScenarioList); Map moduleNameMap = getModuleName(apiScenarioList); Map reportMap = getReportMap(apiScenarioList); - handleScenarioAndEnv(apiScenarioList, projectMap, userMap, testPlanId, moduleNameMap, reportMap); + List associateIds = apiScenarioList.stream().map(TestPlanApiScenarioPageResponse::getId).toList(); + Map> associateBugMap = queryCaseAssociateBug(associateIds, projectId); + handleScenarioAndEnv(apiScenarioList, projectMap, userMap, testPlanId, moduleNameMap, reportMap, associateBugMap); } } @@ -415,7 +417,7 @@ public class TestPlanApiScenarioService extends TestPlanResourceService { private void handleScenarioAndEnv(List apiScenarioList, Map projectMap, Map userMap, String testPlanId, Map moduleNameMap, - Map reportMap) { + Map reportMap, Map> associateBugMap) { //获取二级节点环境 List secondEnv = extTestPlanCollectionMapper.selectSecondCollectionEnv(CaseType.SCENARIO_CASE.getKey(), ModuleConstants.ROOT_NODE_PARENT_ID, testPlanId); Map secondEnvMap = secondEnv.stream().collect(Collectors.toMap(TestPlanCollectionEnvDTO::getId, item -> item)); @@ -442,6 +444,11 @@ public class TestPlanApiScenarioService extends TestPlanResourceService { getRunEnv(collectEnv, caseEnvMap, item); } } + if (associateBugMap.containsKey(item.getId())) { + List associateBugs = associateBugMap.get(item.getId()); + item.setBugList(associateBugs); + item.setBugCount(associateBugs.size()); + } }); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java index f924bc294e..8c8e87346b 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java @@ -30,7 +30,6 @@ import io.metersphere.plan.dto.*; import io.metersphere.plan.dto.request.*; import io.metersphere.plan.dto.response.*; import io.metersphere.plan.mapper.*; -import io.metersphere.plugin.platform.dto.SelectOption; import io.metersphere.project.dto.ModuleCountDTO; import io.metersphere.project.dto.MoveNodeSortDTO; import io.metersphere.provider.BaseAssociateBugProvider; @@ -260,10 +259,8 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService { List ids = functionalCaseLists.stream().map(TestPlanCasePageResponse::getCaseId).collect(Collectors.toList()); Map> collect = functionalCaseService.getCaseCustomFiledMap(ids, projectId); Set userIds = extractUserIds(functionalCaseLists); - List relateIds = functionalCaseLists.stream().map(TestPlanCasePageResponse::getId).collect(Collectors.toList()); - Map> bugListMap = getBugData(relateIds, functionalCaseLists.getFirst().getTestPlanId()); - List statusOption = bugStatusService.getHeaderStatusOption(projectId); - Map statusMap = statusOption.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); + List associateIds = functionalCaseLists.stream().map(TestPlanCasePageResponse::getId).toList(); + Map> associateBugMap = queryCaseAssociateBug(associateIds, projectId); Map userMap = userLoginService.getUserNameMap(new ArrayList<>(userIds)); List moduleIds = functionalCaseLists.stream().map(TestPlanCasePageResponse::getModuleId).toList(); List modules = extFunctionalCaseModuleMapper.getNameInfoByIds(moduleIds); @@ -273,10 +270,10 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService { testPlanCasePageResponse.setCreateUserName(userMap.get(testPlanCasePageResponse.getCreateUser())); testPlanCasePageResponse.setExecuteUserName(userMap.get(testPlanCasePageResponse.getExecuteUser())); testPlanCasePageResponse.setModuleName(StringUtils.isNotBlank(moduleNameMap.get(testPlanCasePageResponse.getModuleId())) ? moduleNameMap.get(testPlanCasePageResponse.getModuleId()) : Translator.get("functional_case.module.default.name")); - if (bugListMap.containsKey(testPlanCasePageResponse.getCaseId())) { - List bugDTOList = bugListMap.get(testPlanCasePageResponse.getCaseId()); - testPlanCasePageResponse.setBugList(handleStatus(bugDTOList, statusMap)); - testPlanCasePageResponse.setBugCount(bugDTOList.size()); + if (associateBugMap.containsKey(testPlanCasePageResponse.getId())) { + List associateBugs = associateBugMap.get(testPlanCasePageResponse.getId()); + testPlanCasePageResponse.setBugList(associateBugs); + testPlanCasePageResponse.setBugCount(associateBugs.size()); } }); return functionalCaseLists; @@ -290,11 +287,6 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService { return bugDTOList; } - private Map> getBugData(List ids, String testPlanId) { - List bugList = bugRelateCaseMapper.getBugCountByIds(ids, testPlanId); - return bugList.stream().collect(Collectors.groupingBy(CaseRelateBugDTO::getCaseId)); - } - public Set extractUserIds(List list) { return list.stream() diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanResourceService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanResourceService.java index 8ae47aff41..8ebd428e4e 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanResourceService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanResourceService.java @@ -4,19 +4,19 @@ import io.metersphere.bug.domain.Bug; import io.metersphere.bug.domain.BugRelationCase; import io.metersphere.bug.mapper.BugMapper; import io.metersphere.bug.mapper.BugRelationCaseMapper; +import io.metersphere.bug.service.BugStatusService; import io.metersphere.dto.BugProviderDTO; import io.metersphere.plan.domain.TestPlan; import io.metersphere.plan.domain.TestPlanCollectionExample; -import io.metersphere.plan.dto.ModuleSelectDTO; -import io.metersphere.plan.dto.TestPlanCollectionDTO; -import io.metersphere.plan.dto.TestPlanResourceAssociationParam; -import io.metersphere.plan.dto.TestPlanResourceExecResultDTO; +import io.metersphere.plan.dto.*; import io.metersphere.plan.dto.request.BaseCollectionAssociateRequest; import io.metersphere.plan.dto.request.BasePlanCaseBatchRequest; import io.metersphere.plan.dto.request.TestPlanCaseAssociateBugRequest; import io.metersphere.plan.dto.response.TestPlanAssociationResponse; +import io.metersphere.plan.mapper.ExtTestPlanBugMapper; import io.metersphere.plan.mapper.TestPlanCollectionMapper; import io.metersphere.plan.mapper.TestPlanMapper; +import io.metersphere.plugin.platform.dto.SelectOption; import io.metersphere.provider.BaseAssociateBugProvider; import io.metersphere.request.BugPageProviderRequest; import io.metersphere.sdk.constants.HttpMethodConstants; @@ -43,6 +43,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.function.Consumer; +import java.util.stream.Collectors; //测试计划关联表 通用方法 @Transactional(rollbackFor = Exception.class) @@ -62,6 +63,10 @@ public abstract class TestPlanResourceService extends TestPlanSortService { private BugRelationCaseMapper bugRelationCaseMapper; @Resource private BugMapper bugMapper; + @Resource + private ExtTestPlanBugMapper extTestPlanBugMapper; + @Resource + private BugStatusService bugStatusService; public static final String MODULE_ALL = "all"; @@ -223,4 +228,18 @@ public abstract class TestPlanResourceService extends TestPlanSortService { } return null; } + + /** + * 查询(计划关联)用例关联的缺陷 + * @param ids 关联用例关系ID集合 + * @param projectId 项目ID + * @return 缺陷集合 + */ + protected Map> queryCaseAssociateBug(List ids, String projectId) { + List associateBugs = extTestPlanBugMapper.getCaseRelatedBug(ids); + List statusOption = bugStatusService.getHeaderStatusOption(projectId); + Map statusMap = statusOption.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); + associateBugs.forEach(bug -> bug.setStatus(statusMap.get(bug.getStatus()))); + return associateBugs.stream().collect(Collectors.groupingBy(TestPlanCaseBugDTO::getPlanCaseRefId)); + } } diff --git a/backend/services/test-plan/src/test/resources/dml/init_test_plan_api_case.sql b/backend/services/test-plan/src/test/resources/dml/init_test_plan_api_case.sql index 69361e9527..6227d8db59 100644 --- a/backend/services/test-plan/src/test/resources/dml/init_test_plan_api_case.sql +++ b/backend/services/test-plan/src/test/resources/dml/init_test_plan_api_case.sql @@ -49,3 +49,10 @@ VALUES INSERT INTO `api_definition_module`(`id`, `name`, `parent_id`, `project_id`, `pos`, `create_time`, `update_time`, `update_user`, `create_user`) VALUES ('123', 'Halo', 'NONE', 'wxx_1234', 384, 1716280762025, 1716280762025, '805048669970432', '805048669970432'); + +INSERT INTO bug_relation_case (id, case_id, bug_id, case_type, test_plan_id, test_plan_case_id, create_user, create_time, update_time) VALUES +('bug_relate_3', 'wxxx_api_case_1', 'bug_3', 'FUNCTIONAL', 'wxxx_1', 'wxxx_1', 'admin', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP), +('bug_relate_4', 'wxxx_api_case_1', 'bug_4', 'FUNCTIONAL', 'wxxx_1', 'wxxx_1', 'admin', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); + +INSERT INTO bug (id, num, title, handle_users, handle_user, create_user, create_time,update_user, update_time, delete_user, delete_time, project_id, template_id, platform, status, tags, platform_bug_id, deleted, pos) +VALUES ('bug_3', 100001, 'oasis', 'admin', 'admin', 'admin', UNIX_TIMESTAMP() * 1000, 'admin', UNIX_TIMESTAMP() * 1000, 'admin', UNIX_TIMESTAMP() * 1000, '100001100001', 'bug-template-id', 'Local', 'open', '["default-tag"]', null, 0, 5000); diff --git a/backend/services/test-plan/src/test/resources/dml/init_test_plan_api_scenario.sql b/backend/services/test-plan/src/test/resources/dml/init_test_plan_api_scenario.sql index 3f28b7658c..20608cdb68 100644 --- a/backend/services/test-plan/src/test/resources/dml/init_test_plan_api_scenario.sql +++ b/backend/services/test-plan/src/test/resources/dml/init_test_plan_api_scenario.sql @@ -45,3 +45,10 @@ VALUES INSERT INTO `api_scenario_module`(`id`, `name`, `pos`, `create_time`, `update_time`, `update_user`, `create_user`, `project_id`, `parent_id`) VALUES ('wx_scenario_module_123', '测试CSV', 64, 1716196253511, 1716196253511, '714940256100352', '714940256100352', '718255970852864', 'NONE'); + +INSERT INTO bug_relation_case (id, case_id, bug_id, case_type, test_plan_id, test_plan_case_id, create_user, create_time, update_time) VALUES +('bug_relate_5', 'wxxx_api_scenario_1', 'bug_5', 'FUNCTIONAL', 'wxxx_plan_1', 'wxxx_plan_scenario_1', 'admin', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP), +('bug_relate_6', 'wxxx_api_scenario_1', 'bug_6', 'FUNCTIONAL', 'wxxx_plan_1', 'wxxx_plan_scenario_1', 'admin', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); + +INSERT INTO bug (id, num, title, handle_users, handle_user, create_user, create_time,update_user, update_time, delete_user, delete_time, project_id, template_id, platform, status, tags, platform_bug_id, deleted, pos) +VALUES ('bug_5', 100001, 'oasis', 'admin', 'admin', 'admin', UNIX_TIMESTAMP() * 1000, 'admin', UNIX_TIMESTAMP() * 1000, 'admin', UNIX_TIMESTAMP() * 1000, '100001100001', 'bug-template-id', 'Local', 'open', '["default-tag"]', null, 0, 5000); diff --git a/backend/services/test-plan/src/test/resources/dml/init_test_plan_case_relate_bug.sql b/backend/services/test-plan/src/test/resources/dml/init_test_plan_case_relate_bug.sql index dff30720d8..428d6579b0 100644 --- a/backend/services/test-plan/src/test/resources/dml/init_test_plan_case_relate_bug.sql +++ b/backend/services/test-plan/src/test/resources/dml/init_test_plan_case_relate_bug.sql @@ -92,3 +92,7 @@ INSERT INTO project_application (project_id, type, type_value) VALUES INSERT INTO service_integration(`id`, `plugin_id`, `enable`, `configuration`, `organization_id`) VALUES ('621103810617343', 'jira', true, 0x504B0304140008080800BC517657000000000000000000000000030000007A6970258DC10EC2201044FF65CF06D2C498D89347B5574FBD6D8158222CD85D6268E3BF4BE3F5CDBC990DD0DAC531430FB348E65EEBE06B41AAA9289480CC1E4991130D07C022F3A366D7DA13B2373B32261592469AF1572FCF883E289362CB735BF8A4C5EE073474C3CB8E59A6F85EEFF12AE676EC4E67F8FE00504B0708384DA4307800000087000000504B01021400140008080800BC517657384DA43078000000870000000300000000000000000000000000000000007A6970504B0506000000000100010031000000A90000000000, '1'), ('652096294625284', 'zentao', true, 0x504B030414000808080093756458000000000000000000000000030000007A6970AB564A4C49294A2D2E56B252CA282929B0D2D7373437D23334D3333230D033B3B4B230B0B050D2514A4C4ECE2FCD2B01AA4A4CC9CDCC038A1424161797E717A500859C1373F2F3D21D8C0C0C4D811245A985A5A9C525219505A940B900C7108F784F3F377FA55A00504B07088A813510680000006C000000504B01021400140008080800937564588A813510680000006C0000000300000000000000000000000000000000007A6970504B0506000000000100010031000000990000000000, '1'); + +INSERT INTO bug_relation_case (id, case_id, bug_id, case_type, test_plan_id, test_plan_case_id, create_user, create_time, update_time) VALUES + ('bug_relate_1', 'fc_1', 'bug_1', 'FUNCTIONAL', 'plan_1', 'relate_case_1', 'admin', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP), + ('bug_relate_2', 'fc_1', 'bug_2', 'FUNCTIONAL', 'plan_1', 'relate_case_1', 'admin', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);