This commit is contained in:
fit2-zhao 2021-03-16 13:19:07 +08:00
commit e5ba2eba44
123 changed files with 7045 additions and 507 deletions

View File

@ -15,6 +15,7 @@ import io.metersphere.api.service.*;
import io.metersphere.base.domain.ApiTest;
import io.metersphere.base.domain.Schedule;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.constants.ScheduleGroup;
import io.metersphere.commons.utils.CronUtils;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
@ -28,15 +29,13 @@ import io.metersphere.service.ScheduleService;
import org.apache.jorphan.collections.HashTree;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.python.core.AstList;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.*;
import static io.metersphere.commons.utils.JsonPathUtils.getListJson;
@ -345,8 +344,11 @@ public class APITestController {
@GetMapping("/runningTask/{projectID}")
public List<TaskInfoResult> runningTask(@PathVariable String projectID) {
List<TaskInfoResult> resultList = scheduleService.findRunningTaskInfoByProjectID(projectID);
List<String> typeFilter = Arrays.asList( // 首页显示的运行中定时任务只要这3种不需要 性能测试api_test(旧版)
ScheduleGroup.API_SCENARIO_TEST.name(),
ScheduleGroup.SWAGGER_IMPORT.name(),
ScheduleGroup.TEST_PLAN_TEST.name());
List<TaskInfoResult> resultList = scheduleService.findRunningTaskInfoByProjectID(projectID, typeFilter);
int dataIndex = 1;
for (TaskInfoResult taskInfo :
resultList) {

View File

@ -144,6 +144,11 @@ public class ApiAutomationController {
apiAutomationService.relevance(request);
}
@PostMapping("/relevance/review")
public void testCaseReviewRelevance(@RequestBody ApiCaseRelevanceRequest request){
apiAutomationService.relevanceReview(request);
}
@PostMapping(value = "/schedule/update")
public void updateSchedule(@RequestBody Schedule request) {
apiAutomationService.updateSchedule(request);

View File

@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.net.MalformedURLException;
import java.util.Date;
import java.util.List;
@ -58,6 +59,12 @@ public class ApiDefinitionController {
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
return PageUtils.setPageInfo(page, apiDefinitionService.listRelevance(request));
}
@PostMapping("/list/relevance/review/{goPage}/{pageSize}")
public Pager<List<ApiDefinitionResult>> listRelevanceReview(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiDefinitionRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
return PageUtils.setPageInfo(page, apiDefinitionService.listRelevanceReview(request));
}
@PostMapping("/list/all")
public List<ApiDefinitionResult> list(@RequestBody ApiDefinitionRequest request) {
@ -157,7 +164,7 @@ public class ApiDefinitionController {
//定时任务创建
@PostMapping(value = "/schedule/create")
public void createSchedule(@RequestBody ScheduleRequest request) {
public void createSchedule(@RequestBody ScheduleRequest request) throws MalformedURLException {
apiDefinitionService.createSchedule(request);
}
@PostMapping(value = "/schedule/update")
@ -217,6 +224,10 @@ public class ApiDefinitionController {
public void testPlanRelevance(@RequestBody ApiCaseRelevanceRequest request) {
apiDefinitionService.testPlanRelevance(request);
}
@PostMapping("/relevance/review")
public void testCaseReviewRelevance(@RequestBody ApiCaseRelevanceRequest request){
apiDefinitionService.testCaseReviewRelevance(request);
}
@PostMapping("/preview")
public String preview(@RequestBody String jsonSchema) {

View File

@ -120,6 +120,10 @@ public class ApiTestCaseController {
public void testPlanRelevance(@RequestBody ApiCaseRelevanceRequest request) {
apiTestCaseService.relevanceByCase(request);
}
@PostMapping("/relevance/review")
public void testCaseReviewRelevance(@RequestBody ApiCaseRelevanceRequest request){
apiTestCaseService.relevanceByApiByReview(request);
}
@PostMapping(value = "/jenkins/run")
public String jenkinsRun(@RequestBody RunCaseRequest request) {

View File

@ -22,4 +22,5 @@ public class ApiScenarioRequest extends BaseQueryRequest {
private long createTime = 0;
private String executeStatus;
private boolean notInTestPlan;
private String reviewId;
}

View File

@ -25,4 +25,5 @@ public class TestPlanScenarioRequest {
private Map<String, List<String>> filters;
private Map<String, Object> combine;
private List<String> ids;
private String reviewId;
}

View File

@ -29,5 +29,7 @@ public class TaskInfoResult {
private Long updateTime;
//定时任务类型 情景定时任务/范围计划任务
private String taskType;
//定时任务组别 swagger/scenario/testPlan
private String taskGroup;
}

View File

@ -20,4 +20,5 @@ public class ApiDefinitionRequest extends BaseQueryRequest {
private long createTime = 0;
private String status;
private String apiCaseCoverage;
private String reviewId;
}

View File

@ -27,4 +27,5 @@ public class ApiTestCaseRequest {
private Map<String, Object> combine;
private boolean isSelectThisWeedData;
private long createTime = 0;
private String reviewId;
}

View File

@ -339,6 +339,8 @@ public class APITestService {
schedule.setJob(ApiTestJob.class.getName());
schedule.setGroup(ScheduleGroup.API_TEST.name());
schedule.setType(ScheduleType.CRON.name());
schedule.setProjectId(request.getProjectId());
schedule.setName(request.getName());
return schedule;
}

View File

@ -23,11 +23,9 @@ import io.metersphere.api.parse.ApiImportParser;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.ApiScenarioMapper;
import io.metersphere.base.mapper.ApiScenarioReportMapper;
import io.metersphere.base.mapper.TestCaseReviewScenarioMapper;
import io.metersphere.base.mapper.TestPlanApiScenarioMapper;
import io.metersphere.base.mapper.ext.ExtApiScenarioMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanApiCaseMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanScenarioCaseMapper;
import io.metersphere.base.mapper.ext.*;
import io.metersphere.commons.constants.*;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.*;
@ -63,6 +61,8 @@ import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = Exception.class)
public class ApiAutomationService {
@Resource
private ExtScheduleMapper extScheduleMapper;
@Resource
private ApiScenarioMapper apiScenarioMapper;
@Resource
@ -72,6 +72,8 @@ public class ApiAutomationService {
@Resource
private TestPlanApiScenarioMapper testPlanApiScenarioMapper;
@Resource
private TestCaseReviewScenarioMapper testCaseReviewScenarioMapper;
@Resource
private JMeterService jMeterService;
@Resource
private ApiTestEnvironmentService environmentService;
@ -95,7 +97,12 @@ public class ApiAutomationService {
setApiScenarioProjectIds(list);
return list;
}
public List<ApiScenarioDTO> listReview(ApiScenarioRequest request) {
request = this.initRequest(request, true, true);
List<ApiScenarioDTO> list = extApiScenarioMapper.listReview(request);
setApiScenarioProjectIds(list);
return list;
}
private void setApiScenarioProjectIds(List<ApiScenarioDTO> list) {
// 如果场景步骤涉及多项目则把涉及到的项目ID保存在projectIds属性
list.forEach(data -> {
@ -196,6 +203,7 @@ public class ApiAutomationService {
final ApiScenarioWithBLOBs scenario = buildSaveScenario(request);
apiScenarioMapper.updateByPrimaryKeySelective(scenario);
extScheduleMapper.updateNameByResourceID(request.getId(), request.getName());// 修改场景name同步到修改首页定时任务
}
public ApiScenarioWithBLOBs buildSaveScenario(SaveApiScenarioRequest request) {
@ -705,7 +713,32 @@ public class ApiAutomationService {
testPlanApiScenarioMapper.insert(testPlanApiScenario);
});
}
public void relevanceReview(ApiCaseRelevanceRequest request){
Map<String, List<String>> mapping = request.getMapping();
Map<String, String> envMap = request.getEnvMap();
Set<String> set = mapping.keySet();
if (set.isEmpty()) {
return;
}
set.forEach(id->{
Map<String, String> newEnvMap = new HashMap<>(16);
if (envMap != null && !envMap.isEmpty()) {
List<String> list = mapping.get(id);
list.forEach(l -> {
newEnvMap.put(l, envMap.get(l));
});
}
TestCaseReviewScenario testCaseReviewScenario=new TestCaseReviewScenario();
testCaseReviewScenario.setId(UUID.randomUUID().toString());
testCaseReviewScenario.setApiScenarioId(id);
testCaseReviewScenario.setTestCaseReviewId(request.getReviewId());
testCaseReviewScenario.setCreateTime(System.currentTimeMillis());
testCaseReviewScenario.setUpdateTime(System.currentTimeMillis());
testCaseReviewScenario.setEnvironment(JSON.toJSONString(newEnvMap));
testCaseReviewScenarioMapper.insert(testCaseReviewScenario);
});
}
public List<ApiScenario> selectByIds(List<String> ids) {
ApiScenarioExample example = new ApiScenarioExample();
example.createCriteria().andIdIn(ids);
@ -720,6 +753,9 @@ public class ApiAutomationService {
public void createSchedule(ScheduleRequest request) {
Schedule schedule = scheduleService.buildApiTestSchedule(request);
ApiScenarioWithBLOBs apiScene = apiScenarioMapper.selectByPrimaryKey(request.getResourceId());
schedule.setName(apiScene.getName()); // add场景定时任务时设置新增的数据库表字段的值
schedule.setProjectId(apiScene.getProjectId());
schedule.setJob(ApiScenarioTestJob.class.getName());
schedule.setGroup(ScheduleGroup.API_SCENARIO_TEST.name());
schedule.setType(ScheduleType.CRON.name());

View File

@ -15,6 +15,7 @@ import io.metersphere.commons.utils.DateUtils;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.track.dto.TestPlanDTO;
import io.metersphere.track.request.testcase.QueryTestPlanRequest;
import io.metersphere.track.service.TestCaseReviewApiCaseService;
import io.metersphere.track.service.TestPlanApiCaseService;
import io.metersphere.track.service.TestPlanService;
import org.apache.commons.collections4.CollectionUtils;
@ -41,6 +42,8 @@ public class ApiDefinitionExecResultService {
private TestPlanService testPlanService;
@Resource
private ApiTestCaseMapper apiTestCaseMapper;
@Resource
private TestCaseReviewApiCaseService testCaseReviewApiCaseService;
@Resource
SqlSessionFactory sqlSessionFactory;
@ -67,6 +70,8 @@ public class ApiDefinitionExecResultService {
saveResult.setStatus(status);
if (StringUtils.equals(type, ApiRunMode.API_PLAN.name())) {
testPlanApiCaseService.setExecResult(item.getName(), status);
testCaseReviewApiCaseService.setExecResult(item.getName(), status);
}
// 更新用例最后执行结果
ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = new ApiTestCaseWithBLOBs();
@ -118,6 +123,7 @@ public class ApiDefinitionExecResultService {
} else {
userID = Objects.requireNonNull(SessionUtils.getUser()).getId();
testPlanApiCaseService.setExecResult(item.getName(), status);
testCaseReviewApiCaseService.setExecResult(item.getName(), status);
}
saveResult.setUserId(userID);

View File

@ -49,6 +49,7 @@ import sun.security.util.Cache;
import javax.annotation.Resource;
import java.io.File;
import java.net.MalformedURLException;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -589,6 +590,10 @@ public class ApiDefinitionService {
apiTestCaseService.relevanceByApi(request);
}
public void testCaseReviewRelevance(ApiCaseRelevanceRequest request) {
apiTestCaseService.relevanceByApiByReview(request);
}
/**
* 数据统计-接口类型
*
@ -673,6 +678,12 @@ public class ApiDefinitionService {
calculateResult(resList);
return resList;
}
public List<ApiDefinitionResult> listRelevanceReview(ApiDefinitionRequest request) {
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
List<ApiDefinitionResult> resList = extApiDefinitionMapper.listRelevanceReview(request);
calculateResult(resList);
return resList;
}
public void calculateResult(List<ApiDefinitionResult> resList) {
if (!resList.isEmpty()) {
@ -702,7 +713,7 @@ public class ApiDefinitionService {
}
/*swagger定时导入*/
public void createSchedule(ScheduleRequest request) {
public void createSchedule(ScheduleRequest request) throws MalformedURLException {
/*保存swaggerUrl*/
SwaggerUrlProject swaggerUrlProject = new SwaggerUrlProject();
swaggerUrlProject.setId(UUID.randomUUID().toString());
@ -714,6 +725,9 @@ public class ApiDefinitionService {
scheduleService.addSwaggerUrlSchedule(swaggerUrlProject);
request.setResourceId(swaggerUrlProject.getId());
Schedule schedule = scheduleService.buildApiTestSchedule(request);
schedule.setProjectId(swaggerUrlProject.getProjectId());
java.net.URL swaggerUrl = new java.net.URL(swaggerUrlProject.getSwaggerUrl());
schedule.setName(swaggerUrl.getHost()); // swagger 定时任务的 name 设置为 swaggerURL 的域名
schedule.setJob(SwaggerUrlImportJob.class.getName());
schedule.setGroup(ScheduleGroup.SWAGGER_IMPORT.name());
schedule.setType(ScheduleType.CRON.name());

View File

@ -112,7 +112,9 @@ public class ApiModuleService extends NodeTreeService<ApiModuleDTO> {
apiModuleDTO.setName(name);
apiModuleDTO.setLabel(name);
apiModuleDTO.setChildren(nodeList);
list.add(apiModuleDTO);
if (!org.springframework.util.CollectionUtils.isEmpty(nodeList)) {
list.add(apiModuleDTO);
}
});
return list;
}

View File

@ -100,7 +100,9 @@ public class ApiScenarioModuleService extends NodeTreeService<ApiScenarioModuleD
scenarioModuleDTO.setName(name);
scenarioModuleDTO.setLabel(name);
scenarioModuleDTO.setChildren(nodeList);
list.add(scenarioModuleDTO);
if (!org.springframework.util.CollectionUtils.isEmpty(nodeList)) {
list.add(scenarioModuleDTO);
}
});
return list;
}

View File

@ -18,10 +18,7 @@ import io.metersphere.api.dto.scenario.request.RequestType;
import io.metersphere.api.jmeter.JMeterService;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.*;
import io.metersphere.base.mapper.ext.ExtApiDefinitionExecResultMapper;
import io.metersphere.base.mapper.ext.ExtApiTestCaseMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanApiCaseMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper;
import io.metersphere.base.mapper.ext.*;
import io.metersphere.commons.constants.TestPlanStatus;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.*;
@ -53,6 +50,8 @@ public class ApiTestCaseService {
@Resource
TestPlanMapper testPlanMapper;
@Resource
TestCaseReviewMapper testCaseReviewMapper;
@Resource
private ApiTestCaseMapper apiTestCaseMapper;
@Resource
private SqlSessionFactory sqlSessionFactory;
@ -313,7 +312,16 @@ public class ApiTestCaseService {
List<ApiTestCase> apiTestCases = apiTestCaseMapper.selectByExample(example);
relevance(apiTestCases, request);
}
public void relevanceByApiByReview(ApiCaseRelevanceRequest request){
List<String> ids = request.getSelectIds();
if (CollectionUtils.isEmpty(ids)) {
return;
}
ApiTestCaseExample example = new ApiTestCaseExample();
example.createCriteria().andIdIn(ids);
List<ApiTestCase> apiTestCases = apiTestCaseMapper.selectByExample(example);
relevanceByReview(apiTestCases, request);
}
public void relevanceByCase(ApiCaseRelevanceRequest request) {
List<String> ids = request.getSelectIds();
if (CollectionUtils.isEmpty(ids)) {
@ -350,9 +358,33 @@ public class ApiTestCaseService {
sqlSession.flushStatements();
}
private void relevanceByReview(List<ApiTestCase> apiTestCases, ApiCaseRelevanceRequest request) {
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
ExtTestCaseReviewApiCaseMapper batchMapper = sqlSession.getMapper(ExtTestCaseReviewApiCaseMapper.class);
apiTestCases.forEach(apiTestCase -> {
TestCaseReviewApiCase TestCaseReviewApiCase = new TestCaseReviewApiCase();
TestCaseReviewApiCase.setId(UUID.randomUUID().toString());
TestCaseReviewApiCase.setApiCaseId(apiTestCase.getId());
TestCaseReviewApiCase.setTestCaseReviewId(request.getReviewId());
TestCaseReviewApiCase.setEnvironmentId(request.getEnvironmentId());
TestCaseReviewApiCase.setCreateTime(System.currentTimeMillis());
TestCaseReviewApiCase.setUpdateTime(System.currentTimeMillis());
batchMapper.insertIfNotExists(TestCaseReviewApiCase);
});
TestCaseReview testCaseReview=testCaseReviewMapper.selectByPrimaryKey(request.getReviewId());
if (StringUtils.equals(testCaseReview.getStatus(), TestPlanStatus.Prepare.name())
|| StringUtils.equals(testCaseReview.getStatus(), TestPlanStatus.Completed.name())) {
testCaseReview.setStatus(TestPlanStatus.Underway.name());
testCaseReviewMapper.updateByPrimaryKey(testCaseReview);
}
sqlSession.flushStatements();
}
public List<String> selectIdsNotExistsInPlan(String projectId, String planId) {
return extApiTestCaseMapper.selectIdsNotExistsInPlan(projectId, planId);
}
public List<String> selectIdsNotExistsInReview(String projectId,String reviewId){
return extApiTestCaseMapper.selectIdsNotExistsInReview(projectId,reviewId);
}
public List<ApiDataCountResult> countProtocolByProjectID(String projectId) {
return extApiTestCaseMapper.countProtocolByProjectID(projectId);

View File

@ -1,8 +1,7 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
import lombok.Data;
@Data
public class Schedule implements Serializable {
@ -30,7 +29,9 @@ public class Schedule implements Serializable {
private Long updateTime;
private String customData;
private String projectId;
private String name;
private static final long serialVersionUID = 1L;
}

View File

@ -913,6 +913,146 @@ public class ScheduleExample {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andProjectIdIsNull() {
addCriterion("project_id is null");
return (Criteria) this;
}
public Criteria andProjectIdIsNotNull() {
addCriterion("project_id is not null");
return (Criteria) this;
}
public Criteria andProjectIdEqualTo(String value) {
addCriterion("project_id =", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotEqualTo(String value) {
addCriterion("project_id <>", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThan(String value) {
addCriterion("project_id >", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThanOrEqualTo(String value) {
addCriterion("project_id >=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThan(String value) {
addCriterion("project_id <", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThanOrEqualTo(String value) {
addCriterion("project_id <=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLike(String value) {
addCriterion("project_id like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotLike(String value) {
addCriterion("project_id not like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdIn(List<String> values) {
addCriterion("project_id in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotIn(List<String> values) {
addCriterion("project_id not in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdBetween(String value1, String value2) {
addCriterion("project_id between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotBetween(String value1, String value2) {
addCriterion("project_id not between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -244,6 +244,76 @@ public class TestCaseExample {
return (Criteria) this;
}
public Criteria andTestIdIsNull() {
addCriterion("test_id is null");
return (Criteria) this;
}
public Criteria andTestIdIsNotNull() {
addCriterion("test_id is not null");
return (Criteria) this;
}
public Criteria andTestIdEqualTo(String value) {
addCriterion("test_id =", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotEqualTo(String value) {
addCriterion("test_id <>", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdGreaterThan(String value) {
addCriterion("test_id >", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdGreaterThanOrEqualTo(String value) {
addCriterion("test_id >=", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLessThan(String value) {
addCriterion("test_id <", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLessThanOrEqualTo(String value) {
addCriterion("test_id <=", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLike(String value) {
addCriterion("test_id like", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotLike(String value) {
addCriterion("test_id not like", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdIn(List<String> values) {
addCriterion("test_id in", values, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotIn(List<String> values) {
addCriterion("test_id not in", values, "testId");
return (Criteria) this;
}
public Criteria andTestIdBetween(String value1, String value2) {
addCriterion("test_id between", value1, value2, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotBetween(String value1, String value2) {
addCriterion("test_id not between", value1, value2, "testId");
return (Criteria) this;
}
public Criteria andNodePathIsNull() {
addCriterion("node_path is null");
return (Criteria) this;
@ -924,76 +994,6 @@ public class TestCaseExample {
return (Criteria) this;
}
public Criteria andTestIdIsNull() {
addCriterion("test_id is null");
return (Criteria) this;
}
public Criteria andTestIdIsNotNull() {
addCriterion("test_id is not null");
return (Criteria) this;
}
public Criteria andTestIdEqualTo(String value) {
addCriterion("test_id =", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotEqualTo(String value) {
addCriterion("test_id <>", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdGreaterThan(String value) {
addCriterion("test_id >", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdGreaterThanOrEqualTo(String value) {
addCriterion("test_id >=", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLessThan(String value) {
addCriterion("test_id <", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLessThanOrEqualTo(String value) {
addCriterion("test_id <=", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLike(String value) {
addCriterion("test_id like", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotLike(String value) {
addCriterion("test_id not like", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdIn(List<String> values) {
addCriterion("test_id in", values, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotIn(List<String> values) {
addCriterion("test_id not in", values, "testId");
return (Criteria) this;
}
public Criteria andTestIdBetween(String value1, String value2) {
addCriterion("test_id between", value1, value2, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotBetween(String value1, String value2) {
addCriterion("test_id not between", value1, value2, "testId");
return (Criteria) this;
}
public Criteria andSortIsNull() {
addCriterion("sort is null");
return (Criteria) this;

View File

@ -0,0 +1,23 @@
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class TestCaseReviewApiCase implements Serializable {
private String id;
private String testCaseReviewId;
private String apiCaseId;
private String status;
private String environmentId;
private Long createTime;
private Long updateTime;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,670 @@
package io.metersphere.base.domain;
import java.util.ArrayList;
import java.util.List;
public class TestCaseReviewApiCaseExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TestCaseReviewApiCaseExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdIsNull() {
addCriterion("test_case_review_id is null");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdIsNotNull() {
addCriterion("test_case_review_id is not null");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdEqualTo(String value) {
addCriterion("test_case_review_id =", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdNotEqualTo(String value) {
addCriterion("test_case_review_id <>", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdGreaterThan(String value) {
addCriterion("test_case_review_id >", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdGreaterThanOrEqualTo(String value) {
addCriterion("test_case_review_id >=", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdLessThan(String value) {
addCriterion("test_case_review_id <", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdLessThanOrEqualTo(String value) {
addCriterion("test_case_review_id <=", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdLike(String value) {
addCriterion("test_case_review_id like", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdNotLike(String value) {
addCriterion("test_case_review_id not like", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdIn(List<String> values) {
addCriterion("test_case_review_id in", values, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdNotIn(List<String> values) {
addCriterion("test_case_review_id not in", values, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdBetween(String value1, String value2) {
addCriterion("test_case_review_id between", value1, value2, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdNotBetween(String value1, String value2) {
addCriterion("test_case_review_id not between", value1, value2, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andApiCaseIdIsNull() {
addCriterion("api_case_id is null");
return (Criteria) this;
}
public Criteria andApiCaseIdIsNotNull() {
addCriterion("api_case_id is not null");
return (Criteria) this;
}
public Criteria andApiCaseIdEqualTo(String value) {
addCriterion("api_case_id =", value, "apiCaseId");
return (Criteria) this;
}
public Criteria andApiCaseIdNotEqualTo(String value) {
addCriterion("api_case_id <>", value, "apiCaseId");
return (Criteria) this;
}
public Criteria andApiCaseIdGreaterThan(String value) {
addCriterion("api_case_id >", value, "apiCaseId");
return (Criteria) this;
}
public Criteria andApiCaseIdGreaterThanOrEqualTo(String value) {
addCriterion("api_case_id >=", value, "apiCaseId");
return (Criteria) this;
}
public Criteria andApiCaseIdLessThan(String value) {
addCriterion("api_case_id <", value, "apiCaseId");
return (Criteria) this;
}
public Criteria andApiCaseIdLessThanOrEqualTo(String value) {
addCriterion("api_case_id <=", value, "apiCaseId");
return (Criteria) this;
}
public Criteria andApiCaseIdLike(String value) {
addCriterion("api_case_id like", value, "apiCaseId");
return (Criteria) this;
}
public Criteria andApiCaseIdNotLike(String value) {
addCriterion("api_case_id not like", value, "apiCaseId");
return (Criteria) this;
}
public Criteria andApiCaseIdIn(List<String> values) {
addCriterion("api_case_id in", values, "apiCaseId");
return (Criteria) this;
}
public Criteria andApiCaseIdNotIn(List<String> values) {
addCriterion("api_case_id not in", values, "apiCaseId");
return (Criteria) this;
}
public Criteria andApiCaseIdBetween(String value1, String value2) {
addCriterion("api_case_id between", value1, value2, "apiCaseId");
return (Criteria) this;
}
public Criteria andApiCaseIdNotBetween(String value1, String value2) {
addCriterion("api_case_id not between", value1, value2, "apiCaseId");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("`status` like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("`status` not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andEnvironmentIdIsNull() {
addCriterion("environment_id is null");
return (Criteria) this;
}
public Criteria andEnvironmentIdIsNotNull() {
addCriterion("environment_id is not null");
return (Criteria) this;
}
public Criteria andEnvironmentIdEqualTo(String value) {
addCriterion("environment_id =", value, "environmentId");
return (Criteria) this;
}
public Criteria andEnvironmentIdNotEqualTo(String value) {
addCriterion("environment_id <>", value, "environmentId");
return (Criteria) this;
}
public Criteria andEnvironmentIdGreaterThan(String value) {
addCriterion("environment_id >", value, "environmentId");
return (Criteria) this;
}
public Criteria andEnvironmentIdGreaterThanOrEqualTo(String value) {
addCriterion("environment_id >=", value, "environmentId");
return (Criteria) this;
}
public Criteria andEnvironmentIdLessThan(String value) {
addCriterion("environment_id <", value, "environmentId");
return (Criteria) this;
}
public Criteria andEnvironmentIdLessThanOrEqualTo(String value) {
addCriterion("environment_id <=", value, "environmentId");
return (Criteria) this;
}
public Criteria andEnvironmentIdLike(String value) {
addCriterion("environment_id like", value, "environmentId");
return (Criteria) this;
}
public Criteria andEnvironmentIdNotLike(String value) {
addCriterion("environment_id not like", value, "environmentId");
return (Criteria) this;
}
public Criteria andEnvironmentIdIn(List<String> values) {
addCriterion("environment_id in", values, "environmentId");
return (Criteria) this;
}
public Criteria andEnvironmentIdNotIn(List<String> values) {
addCriterion("environment_id not in", values, "environmentId");
return (Criteria) this;
}
public Criteria andEnvironmentIdBetween(String value1, String value2) {
addCriterion("environment_id between", value1, value2, "environmentId");
return (Criteria) this;
}
public Criteria andEnvironmentIdNotBetween(String value1, String value2) {
addCriterion("environment_id not between", value1, value2, "environmentId");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Long value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Long value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Long value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Long value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Long> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Long> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Long value1, Long value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Long value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Long value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Long value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Long value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Long value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Long> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Long> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Long value1, Long value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Long value1, Long value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,23 @@
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class TestCaseReviewLoad implements Serializable {
private String id;
private String testCaseReviewId;
private String loadCaseId;
private String status;
private Long createTime;
private Long updateTime;
private String loadReportId;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,670 @@
package io.metersphere.base.domain;
import java.util.ArrayList;
import java.util.List;
public class TestCaseReviewLoadExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TestCaseReviewLoadExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdIsNull() {
addCriterion("test_case_review_id is null");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdIsNotNull() {
addCriterion("test_case_review_id is not null");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdEqualTo(String value) {
addCriterion("test_case_review_id =", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdNotEqualTo(String value) {
addCriterion("test_case_review_id <>", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdGreaterThan(String value) {
addCriterion("test_case_review_id >", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdGreaterThanOrEqualTo(String value) {
addCriterion("test_case_review_id >=", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdLessThan(String value) {
addCriterion("test_case_review_id <", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdLessThanOrEqualTo(String value) {
addCriterion("test_case_review_id <=", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdLike(String value) {
addCriterion("test_case_review_id like", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdNotLike(String value) {
addCriterion("test_case_review_id not like", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdIn(List<String> values) {
addCriterion("test_case_review_id in", values, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdNotIn(List<String> values) {
addCriterion("test_case_review_id not in", values, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdBetween(String value1, String value2) {
addCriterion("test_case_review_id between", value1, value2, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdNotBetween(String value1, String value2) {
addCriterion("test_case_review_id not between", value1, value2, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andLoadCaseIdIsNull() {
addCriterion("load_case_id is null");
return (Criteria) this;
}
public Criteria andLoadCaseIdIsNotNull() {
addCriterion("load_case_id is not null");
return (Criteria) this;
}
public Criteria andLoadCaseIdEqualTo(String value) {
addCriterion("load_case_id =", value, "loadCaseId");
return (Criteria) this;
}
public Criteria andLoadCaseIdNotEqualTo(String value) {
addCriterion("load_case_id <>", value, "loadCaseId");
return (Criteria) this;
}
public Criteria andLoadCaseIdGreaterThan(String value) {
addCriterion("load_case_id >", value, "loadCaseId");
return (Criteria) this;
}
public Criteria andLoadCaseIdGreaterThanOrEqualTo(String value) {
addCriterion("load_case_id >=", value, "loadCaseId");
return (Criteria) this;
}
public Criteria andLoadCaseIdLessThan(String value) {
addCriterion("load_case_id <", value, "loadCaseId");
return (Criteria) this;
}
public Criteria andLoadCaseIdLessThanOrEqualTo(String value) {
addCriterion("load_case_id <=", value, "loadCaseId");
return (Criteria) this;
}
public Criteria andLoadCaseIdLike(String value) {
addCriterion("load_case_id like", value, "loadCaseId");
return (Criteria) this;
}
public Criteria andLoadCaseIdNotLike(String value) {
addCriterion("load_case_id not like", value, "loadCaseId");
return (Criteria) this;
}
public Criteria andLoadCaseIdIn(List<String> values) {
addCriterion("load_case_id in", values, "loadCaseId");
return (Criteria) this;
}
public Criteria andLoadCaseIdNotIn(List<String> values) {
addCriterion("load_case_id not in", values, "loadCaseId");
return (Criteria) this;
}
public Criteria andLoadCaseIdBetween(String value1, String value2) {
addCriterion("load_case_id between", value1, value2, "loadCaseId");
return (Criteria) this;
}
public Criteria andLoadCaseIdNotBetween(String value1, String value2) {
addCriterion("load_case_id not between", value1, value2, "loadCaseId");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("`status` like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("`status` not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Long value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Long value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Long value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Long value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Long> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Long> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Long value1, Long value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Long value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Long value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Long value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Long value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Long value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Long> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Long> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Long value1, Long value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Long value1, Long value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andLoadReportIdIsNull() {
addCriterion("load_report_id is null");
return (Criteria) this;
}
public Criteria andLoadReportIdIsNotNull() {
addCriterion("load_report_id is not null");
return (Criteria) this;
}
public Criteria andLoadReportIdEqualTo(String value) {
addCriterion("load_report_id =", value, "loadReportId");
return (Criteria) this;
}
public Criteria andLoadReportIdNotEqualTo(String value) {
addCriterion("load_report_id <>", value, "loadReportId");
return (Criteria) this;
}
public Criteria andLoadReportIdGreaterThan(String value) {
addCriterion("load_report_id >", value, "loadReportId");
return (Criteria) this;
}
public Criteria andLoadReportIdGreaterThanOrEqualTo(String value) {
addCriterion("load_report_id >=", value, "loadReportId");
return (Criteria) this;
}
public Criteria andLoadReportIdLessThan(String value) {
addCriterion("load_report_id <", value, "loadReportId");
return (Criteria) this;
}
public Criteria andLoadReportIdLessThanOrEqualTo(String value) {
addCriterion("load_report_id <=", value, "loadReportId");
return (Criteria) this;
}
public Criteria andLoadReportIdLike(String value) {
addCriterion("load_report_id like", value, "loadReportId");
return (Criteria) this;
}
public Criteria andLoadReportIdNotLike(String value) {
addCriterion("load_report_id not like", value, "loadReportId");
return (Criteria) this;
}
public Criteria andLoadReportIdIn(List<String> values) {
addCriterion("load_report_id in", values, "loadReportId");
return (Criteria) this;
}
public Criteria andLoadReportIdNotIn(List<String> values) {
addCriterion("load_report_id not in", values, "loadReportId");
return (Criteria) this;
}
public Criteria andLoadReportIdBetween(String value1, String value2) {
addCriterion("load_report_id between", value1, value2, "loadReportId");
return (Criteria) this;
}
public Criteria andLoadReportIdNotBetween(String value1, String value2) {
addCriterion("load_report_id not between", value1, value2, "loadReportId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,29 @@
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class TestCaseReviewScenario implements Serializable {
private String id;
private String testCaseReviewId;
private String apiScenarioId;
private String status;
private String environment;
private Long createTime;
private Long updateTime;
private String passRate;
private String lastResult;
private String reportId;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,880 @@
package io.metersphere.base.domain;
import java.util.ArrayList;
import java.util.List;
public class TestCaseReviewScenarioExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TestCaseReviewScenarioExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdIsNull() {
addCriterion("test_case_review_id is null");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdIsNotNull() {
addCriterion("test_case_review_id is not null");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdEqualTo(String value) {
addCriterion("test_case_review_id =", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdNotEqualTo(String value) {
addCriterion("test_case_review_id <>", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdGreaterThan(String value) {
addCriterion("test_case_review_id >", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdGreaterThanOrEqualTo(String value) {
addCriterion("test_case_review_id >=", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdLessThan(String value) {
addCriterion("test_case_review_id <", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdLessThanOrEqualTo(String value) {
addCriterion("test_case_review_id <=", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdLike(String value) {
addCriterion("test_case_review_id like", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdNotLike(String value) {
addCriterion("test_case_review_id not like", value, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdIn(List<String> values) {
addCriterion("test_case_review_id in", values, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdNotIn(List<String> values) {
addCriterion("test_case_review_id not in", values, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdBetween(String value1, String value2) {
addCriterion("test_case_review_id between", value1, value2, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andTestCaseReviewIdNotBetween(String value1, String value2) {
addCriterion("test_case_review_id not between", value1, value2, "testCaseReviewId");
return (Criteria) this;
}
public Criteria andApiScenarioIdIsNull() {
addCriterion("api_scenario_id is null");
return (Criteria) this;
}
public Criteria andApiScenarioIdIsNotNull() {
addCriterion("api_scenario_id is not null");
return (Criteria) this;
}
public Criteria andApiScenarioIdEqualTo(String value) {
addCriterion("api_scenario_id =", value, "apiScenarioId");
return (Criteria) this;
}
public Criteria andApiScenarioIdNotEqualTo(String value) {
addCriterion("api_scenario_id <>", value, "apiScenarioId");
return (Criteria) this;
}
public Criteria andApiScenarioIdGreaterThan(String value) {
addCriterion("api_scenario_id >", value, "apiScenarioId");
return (Criteria) this;
}
public Criteria andApiScenarioIdGreaterThanOrEqualTo(String value) {
addCriterion("api_scenario_id >=", value, "apiScenarioId");
return (Criteria) this;
}
public Criteria andApiScenarioIdLessThan(String value) {
addCriterion("api_scenario_id <", value, "apiScenarioId");
return (Criteria) this;
}
public Criteria andApiScenarioIdLessThanOrEqualTo(String value) {
addCriterion("api_scenario_id <=", value, "apiScenarioId");
return (Criteria) this;
}
public Criteria andApiScenarioIdLike(String value) {
addCriterion("api_scenario_id like", value, "apiScenarioId");
return (Criteria) this;
}
public Criteria andApiScenarioIdNotLike(String value) {
addCriterion("api_scenario_id not like", value, "apiScenarioId");
return (Criteria) this;
}
public Criteria andApiScenarioIdIn(List<String> values) {
addCriterion("api_scenario_id in", values, "apiScenarioId");
return (Criteria) this;
}
public Criteria andApiScenarioIdNotIn(List<String> values) {
addCriterion("api_scenario_id not in", values, "apiScenarioId");
return (Criteria) this;
}
public Criteria andApiScenarioIdBetween(String value1, String value2) {
addCriterion("api_scenario_id between", value1, value2, "apiScenarioId");
return (Criteria) this;
}
public Criteria andApiScenarioIdNotBetween(String value1, String value2) {
addCriterion("api_scenario_id not between", value1, value2, "apiScenarioId");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("`status` like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("`status` not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andEnvironmentIsNull() {
addCriterion("environment is null");
return (Criteria) this;
}
public Criteria andEnvironmentIsNotNull() {
addCriterion("environment is not null");
return (Criteria) this;
}
public Criteria andEnvironmentEqualTo(String value) {
addCriterion("environment =", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentNotEqualTo(String value) {
addCriterion("environment <>", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentGreaterThan(String value) {
addCriterion("environment >", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentGreaterThanOrEqualTo(String value) {
addCriterion("environment >=", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentLessThan(String value) {
addCriterion("environment <", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentLessThanOrEqualTo(String value) {
addCriterion("environment <=", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentLike(String value) {
addCriterion("environment like", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentNotLike(String value) {
addCriterion("environment not like", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentIn(List<String> values) {
addCriterion("environment in", values, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentNotIn(List<String> values) {
addCriterion("environment not in", values, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentBetween(String value1, String value2) {
addCriterion("environment between", value1, value2, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentNotBetween(String value1, String value2) {
addCriterion("environment not between", value1, value2, "environment");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Long value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Long value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Long value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Long value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Long> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Long> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Long value1, Long value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Long value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Long value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Long value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Long value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Long value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Long> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Long> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Long value1, Long value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Long value1, Long value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andPassRateIsNull() {
addCriterion("pass_rate is null");
return (Criteria) this;
}
public Criteria andPassRateIsNotNull() {
addCriterion("pass_rate is not null");
return (Criteria) this;
}
public Criteria andPassRateEqualTo(String value) {
addCriterion("pass_rate =", value, "passRate");
return (Criteria) this;
}
public Criteria andPassRateNotEqualTo(String value) {
addCriterion("pass_rate <>", value, "passRate");
return (Criteria) this;
}
public Criteria andPassRateGreaterThan(String value) {
addCriterion("pass_rate >", value, "passRate");
return (Criteria) this;
}
public Criteria andPassRateGreaterThanOrEqualTo(String value) {
addCriterion("pass_rate >=", value, "passRate");
return (Criteria) this;
}
public Criteria andPassRateLessThan(String value) {
addCriterion("pass_rate <", value, "passRate");
return (Criteria) this;
}
public Criteria andPassRateLessThanOrEqualTo(String value) {
addCriterion("pass_rate <=", value, "passRate");
return (Criteria) this;
}
public Criteria andPassRateLike(String value) {
addCriterion("pass_rate like", value, "passRate");
return (Criteria) this;
}
public Criteria andPassRateNotLike(String value) {
addCriterion("pass_rate not like", value, "passRate");
return (Criteria) this;
}
public Criteria andPassRateIn(List<String> values) {
addCriterion("pass_rate in", values, "passRate");
return (Criteria) this;
}
public Criteria andPassRateNotIn(List<String> values) {
addCriterion("pass_rate not in", values, "passRate");
return (Criteria) this;
}
public Criteria andPassRateBetween(String value1, String value2) {
addCriterion("pass_rate between", value1, value2, "passRate");
return (Criteria) this;
}
public Criteria andPassRateNotBetween(String value1, String value2) {
addCriterion("pass_rate not between", value1, value2, "passRate");
return (Criteria) this;
}
public Criteria andLastResultIsNull() {
addCriterion("last_result is null");
return (Criteria) this;
}
public Criteria andLastResultIsNotNull() {
addCriterion("last_result is not null");
return (Criteria) this;
}
public Criteria andLastResultEqualTo(String value) {
addCriterion("last_result =", value, "lastResult");
return (Criteria) this;
}
public Criteria andLastResultNotEqualTo(String value) {
addCriterion("last_result <>", value, "lastResult");
return (Criteria) this;
}
public Criteria andLastResultGreaterThan(String value) {
addCriterion("last_result >", value, "lastResult");
return (Criteria) this;
}
public Criteria andLastResultGreaterThanOrEqualTo(String value) {
addCriterion("last_result >=", value, "lastResult");
return (Criteria) this;
}
public Criteria andLastResultLessThan(String value) {
addCriterion("last_result <", value, "lastResult");
return (Criteria) this;
}
public Criteria andLastResultLessThanOrEqualTo(String value) {
addCriterion("last_result <=", value, "lastResult");
return (Criteria) this;
}
public Criteria andLastResultLike(String value) {
addCriterion("last_result like", value, "lastResult");
return (Criteria) this;
}
public Criteria andLastResultNotLike(String value) {
addCriterion("last_result not like", value, "lastResult");
return (Criteria) this;
}
public Criteria andLastResultIn(List<String> values) {
addCriterion("last_result in", values, "lastResult");
return (Criteria) this;
}
public Criteria andLastResultNotIn(List<String> values) {
addCriterion("last_result not in", values, "lastResult");
return (Criteria) this;
}
public Criteria andLastResultBetween(String value1, String value2) {
addCriterion("last_result between", value1, value2, "lastResult");
return (Criteria) this;
}
public Criteria andLastResultNotBetween(String value1, String value2) {
addCriterion("last_result not between", value1, value2, "lastResult");
return (Criteria) this;
}
public Criteria andReportIdIsNull() {
addCriterion("report_id is null");
return (Criteria) this;
}
public Criteria andReportIdIsNotNull() {
addCriterion("report_id is not null");
return (Criteria) this;
}
public Criteria andReportIdEqualTo(String value) {
addCriterion("report_id =", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdNotEqualTo(String value) {
addCriterion("report_id <>", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdGreaterThan(String value) {
addCriterion("report_id >", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdGreaterThanOrEqualTo(String value) {
addCriterion("report_id >=", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdLessThan(String value) {
addCriterion("report_id <", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdLessThanOrEqualTo(String value) {
addCriterion("report_id <=", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdLike(String value) {
addCriterion("report_id like", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdNotLike(String value) {
addCriterion("report_id not like", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdIn(List<String> values) {
addCriterion("report_id in", values, "reportId");
return (Criteria) this;
}
public Criteria andReportIdNotIn(List<String> values) {
addCriterion("report_id not in", values, "reportId");
return (Criteria) this;
}
public Criteria andReportIdBetween(String value1, String value2) {
addCriterion("report_id between", value1, value2, "reportId");
return (Criteria) this;
}
public Criteria andReportIdNotBetween(String value1, String value2) {
addCriterion("report_id not between", value1, value2, "reportId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -16,21 +16,15 @@ public interface ScheduleMapper {
int insertSelective(Schedule record);
List<Schedule> selectByExampleWithBLOBs(ScheduleExample example);
List<Schedule> selectByExample(ScheduleExample example);
Schedule selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") Schedule record, @Param("example") ScheduleExample example);
int updateByExampleWithBLOBs(@Param("record") Schedule record, @Param("example") ScheduleExample example);
int updateByExample(@Param("record") Schedule record, @Param("example") ScheduleExample example);
int updateByPrimaryKeySelective(Schedule record);
int updateByPrimaryKeyWithBLOBs(Schedule record);
int updateByPrimaryKey(Schedule record);
}

View File

@ -14,9 +14,8 @@
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.Schedule">
<result column="custom_data" jdbcType="LONGVARCHAR" property="customData" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -78,27 +77,8 @@
</sql>
<sql id="Base_Column_List">
id, `key`, `type`, `value`, `group`, job, `enable`, resource_id, user_id, workspace_id,
create_time, update_time
create_time, update_time, project_id, `name`
</sql>
<sql id="Blob_Column_List">
custom_data
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ScheduleExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from schedule
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.ScheduleExample" resultMap="BaseResultMap">
select
<if test="distinct">
@ -113,11 +93,9 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from schedule
where id = #{id,jdbcType=VARCHAR}
</select>
@ -136,12 +114,12 @@
`value`, `group`, job,
`enable`, resource_id, user_id,
workspace_id, create_time, update_time,
custom_data)
project_id, `name`)
values (#{id,jdbcType=VARCHAR}, #{key,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{value,jdbcType=VARCHAR}, #{group,jdbcType=VARCHAR}, #{job,jdbcType=VARCHAR},
#{enable,jdbcType=BIT}, #{resourceId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR},
#{workspaceId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{customData,jdbcType=LONGVARCHAR})
#{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.Schedule">
insert into schedule
@ -182,8 +160,11 @@
<if test="updateTime != null">
update_time,
</if>
<if test="customData != null">
custom_data,
<if test="projectId != null">
project_id,
</if>
<if test="name != null">
`name`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -223,8 +204,11 @@
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="customData != null">
#{customData,jdbcType=LONGVARCHAR},
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
</trim>
</insert>
@ -273,33 +257,17 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.customData != null">
custom_data = #{record.customData,jdbcType=LONGVARCHAR},
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update schedule
set id = #{record.id,jdbcType=VARCHAR},
`key` = #{record.key,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR},
`value` = #{record.value,jdbcType=VARCHAR},
`group` = #{record.group,jdbcType=VARCHAR},
job = #{record.job,jdbcType=VARCHAR},
`enable` = #{record.enable,jdbcType=BIT},
resource_id = #{record.resourceId,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
custom_data = #{record.customData,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update schedule
set id = #{record.id,jdbcType=VARCHAR},
@ -313,7 +281,9 @@
user_id = #{record.userId,jdbcType=VARCHAR},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
update_time = #{record.updateTime,jdbcType=BIGINT},
project_id = #{record.projectId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -354,28 +324,15 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="customData != null">
custom_data = #{customData,jdbcType=LONGVARCHAR},
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.Schedule">
update schedule
set `key` = #{key,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR},
`value` = #{value,jdbcType=VARCHAR},
`group` = #{group,jdbcType=VARCHAR},
job = #{job,jdbcType=VARCHAR},
`enable` = #{enable,jdbcType=BIT},
resource_id = #{resourceId,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
custom_data = #{customData,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.Schedule">
update schedule
set `key` = #{key,jdbcType=VARCHAR},
@ -388,7 +345,9 @@
user_id = #{userId,jdbcType=VARCHAR},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
update_time = #{updateTime,jdbcType=BIGINT},
project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -0,0 +1,30 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.TestCaseReviewApiCase;
import io.metersphere.base.domain.TestCaseReviewApiCaseExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TestCaseReviewApiCaseMapper {
long countByExample(TestCaseReviewApiCaseExample example);
int deleteByExample(TestCaseReviewApiCaseExample example);
int deleteByPrimaryKey(String id);
int insert(TestCaseReviewApiCase record);
int insertSelective(TestCaseReviewApiCase record);
List<TestCaseReviewApiCase> selectByExample(TestCaseReviewApiCaseExample example);
TestCaseReviewApiCase selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") TestCaseReviewApiCase record, @Param("example") TestCaseReviewApiCaseExample example);
int updateByExample(@Param("record") TestCaseReviewApiCase record, @Param("example") TestCaseReviewApiCaseExample example);
int updateByPrimaryKeySelective(TestCaseReviewApiCase record);
int updateByPrimaryKey(TestCaseReviewApiCase record);
}

View File

@ -0,0 +1,243 @@
<?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.base.mapper.TestCaseReviewApiCaseMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestCaseReviewApiCase">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="test_case_review_id" jdbcType="VARCHAR" property="testCaseReviewId" />
<result column="api_case_id" jdbcType="VARCHAR" property="apiCaseId" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="environment_id" jdbcType="VARCHAR" property="environmentId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, test_case_review_id, api_case_id, `status`, environment_id, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestCaseReviewApiCaseExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from test_case_review_api_case
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from test_case_review_api_case
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from test_case_review_api_case
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.TestCaseReviewApiCaseExample">
delete from test_case_review_api_case
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseReviewApiCase">
insert into test_case_review_api_case (id, test_case_review_id, api_case_id,
`status`, environment_id, create_time,
update_time)
values (#{id,jdbcType=VARCHAR}, #{testCaseReviewId,jdbcType=VARCHAR}, #{apiCaseId,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseReviewApiCase">
insert into test_case_review_api_case
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="testCaseReviewId != null">
test_case_review_id,
</if>
<if test="apiCaseId != null">
api_case_id,
</if>
<if test="status != null">
`status`,
</if>
<if test="environmentId != null">
environment_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="testCaseReviewId != null">
#{testCaseReviewId,jdbcType=VARCHAR},
</if>
<if test="apiCaseId != null">
#{apiCaseId,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="environmentId != null">
#{environmentId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.TestCaseReviewApiCaseExample" resultType="java.lang.Long">
select count(*) from test_case_review_api_case
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update test_case_review_api_case
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.testCaseReviewId != null">
test_case_review_id = #{record.testCaseReviewId,jdbcType=VARCHAR},
</if>
<if test="record.apiCaseId != null">
api_case_id = #{record.apiCaseId,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.environmentId != null">
environment_id = #{record.environmentId,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update test_case_review_api_case
set id = #{record.id,jdbcType=VARCHAR},
test_case_review_id = #{record.testCaseReviewId,jdbcType=VARCHAR},
api_case_id = #{record.apiCaseId,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
environment_id = #{record.environmentId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.TestCaseReviewApiCase">
update test_case_review_api_case
<set>
<if test="testCaseReviewId != null">
test_case_review_id = #{testCaseReviewId,jdbcType=VARCHAR},
</if>
<if test="apiCaseId != null">
api_case_id = #{apiCaseId,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="environmentId != null">
environment_id = #{environmentId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCaseReviewApiCase">
update test_case_review_api_case
set test_case_review_id = #{testCaseReviewId,jdbcType=VARCHAR},
api_case_id = #{apiCaseId,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
environment_id = #{environmentId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -0,0 +1,30 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.TestCaseReviewLoad;
import io.metersphere.base.domain.TestCaseReviewLoadExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TestCaseReviewLoadMapper {
long countByExample(TestCaseReviewLoadExample example);
int deleteByExample(TestCaseReviewLoadExample example);
int deleteByPrimaryKey(String id);
int insert(TestCaseReviewLoad record);
int insertSelective(TestCaseReviewLoad record);
List<TestCaseReviewLoad> selectByExample(TestCaseReviewLoadExample example);
TestCaseReviewLoad selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") TestCaseReviewLoad record, @Param("example") TestCaseReviewLoadExample example);
int updateByExample(@Param("record") TestCaseReviewLoad record, @Param("example") TestCaseReviewLoadExample example);
int updateByPrimaryKeySelective(TestCaseReviewLoad record);
int updateByPrimaryKey(TestCaseReviewLoad record);
}

View File

@ -0,0 +1,243 @@
<?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.base.mapper.TestCaseReviewLoadMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestCaseReviewLoad">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="test_case_review_id" jdbcType="VARCHAR" property="testCaseReviewId" />
<result column="load_case_id" jdbcType="VARCHAR" property="loadCaseId" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="load_report_id" jdbcType="VARCHAR" property="loadReportId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, test_case_review_id, load_case_id, `status`, create_time, update_time, load_report_id
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestCaseReviewLoadExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from test_case_review_load
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from test_case_review_load
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from test_case_review_load
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.TestCaseReviewLoadExample">
delete from test_case_review_load
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseReviewLoad">
insert into test_case_review_load (id, test_case_review_id, load_case_id,
`status`, create_time, update_time,
load_report_id)
values (#{id,jdbcType=VARCHAR}, #{testCaseReviewId,jdbcType=VARCHAR}, #{loadCaseId,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{loadReportId,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseReviewLoad">
insert into test_case_review_load
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="testCaseReviewId != null">
test_case_review_id,
</if>
<if test="loadCaseId != null">
load_case_id,
</if>
<if test="status != null">
`status`,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="loadReportId != null">
load_report_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="testCaseReviewId != null">
#{testCaseReviewId,jdbcType=VARCHAR},
</if>
<if test="loadCaseId != null">
#{loadCaseId,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="loadReportId != null">
#{loadReportId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.TestCaseReviewLoadExample" resultType="java.lang.Long">
select count(*) from test_case_review_load
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update test_case_review_load
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.testCaseReviewId != null">
test_case_review_id = #{record.testCaseReviewId,jdbcType=VARCHAR},
</if>
<if test="record.loadCaseId != null">
load_case_id = #{record.loadCaseId,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.loadReportId != null">
load_report_id = #{record.loadReportId,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update test_case_review_load
set id = #{record.id,jdbcType=VARCHAR},
test_case_review_id = #{record.testCaseReviewId,jdbcType=VARCHAR},
load_case_id = #{record.loadCaseId,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
load_report_id = #{record.loadReportId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.TestCaseReviewLoad">
update test_case_review_load
<set>
<if test="testCaseReviewId != null">
test_case_review_id = #{testCaseReviewId,jdbcType=VARCHAR},
</if>
<if test="loadCaseId != null">
load_case_id = #{loadCaseId,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="loadReportId != null">
load_report_id = #{loadReportId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCaseReviewLoad">
update test_case_review_load
set test_case_review_id = #{testCaseReviewId,jdbcType=VARCHAR},
load_case_id = #{loadCaseId,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
load_report_id = #{loadReportId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -0,0 +1,30 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.TestCaseReviewScenario;
import io.metersphere.base.domain.TestCaseReviewScenarioExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TestCaseReviewScenarioMapper {
long countByExample(TestCaseReviewScenarioExample example);
int deleteByExample(TestCaseReviewScenarioExample example);
int deleteByPrimaryKey(String id);
int insert(TestCaseReviewScenario record);
int insertSelective(TestCaseReviewScenario record);
List<TestCaseReviewScenario> selectByExample(TestCaseReviewScenarioExample example);
TestCaseReviewScenario selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") TestCaseReviewScenario record, @Param("example") TestCaseReviewScenarioExample example);
int updateByExample(@Param("record") TestCaseReviewScenario record, @Param("example") TestCaseReviewScenarioExample example);
int updateByPrimaryKeySelective(TestCaseReviewScenario record);
int updateByPrimaryKey(TestCaseReviewScenario record);
}

View File

@ -0,0 +1,291 @@
<?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.base.mapper.TestCaseReviewScenarioMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestCaseReviewScenario">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="test_case_review_id" jdbcType="VARCHAR" property="testCaseReviewId" />
<result column="api_scenario_id" jdbcType="VARCHAR" property="apiScenarioId" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="environment" jdbcType="VARCHAR" property="environment" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="pass_rate" jdbcType="VARCHAR" property="passRate" />
<result column="last_result" jdbcType="VARCHAR" property="lastResult" />
<result column="report_id" jdbcType="VARCHAR" property="reportId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, test_case_review_id, api_scenario_id, `status`, environment, create_time, update_time,
pass_rate, last_result, report_id
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestCaseReviewScenarioExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from test_case_review_scenario
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from test_case_review_scenario
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from test_case_review_scenario
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.TestCaseReviewScenarioExample">
delete from test_case_review_scenario
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseReviewScenario">
insert into test_case_review_scenario (id, test_case_review_id, api_scenario_id,
`status`, environment, create_time,
update_time, pass_rate, last_result,
report_id)
values (#{id,jdbcType=VARCHAR}, #{testCaseReviewId,jdbcType=VARCHAR}, #{apiScenarioId,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{environment,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{passRate,jdbcType=VARCHAR}, #{lastResult,jdbcType=VARCHAR},
#{reportId,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseReviewScenario">
insert into test_case_review_scenario
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="testCaseReviewId != null">
test_case_review_id,
</if>
<if test="apiScenarioId != null">
api_scenario_id,
</if>
<if test="status != null">
`status`,
</if>
<if test="environment != null">
environment,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="passRate != null">
pass_rate,
</if>
<if test="lastResult != null">
last_result,
</if>
<if test="reportId != null">
report_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="testCaseReviewId != null">
#{testCaseReviewId,jdbcType=VARCHAR},
</if>
<if test="apiScenarioId != null">
#{apiScenarioId,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="environment != null">
#{environment,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="passRate != null">
#{passRate,jdbcType=VARCHAR},
</if>
<if test="lastResult != null">
#{lastResult,jdbcType=VARCHAR},
</if>
<if test="reportId != null">
#{reportId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.TestCaseReviewScenarioExample" resultType="java.lang.Long">
select count(*) from test_case_review_scenario
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update test_case_review_scenario
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.testCaseReviewId != null">
test_case_review_id = #{record.testCaseReviewId,jdbcType=VARCHAR},
</if>
<if test="record.apiScenarioId != null">
api_scenario_id = #{record.apiScenarioId,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.environment != null">
environment = #{record.environment,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.passRate != null">
pass_rate = #{record.passRate,jdbcType=VARCHAR},
</if>
<if test="record.lastResult != null">
last_result = #{record.lastResult,jdbcType=VARCHAR},
</if>
<if test="record.reportId != null">
report_id = #{record.reportId,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update test_case_review_scenario
set id = #{record.id,jdbcType=VARCHAR},
test_case_review_id = #{record.testCaseReviewId,jdbcType=VARCHAR},
api_scenario_id = #{record.apiScenarioId,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
environment = #{record.environment,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
pass_rate = #{record.passRate,jdbcType=VARCHAR},
last_result = #{record.lastResult,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.TestCaseReviewScenario">
update test_case_review_scenario
<set>
<if test="testCaseReviewId != null">
test_case_review_id = #{testCaseReviewId,jdbcType=VARCHAR},
</if>
<if test="apiScenarioId != null">
api_scenario_id = #{apiScenarioId,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="environment != null">
environment = #{environment,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="passRate != null">
pass_rate = #{passRate,jdbcType=VARCHAR},
</if>
<if test="lastResult != null">
last_result = #{lastResult,jdbcType=VARCHAR},
</if>
<if test="reportId != null">
report_id = #{reportId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCaseReviewScenario">
update test_case_review_scenario
set test_case_review_id = #{testCaseReviewId,jdbcType=VARCHAR},
api_scenario_id = #{apiScenarioId,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
environment = #{environment,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
pass_rate = #{passRate,jdbcType=VARCHAR},
last_result = #{lastResult,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -36,6 +36,6 @@ public interface ExtApiDefinitionMapper {
ApiDefinition getNextNum(@Param("projectId") String projectId);
List<ApiDefinitionResult> listRelevance(@Param("request")ApiDefinitionRequest request);
List<ApiDefinitionResult> listRelevanceReview(@Param("request")ApiDefinitionRequest request);
List<String> selectIds(@Param("request") BaseQueryRequest query);
}

View File

@ -363,6 +363,86 @@
</foreach>
</if>
</select>
<select id="listRelevanceReview" resultType="io.metersphere.api.dto.definition.ApiDefinitionResult">
select
<include refid="io.metersphere.base.mapper.ApiDefinitionMapper.Base_Column_List"/>
from api_definition
<where>
<if test="request.combine != null">
<include refid="combine">
<property name="condition" value="request.combine"/>
<property name="name" value="request.name"/>
<property name="objectKey" value="request.combine.tags"/>
</include>
</if>
<if test="request.name != null">
and api_definition.name like CONCAT('%', #{request.name},'%')
</if>
<if test="request.protocol != null">
AND api_definition.protocol = #{request.protocol}
</if>
<if test="request.id != null">
AND api_definition.id = #{request.id}
</if>
<if test="request.moduleId != null">
AND api_definition.module_id = #{request.moduleId}
</if>
<if test="request.projectId != null">
AND api_definition.project_id = #{request.projectId}
</if>
<if test="request.moduleIds != null and request.moduleIds.size() > 0">
AND api_definition.module_id in
<foreach collection="request.moduleIds" item="nodeId" separator="," open="(" close=")">
#{nodeId}
</foreach>
</if>
<if test="request.filters != null and request.filters.size() > 0">
<foreach collection="request.filters.entrySet()" index="key" item="values">
<if test="values != null and values.size() > 0">
<choose>
<when test="key=='status'">
and api_definition.status in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
<when test="key=='method'">
and api_definition.method in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
<when test="key=='user_id'">
and api_definition.user_id in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
</choose>
</if>
</foreach>
</if>
and exists (
select id
from api_test_case c
where c.api_definition_id = api_definition.id
and not exists (
select id
from test_case_review_api_case t
where t.api_case_id = c.id
and t.test_case_review_id = #{request.reviewId}
)
)
</where>
<if test="request.orders != null and request.orders.size() > 0">
order by
<foreach collection="request.orders" separator="," item="order">
api_definition.${order.name} ${order.type}
</foreach>
</if>
</select>
<select id="selectScheduleList" resultType="io.metersphere.api.dto.definition.ApiSwaggerUrlDTO">
SELECT apiScene.id AS scenarioId,
apiScene.`name` AS `name`,

View File

@ -13,7 +13,7 @@ import java.util.List;
public interface ExtApiScenarioMapper {
List<ApiScenarioDTO> list(@Param("request") ApiScenarioRequest request);
List<ApiScenarioDTO> listReview(@Param("request") ApiScenarioRequest request);
List<ApiScenarioWithBLOBs> selectByTagId(@Param("id") String id);
List<ApiScenarioWithBLOBs> selectIds(@Param("ids") List<String> ids);

View File

@ -337,5 +337,118 @@
<include refid="queryWhereCondition"/>
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
</select>
<select id="listReview" resultMap="BaseResultMap">
select api_scenario.id, api_scenario.project_id, api_scenario.tags, api_scenario.user_id, api_scenario.num,
api_scenario.scenario_definition,
api_scenario.api_scenario_module_id,api_scenario.module_path, api_scenario.name, api_scenario.level,
api_scenario.status, api_scenario.principal, api_scenario.step_total, api_scenario.follow_people,
api_scenario.last_result,api_scenario.pass_rate,api_scenario.report_id,
api_scenario.schedule, api_scenario.description, api_scenario.create_time, api_scenario.update_time,
project.name as project_name, user.name as user_name
from api_scenario
left join project on api_scenario.project_id = project.id
left join user on api_scenario.user_id = user.id
<include refid="queryWhereConditionReview"/>
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
</select>
<sql id="queryWhereConditionReview">
<where>
<if test="request.combine != null">
<include refid="combine">
<property name="condition" value="request.combine"/>
<property name="name" value="request.name"/>
<property name="objectKey" value="request.combine.tags"/>
</include>
</if>
<if test="request.name != null">
and (api_scenario.name like CONCAT('%', #{request.name},'%')
or api_scenario.tags like CONCAT('%', #{request.name},'%')
or api_scenario.num like CONCAT('%', #{request.name},'%'))
</if>
<if test="request.workspaceId != null">
AND project.workspace_id = #{request.workspaceId}
</if>
<if test="request.projectId != null">
AND project.id = #{request.projectId}
</if>
<if test="request.id != null">
AND api_scenario.id = #{request.id}
</if>
<if test="request.userId != null">
AND api_scenario.user_id = #{request.userId}
</if>
<if test="request.moduleId != null">
AND api_scenario.api_scenario_module_id = #{request.moduleId}
</if>
<if test="request.projectId != null">
AND api_scenario.project_id = #{request.projectId}
</if>
<if test="request.createTime >0 ">
AND api_scenario.create_time >= #{request.createTime}
</if>
<if test="request.ids != null and request.ids.size() > 0">
AND api_scenario.id in
<foreach collection="request.ids" item="itemId" separator="," open="(" close=")">
#{itemId}
</foreach>
</if>
<if test="request.moduleIds != null and request.moduleIds.size() > 0">
AND api_scenario.api_scenario_module_id in
<foreach collection="request.moduleIds" item="nodeId" separator="," open="(" close=")">
#{nodeId}
</foreach>
</if>
<if test="request.filters != null and request.filters.size() > 0">
<foreach collection="request.filters.entrySet()" index="key" item="values">
<if test="values != null and values.size() > 0">
<choose>
<when test="key=='status'">
and api_scenario.status in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
<when test="key=='user_id'">
and api_scenario.user_id in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
<when test="key=='level'">
and api_scenario.level in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
<when test="key=='last_result'">
and api_scenario.last_result in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
</choose>
</if>
</foreach>
</if>
<if test="request.executeStatus == 'unExecute'">
and api_scenario.last_result IS NULL
</if>
<if test="request.executeStatus == 'executeFailed'">
and api_scenario.last_result = 'Fail'
</if>
<if test="request.executeStatus == 'executePass'">
and api_scenario.last_result = 'Success'
</if>
<if test="request.notInTestPlan == true ">
and api_scenario.id not in (
select pc.api_scenario_id
from test_case_review_scenario pc
where pc.test_case_review_id = #{request.reviewId}
)
</if>
</where>
</sql>
</mapper>

View File

@ -20,6 +20,8 @@ public interface ExtApiTestCaseMapper {
List<ApiTestCaseDTO> listSimple(@Param("request") ApiTestCaseRequest request);
List<String> selectIdsNotExistsInPlan(@Param("projectId") String projectId, @Param("planId") String planId);
List<String> selectIdsNotExistsInReview(@Param("projectId") String projectId, @Param("reviewId") String reviewId);
List<ApiDataCountResult> countProtocolByProjectID(String projectId);

View File

@ -337,6 +337,15 @@
where pc.test_plan_id = #{planId}
)
</select>
<select id="selectIdsNotExistsInReview" resultType="java.lang.String">
select c.id
from api_test_case c
where c.project_id = #{projectId} and c.id not in (
select pc.api_case_id
from test_case_review_api_case pc
where pc.test_case_review_id = #{reviewId}
)
</select>
<select id="countProtocolByProjectID" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
SELECT apiDef.protocol AS groupField,COUNT(testCase.id) AS countNumber FROM api_test_case testCase

View File

@ -15,10 +15,12 @@ public interface ExtScheduleMapper {
long countTaskByProjectIdAndCreateTimeRange(@Param("projectId")String projectId, @Param("startTime") long startTime, @Param("endTime") long endTime);
List<TaskInfoResult> findRunningTaskInfoByProjectID(String workspaceID);
List<TaskInfoResult> findRunningTaskInfoByProjectID(@Param("projectId") String workspaceID, @Param("types") List<String> typeFilter);
void insert(@Param("apiSwaggerUrlDTO") ApiSwaggerUrlDTO apiSwaggerUrlDTO);
ApiSwaggerUrlDTO select(String id);
int updateNameByResourceID(@Param("resourceId") String resourceId, @Param("name") String name);
}

View File

@ -61,35 +61,33 @@
AND create_time BETWEEN #{startTime} and #{endTime}
</select>
<select id="findRunningTaskInfoByProjectID" resultType="io.metersphere.api.dto.datacount.response.TaskInfoResult">
SELECT apiScene.id AS scenarioId,
apiScene.`name` AS `name`,
sch.id AS taskID,
sch.`value` AS rule,
sch.`enable` AS `taskStatus`,
u.`name` AS creator,
sch.update_time AS updateTime,
'scenario' AS taskType
FROM api_scenario apiScene
INNER JOIN `schedule` sch ON apiScene.id = sch.resource_id
INNER JOIN `user` u ON u.id = sch.user_id
SELECT sch.id AS taskID,
sch.`name` AS `name`,
sch.`value` AS rule,
sch.`enable` AS `taskStatus`,
sch.update_time AS updateTime,
sch.id AS taskID,
sch.`value` AS rule,
sch.`enable` AS `taskStatus`,
u.name AS creator,
sch.update_time AS updateTime,
sch.type AS taskType,
sch.group AS taskGroup
FROM (
schedule sch left join user u
ON sch.user_id = u.id
)
WHERE sch.`enable` = true
AND apiScene.project_id = #{0,jdbcType=VARCHAR}
UNION
SELECT testPlan.id AS scenarioId,
testPlan.`name` AS `name`,
sch.id AS taskID,
sch.`value` AS rule,
sch.`enable` AS `taskStatus`,
u.`name` AS creator,
sch.update_time AS updateTime,
'testPlan' AS taskType
FROM test_plan testPlan
INNER JOIN `schedule` sch ON testPlan.id = sch.resource_id
INNER JOIN `user` u ON u.id = sch.user_id
WHERE sch.`enable` = true
AND testPlan.project_id = #{0,jdbcType=VARCHAR}
AND sch.project_id = #{projectId,jdbcType=VARCHAR}
and sch.group in
<foreach collection="types" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<select id="select" resultType="io.metersphere.api.dto.definition.ApiSwaggerUrlDTO">
select * from swagger_url_project where id=#{id}
</select>
<update id="updateNameByResourceID">
update schedule set name = #{name} where resource_id = #{resourceId}
</update>
</mapper>

View File

@ -306,6 +306,9 @@
or test_case.num like CONCAT('%', #{request.name},'%')
or test_case.tags like CONCAT('%', #{request.name},'%'))
</if>
<if test="request.createTime >0">
AND test_case.create_time >= #{request.createTime}
</if>
<if test="request.nodeIds != null and request.nodeIds.size() > 0">
and test_case.node_id in
<foreach collection="request.nodeIds" item="nodeId" separator="," open="(" close=")">
@ -316,6 +319,12 @@
and test_case.project_id = #{request.projectId}
</if>
<include refid="filters"/>
<if test="request.caseCoverage == 'uncoverage' ">
and test_case.test_id is null and test_case.type != 'functional'
</if>
<if test="request.caseCoverage == 'coverage' ">
and test_case.test_id is not null and test_case.type != 'functional'
</if>
</where>
</sql>

View File

@ -0,0 +1,20 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
import io.metersphere.api.dto.definition.TestPlanApiCaseDTO;
import io.metersphere.base.domain.TestCaseReviewApiCase;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtTestCaseReviewApiCaseMapper {
void insertIfNotExists(@Param("request")TestCaseReviewApiCase testCaseReviewApiCase);
List<TestPlanApiCaseDTO> list(@Param("request") ApiTestCaseRequest request);
List<String> getExecResultByReviewId(String reviewId);
List<String> getIdsByReviewId(String reviewId);
List<String> getNotRelevanceCaseIds(@Param("reviewId")String reviewId, @Param("relevanceProjectIds")List<String> relevanceProjectIds);
List<String> getStatusByTestReviewId(String id);
}

View File

@ -0,0 +1,136 @@
<?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.base.mapper.ext.ExtTestCaseReviewApiCaseMapper">
<insert id="insertIfNotExists" parameterType="io.metersphere.base.domain.TestCaseReviewApiCase">
-- 查询没有数据再插入
INSERT INTO test_case_review_api_case(id, test_case_review_id, api_case_id, environment_id, create_time, update_time)
SELECT #{request.id}, #{request.testCaseReviewId}, #{request.apiCaseId}, #{request.environmentId}, #{request.createTime}, #{request.updateTime}
FROM DUAL
WHERE NOT EXISTS(
SELECT id FROM
test_case_review_api_case
WHERE test_case_review_id = #{request.testCaseReviewId} and api_case_id = #{request.apiCaseId}
)
</insert>
<select id="list" resultType="io.metersphere.api.dto.definition.TestPlanApiCaseDTO">
select
t.id, t.environment_id, t.create_time, t.update_time,
c.id as case_id, c.project_id, c.name, c.api_definition_id, c.priority, c.description, c.create_user_id, c.update_user_id, c.num, c.tags,
a.module_id, a.path, a.protocol, t.status execResult
from
test_case_review_api_case t
inner join
api_test_case c
on t.api_case_id = c.id
<if test="request.reviewId != null and request.planId!=''">
and t.test_case_review_id = #{request.reviewId}
</if>
inner join
api_definition a
on
c.api_definition_id = a.id
<if test="request.protocol != null and request.protocol!=''">
and a.protocol = #{request.protocol}
</if>
<choose>
<when test="request.status == 'Trash'">
and a.status = 'Trash'
</when>
<when test="request.status == null">
and a.status != 'Trash'
</when>
<when test="request.status == ''">
and a.status != 'Trash'
</when>
<when test="request.status == 'running'">
and t.status IS NULL
</when>
<otherwise>
and t.status = #{request.status}
</otherwise>
</choose>
where 1
<if test="request.ids != null and request.ids.size() > 0">
<if test="request.projectId != null and request.projectId!=''">
and
</if>
t.id in
<foreach collection="request.ids" item="caseId" separator="," open="(" close=")">
#{caseId}
</foreach>
</if>
<if test="request.name != null and request.name!=''">
and (c.name like CONCAT('%', #{request.name},'%') or c.tags like CONCAT('%', #{request.name},'%'))
</if>
<if test="request.moduleIds != null and request.moduleIds.size() > 0">
and a.module_id in
<foreach collection="request.moduleIds" item="nodeId" separator="," open="(" close=")">
#{nodeId}
</foreach>
</if>
<if test="request.filters != null and request.filters.size() > 0">
<foreach collection="request.filters.entrySet()" index="key" item="values">
<if test="values != null and values.size() > 0">
<choose>
<when test="key == 'priority'">
and c.priority in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
<when test="key == 'user_id'">
and c.create_user_id in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
</choose>
</if>
</foreach>
</if>
<if test="request.orders != null and request.orders.size() > 0">
order by
<foreach collection="request.orders" separator="," item="order">
<choose>
<when test="order.name == 'update_time'">
t.${order.name} ${order.type}
</when>
<when test="order.name == 'create_user'">
create_user_id ${order.type}
</when>
<otherwise>
${order.name} ${order.type}
</otherwise>
</choose>
</foreach>
</if>
</select>
<select id="getExecResultByReviewId" resultType="java.lang.String">
select status
from
test_case_review_api_case
where test_case_review_id= #{reviewId}
</select>
<select id="getIdsByReviewId" resultType="java.lang.String">
select id
from test_case_review_api_case
where id = #{reviewId}
</select>
<select id="getNotRelevanceCaseIds" resultType="java.lang.String">
select t.id
from test_case_review_api_case t
inner join api_test_case c
on c.id = t.api_case_id
<if test="relevanceProjectIds != null and relevanceProjectIds.size() > 0">
and c.project_id not in
<foreach collection="relevanceProjectIds" item="projectId" separator="," open="(" close=")">
#{projectId}
</foreach>
</if>
where t.test_case_review_id = #{reviewId}
</select>
<select id="getStatusByTestReviewId" resultType="java.lang.String">
SELECT `status` FROM test_case_review_api_case WHERE test_case_review_id = #{0}
</select>
</mapper>

View File

@ -0,0 +1,15 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.dto.TestReviewLoadCaseDTO;
import io.metersphere.track.request.testplan.LoadCaseRequest;
import io.metersphere.track.request.testreview.TestReviewRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtTestCaseReviewLoadMapper {
List<String> selectIdsNotInPlan(@Param("projectId") String projectId, @Param("reviewId") String reviewId);
List<TestReviewLoadCaseDTO> selectTestReviewLoadCaseList(@Param("request") TestReviewRequest request);
void updateCaseStatus(@Param("reportId") String reportId, @Param("status") String status);
List<String> getStatusByreviewId(@Param("reviewId") String reviewId);
}

View File

@ -0,0 +1,71 @@
<?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.base.mapper.ext.ExtTestCaseReviewLoadMapper">
<update id="updateCaseStatus">
update test_case_review_load tplc
set status = #{status}
where tplc.load_report_id = #{reportId}
</update>
<select id="selectIdsNotInPlan" resultType="java.lang.String">
select load_test.id
from load_test
where load_test.project_id = #{projectId}
and load_test.id not in (
select tplc.load_case_id from test_case_review_load tplc where tplc.test_case_review_id = #{reviewId}
)
</select>
<select id="selectTestReviewLoadCaseList" resultType="io.metersphere.dto.TestReviewLoadCaseDTO">
select tplc.id,
u.name as userName,
tplc.create_time,
tplc.update_time,
tplc.test_case_review_id,
tplc.load_case_id,
lt.status,
lt.num,
tplc.status as caseStatus,
lt.name as caseName,
tplc.load_report_id,
p.name as projectName
from test_case_review_load tplc
inner join load_test lt on tplc.load_case_id = lt.id
inner join user u on lt.user_id = u.id
inner join project p on lt.project_id = p.id
<where>
tplc.test_case_review_id = #{request.testCaseReviewId}
<if test="request.projectId != null and request.projectId != ''">
and lt.project_id = #{request.projectId}
</if>
<if test="request.name != null">
and (lt.name like CONCAT('%', #{request.name},'%') or lt.num like CONCAT('%', #{request.name},'%'))
</if>
<if test="request.status != null">
and tplc.status like CONCAT('%', #{request.status},'%')
</if>
<if test="request.filters != null and request.filters.size() > 0">
<foreach collection="request.filters.entrySet()" index="key" item="values">
<if test="values != null and values.size() > 0">
<choose>
<when test="key=='status'">
and lt.status in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
</choose>
</if>
</foreach>
</if>
</where>
<if test="request.orders != null and request.orders.size() > 0">
order by
<foreach collection="request.orders" separator="," item="order">
tplc.${order.name} ${order.type}
</foreach>
</if>
</select>
<select id="getStatusByreviewId" resultType="java.lang.String">
select status from test_case_review_load tplc where tplc.test_case_review_id = #{reviewId}
</select>
</mapper>

View File

@ -0,0 +1,21 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.api.dto.automation.ApiScenarioDTO;
import io.metersphere.api.dto.automation.TestPlanScenarioRequest;
import io.metersphere.base.domain.TestCaseReviewScenario;
import io.metersphere.base.domain.TestPlanApiScenario;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtTestCaseReviewScenarioCaseMapper {
void insertIfNotExists(@Param("request") TestCaseReviewScenario request);
List<ApiScenarioDTO> list(@Param("request") TestPlanScenarioRequest request);
List<String> getExecResultByReviewId(String reviewId);
List<String> getIdsByReviewId(String reviewId);
List<String> getNotRelevanceCaseIds(String planId, List<String> relevanceProjectIds);
}

View File

@ -0,0 +1,114 @@
<?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.base.mapper.ext.ExtTestCaseReviewScenarioCaseMapper">
<insert id="insertIfNotExists" parameterType="io.metersphere.base.domain.TestPlanApiScenario">
-- 查询没有数据再插入
INSERT INTO test_case_review_scenario(id, test_case_review_id, api_scenario_id, create_time, update_time, environment)
SELECT #{request.id}, #{request.reviewId}, #{request.apiScenarioId}, #{request.createTime}, #{request.updateTime}, #{request.environment}
FROM DUAL
WHERE NOT EXISTS(
SELECT id FROM
test_case_review_scenario
WHERE test_case_review_id = #{request.reviewId} and api_scenario_id = #{request.apiScenarioId}
)
</insert>
<select id="list" resultType="io.metersphere.api.dto.automation.ApiScenarioDTO">
select
t.id, t.environment, t.create_time, t.update_time, t.last_result, t.pass_rate, t.report_id, c.scenario_definition,
c.id as case_id, c.project_id, c.user_id,c.api_scenario_module_id, c.module_path, c.name, c.level,
c.status, c.principal, c.step_total, c.follow_people, c.schedule, c.description, c.tags, c.num,
p.name as project_name, p.id as project_id, u.name as user_name
from
test_case_review_scenario t
inner join
api_scenario c
on t.api_scenario_id = c.id and c.status != 'Trash'
<if test="request.reviewId != null and request.reviewId!=''">
and t.test_case_review_id = #{request.reviewId}
</if>
left join project p
on c.project_id = p.id
left join user u
on c.user_id = u.id
where 1
<if test="request.ids != null and request.ids.size() > 0">
<if test="request.projectId != null and request.projectId!=''">
and
</if>
t.id in
<foreach collection="request.ids" item="caseId" separator="," open="(" close=")">
#{caseId}
</foreach>
</if>
<if test="request.name != null and request.name!=''">
and (c.name like CONCAT('%', #{request.name},'%')
or c.num like CONCAT('%', #{request.name},'%')
or c.tags like CONCAT('%', #{request.name},'%'))
</if>
<if test="request.status != null and request.status!=''">
and t.last_result like CONCAT('%', #{request.status},'%')
</if>
<if test="request.moduleIds != null and request.moduleIds.size() > 0">
and c.api_scenario_module_id in
<foreach collection="request.moduleIds" item="nodeId" separator="," open="(" close=")">
#{nodeId}
</foreach>
</if>
<if test="request.filters != null and request.filters.size() > 0">
<foreach collection="request.filters.entrySet()" index="key" item="values">
<if test="values != null and values.size() > 0">
<choose>
<when test="key == 'priority'">
and c.priority in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
</choose>
</if>
</foreach>
</if>
<if test="request.orders != null and request.orders.size() > 0">
order by
<foreach collection="request.orders" separator="," item="order">
<choose>
<when test="order.name == 'update_time'">
t.${order.name} ${order.type}
</when>
<otherwise>
${order.name} ${order.type}
</otherwise>
</choose>
</foreach>
</if>
</select>
<select id="getExecResultByReviewId" resultType="java.lang.String">
select last_result
from
test_case_review_scenario
where test_case_review_id = #{reviewId}
</select>
<select id="getIdsByReviewId" resultType="java.lang.String">
select id
from test_case_review_scenario
where test_case_review_id = #{reviewId}
</select>
<select id="getNotRelevanceCaseIds" resultType="java.lang.String">
select t.id
from test_case_review_scenario t
inner join api_scenario c
on c.id = t.api_scenario_id
<if test="relevanceProjectIds != null and relevanceProjectIds.size() > 0">
and c.project_id not in
<foreach collection="relevanceProjectIds" item="projectId" separator="," open="(" close=")">
#{projectId}
</foreach>
</if>
where t.test_case_review_id = #{reviewId}
</select>
</mapper>

View File

@ -45,4 +45,6 @@ public interface ExtTestPlanTestCaseMapper {
void deleteByTestCaseID(String id);
List<String> getExecResultByPlanId(String planId);
List<TestPlanCaseDTO> listForMinder(@Param("planId") String planId);
}

View File

@ -405,6 +405,23 @@
</where>
</select>
<select id="listForMinder" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
select pc.id as id,
pc.executor, pc.status,
pc.update_time,
pc.plan_id as planId,
t.name, t.priority,
t.type, t.node_id,
t.steps, t.prerequisite,
t.remark,
t.node_path, t.method, t.num
from test_plan_test_case pc
inner join test_case t on pc.case_id = t.id
<where>
pc.plan_id = #{planId}
</where>
</select>
<update id="updateTestCaseStates" parameterType="java.lang.String">
update test_plan_test_case
<set>
@ -423,4 +440,4 @@
from test_plan_api_case
where api_case_id = #{id,jdbcType=VARCHAR}
</delete>
</mapper>
</mapper>

View File

@ -97,10 +97,13 @@
</sql>
<select id="list" resultType="io.metersphere.track.dto.TestReviewCaseDTO">
select test_case_review_test_case.id as id, test_case.id as caseId, test_case.name, test_case.priority,
test_case.type, test_case.node_path, test_case.method, test_case.num, test_case_review_test_case.reviewer,
test_case.review_status, test_case_review_test_case.update_time, test_case_node.name as model,
project.name as projectName, test_case_review_test_case.review_id as reviewId,test_case.test_id as testId
select test_case_review_test_case.id as id, test_case_review_test_case.reviewer,
test_case_review_test_case.update_time, test_case_review_test_case.review_id as reviewId,
test_case.id as caseId, test_case.name, test_case.priority, test_case.test_id as testId,
test_case.type, test_case.node_path, test_case.method, test_case.num, test_case.review_status,
test_case.remark as remark, test_case.steps as steps, test_case.node_id as nodeId,
test_case_node.name as model,
project.name as projectName
from test_case_review_test_case
inner join test_case on test_case_review_test_case.case_id = test_case.id
left join test_case_node on test_case_node.id=test_case.node_id
@ -215,4 +218,4 @@
#{id}
</foreach>
</select>
</mapper>
</mapper>

View File

@ -0,0 +1,15 @@
package io.metersphere.dto;
import io.metersphere.base.domain.TestCaseReviewLoad;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestReviewLoadCaseDTO extends TestCaseReviewLoad {
private String userName;
private String caseName;
private String projectName;
private String caseStatus;
private String num;
}

View File

@ -4,9 +4,7 @@ import com.alibaba.fastjson.JSON;
import io.metersphere.api.dto.datacount.response.TaskInfoResult;
import io.metersphere.api.dto.definition.ApiSwaggerUrlDTO;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.ScheduleMapper;
import io.metersphere.base.mapper.SwaggerUrlProjectMapper;
import io.metersphere.base.mapper.UserMapper;
import io.metersphere.base.mapper.*;
import io.metersphere.base.mapper.ext.ExtScheduleMapper;
import io.metersphere.commons.constants.ScheduleGroup;
import io.metersphere.commons.constants.ScheduleType;
@ -38,6 +36,10 @@ import java.util.stream.Collectors;
@Transactional(rollbackFor = Exception.class)
public class ScheduleService {
@Resource
private TestPlanMapper testPlanMapper;
@Resource
private ApiScenarioMapper apiScenarioMapper;
@Resource
private ScheduleMapper scheduleMapper;
@Resource
@ -214,8 +216,8 @@ public class ScheduleService {
}
}
public List<TaskInfoResult> findRunningTaskInfoByProjectID(String projectID) {
List<TaskInfoResult> runningTaskInfoList = extScheduleMapper.findRunningTaskInfoByProjectID(projectID);
public List<TaskInfoResult> findRunningTaskInfoByProjectID(String projectID, List<String> typeFilter) {
List<TaskInfoResult> runningTaskInfoList = extScheduleMapper.findRunningTaskInfoByProjectID(projectID, typeFilter);
return runningTaskInfoList;
}
@ -227,13 +229,19 @@ public class ScheduleService {
TriggerKey triggerKey = null;
Class clazz = null;
if("testPlan".equals(request.getScheduleFrom())){
TestPlan testPlan = testPlanMapper.selectByPrimaryKey(request.getResourceId());
schedule.setName(testPlan.getName());
schedule.setProjectId(testPlan.getProjectId());
schedule.setGroup(ScheduleGroup.TEST_PLAN_TEST.name());
schedule.setType(ScheduleType.CRON.name());
jobKey = TestPlanTestJob.getJobKey(request.getResourceId());
triggerKey = TestPlanTestJob.getTriggerKey(request.getResourceId());
clazz = TestPlanTestJob.class;
}else {
}else { // 实际上在场景中添加定时任务并不会执行到这里?
//默认为情景
ApiScenarioWithBLOBs apiScene = apiScenarioMapper.selectByPrimaryKey(request.getResourceId());
schedule.setName(apiScene.getName());
schedule.setProjectId(apiScene.getProjectId());
schedule.setGroup(ScheduleGroup.API_SCENARIO_TEST.name());
schedule.setType(ScheduleType.CRON.name());
jobKey = ApiScenarioTestJob.getJobKey(request.getResourceId());

View File

@ -18,6 +18,7 @@ import io.metersphere.track.dto.TestPlanCaseDTO;
import io.metersphere.track.request.testcase.EditTestCaseRequest;
import io.metersphere.track.request.testcase.QueryTestCaseRequest;
import io.metersphere.track.request.testcase.TestCaseBatchRequest;
import io.metersphere.track.request.testcase.TestCaseMinderEditRequest;
import io.metersphere.track.request.testplan.FileOperationRequest;
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
import io.metersphere.track.service.TestCaseService;
@ -59,6 +60,12 @@ public class TestCaseController {
return testCaseService.listTestCase(request);
}
@GetMapping("/list/detail/{projectId}")
public List<TestCaseWithBLOBs> listDetail(@PathVariable String projectId) {
checkPermissionService.checkProjectOwner(projectId);
return testCaseService.listTestCaseDetail(projectId);
}
/*jenkins项目下所有接口和性能测试用例*/
@GetMapping("/list/method/{projectId}")
public List<TestCaseDTO> listByMethod(@PathVariable String projectId) {
@ -195,4 +202,11 @@ public class TestCaseController {
return testCaseService.addTestCase(testCaseWithBLOBs);
}
@PostMapping("/minder/edit")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public void minderEdit(@RequestBody TestCaseMinderEditRequest request) {
testCaseService.minderEdit(request);
}
}

View File

@ -37,9 +37,9 @@ public class TestCaseIssuesController {
issuesService.closeLocalIssue(id);
}
@GetMapping("/delete/{id}")
public void deleteIssue(@PathVariable String id) {
issuesService.deleteIssue(id);
@PostMapping("/delete")
public void deleteIssue(@RequestBody IssuesRequest request) {
issuesService.deleteIssue(request);
}
@GetMapping("/tapd/user/{caseId}")

View File

@ -0,0 +1,56 @@
package io.metersphere.track.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.api.dto.definition.ApiTestCaseDTO;
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
import io.metersphere.api.dto.definition.TestPlanApiCaseDTO;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.track.request.testcase.TestPlanApiCaseBatchRequest;
import io.metersphere.track.request.testreview.TestReviewApiCaseBatchRequest;
import io.metersphere.track.service.TestCaseReviewApiCaseService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/test/case/review/api/case")
public class TestCaseReviewApiCaseController {
@Resource
private TestCaseReviewApiCaseService testCaseReviewApiCaseService;
@PostMapping("/list/{goPage}/{pageSize}")
public Pager<List<TestPlanApiCaseDTO>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiTestCaseRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, testCaseReviewApiCaseService.list(request));
}
@PostMapping("/relevance/list/{goPage}/{pageSize}")
public Pager<List<ApiTestCaseDTO>> relevanceList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiTestCaseRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
return PageUtils.setPageInfo(page, testCaseReviewApiCaseService.relevanceList(request));
}
@GetMapping("/delete/{id}")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public int deleteTestCase(@PathVariable String id) {
return testCaseReviewApiCaseService.delete(id);
}
@PostMapping("/batch/delete")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public void deleteApiCaseBath(@RequestBody TestReviewApiCaseBatchRequest request) {
testCaseReviewApiCaseService.deleteApiCaseBath(request);
}
@PostMapping("/batch/update/env")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public void batchUpdateEnv(@RequestBody TestPlanApiCaseBatchRequest request) {
testCaseReviewApiCaseService.batchUpdateEnv(request);
}
}

View File

@ -0,0 +1,63 @@
package io.metersphere.track.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.api.dto.automation.*;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.track.dto.RelevanceScenarioRequest;
import io.metersphere.track.request.testcase.TestPlanApiCaseBatchRequest;
import io.metersphere.track.service.TestCaseReviewScenarioCaseService;
import io.metersphere.track.service.TestPlanScenarioCaseService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/test/case/review/scenario/case")
public class TestCaseReviewScenarioCaseController {
@Resource
TestCaseReviewScenarioCaseService testCaseReviewScenarioCaseService;
@PostMapping("/list/{goPage}/{pageSize}")
public Pager<List<ApiScenarioDTO>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody TestPlanScenarioRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, testCaseReviewScenarioCaseService.list(request));
}
@PostMapping("/relevance/list/{goPage}/{pageSize}")
public Pager<List<ApiScenarioDTO>> relevanceList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiScenarioRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
return PageUtils.setPageInfo(page, testCaseReviewScenarioCaseService.relevanceList(request));
}
@GetMapping("/delete/{id}")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public int deleteTestCase(@PathVariable String id) {
return testCaseReviewScenarioCaseService.delete(id);
}
@PostMapping("/batch/delete")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public void deleteApiCaseBath(@RequestBody TestPlanApiCaseBatchRequest request) {
testCaseReviewScenarioCaseService.deleteApiCaseBath(request);
}
@PostMapping(value = "/run")
public String run(@RequestBody RunScenarioRequest request) {
request.setExecuteType(ExecuteType.Completed.name());
return testCaseReviewScenarioCaseService.run(request);
}
@PostMapping("/batch/update/env")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public void batchUpdateEnv(@RequestBody RelevanceScenarioRequest request) {
testCaseReviewScenarioCaseService.batchUpdateEnv(request);
}
}

View File

@ -39,6 +39,13 @@ public class TestPlanTestCaseController {
return testPlanTestCaseService.listByPlanId(request);
}
@GetMapping("/list/minder/{planId}")
public List<TestPlanCaseDTO> listForMinder(@PathVariable String planId) {
QueryTestPlanCaseRequest request = new QueryTestPlanCaseRequest();
request.setPlanId(planId);
return testPlanTestCaseService.listForMinder(planId);
}
@GetMapping("/list/node/{planId}/{nodePaths}")
public List<TestPlanCaseDTO> getTestPlanCasesByNodePath(@PathVariable String planId, @PathVariable String nodePaths) {
String nodePath = nodePaths.replace("f", "/");

View File

@ -0,0 +1,65 @@
package io.metersphere.track.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.base.domain.LoadTest;
import io.metersphere.base.domain.TestCaseReviewLoad;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.dto.TestReviewLoadCaseDTO;
import io.metersphere.performance.request.RunTestPlanRequest;
import io.metersphere.track.request.testplan.LoadCaseReportRequest;
import io.metersphere.track.request.testplan.LoadCaseRequest;
import io.metersphere.track.request.testreview.TestReviewRequest;
import io.metersphere.track.service.TestCaseReviewLoadService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/test/review/load/case")
public class TestReviewLoadCaseController {
@Resource
private TestCaseReviewLoadService testCaseReviewLoadService;
@PostMapping("/relevance/list/{goPage}/{pageSize}")
public Pager<List<LoadTest>> relevanceList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody TestReviewRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, testCaseReviewLoadService.relevanceList(request));
}
@PostMapping("/relevance")
public void relevanceCase(@RequestBody TestReviewRequest request) {
testCaseReviewLoadService.relevanceCase(request);
}
@PostMapping("/list/{goPage}/{pageSize}")
public Pager<List<TestReviewLoadCaseDTO>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody TestReviewRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, testCaseReviewLoadService.list(request));
}
@GetMapping("/delete/{id}")
public void delete(@PathVariable String id) {
testCaseReviewLoadService.delete(id);
}
@PostMapping("/run")
public String run(@RequestBody RunTestPlanRequest request) {
return testCaseReviewLoadService.run(request);
}
@PostMapping("/report/exist")
public Boolean isExistReport(@RequestBody LoadCaseReportRequest request) {
return testCaseReviewLoadService.isExistReport(request);
}
@PostMapping("/batch/delete")
public void batchDelete(@RequestBody List<String> ids) {
testCaseReviewLoadService.batchDelete(ids);
}
@PostMapping("/update")
public void update(@RequestBody TestCaseReviewLoad testCaseReviewLoad) {
testCaseReviewLoadService.update(testCaseReviewLoad);
}
}

View File

@ -36,4 +36,8 @@ public class ApiCaseRelevanceRequest {
* 用例的环境的对应关系
*/
private Map<String, List<String>> mapping;
/**
*测试评审ID
*/
private String reviewId;
}

View File

@ -21,4 +21,10 @@ public class IssuesRequest {
* zentao bug 影响版本
*/
private List<String> zentaoBuilds;
/**
* issues id
*/
private String id;
private String caseId;
}

View File

@ -22,4 +22,10 @@ public class QueryTestCaseRequest extends BaseQueryRequest {
private String userId;
private String reviewId;
private boolean isSelectThisWeedData = false;
private String caseCoverage;
private long createTime = 0;
}

View File

@ -0,0 +1,14 @@
package io.metersphere.track.request.testcase;
import io.metersphere.base.domain.TestCaseWithBLOBs;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class TestCaseMinderEditRequest {
private String projectId;
List<TestCaseWithBLOBs> data;
}

View File

@ -17,4 +17,5 @@ public class LoadCaseRequest extends TestPlanLoadCase {
private String status;
private Map<String, List<String>> filters;
private List<OrderRequest> orders;
}

View File

@ -0,0 +1,23 @@
package io.metersphere.track.request.testreview;
import io.metersphere.base.domain.TestCaseReviewApiCase;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
import java.util.Map;
@Getter
@Setter
public class TestReviewApiCaseBatchRequest extends TestCaseReviewApiCase {
private List<String> ids;
/**
* 批量修改选中的数据
*/
private Map<String, String> selectRows;
/**
* 项目ID环境ID对应关系
*/
private Map<String, String> projectEnvMap;
}

View File

@ -0,0 +1,20 @@
package io.metersphere.track.request.testreview;
import io.metersphere.base.domain.TestCaseReviewLoad;
import io.metersphere.controller.request.OrderRequest;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
import java.util.Map;
@Getter
@Setter
public class TestReviewRequest extends TestCaseReviewLoad {
private String projectId;
private List<String> caseIds;
private String name;
private String status;
private Map<String, List<String>> filters;
private List<OrderRequest> orders;
}

View File

@ -1,10 +1,8 @@
package io.metersphere.track.service;
import io.metersphere.base.domain.Issues;
import io.metersphere.base.domain.Project;
import io.metersphere.base.domain.ServiceIntegration;
import io.metersphere.base.domain.TestCaseWithBLOBs;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.IssuesMapper;
import io.metersphere.base.mapper.TestCaseIssuesMapper;
import io.metersphere.commons.constants.IssuesManagePlatform;
import io.metersphere.commons.constants.NoticeConstants;
import io.metersphere.commons.user.SessionUser;
@ -43,6 +41,8 @@ public class IssuesService {
private IssuesMapper issuesMapper;
@Resource
private NoticeSendService noticeSendService;
@Resource
private TestCaseIssuesMapper testCaseIssuesMapper;
public void testAuth(String platform) {
AbstractIssuePlatform abstractPlatform = IssueFactory.createPlatform(platform, new IssuesRequest());
@ -202,8 +202,14 @@ public class IssuesService {
return platform.getPlatformUser();
}
public void deleteIssue(String id) {
public void deleteIssue(IssuesRequest request) {
String caseId = request.getCaseId();
String id = request.getId();
issuesMapper.deleteByPrimaryKey(id);
TestCaseIssuesExample example = new TestCaseIssuesExample();
example.createCriteria().andTestCaseIdEqualTo(caseId).andIssuesIdEqualTo(id);
testCaseIssuesMapper.deleteByExample(example);
}
private static String getIssuesContext(SessionUser user, IssuesRequest issuesRequest, String type) {

View File

@ -189,7 +189,9 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
testCaseNodeDTO.setName(name);
testCaseNodeDTO.setLabel(name);
testCaseNodeDTO.setChildren(nodeList);
list.add(testCaseNodeDTO);
if (!CollectionUtils.isEmpty(nodeList)) {
list.add(testCaseNodeDTO);
}
}
});
@ -212,11 +214,14 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
List<String> caseIds = testCaseReviewTestCases.stream().map(TestCaseReviewTestCase::getCaseId).collect(Collectors.toList());
List<TestCaseNodeDTO> nodeList = getReviewNodeDTO(id, caseIds);
TestCaseNodeDTO testCaseNodeDTO = new TestCaseNodeDTO();
testCaseNodeDTO.setName(name);
testCaseNodeDTO.setLabel(name);
testCaseNodeDTO.setChildren(nodeList);
list.add(testCaseNodeDTO);
if (!CollectionUtils.isEmpty(nodeList)) {
TestCaseNodeDTO testCaseNodeDTO = new TestCaseNodeDTO();
testCaseNodeDTO.setName(name);
testCaseNodeDTO.setLabel(name);
testCaseNodeDTO.setChildren(nodeList);
testCaseNodeDTO.setProjectId(id);
list.add(testCaseNodeDTO);
}
});
return list;

View File

@ -0,0 +1,104 @@
package io.metersphere.track.service;
import io.metersphere.api.dto.definition.ApiTestCaseDTO;
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
import io.metersphere.api.dto.definition.TestPlanApiCaseDTO;
import io.metersphere.api.service.ApiDefinitionExecResultService;
import io.metersphere.api.service.ApiTestCaseService;
import io.metersphere.base.domain.TestCaseReviewApiCase;
import io.metersphere.base.domain.TestCaseReviewApiCaseExample;
import io.metersphere.base.domain.TestPlanApiCase;
import io.metersphere.base.domain.TestPlanApiCaseExample;
import io.metersphere.base.mapper.TestCaseReviewApiCaseMapper;
import io.metersphere.base.mapper.ext.ExtTestCaseReviewApiCaseMapper;
import io.metersphere.commons.utils.ServiceUtils;
import io.metersphere.track.request.testcase.TestPlanApiCaseBatchRequest;
import io.metersphere.track.request.testreview.TestReviewApiCaseBatchRequest;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Service
@Transactional(rollbackFor = Exception.class)
public class TestCaseReviewApiCaseService {
@Resource
private ExtTestCaseReviewApiCaseMapper extTestCaseReviewApiCaseMapper;
@Resource
ApiTestCaseService apiTestCaseService;
@Resource
TestCaseReviewApiCaseMapper testCaseReviewApiCaseMapper;
@Lazy
@Resource
ApiDefinitionExecResultService apiDefinitionExecResultService;
public List<TestPlanApiCaseDTO> list(ApiTestCaseRequest request) {
request.setProjectId(null);
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
List<TestPlanApiCaseDTO> apiTestCases = extTestCaseReviewApiCaseMapper.list(request);
if (CollectionUtils.isEmpty(apiTestCases)) {
return apiTestCases;
}
apiTestCaseService.buildUserInfo(apiTestCases);
return apiTestCases;
}
public List<String> getExecResultByReviewId(String reviewId) {
return extTestCaseReviewApiCaseMapper.getExecResultByReviewId(reviewId);
}
public List<ApiTestCaseDTO> relevanceList(ApiTestCaseRequest request) {
List<String> ids = apiTestCaseService.selectIdsNotExistsInReview(request.getProjectId(), request.getReviewId());
if (CollectionUtils.isEmpty(ids)) {
return new ArrayList<>();
}
request.setIds(ids);
return apiTestCaseService.listSimple(request);
}
public int delete(String id) {
apiDefinitionExecResultService.deleteByResourceId(id);
TestCaseReviewApiCaseExample example=new TestCaseReviewApiCaseExample();
example.createCriteria()
.andIdEqualTo(id);
return testCaseReviewApiCaseMapper.deleteByExample(example);
}
public void deleteApiCaseBath(TestReviewApiCaseBatchRequest request) {
if (CollectionUtils.isEmpty(request.getIds())) {
return;
}
apiDefinitionExecResultService.deleteByResourceIds(request.getIds());
TestCaseReviewApiCaseExample example=new TestCaseReviewApiCaseExample();
example.createCriteria()
.andIdIn(request.getIds())
.andTestCaseReviewIdEqualTo(request.getTestCaseReviewId());
testCaseReviewApiCaseMapper.deleteByExample(example);
}
public void batchUpdateEnv(TestPlanApiCaseBatchRequest request) {
// 批量修改用例环境
Map<String, String> rows = request.getSelectRows();
Set<String> ids = rows.keySet();
Map<String, String> env = request.getProjectEnvMap();
if (env != null && !env.isEmpty()) {
ids.forEach(id -> {
TestCaseReviewApiCase apiCase = new TestCaseReviewApiCase();
apiCase.setId(id);
apiCase.setEnvironmentId(env.get(rows.get(id)));
testCaseReviewApiCaseMapper.updateByPrimaryKeySelective(apiCase);
});
}
}
public void setExecResult(String id, String status) {
TestCaseReviewApiCase apiCase = new TestCaseReviewApiCase();
apiCase.setId(id);
apiCase.setStatus(status);
apiCase.setUpdateTime(System.currentTimeMillis());
testCaseReviewApiCaseMapper.updateByPrimaryKeySelective(apiCase);
}
public void updateByPrimaryKeySelective(TestCaseReviewApiCase apiCase) {
testCaseReviewApiCaseMapper.updateByPrimaryKeySelective(apiCase);
}
}

View File

@ -0,0 +1,155 @@
package io.metersphere.track.service;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.*;
import io.metersphere.base.mapper.ext.ExtTestCaseReviewLoadMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanLoadCaseMapper;
import io.metersphere.commons.constants.TestPlanStatus;
import io.metersphere.controller.request.OrderRequest;
import io.metersphere.dto.TestReviewLoadCaseDTO;
import io.metersphere.performance.request.RunTestPlanRequest;
import io.metersphere.performance.service.PerformanceTestService;
import io.metersphere.track.dto.TestPlanLoadCaseDTO;
import io.metersphere.track.request.testplan.LoadCaseReportRequest;
import io.metersphere.track.request.testplan.LoadCaseRequest;
import io.metersphere.track.request.testreview.TestReviewRequest;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = Exception.class)
public class TestCaseReviewLoadService {
@Resource
TestCaseReviewMapper testCaseReviewMapper;
@Resource
private TestCaseReviewLoadMapper testCaseReviewLoadMapper;
@Resource
private ExtTestCaseReviewLoadMapper extTestCaseReviewLoadMapper;
@Resource
private PerformanceTestService performanceTestService;
@Resource
private SqlSessionFactory sqlSessionFactory;
@Resource
private LoadTestReportMapper loadTestReportMapper;
@Resource
private LoadTestMapper loadTestMapper;
public List<LoadTest> relevanceList(TestReviewRequest request) {
List<String> ids = extTestCaseReviewLoadMapper.selectIdsNotInPlan(request.getProjectId(), request.getTestCaseReviewId());
if (CollectionUtils.isEmpty(ids)) {
return new ArrayList<>();
}
return performanceTestService.getLoadTestListByIds(ids);
}
public List<TestReviewLoadCaseDTO> list(TestReviewRequest request) {
List<OrderRequest> orders = request.getOrders();
if (orders == null || orders.size() < 1) {
OrderRequest orderRequest = new OrderRequest();
orderRequest.setName("create_time");
orderRequest.setType("desc");
orders = new ArrayList<>();
orders.add(orderRequest);
}
request.setOrders(orders);
return extTestCaseReviewLoadMapper.selectTestReviewLoadCaseList(request);
}
public void relevanceCase(TestReviewRequest request) {
List<String> caseIds = request.getCaseIds();
String reviewId = request.getTestCaseReviewId();
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
TestCaseReviewLoadMapper testCaseReviewLoadMapper = sqlSession.getMapper(TestCaseReviewLoadMapper.class);
caseIds.forEach(id -> {
TestCaseReviewLoad t = new TestCaseReviewLoad();
t.setId(UUID.randomUUID().toString());
t.setTestCaseReviewId(reviewId);
t.setLoadCaseId(id);
t.setCreateTime(System.currentTimeMillis());
t.setUpdateTime(System.currentTimeMillis());
testCaseReviewLoadMapper.insert(t);
});
TestCaseReview testCaseReview = testCaseReviewMapper.selectByPrimaryKey(request.getTestCaseReviewId());
if (org.apache.commons.lang3.StringUtils.equals(testCaseReview.getStatus(), TestPlanStatus.Prepare.name())
|| org.apache.commons.lang3.StringUtils.equals(testCaseReview.getStatus(), TestPlanStatus.Completed.name())) {
testCaseReview.setStatus(TestPlanStatus.Underway.name());
testCaseReviewMapper.updateByPrimaryKey(testCaseReview);
}
sqlSession.flushStatements();
}
public void delete(String id) {
TestCaseReviewLoadExample example = new TestCaseReviewLoadExample();
example.createCriteria().andIdEqualTo(id);
testCaseReviewLoadMapper.deleteByExample(example);
}
public String run(RunTestPlanRequest request) {
String reportId = performanceTestService.run(request);
TestCaseReviewLoad testCaseReviewLoad = new TestCaseReviewLoad();
testCaseReviewLoad.setId(request.getTestPlanLoadId());
testCaseReviewLoad.setLoadReportId(reportId);
testCaseReviewLoadMapper.updateByPrimaryKeySelective(testCaseReviewLoad);
return reportId;
}
//???
public Boolean isExistReport(LoadCaseReportRequest request) {
String reportId = request.getReportId();
String testPlanLoadCaseId = request.getTestPlanLoadCaseId();
LoadTestReportExample example = new LoadTestReportExample();
example.createCriteria().andIdEqualTo(reportId);
List<LoadTestReport> loadTestReports = loadTestReportMapper.selectByExample(example);
if (CollectionUtils.isEmpty(loadTestReports)) {
TestCaseReviewLoad testCaseReviewLoad = new TestCaseReviewLoad();
testCaseReviewLoad.setId(testPlanLoadCaseId);
testCaseReviewLoad.setLoadReportId("");
testCaseReviewLoadMapper.updateByPrimaryKeySelective(testCaseReviewLoad);
return false;
}
return true;
}
public void deleteByRelevanceProjectIds(String id, List<String> relevanceProjectIds) {
LoadTestExample loadTestExample = new LoadTestExample();
loadTestExample.createCriteria().andProjectIdIn(relevanceProjectIds);
List<LoadTest> loadTests = loadTestMapper.selectByExample(loadTestExample);
TestCaseReviewLoadExample example = new TestCaseReviewLoadExample();
TestCaseReviewLoadExample.Criteria criteria = example.createCriteria().andTestCaseReviewIdEqualTo(id);
if (!CollectionUtils.isEmpty(loadTests)) {
List<String> ids = loadTests.stream().map(LoadTest::getId).collect(Collectors.toList());
criteria.andLoadCaseIdNotIn(ids);
}
testCaseReviewLoadMapper.deleteByExample(example);
}
public void batchDelete(List<String> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
TestCaseReviewLoadExample example = new TestCaseReviewLoadExample();
example.createCriteria().andIdIn(ids);
testCaseReviewLoadMapper.deleteByExample(example);
}
public void update(TestCaseReviewLoad testCaseReviewLoad) {
if (!StringUtils.isEmpty(testCaseReviewLoad.getId())) {
testCaseReviewLoadMapper.updateByPrimaryKeySelective(testCaseReviewLoad);
}
}
public List<String> getStatus(String reviewId) {
return extTestCaseReviewLoadMapper.getStatusByreviewId(reviewId);
}
}

View File

@ -0,0 +1,194 @@
package io.metersphere.track.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONPath;
import io.metersphere.api.dto.automation.ApiScenarioDTO;
import io.metersphere.api.dto.automation.ApiScenarioRequest;
import io.metersphere.api.dto.automation.RunScenarioRequest;
import io.metersphere.api.dto.automation.TestPlanScenarioRequest;
import io.metersphere.api.dto.definition.RunDefinitionRequest;
import io.metersphere.api.service.ApiAutomationService;
import io.metersphere.api.service.ApiScenarioReportService;
import io.metersphere.base.domain.TestCaseReviewScenario;
import io.metersphere.base.domain.TestCaseReviewScenarioExample;
import io.metersphere.base.domain.TestPlanApiScenario;
import io.metersphere.base.domain.TestPlanApiScenarioExample;
import io.metersphere.base.mapper.TestCaseReviewScenarioMapper;
import io.metersphere.base.mapper.TestPlanApiScenarioMapper;
import io.metersphere.base.mapper.ext.ExtTestCaseReviewScenarioCaseMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanScenarioCaseMapper;
import io.metersphere.commons.constants.ApiRunMode;
import io.metersphere.commons.utils.ServiceUtils;
import io.metersphere.track.dto.RelevanceScenarioRequest;
import io.metersphere.track.request.testcase.TestPlanApiCaseBatchRequest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = Exception.class)
public class TestCaseReviewScenarioCaseService {
@Resource
ApiAutomationService apiAutomationService;
@Resource
TestCaseReviewScenarioMapper testCaseReviewScenarioMapper;
@Resource
ExtTestCaseReviewScenarioCaseMapper extTestCaseReviewScenarioCaseMapper;
@Resource
ApiScenarioReportService apiScenarioReportService;
public List<ApiScenarioDTO> list(TestPlanScenarioRequest request) {
request.setProjectId(null);
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
List<ApiScenarioDTO> apiTestCases = extTestCaseReviewScenarioCaseMapper.list(request);
setApiScenarioProjectIds(apiTestCases);
if (CollectionUtils.isEmpty(apiTestCases)) {
return apiTestCases;
}
return apiTestCases;
}
private void setApiScenarioProjectIds(List<ApiScenarioDTO> list) {
// 如果场景步骤涉及多项目则把涉及到的项目ID保存在projectIds属性
list.forEach(data -> {
List<String> idList = new ArrayList<>();
String definition = data.getScenarioDefinition();
if (org.apache.commons.lang3.StringUtils.isNotBlank(definition)) {
RunDefinitionRequest d = JSON.parseObject(definition, RunDefinitionRequest.class);
if (d != null) {
Map<String, String> map = d.getEnvironmentMap();
if (map != null) {
if (map.isEmpty()) {
List<String> ids = (List<String>) JSONPath.read(definition, "$..projectId");
idList.addAll(new HashSet<>(ids));
} else {
Set<String> set = d.getEnvironmentMap().keySet();
idList = new ArrayList<>(set);
}
} else {
// 兼容历史数据无EnvironmentMap直接赋值场景所属项目
idList.add(data.getProjectId());
}
}
}
data.setProjectIds(idList);
});
}
public List<ApiScenarioDTO> relevanceList(ApiScenarioRequest request) {
request.setNotInTestPlan(true);
List<ApiScenarioDTO> list = apiAutomationService.listReview(request);
setApiScenarioProjectIds(list);
return list;
}
public int delete(String id) {
TestCaseReviewScenario testCaseReviewScenario = testCaseReviewScenarioMapper.selectByPrimaryKey(id);
String reportId = testCaseReviewScenario.getReportId();
if (!StringUtils.isEmpty(reportId)) {
apiScenarioReportService.delete(reportId);
}
TestCaseReviewScenarioExample example = new TestCaseReviewScenarioExample();
example.createCriteria()
.andIdEqualTo(id);
return testCaseReviewScenarioMapper.deleteByExample(example);
}
public void deleteApiCaseBath(TestPlanApiCaseBatchRequest request) {
if (CollectionUtils.isEmpty(request.getIds())) {
return;
}
TestCaseReviewScenarioExample example = new TestCaseReviewScenarioExample();
example.createCriteria()
.andIdIn(request.getIds());
List<String> reportIds = testCaseReviewScenarioMapper.selectByExample(example).stream()
.map(TestCaseReviewScenario::getReportId).collect(Collectors.toList());
apiScenarioReportService.deleteByIds(reportIds);
testCaseReviewScenarioMapper.deleteByExample(example);
}
public String run(RunScenarioRequest request) {
TestCaseReviewScenarioExample example = new TestCaseReviewScenarioExample();
example.createCriteria().andIdIn(request.getPlanCaseIds());
List<TestCaseReviewScenario> testPlanApiScenarioList = testCaseReviewScenarioMapper.selectByExample(example);
List<String> scenarioIds = new ArrayList<>();
Map<String,String> scenarioIdApiScarionMap = new HashMap<>();
for (TestCaseReviewScenario apiScenario:
testPlanApiScenarioList) {
scenarioIds.add(apiScenario.getApiScenarioId());
scenarioIdApiScarionMap.put(apiScenario.getApiScenarioId(),apiScenario.getId());
}
request.setIds(scenarioIds);
request.setScenarioTestPlanIdMap(scenarioIdApiScarionMap);
request.setRunMode(ApiRunMode.SCENARIO_PLAN.name());
return apiAutomationService.run(request);
}
public List<TestCaseReviewScenario> getCasesByReviewId(String reviewId) {
TestCaseReviewScenarioExample example = new TestCaseReviewScenarioExample();
example.createCriteria().andTestCaseReviewIdEqualTo(reviewId);
return testCaseReviewScenarioMapper.selectByExample(example);
}
public List<String> getExecResultByReviewId(String reviewId) {
return extTestCaseReviewScenarioCaseMapper.getExecResultByReviewId(reviewId);
}
public void deleteByReviewId(String reviewId) {
TestPlanApiCaseBatchRequest request = new TestPlanApiCaseBatchRequest();
List<String> ids = extTestCaseReviewScenarioCaseMapper.getIdsByReviewId(reviewId);
request.setIds(ids);
deleteApiCaseBath(request);
}
public void deleteByRelevanceProjectIds(String reviewId, List<String> relevanceProjectIds) {
TestPlanApiCaseBatchRequest request = new TestPlanApiCaseBatchRequest();
request.setIds(extTestCaseReviewScenarioCaseMapper.getNotRelevanceCaseIds(reviewId, relevanceProjectIds));
request.setPlanId(reviewId);
deleteApiCaseBath(request);
}
public void bathDeleteByScenarioIds(List<String> ids) {
TestCaseReviewScenarioExample example = new TestCaseReviewScenarioExample();
example.createCriteria().andApiScenarioIdIn(ids);
testCaseReviewScenarioMapper.deleteByExample(example);
}
public void deleteByScenarioId(String id) {
TestCaseReviewScenarioExample example = new TestCaseReviewScenarioExample();
example.createCriteria().andApiScenarioIdEqualTo(id);
testCaseReviewScenarioMapper.deleteByExample(example);
}
public void batchUpdateEnv(RelevanceScenarioRequest request) {
Map<String, String> envMap = request.getEnvMap();
Map<String, List<String>> mapping = request.getMapping();
Set<String> set = mapping.keySet();
if (set.isEmpty()) { return; }
set.forEach(id -> {
Map<String, String> newEnvMap = new HashMap<>(16);
if (envMap != null && !envMap.isEmpty()) {
List<String> list = mapping.get(id);
list.forEach(l -> {
newEnvMap.put(l, envMap.get(l));
});
}
if (!newEnvMap.isEmpty()) {
TestCaseReviewScenario scenario = new TestCaseReviewScenario();
scenario.setId(id);
scenario.setEnvironment(JSON.toJSONString(newEnvMap));
testCaseReviewScenarioMapper.updateByPrimaryKeySelective(scenario);
}
});
}
}

View File

@ -5,7 +5,6 @@ import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.github.pagehelper.PageHelper;
import io.metersphere.api.dto.definition.ApiBatchRequest;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.*;
import io.metersphere.base.mapper.ext.ExtTestCaseMapper;
@ -14,10 +13,7 @@ import io.metersphere.commons.constants.TestCaseConstants;
import io.metersphere.commons.constants.TestCaseReviewStatus;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.user.SessionUser;
import io.metersphere.commons.utils.BeanUtils;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.commons.utils.ServiceUtils;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.commons.utils.*;
import io.metersphere.controller.request.OrderRequest;
import io.metersphere.excel.domain.ExcelErrData;
import io.metersphere.excel.domain.ExcelResponse;
@ -32,6 +28,7 @@ import io.metersphere.track.dto.TestCaseDTO;
import io.metersphere.track.request.testcase.EditTestCaseRequest;
import io.metersphere.track.request.testcase.QueryTestCaseRequest;
import io.metersphere.track.request.testcase.TestCaseBatchRequest;
import io.metersphere.track.request.testcase.TestCaseMinderEditRequest;
import io.metersphere.xmind.XmindCaseParser;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
@ -188,6 +185,7 @@ public class TestCaseService {
}
public List<TestCaseDTO> listTestCase(QueryTestCaseRequest request) {
this.initRequest(request, true);
List<OrderRequest> orderList = ServiceUtils.getDefaultOrder(request.getOrders());
OrderRequest order = new OrderRequest();
// 对模板导入的测试用例排序
@ -198,6 +196,25 @@ public class TestCaseService {
return extTestCaseMapper.list(request);
}
/**
* 初始化部分参数
*
* @param request
* @param checkThisWeekData
* @return
*/
private void initRequest(QueryTestCaseRequest request, boolean checkThisWeekData) {
if (checkThisWeekData) {
if (request.isSelectThisWeedData()) {
Map<String, Date> weekFirstTimeAndLastTime = DateUtils.getWeedFirstTimeAndLastTime(new Date());
Date weekFirstTime = weekFirstTimeAndLastTime.get("firstTime");
if (weekFirstTime != null) {
request.setCreateTime(weekFirstTime.getTime());
}
}
}
}
public List<TestCaseDTO> listTestCaseMthod(QueryTestCaseRequest request) {
return extTestCaseMapper.listByMethod(request);
}
@ -705,4 +722,23 @@ public class TestCaseService {
return extTestCaseMapper.list(request);
}
public List<TestCaseWithBLOBs> listTestCaseDetail(String projectId) {
TestCaseExample testCaseExample = new TestCaseExample();
testCaseExample.createCriteria().andProjectIdEqualTo(projectId);
return testCaseMapper.selectByExampleWithBLOBs(testCaseExample);
}
public void minderEdit(TestCaseMinderEditRequest request) {
List<TestCaseWithBLOBs> data = request.getData();
data.forEach(item -> {
item.setProjectId(request.getProjectId());
if (StringUtils.isBlank(item.getId()) || item.getId().length() < 20) {
item.setId(UUID.randomUUID().toString());
item.setMaintainer(SessionUtils.getUserId());
addTestCase(item);
} else {
editTestCase(item);
}
});
}
}

View File

@ -57,6 +57,8 @@ import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = Exception.class)
public class TestPlanService {
@Resource
ExtScheduleMapper extScheduleMapper;
@Resource
TestPlanMapper testPlanMapper;
@Resource
@ -179,6 +181,7 @@ public class TestPlanService {
testPlan.setActualEndTime(System.currentTimeMillis());
}
}
extScheduleMapper.updateNameByResourceID(testPlan.getId(), testPlan.getName());// 同步更新该测试的定时任务的name
List<String> userIds = new ArrayList<>();
userIds.add(testPlan.getPrincipal());

View File

@ -150,4 +150,8 @@ public class TestPlanTestCaseService {
public int updateTestCaseStates(List<String> ids, String reportStatus) {
return extTestPlanTestCaseMapper.updateTestCaseStates(ids, reportStatus);
}
public List<TestPlanCaseDTO> listForMinder(String planId) {
return extTestPlanTestCaseMapper.listForMinder(planId);
}
}

View File

@ -80,6 +80,8 @@ alter table test_case
add demand_name varchar(999) null;
alter table test_case
add follow_people varchar(100) null;
alter table test_case
add status varchar(25) null;
-- test_case_review add column
ALTER TABLE test_case_review
ADD tags VARCHAR(2000) NULL;
@ -96,4 +98,52 @@ alter table file_metadata
alter table api_definition add original_state varchar(64);
alter table api_scenario add original_state varchar(64);
update api_definition set original_state='Underway';
update api_scenario set original_state='Underway';
update api_scenario set original_state='Underway';
-- alter test_case_review_scenario
alter table test_case_review_scenario modify environment longtext null;
-- schedule table add project_id column
alter table schedule add project_id varchar(50) NULL;
-- set values for new colums of exitsting data
update schedule sch inner join test_plan testPlan on
testPlan.id = sch.resource_id
set sch.project_id = testPlan.project_id where
sch.resource_id = testPlan.id;
update schedule sch inner join swagger_url_project sup on
sup.id = sch.resource_id
set sch.project_id = sup.project_id where
sch.resource_id = sup.id;
update schedule sch inner join api_scenario apiScene on
apiScene.id = sch.resource_id
set sch.project_id = apiScene.project_id where
sch.resource_id = apiScene.id;
update schedule sch inner join load_test ldt on
ldt.id = sch.resource_id
set sch.project_id = ldt.project_id where
sch.resource_id = ldt.id;
update schedule sch inner join api_test apiTest on
apiTest.id = sch.resource_id
set sch.project_id = apiTest.project_id where
sch.resource_id = apiTest.id;
-- schedule table add name column
alter table schedule add name varchar(100) NULL;
-- set values for new colums of exitsting data
update schedule sch inner join api_scenario apiScene on
apiScene.id = sch.resource_id
set sch.name = apiScene.name;
update schedule sch inner join test_plan testPlan on
testPlan.id = sch.resource_id
set sch.name = testPlan.name;
update schedule sch inner join load_test ldt on
ldt.id = sch.resource_id
set sch.name = ldt.name;
update schedule sch inner join api_test apiTest on
apiTest.id = sch.resource_id
set sch.name = apiTest.name;
update schedule sch inner join swagger_url_project sup on
sup.id = sch.resource_id
set sch.name = LEFT(SUBSTRING_INDEX(sup.swagger_url, '/', 3), 100);
-- delete an unused colum
alter table schedule drop column custom_data;

View File

@ -71,7 +71,11 @@
<!--<table tableName="test_plan"/>-->
<!--<table tableName="api_scenario_report"/>-->
<!--<table tableName="test_case_review"/>-->
<table tableName="test_case"/>
<!--<table tableName="test_case"/>-->
<table tableName="test_case_review_api_case"/>
<table tableName="test_case_review_load"/>
<table tableName="test_case_review_scenario"/>
</context>
</generatorConfiguration>

View File

@ -765,9 +765,6 @@
z-index: auto !important;
}
/deep/ el-table__fixed-right {
}
/deep/ .el-table__fixed-right {
height: 100% !important;

View File

@ -3,21 +3,14 @@
<span class="kv-description" v-if="description">
{{ description }}
</span>
<el-dropdown>
<span class="el-dropdown-link">
{{ $t('api_test.select_or_invert') }} <i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="selectAll">{{ $t('api_test.select_all') }}</el-dropdown-item>
<el-dropdown-item @click.native="invertSelect">{{ $t('api_test.invert_select') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-row>
<el-checkbox v-model="isSelectAll" v-if="items.length > 1"/>
</el-row>
<div class="kv-row item" v-for="(item, index) in items" :key="index">
<el-row type="flex" :gutter="20" justify="space-between" align="middle">
<el-col class="kv-checkbox" v-if="isShowEnable">
<input type="checkbox" v-if="!isDisable(index)" v-model="item.enable"
<el-checkbox v-if="!isDisable(index)" v-model="item.enable"
:disabled="isReadOnly"/>
</el-col>
<span style="margin-left: 10px" v-else></span>
@ -59,7 +52,7 @@
valuePlaceholder: String,
isShowEnable: {
type: Boolean,
default: false
default: true
},
description: String,
items: Array,
@ -73,6 +66,7 @@
return {
keyValues: [],
loading: false,
isSelectAll: true
}
},
computed: {
@ -83,7 +77,15 @@
return this.valuePlaceholder || this.$t("api_test.value");
}
},
watch: {
isSelectAll: function(to, from) {
if(from == false && to == true) {
this.selectAll();
} else if(from == true && to == false) {
this.invertSelect();
}
}
},
methods: {
moveBottom(index) {
if (this.items.length < 2 || index === this.items.length - 2) {
@ -154,7 +156,7 @@
},
invertSelect() {
this.items.forEach(item => {
item.enable = !item.enable;
item.enable = false;
});
},
},

View File

@ -3,19 +3,13 @@
<span class="kv-description" v-if="description">
{{ description }}
</span>
<el-dropdown>
<span class="el-dropdown-link">
{{ $t('api_test.select_or_invert') }} <i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="selectAll">{{ $t('api_test.select_all') }}</el-dropdown-item>
<el-dropdown-item @click.native="invertSelect">{{ $t('api_test.invert_select') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-row>
<el-checkbox v-model="isSelectAll" v-if="parameters.length > 1"/>
</el-row>
<div class="item kv-row" v-for="(item, index) in parameters" :key="index">
<el-row type="flex" :gutter="20" justify="space-between" align="middle">
<el-col class="kv-checkbox" v-if="isShowEnable">
<input type="checkbox" v-if="!isDisable(index)" v-model="item.enable"
<el-checkbox v-if="!isDisable(index)" v-model="item.enable"
:disabled="isReadOnly"/>
</el-col>
<span style="margin-left: 10px" v-else></span>
@ -131,8 +125,18 @@
return {
currentItem: null,
requireds: REQUIRED,
isSelectAll: true,
}
},
watch: {
isSelectAll: function(to, from) {
if(from == false && to == true) {
this.selectAll();
} else if(from == true && to == false) {
this.invertSelect();
}
},
},
computed: {
keyText() {
return this.keyPlaceholder || this.$t("api_test.key");
@ -191,7 +195,7 @@
// TODO key
},
isDisable: function (index) {
return this.parameters.length - 1 === index;
return this.parameters.length - 1 == index;
},
querySearch(queryString, cb) {
let suggestions = this.suggestions;
@ -235,7 +239,7 @@
},
invertSelect() {
this.parameters.forEach(item => {
item.enable = !item.enable;
item.enable = false;
});
},
},

View File

@ -142,7 +142,7 @@ export default {
status: [{required: true, message: this.$t('commons.please_select'), trigger: 'change'}],
},
httpForm: {environmentId: "", tags: []},
isShowEnable: false,
isShowEnable: true,
maintainerOptions: [],
currentModule: {},
reqOptions: REQ_METHOD,

View File

@ -74,6 +74,7 @@ export default {
},
planId: String,
relevanceProjectId: String,
reviewId: String
},
computed: {
isPlanModel() {
@ -81,6 +82,9 @@ export default {
},
isRelevanceModel() {
return this.relevanceProjectId ? true : false;
},
isReviewModel() {
return this.reviewId ? true : false;
}
},
mounted() {
@ -104,6 +108,9 @@ export default {
},
relevanceProjectId() {
this.list();
},
reviewId() {
this.list();
}
},
methods: {

View File

@ -20,8 +20,9 @@
</el-table-column>
<el-table-column prop="taskType" :label="$t('api_test.home_page.running_task_list.table_coloum.task_type')" width="120" show-overflow-tooltip>
<template v-slot:default="scope">
<ms-tag v-if="scope.row.taskType == 'scenario'" type="success" effect="plain" :content="$t('api_test.home_page.running_task_list.scenario_schedule')"/>
<ms-tag v-if="scope.row.taskType == 'testPlan'" type="warning" effect="plain" :content="$t('api_test.home_page.running_task_list.test_plan_schedule')"/>
<ms-tag v-if="scope.row.taskGroup == 'API_SCENARIO_TEST'" type="success" effect="plain" :content="$t('api_test.home_page.running_task_list.scenario_schedule')"/>
<ms-tag v-if="scope.row.taskGroup == 'TEST_PLAN_TEST'" type="warning" effect="plain" :content="$t('api_test.home_page.running_task_list.test_plan_schedule')"/>
<ms-tag v-if="scope.row.taskGroup == 'SWAGGER_IMPORT'" type="danger" effect="plain" :content="$t('api_test.home_page.running_task_list.swagger_schedule')"/>
</template>
</el-table-column>
<el-table-column prop="rule" :label="$t('api_test.home_page.running_task_list.table_coloum.run_rule')" width="120" show-overflow-tooltip/>

View File

@ -1,8 +1,11 @@
<template>
<div class="minder">
<minder-editor v-if="isActive"
<minder-editor
v-if="isActive"
class="minder-container"
:import-json="importJson"
:height="700"
:progress-enable="false"
@save="save"
/>
</div>
@ -20,10 +23,10 @@ export default {
return []
}
},
data: {
type: Array,
dataMap: {
type: Map,
default() {
return []
return new Map();
}
}
},
@ -52,7 +55,9 @@ export default {
root: {
data: {
text: "全部用例",
disable: true
disable: true,
id: "root",
path: ""
},
children: []
},
@ -62,33 +67,46 @@ export default {
}
},
mounted() {
this.$nextTick(() => {
this.parse(this.importJson.root, this.treeNodes);
this.reload();
})
},
watch: {
dataMap() {
this.$nextTick(() => {
this.parse(this.importJson.root, this.treeNodes);
this.reload();
})
}
},
methods: {
save(data) {
console.log(data);
// console.log(this.treeNodes);
this.$emit('save', data)
},
parse(root, children) {
root.children = [];
//
let dataNodes = this.dataMap.get(root.data.id);
if (dataNodes) {
dataNodes.forEach((dataNode) => {
root.children.push(dataNode);
})
}
if (children == null || children.length < 1) {
return;
}
root.children = [];
children.forEach((item) => {
let node = {
data: {
text: item.name,
id: item.id,
disable: true,
// resource: ['#']
path: root.data.path + "/" + item.name,
expandState:"collapse"
},
}
root.children.push(node);
this.parse(node, item.children);
})
});
},
reload() {
this.isActive = false;
@ -101,4 +119,9 @@ export default {
</script>
<style scoped>
.minder-container >>> .save-btn {
right: 30px;
bottom: auto;
top: 30px;
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<div>
<div class="ms-table-header">
<el-row v-if="title" class="table-title" type="flex" justify="space-between" align="middle">
<slot name="title">
{{title}}

View File

@ -16,14 +16,17 @@
import TrackHeaderMenus from "./head/TrackHeaderMenus";
export default {
name: "TrackHome",
components: {TrackHeaderMenus},
data() {
return {
baseUrl: "track"
}
name: "TrackHome",
components: {TrackHeaderMenus},
data() {
return {
baseUrl: "track"
}
},
activated() {
this.$refs.table.doLayout()
}
}
</script>

View File

@ -39,8 +39,9 @@
@setCondition="setCondition"
ref="testCaseList">
</test-case-list>
<testcase-minder
<test-case-minder
:tree-nodes="treeNodes"
:project-id="projectId"
v-if="activeDom === 'right'"
ref="testCaseList"/>
</ms-tab-button>
@ -97,17 +98,17 @@ import SelectMenu from "../common/SelectMenu";
import MsContainer from "../../common/components/MsContainer";
import MsAsideContainer from "../../common/components/MsAsideContainer";
import MsMainContainer from "../../common/components/MsMainContainer";
import {checkoutTestManagerOrTestUser, getCurrentProjectID, getUUID, hasRoles} from "../../../../common/js/utils";
import {checkoutTestManagerOrTestUser, getCurrentProjectID, getUUID} from "../../../../common/js/utils";
import TestCaseNodeTree from "../common/TestCaseNodeTree";
import {TrackEvent,LIST_CHANGE} from "@/business/components/common/head/ListEvent";
import TestcaseMinder from "@/business/components/common/components/MsModuleMinder";
import MsTabButton from "@/business/components/common/components/MsTabButton";
import TestCaseMinder from "@/business/components/track/common/minder/TestCaseMinder";
export default {
name: "TestCase",
components: {
TestCaseMinder,
MsTabButton,
TestcaseMinder,
TestCaseNodeTree,
MsMainContainer,
MsAsideContainer, MsContainer, TestCaseList, NodeTree, TestCaseEdit, SelectMenu
@ -129,11 +130,13 @@ export default {
renderComponent:true,
loading: false,
type:'',
activeDom: 'left'
activeDom: 'left',
projectId: ""
}
},
mounted() {
this.init(this.$route);
this.projectId = getCurrentProjectID();
},
watch: {
redirectID() {
@ -193,7 +196,7 @@ export default {
}
},
addTab(tab) {
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}
@ -253,7 +256,7 @@ export default {
this.testCaseReadOnly = true;
}
let caseId = this.$route.params.caseId;
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}

View File

@ -472,7 +472,6 @@ export default {
reload() {
this.isStepTableAlive = false;
this.$nextTick(() => (this.isStepTableAlive = true));
console.log(this.form)
},
open(testCase) {
this.projectId = getCurrentProjectID();
@ -552,9 +551,7 @@ export default {
let tmp = {};
Object.assign(tmp, testCase);
tmp.steps = JSON.parse(testCase.steps);
console.log(tmp)
Object.assign(this.form, tmp);
console.log(this.form)
this.form.module = testCase.nodeId;
this.getFileMetaData(testCase);
},
@ -631,7 +628,6 @@ export default {
let param = this.buildParam();
if (this.validate(param)) {
let option = this.getOption(param);
console.log(option)
this.result = this.$request(option, () => {
this.$success(this.$t('commons.save_success'));
if (this.operationType == 'add' && this.isCreateContinue) {

View File

@ -312,6 +312,7 @@ export default {
currentCaseId: null,
projectId: "",
selectDataCounts: 0,
selectDataRange: "all"
}
},
props: {
@ -326,10 +327,27 @@ export default {
},
moduleOptions: {
type: Array
},
trashEnable: {
type: Boolean,
default: false,
}
},
created: function () {
this.$emit('setCondition', this.condition);
if (this.trashEnable) {
this.condition.filters = {status: ["Trash"]};
} else {
this.condition.filters = {status: ["Prepare", "Pass", "UnPass"]};
}
this.initTableData();
},
activated() {
if (this.trashEnable) {
this.condition.filters = {status: ["Trash"]};
} else {
this.condition.filters = {status: ["Prepare", "Pass", "UnPass"]};
}
this.initTableData();
},
watch: {
@ -345,6 +363,11 @@ export default {
customHeader() {
this.$refs.headerCustom.open(this.tableLabel)
},
getSelectDataRange() {
let dataRange = this.$route.params.dataSelectRange;
let dataType = this.$route.params.dataType;
this.selectDataRange = dataType === 'case' ? dataRange : 'all';
},
initTableData() {
this.projectId = getCurrentProjectID();
this.condition.planId = "";
@ -363,6 +386,29 @@ export default {
this.getData();
},
getData() {
this.getSelectDataRange();
this.condition.selectThisWeedData = false;
this.condition.caseCoverage = null;
switch (this.selectDataRange) {
case 'thisWeekCount':
this.condition.selectThisWeedData = true;
break;
case 'uncoverage':
this.condition.caseCoverage = 'uncoverage';
break;
case 'coverage':
this.condition.caseCoverage = 'coverage';
break;
case 'Prepare':
this.condition.filters.status = [this.selectDataRange];
break;
case 'Pass':
this.condition.filters.status = [this.selectDataRange];
break;
case 'UnPass':
this.condition.filters.status = [this.selectDataRange];
break;
}
if (this.projectId) {
this.condition.projectId = this.projectId;
this.result = this.$post(this.buildPagePath('/test/case/list'), this.condition, response => {

View File

@ -1,65 +0,0 @@
<template>
<ms-module-minder
:tree-nodes="treeNodes"/>
</template>
<script>
import MsModuleMinder from "@/business/components/common/components/MsModuleMinder";
export default {
name: "TestCaseMinder",
components: {MsModuleMinder},
data() {
return{
testCase: [],
dataMap: new Map()
}
},
props: {
treeNodes: {
type: Array,
default() {
return []
}
},
condition: Object,
projectId: String
},
mounted() {
// this.getTestCases();
},
methods: {
getTestCases() {
if (this.projectId) {
this.result = this.$get('/test/case/list/detail/' + this.projectId,response => {
this.testCase = response.data;
console.log(this.testCase)
this.parse();
});
}
},
parse() {
this.testCase.forEach(item => {
let mapItem = this.dataMap.get(item.moduleId);
let nodeItem = {
id: item.id,
name: item.name,
}
if (mapItem) {
mapItem.push(item);
} else {
mapItem = [];
mapItem.push(item);
}
if (item.tags && item.tags.length > 0) {
item.tags = JSON.parse(item.tags);
}
})
}
},
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,124 @@
<template>
<ms-module-minder
v-loading="result.loading"
:tree-nodes="treeNodes"
:data-map="dataMap"
@save="save"
/>
</template>
<script>
import MsModuleMinder from "@/business/components/common/components/MsModuleMinder";
import {getTestCaseDataMap} from "@/business/components/track/common/minder/minderUtils";
export default {
name: "TestCaseMinder",
components: {MsModuleMinder},
data() {
return{
testCase: [],
dataMap: new Map(),
result: {}
}
},
props: {
treeNodes: {
type: Array,
default() {
return []
}
},
condition: Object,
projectId: String
},
mounted() {
this.$nextTick(() => {
this.getTestCases();
})
},
methods: {
getTestCases() {
if (this.projectId) {
this.result = this.$get('/test/case/list/detail/' + this.projectId,response => {
this.testCase = response.data;
this.dataMap = getTestCaseDataMap(this.testCase);
});
}
},
save(data) {
let saveCases = [];
this.buildSaveCase(data.root, saveCases, undefined);
console.log(saveCases);
let param = {
projectId: this.projectId,
data: saveCases
}
this.result = this.$post('/test/case/minder/edit', param, () => {
this.$success(this.$t('commons.save_success'));
});
},
buildSaveCase(root, saveCases, parent) {
let data = root.data;
if (data.resource && data.resource.indexOf("用例") > -1) {
this._buildSaveCase(root, saveCases, parent);
} else {
if (root.children) {
root.children.forEach((childNode) => {
this.buildSaveCase(childNode, saveCases, root.data);
})
}
}
},
_buildSaveCase(node, saveCases, parent) {
let data = node.data;
let isChange = false;
let testCase = {
id: data.id,
name: data.text,
nodeId: parent ? parent.id : "",
nodePath: parent ? parent.path : "",
type: data.type ? data.type : 'functional',
method: data.method ? data.method: 'manual',
maintainer: data.maintainer,
priority: 'P' + data.priority,
};
if (data.changed) isChange = true;
let steps = [];
let stepNum = 1;
if (node.children) {
node.children.forEach((childNode) => {
let childData = childNode.data;
if (childData.resource && childData.resource.indexOf('前置条件') > -1) {
testCase.prerequisite = childData.text;
} else if (childData.resource && childData.resource.indexOf('备注') > -1) {
testCase.remark = childData.text;
} else {
//
let step = {};
step.num = stepNum++;
step.desc = childData.text;
if (childNode.children) {
let result = "";
childNode.children.forEach((child) => {
result += child.data.text;
if (child.data.changed) isChange = true;
})
step.result = result;
}
steps.push(step);
}
if (childData.changed) isChange = true;
})
}
testCase.steps = JSON.stringify(steps);
if (isChange) {
saveCases.push(testCase);
}
},
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,128 @@
<template>
<ms-module-minder
v-loading="result.loading"
:tree-nodes="treeNodes"
:data-map="dataMap"
@save="save"
/>
</template>
<script>
import MsModuleMinder from "@/business/components/common/components/MsModuleMinder";
import {getTestCaseDataMap} from "@/business/components/track/common/minder/minderUtils";
export default {
name: "TestPlanMinder",
components: {MsModuleMinder},
data() {
return{
testCase: [],
dataMap: new Map(),
result: {}
}
},
props: {
treeNodes: {
type: Array,
default() {
return []
}
},
selectNodeIds: {
type: Array
},
planId: {
type: String
},
projectId: String
},
mounted() {
this.$nextTick(() => {
this.getTestCases();
})
},
methods: {
getTestCases() {
if (this.projectId) {
this.result = this.$get('/test/plan/case/list/minder/' + this.planId, response => {
this.testCase = response.data;
this.dataMap = getTestCaseDataMap(this.testCase);
});
}
},
save(data) {
// let saveCases = [];
// this.buildSaveCase(data.root, saveCases, undefined);
// console.log(saveCases);
// let param = {
// projectId: this.projectId,
// data: saveCases
// }
// this.result = this.$post('/test/case/minder/edit', param, () => {
// this.$success(this.$t('commons.save_success'));
// });
},
buildSaveCase(root, saveCases, parent) {
let data = root.data;
if (data.resource && data.resource.indexOf("用例") > -1) {
this._buildSaveCase(root, saveCases, parent);
} else {
if (root.children) {
root.children.forEach((childNode) => {
this.buildSaveCase(childNode, saveCases, root.data);
})
}
}
},
_buildSaveCase(node, saveCases, parent) {
let data = node.data;
let isChange = false;
let testCase = {
id: data.id,
name: data.text,
nodeId: parent ? parent.id : "",
nodePath: parent ? parent.path : "",
type: data.type ? data.type : 'functional',
method: data.method ? data.method : 'manual',
maintainer: data.maintainer,
priority: 'P' + data.priority,
};
if (data.changed) isChange = true;
let steps = [];
let stepNum = 1;
if (node.children) {
node.children.forEach((childNode) => {
let childData = childNode.data;
if (childData.resource && childData.resource.indexOf('前置条件') > -1) {
testCase.prerequisite = childData.text;
} else if (childData.resource && childData.resource.indexOf('备注') > -1) {
testCase.remark = childData.text;
} else {
//
let step = {};
step.num = stepNum++;
step.desc = childData.text;
if (childNode.children) {
let result = "";
childNode.children.forEach((child) => {
result += child.data.text;
if (child.data.changed) isChange = true;
})
step.result = result;
}
steps.push(step);
}
if (childData.changed) isChange = true;
})
}
testCase.steps = JSON.stringify(steps);
if (isChange) {
saveCases.push(testCase);
}
},
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,128 @@
<template>
<ms-module-minder
v-loading="result.loading"
:tree-nodes="treeNodes"
:data-map="dataMap"
@save="save"
/>
</template>
<script>
import MsModuleMinder from "@/business/components/common/components/MsModuleMinder";
import {getTestCaseDataMap} from "@/business/components/track/common/minder/minderUtils";
export default {
name: "TestReviewMinder",
components: {MsModuleMinder},
data() {
return{
testCase: [],
dataMap: new Map(),
result: {}
}
},
props: {
treeNodes: {
type: Array,
default() {
return []
}
},
selectNodeIds: {
type: Array
},
reviewId: {
type: String
},
projectId: String
},
mounted() {
this.$nextTick(() => {
this.getTestCases();
})
},
methods: {
getTestCases() {
if (this.projectId) {
this.result = this.$post('/test/review/case/list/all', {reviewId: this.reviewId}, response => {
this.testCase = response.data;
this.dataMap = getTestCaseDataMap(this.testCase);
});
}
},
save(data) {
// let saveCases = [];
// this.buildSaveCase(data.root, saveCases, undefined);
// console.log(saveCases);
// let param = {
// projectId: this.projectId,
// data: saveCases
// }
// this.result = this.$post('/test/case/minder/edit', param, () => {
// this.$success(this.$t('commons.save_success'));
// });
},
buildSaveCase(root, saveCases, parent) {
let data = root.data;
if (data.resource && data.resource.indexOf("用例") > -1) {
this._buildSaveCase(root, saveCases, parent);
} else {
if (root.children) {
root.children.forEach((childNode) => {
this.buildSaveCase(childNode, saveCases, root.data);
})
}
}
},
_buildSaveCase(node, saveCases, parent) {
let data = node.data;
let isChange = false;
let testCase = {
id: data.id,
name: data.text,
nodeId: parent ? parent.id : "",
nodePath: parent ? parent.path : "",
type: data.type ? data.type : 'functional',
method: data.method ? data.method : 'manual',
maintainer: data.maintainer,
priority: 'P' + data.priority,
};
if (data.changed) isChange = true;
let steps = [];
let stepNum = 1;
if (node.children) {
node.children.forEach((childNode) => {
let childData = childNode.data;
if (childData.resource && childData.resource.indexOf('前置条件') > -1) {
testCase.prerequisite = childData.text;
} else if (childData.resource && childData.resource.indexOf('备注') > -1) {
testCase.remark = childData.text;
} else {
//
let step = {};
step.num = stepNum++;
step.desc = childData.text;
if (childNode.children) {
let result = "";
childNode.children.forEach((child) => {
result += child.data.text;
if (child.data.changed) isChange = true;
})
step.result = result;
}
steps.push(step);
}
if (childData.changed) isChange = true;
})
}
testCase.steps = JSON.stringify(steps);
if (isChange) {
saveCases.push(testCase);
}
},
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,59 @@
export function getTestCaseDataMap(testCase) {
let dataMap = new Map();
testCase.forEach(item => {
item.steps = JSON.parse(item.steps);
// if (item.tags && item.tags.length > 0) {
// item.tags = JSON.parse(item.tags);
// }
let mapItem = dataMap.get(item.nodeId);
let nodeItem = {
data: {
id: item.id,
text: item.name,
priority: Number.parseInt(item.priority.substring(item.priority.length - 1 )),
resource: ["用例"],
type: item.type,
method: item.method,
maintainer: item.maintainer
}
}
parseChildren(nodeItem, item);
if (mapItem) {
mapItem.push(nodeItem);
} else {
mapItem = [];
mapItem.push(nodeItem);
dataMap.set(item.nodeId, mapItem);
}
})
return dataMap;
}
function parseChildren(nodeItem, item) {
nodeItem.children = [];
let children = [];
_parseChildren(children, item.prerequisite, "前置条件");
item.steps.forEach((step) => {
let descNode = _parseChildren(children, step.desc, "测试步骤");
if (descNode) {
descNode.data.num = step.num;
descNode.children = [];
_parseChildren(descNode.children, step.result, "预期结果");
}
});
_parseChildren(children, item.remark, "备注");
nodeItem.children = children;
}
function _parseChildren(children, k, v) {
if (k) {
let node = {
data: {
text: k,
resource: [v]
}
}
children.push(node);
return node;
}
}

View File

@ -29,12 +29,12 @@
<el-row :gutter="10">
<el-col :span="6">
<div class="square">
<case-count-card :track-count-data="trackCountData" class="track-card"/>
<case-count-card :track-count-data="trackCountData" class="track-card" @redirectPage="redirectPage"/>
</div>
</el-col>
<el-col :span="6">
<div class="square">
<relevance-case-card :relevance-count-data="relevanceCountData" class="track-card"/>
<relevance-case-card :relevance-count-data="relevanceCountData" class="track-card" @redirectPage="redirectPage"/>
</div>
</el-col>
<el-col :span="12">
@ -73,7 +73,7 @@ import MsMainContainer from "@/business/components/common/components/MsMainConta
import MsContainer from "@/business/components/common/components/MsContainer";
import CaseCountCard from "@/business/components/track/home/components/CaseCountCard";
import RelevanceCaseCard from "@/business/components/track/home/components/RelevanceCaseCard";
import {getCurrentProjectID} from "@/common/js/utils";
import {getCurrentProjectID, getUUID} from "@/common/js/utils";
import CaseMaintenance from "@/business/components/track/home/components/CaseMaintenance";
import {COUNT_NUMBER, COUNT_NUMBER_SHALLOW} from "@/common/js/constants";
import BugCountCard from "@/business/components/track/home/components/BugCountCard";
@ -185,8 +185,14 @@ export default {
}]
};
this.caseOption = option;
},
redirectPage(page,dataType,selectType){
switch (page){
case "case":
this.$router.push({name:'testCase',params:{dataType:dataType,dataSelectRange:selectType, projectId: getCurrentProjectID()}});
break;
}
}
}
}
</script>

View File

@ -83,27 +83,27 @@
<el-row>
<el-col>
<span class="default-property">
{{$t('api_test.home_page.detail_card.running')}}
未评审
{{"\xa0\xa0"}}
<el-link type="info" @click="redirectPage('Underway')" target="_blank" style="color: #000000">
<el-link type="info" @click="redirectPage('Prepare')" target="_blank" style="color: #000000">
{{trackCountData.prepareCount}}
</el-link>
</span>
</el-col>
<el-col style="margin-top: 5px;">
<span class="default-property">
{{$t('api_test.home_page.detail_card.not_started')}}
未通过
{{"\xa0\xa0"}}
<el-link type="info" @click="redirectPage('Prepare')" target="_blank" style="color: #000000">
<el-link type="info" @click="redirectPage('Pass')" target="_blank" style="color: #000000">
{{trackCountData.passCount}}
</el-link>
</span>
</el-col>
<el-col style="margin-top: 5px;">
<span class="main-property">
{{$t('api_test.home_page.detail_card.finished')}}
已通过
{{"\xa0\xa0"}}
<el-link type="info" @click="redirectPage('Completed')" target="_blank" style="color: #000000">
<el-link type="info" @click="redirectPage('UnPass')" target="_blank" style="color: #000000">
{{trackCountData.unPassCount}}
</el-link>
</span>
@ -133,7 +133,7 @@ export default {
},
methods: {
redirectPage(clickType){
this.$emit("redirectPage","api","api",clickType);
this.$emit("redirectPage","case", "case",clickType);
}
}
}

View File

@ -68,7 +68,7 @@
<span class="default-property">
未覆盖
{{"\xa0\xa0"}}
<el-link type="info" @click="redirectPage('Underway')" target="_blank" style="color: #000000">
<el-link type="info" @click="redirectPage('uncoverage')" target="_blank" style="color: #000000">
{{relevanceCountData.uncoverageCount}}
</el-link>
</span>
@ -77,7 +77,7 @@
<span class="main-property">
已覆盖
{{"\xa0\xa0"}}
<el-link type="info" @click="redirectPage('Prepare')" target="_blank" style="color: #000000">
<el-link type="info" @click="redirectPage('coverage')" target="_blank" style="color: #000000">
{{relevanceCountData.coverageCount}}
</el-link>
</span>
@ -107,7 +107,7 @@ export default {
},
methods: {
redirectPage(clickType){
this.$emit("redirectPage","api","api",clickType);
this.$emit("redirectPage","case","case",clickType);
}
}
}

View File

@ -6,6 +6,7 @@
@openTestPlanEditDialog="openTestPlanEditDialog"
@testPlanEdit="openTestPlanEditDialog"
ref="testPlanList"/>
</ms-main-container>
<test-plan-edit ref="testPlanEditDialog" @refresh="refreshTestPlanList"/>

View File

@ -19,6 +19,11 @@
<el-input v-model="form.name" :placeholder="$t('test_track.plan.input_plan_name')"></el-input>
</el-form-item>
</el-col>
<el-col :span="10" :offset="1">
<el-form-item :label="$t('commons.tag')" :label-width="formLabelWidth" prop="tag">
<ms-input-tag :currentScenario="form" ref="tag"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
@ -93,6 +98,7 @@
</el-form>
<template v-slot:footer>
<div class="dialog-footer">
<el-button
@click="dialogFormVisible = false">
@ -118,10 +124,11 @@ import {WORKSPACE_ID} from '@/common/js/constants';
import TestPlanStatusButton from "../common/TestPlanStatusButton";
import {getCurrentProjectID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
export default {
name: "TestPlanEdit",
components: {TestPlanStatusButton},
components: {TestPlanStatusButton, MsInputTag},
data() {
return {
dialogFormVisible: false,
@ -174,6 +181,10 @@ export default {
return;
}
param.workspaceId = localStorage.getItem(WORKSPACE_ID);
if (this.form.tags instanceof Array) {
this.form.tags = JSON.stringify(this.form.tags);
}
param.tags = this.form.tags;
this.$post('/test/plan/' + this.operationType, param, () => {
this.$success(this.$t('commons.save_success'));
this.dialogFormVisible = false;

View File

@ -3,8 +3,10 @@
<template v-slot:header>
<ms-table-header :is-tester-permission="true" :condition.sync="condition"
@search="initTableData" @create="testPlanCreate"
:create-tip="$t('test_track.plan.create_plan')"
:title="$t('test_track.plan.test_plan')"/>
:title="$t('test_track.plan.test_plan')"
:show-create="false"/>
<el-button type="primary" plain icon="el-icon-plus" size="mini" v-tester @click="testPlanCreate"/>
</template>
<el-table

View File

@ -8,6 +8,7 @@
<template v-slot:aside>
<ms-api-module
:relevance-project-id="projectId"
@nodeSelectEvent="nodeChange"
@protocolChange="handleProtocolChange"
@refreshTable="refresh"
@ -132,6 +133,7 @@
url = '/api/definition/relevance';
environmentId = this.$refs.apiList.environmentId;
selectIds = Array.from(this.$refs.apiList.selectRows).map(row => row.id);
} else {
url = '/api/testcase/relevance';
environmentId = this.$refs.apiCaseList.environmentId;

Some files were not shown because too many files have changed in this diff Show More