Merge remote-tracking branch 'origin/master'

# Conflicts:
#	backend/src/main/resources/db/migration/V78__v1.8_release.sql
This commit is contained in:
Captain.B 2021-03-16 13:42:36 +08:00
commit 15dc136df7
86 changed files with 6086 additions and 145 deletions

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

@ -59,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) {
@ -218,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

@ -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

@ -23,6 +23,7 @@ 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.*;
import io.metersphere.commons.constants.*;
@ -71,6 +72,8 @@ public class ApiAutomationService {
@Resource
private TestPlanApiScenarioMapper testPlanApiScenarioMapper;
@Resource
private TestCaseReviewScenarioMapper testCaseReviewScenarioMapper;
@Resource
private JMeterService jMeterService;
@Resource
private ApiTestEnvironmentService environmentService;
@ -94,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 -> {
@ -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);

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

@ -590,6 +590,10 @@ public class ApiDefinitionService {
apiTestCaseService.relevanceByApi(request);
}
public void testCaseReviewRelevance(ApiCaseRelevanceRequest request) {
apiTestCaseService.relevanceByApiByReview(request);
}
/**
* 数据统计-接口类型
*
@ -674,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()) {

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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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);
}
}
});

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

@ -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;
@ -94,6 +96,10 @@ alter table api_scenario add original_state varchar(64);
update api_definition 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

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

@ -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

@ -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

@ -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

@ -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;

View File

@ -262,6 +262,7 @@ export default {
}
},
planId: String,
reviewId: String,
clickType: String
},
created: function () {
@ -280,6 +281,9 @@ export default {
},
planId() {
this.initTable();
},
reviewId() {
this.initTable();
}
},
computed: {
@ -317,9 +321,6 @@ export default {
this.selectRows = new Set();
this.condition.status = "";
this.condition.moduleIds = this.selectNodeIds;
this.condition.planId = this.planId;
if (this.currentProtocol != null) {
this.condition.protocol = this.currentProtocol;
}
@ -331,15 +332,31 @@ export default {
}
this.status = 'all';
}
this.result = this.$post('/test/plan/api/case/list/' + this.currentPage + "/" + this.pageSize, this.condition, response => {
this.total = response.data.itemCount;
this.tableData = response.data.listObject;
this.tableData.forEach(item => {
if (item.tags && item.tags.length > 0) {
item.tags = JSON.parse(item.tags);
}
})
});
if (this.reviewId) {
this.condition.reviewId = this.reviewId;
this.result = this.$post('/test/case/review/api/case/list/' + this.currentPage + "/" + this.pageSize, this.condition, response => {
this.total = response.data.itemCount;
this.tableData = response.data.listObject;
this.tableData.forEach(item => {
if (item.tags && item.tags.length > 0) {
item.tags = JSON.parse(item.tags);
}
})
});
}
if (this.planId) {
this.condition.planId = this.planId;
this.result = this.$post('/test/plan/api/case/list/' + this.currentPage + "/" + this.pageSize, this.condition, response => {
this.total = response.data.itemCount;
this.tableData = response.data.listObject;
this.tableData.forEach(item => {
if (item.tags && item.tags.length > 0) {
item.tags = JSON.parse(item.tags);
}
})
});
}
},
handleSelect(selection, row) {
row.hashTree = [];
@ -399,13 +416,25 @@ export default {
if (action === 'confirm') {
let param = {};
param.ids = Array.from(this.selectRows).map(row => row.id);
param.planId = this.planId;
this.$post('/test/plan/api/case/batch/delete', param, () => {
this.selectRows.clear();
this.initTable();
this.$emit('refresh');
this.$success(this.$t('test_track.cancel_relevance_success'));
});
if (this.reviewId) {
param.testCaseReviewId = this.reviewId
this.$post('/test/case/review/api/case/batch/delete', param, () => {
this.selectRows.clear();
this.initTable();
this.$emit('refresh');
this.$success(this.$t('test_track.cancel_relevance_success'));
});
}
if (this.planId) {
param.planId = this.planId;
this.$post('/test/plan/api/case/batch/delete', param, () => {
this.selectRows.clear();
this.initTable();
this.$emit('refresh');
this.$success(this.$t('test_track.cancel_relevance_success'));
});
}
}
}
});
@ -494,11 +523,20 @@ export default {
});
},
handleDelete(apiCase) {
this.$get('/test/plan/api/case/delete/' + apiCase.id, () => {
this.$success(this.$t('test_track.cancel_relevance_success'));
this.$emit('refresh');
this.initTable();
});
if (this.planId) {
this.$get('/test/plan/api/case/delete/' + apiCase.id, () => {
this.$success(this.$t('test_track.cancel_relevance_success'));
this.$emit('refresh');
this.initTable();
});
}
if (this.reviewId) {
this.$get('/test/case/review/api/case/delete/' + apiCase.id, () => {
this.$success(this.$t('test_track.cancel_relevance_success'));
this.$emit('refresh');
this.initTable();
});
}
return;
},
getProjectId() {

View File

@ -140,6 +140,7 @@ export default {
default: false,
},
selectNodeIds: Array,
reviewId: String,
planId: String,
clickType: String
},
@ -202,7 +203,6 @@ export default {
this.selectRows = new Set();
this.loading = true;
this.condition.moduleIds = this.selectNodeIds;
this.condition.planId = this.planId;
if (this.clickType) {
if (this.status == 'default') {
this.condition.status = this.clickType;
@ -211,18 +211,37 @@ export default {
}
this.status = 'all';
}
let url = "/test/plan/scenario/case/list/" + this.currentPage + "/" + this.pageSize;
this.$post(url, this.condition, response => {
let data = response.data;
this.total = data.itemCount;
this.tableData = data.listObject;
this.tableData.forEach(item => {
if (item.tags && item.tags.length > 0) {
item.tags = JSON.parse(item.tags);
}
if (this.planId) {
this.condition.planId = this.planId;
let url = "/test/plan/scenario/case/list/" + this.currentPage + "/" + this.pageSize;
this.$post(url, this.condition, response => {
let data = response.data;
this.total = data.itemCount;
this.tableData = data.listObject;
this.tableData.forEach(item => {
if (item.tags && item.tags.length > 0) {
item.tags = JSON.parse(item.tags);
}
});
this.loading = false;
});
this.loading = false;
});
}
if (this.reviewId) {
this.condition.reviewId = this.reviewId;
let url = "/test/case/review/scenario/case/list/" + this.currentPage + "/" + this.pageSize;
this.$post(url, this.condition, response => {
let data = response.data;
this.total = data.itemCount;
this.tableData = data.listObject;
this.tableData.forEach(item => {
if (item.tags && item.tags.length > 0) {
item.tags = JSON.parse(item.tags);
}
});
this.loading = false;
});
}
},
reductionApi(row) {
row.scenarioDefinition = null;
@ -233,21 +252,39 @@ export default {
})
},
handleBatchExecute() {
this.selectRows.forEach(row => {
let param = this.buildExecuteParam(row);
this.$post("/test/plan/scenario/case/run", param, response => {
if (this.reviewId) {
this.selectRows.forEach(row => {
let param = this.buildExecuteParam(row);
this.$post("/test/case/review/scenario/case/run", param, response => {
});
});
});
}
if (this.planId) {
this.selectRows.forEach(row => {
let param = this.buildExecuteParam(row);
this.$post("/test/plan/scenario/case/run", param, response => {
});
});
}
this.$message('任务执行中,请稍后刷新查看结果');
this.search();
},
execute(row) {
this.infoDb = false;
let param = this.buildExecuteParam(row);
this.$post("/test/plan/scenario/case/run", param, response => {
this.runVisible = true;
this.reportId = response.data;
});
if (this.planId) {
this.$post("/test/plan/scenario/case/run", param, response => {
this.runVisible = true;
this.reportId = response.data;
});
}
if (this.reviewId) {
this.$post("/test/case/review/scenario/case/run", param, response => {
this.runVisible = true;
this.reportId = response.data;
});
}
},
buildExecuteParam(row) {
let param = {};
@ -265,11 +302,20 @@ export default {
this.reportId = row.reportId;
},
remove(row) {
this.$get('/test/plan/scenario/case/delete/' + row.id, () => {
this.$success(this.$t('test_track.cancel_relevance_success'));
this.$emit('refresh');
this.search();
});
if (this.planId) {
this.$get('/test/plan/scenario/case/delete/' + row.id, () => {
this.$success(this.$t('test_track.cancel_relevance_success'));
this.$emit('refresh');
this.search();
});
}
if (this.reviewId) {
this.$get('/test/case/review/scenario/case/delete/' + row.id, () => {
this.$success(this.$t('test_track.cancel_relevance_success'));
this.$emit('refresh');
this.search();
});
}
return;
},
isSelect(row) {
@ -288,13 +334,24 @@ export default {
if (action === 'confirm') {
let param = {};
param.ids = Array.from(this.selectRows).map(row => row.id);
param.planId = this.planId;
this.$post('/test/plan/scenario/case/batch/delete', param, () => {
this.selectRows.clear();
this.search();
this.$success(this.$t('test_track.cancel_relevance_success'));
this.$emit('refresh');
});
if (this.planId) {
param.planId = this.planId;
this.$post('/test/plan/scenario/case/batch/delete', param, () => {
this.selectRows.clear();
this.search();
this.$success(this.$t('test_track.cancel_relevance_success'));
this.$emit('refresh');
});
}
if (this.reviewId) {
param.reviewId = this.reviewId;
this.$post('/test/case/review/scenario/case/batch/delete', param, () => {
this.selectRows.clear();
this.search();
this.$success(this.$t('test_track.cancel_relevance_success'));
this.$emit('refresh');
});
}
}
}
});
@ -311,10 +368,19 @@ export default {
})
param.mapping = strMapToObj(map);
param.envMap = strMapToObj(form.projectEnvMap);
this.$post('/test/plan/scenario/case/batch/update/env', param, () => {
this.$success(this.$t('commons.save_success'));
this.search();
})
if (this.planId) {
this.$post('/test/plan/scenario/case/batch/update/env', param, () => {
this.$success(this.$t('commons.save_success'));
this.search();
})
}
if (this.reviewId) {
this.$post('/test/case/review/scenario/case/batch/update/env', param, () => {
this.$success(this.$t('commons.save_success'));
this.search();
})
}
},
}
}

View File

@ -14,7 +14,8 @@
<slot></slot>
<template v-slot:footer>
<div v-if="$slots.footer">
<div v-if="$slots.footer">
<slot name="footer"></slot>
</div>
<div v-else>

View File

@ -664,8 +664,9 @@ export default {
}
},
deleteIssue(row) {
this.result = this.$get("/issues/delete/" + row.id, () => {
this.getIssues(this.testCase.caseId);
let caseId = this.testCase.caseId;
this.result = this.$post("/issues/delete", {id: row.id, caseId: caseId}, () => {
this.getIssues(caseId);
this.$success(this.$t('commons.delete_success'));
})
},

View File

@ -1,7 +1,7 @@
<template>
<div class="card-container">
<el-card class="card-content" v-loading="result.loading">
<template v-slot:header>
<!-- <el-card class="card-content" v-loading="result.loading">-->
<!-- <template v-slot:header>-->
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="initTableData"
:show-create="false" :tip="$t('commons.search_by_id_name_tag')">
<template v-slot:title>
@ -19,7 +19,7 @@
:content="$t('test_track.plan_view.cancel_all_relevance')" @click="handleDeleteBatch"/>
</template>
</ms-table-header>
</template>
<!-- </template>-->
<executor-edit ref="executorEdit" :select-ids="new Set(Array.from(this.selectRows).map(row => row.id))"
@refresh="initTableData"/>
@ -250,7 +250,7 @@
:is-read-only="isReadOnly"
@refreshTable="search"/>
</el-card>
<!-- </el-card>-->
<batch-edit ref="batchEdit" @batchEdit="batchEdit"
:type-arr="typeArr" :value-arr="valueArr" :dialog-title="$t('test_track.case.batch_edit_case')"/>
</div>
@ -671,6 +671,9 @@ export default {
</script>
<style scoped>
.ms-table-header {
margin: 20px;
}
.search {
margin-left: 10px;

View File

@ -61,8 +61,11 @@
</el-table-column>
</el-table>
<div v-if="!lineStatus" style="text-align: center">{{$t('test_track.review_view.last_page')}}</div>
<div style="text-align: center"> {{total}} </div>
<div v-if="!lineStatus" style="text-align: center">{{ $t('test_track.review_view.last_page') }}</div>
<div style="text-align: center"> {{ total }} </div>
<div style="margin-bottom: 15px;margin-right: 0">
<el-checkbox v-model="checked">同步添加关联的接口和性能测试</el-checkbox>
</div>
</test-case-relevance-base>

View File

@ -9,8 +9,16 @@
ref="nodeTree"/>
</template>
<template v-slot:main>
<ms-tab-button
:active-dom.sync="activeDom"
:left-tip="'用例列表'"
:left-content="'CASE'"
:right-tip="'脑图'"
:right-content="'脑图'"
:middle-button-enable="false">
<functional-test-case-list
class="table-list"
v-if="activeDom === 'left'"
@openTestCaseRelevanceDialog="openTestCaseRelevanceDialog"
@refresh="refresh"
:plan-id="planId"
@ -18,6 +26,13 @@
:select-node-ids="selectNodeIds"
:select-parent-nodes="selectParentNodes"
ref="testPlanTestCaseList"/>
<test-plan-minder
:tree-nodes="treeNodes"
:project-id="projectId"
:plan-id="planId"
v-if="activeDom === 'right'"
/>
</ms-tab-button>
</template>
<test-case-functional-relevance
@ -34,10 +49,15 @@
import MsTestPlanCommonComponent from "../base/TestPlanCommonComponent";
import TestCaseFunctionalRelevance from "./TestCaseFunctionalRelevance";
import FunctionalTestCaseList from "./FunctionalTestCaseList";
import MsTabButton from "@/business/components/common/components/MsTabButton";
import TestPlanMinder from "@/business/components/track/common/minder/TestPlanMinder";
import {getCurrentProjectID} from "@/common/js/utils";
export default {
name: "TestPlanFunctional",
components: {
TestPlanMinder,
MsTabButton,
FunctionalTestCaseList,
TestCaseFunctionalRelevance,
MsTestPlanCommonComponent,
@ -50,6 +70,8 @@
selectNodeIds: [],
selectParentNodes: [],
treeNodes: [],
activeDom: 'left',
projectId: ""
}
},
props: [
@ -58,6 +80,7 @@
'clickType'
],
mounted() {
this.projectId = getCurrentProjectID();
this.initData();
},
activated(){
@ -121,5 +144,7 @@
</script>
<style scoped>
/deep/ .el-button-group>.el-button:first-child {
padding: 4px 1px !important;
}
</style>

View File

@ -113,6 +113,9 @@ export default {
props: {
planId: {
type: String
},
reviewId: {
type: String
}
},
watch: {
@ -126,6 +129,9 @@ export default {
this.condition.projectId = this.projectId;
this.getProjectNode();
this.search();
},
reviewId() {
this.condition.reviewId = this.reviewId;
}
},
methods: {
@ -137,16 +143,30 @@ export default {
},
saveCaseRelevance() {
let param = {};
param.testPlanId = this.planId;
param.caseIds = [...this.selectIds];
this.result = this.$post('/test/plan/load/case/relevance', param, () => {
this.selectIds.clear();
this.$success(this.$t('commons.save_success'));
if (this.planId) {
param.testPlanId = this.planId;
this.result = this.$post('/test/plan/load/case/relevance', param, () => {
this.selectIds.clear();
this.$success(this.$t('commons.save_success'));
this.$refs.baseRelevance.close();
this.$refs.baseRelevance.close();
this.$emit('refresh');
});
}
if (this.reviewId) {
param.testCaseReviewId = this.reviewId;
this.result = this.$post('/test/review/load/case/relevance', param, () => {
this.selectIds.clear();
this.$success(this.$t('commons.save_success'));
this.$refs.baseRelevance.close();
this.$emit('refresh');
});
}
this.$emit('refresh');
});
},
buildPagePath(path) {
return path + "/" + this.currentPage + "/" + this.pageSize;
@ -159,8 +179,6 @@ export default {
getTestCases() {
if (this.planId) {
this.condition.testPlanId = this.planId;
}
if (this.projectId) {
this.condition.projectId = this.projectId;
this.result = this.$post(this.buildPagePath('/test/plan/load/case/relevance/list'), this.condition, response => {
let data = response.data;
@ -168,6 +186,17 @@ export default {
this.testCases = data.listObject;
});
}
if (this.reviewId) {
this.condition.testCaseReviewId = this.reviewId;
if (this.projectId) {
this.condition.projectId = this.projectId;
this.result = this.$post(this.buildPagePath('/test/review/load/case/relevance/list'), this.condition, response => {
let data = response.data;
this.total = data.itemCount;
this.testCases = data.listObject;
});
}
}
},
handleSelectAll(selection) {
if (selection.length > 0) {

View File

@ -192,6 +192,7 @@ export default {
default: false
},
planId: String,
reviewId: String,
clickType: String,
},
created() {
@ -225,12 +226,24 @@ export default {
}
this.status = 'all';
}
this.$post("/test/plan/load/case/list/" + this.currentPage + "/" + this.pageSize, this.condition, response => {
let data = response.data;
let {itemCount, listObject} = data;
this.total = itemCount;
this.tableData = listObject;
})
if (this.planId) {
this.condition.testPlanId = this.planId;
this.$post("/test/plan/load/case/list/" + this.currentPage + "/" + this.pageSize, this.condition, response => {
let data = response.data;
let {itemCount, listObject} = data;
this.total = itemCount;
this.tableData = listObject;
})
}
if (this.reviewId) {
this.condition.testCaseReviewId = this.reviewId;
this.$post("/test/review/load/case/list/" + this.currentPage + "/" + this.pageSize, this.condition, response => {
let data = response.data;
let {itemCount, listObject} = data;
this.total = itemCount;
this.tableData = listObject;
})
}
},
refreshStatus() {
this.refreshScheduler = setInterval(() => {
@ -267,11 +280,20 @@ export default {
callback: (action) => {
if (action === 'confirm') {
let ids = Array.from(this.selectRows).map(row => row.id);
this.result = this.$post('/test/plan/load/case/batch/delete', ids, () => {
this.selectRows.clear();
this.initTable();
this.$success(this.$t('test_track.cancel_relevance_success'));
});
if (this.planId) {
this.result = this.$post('/test/plan/load/case/batch/delete', ids, () => {
this.selectRows.clear();
this.initTable();
this.$success(this.$t('test_track.cancel_relevance_success'));
});
}
if (this.reviewId) {
this.result = this.$post('/test/review/load/case/batch/delete', ids, () => {
this.selectRows.clear();
this.initTable();
this.$success(this.$t('test_track.cancel_relevance_success'));
});
}
}
}
})
@ -306,14 +328,21 @@ export default {
})
},
updateStatus(loadCase, status) {
this.$post('/test/plan/load/case/update', {id: loadCase.id, status: status}, () => {
this.$post('/test/plan/edit/status/' + loadCase.testPlanId, {}, () => {
if (this.planId) {
this.$post('/test/plan/load/case/update', {id: loadCase.id, status: status}, () => {
this.$post('/test/plan/edit/status/' + loadCase.testPlanId, {}, () => {
this.initTable();
});
});
}
if (this.reviewId) {
this.$post('/test/review/load/case/update', {id: loadCase.id, status: status}, () => {
this.initTable();
});
});
}
},
handleDelete(loadCase) {
this.result = this.$get('/test/plan/load/case/delete/' + loadCase.id, () => {
this.result = this.$get('/test/review/load/case/delete/' + loadCase.id, () => {
this.$success(this.$t('test_track.cancel_relevance_success'));
this.$emit('refresh');
this.initTable();

View File

@ -1,9 +1,12 @@
<template>
<div class="table-card" v-loading="result.loading">
<el-card class="table-card" v-loading="result.loading">
<template v-slot:header>
<ms-table-header :is-tester-permission="true" :condition.sync="condition"
@search="initTableData" @create="testCaseReviewCreate"
:create-tip="$t('test_track.review.create_review')"
:title="$t('test_track.review.test_review')"/>
</template>
<el-table
border
class="adjust-table"
@ -103,7 +106,8 @@
<ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/>
<ms-delete-confirm :title="$t('test_track.review.delete')" @delete="_handleDelete" ref="deleteConfirm"/>
</div>
</el-card>
</template>
<script>

View File

@ -10,20 +10,19 @@
</template>
<template v-slot:menu>
<el-menu v-if="isMenuShow" active-text-color="#6d317c"
class="el-menu-demo header-menu" mode="horizontal" @select="handleSelect" :default-active="activeIndex">
class="el-menu-demo header-menu" mode="horizontal" @select="handleSelect"
:default-active="activeIndex">
<el-menu-item index="functional">功能测试用例</el-menu-item>
<el-menu-item index="api">接口测试用例</el-menu-item>
<el-menu-item index="load">性能测试用例</el-menu-item>
<!-- <el-menu-item index="report">报告统计</el-menu-item>-->
<!-- <el-menu-item index="report">报告统计</el-menu-item>-->
</el-menu>
</template>
</ms-test-plan-header-bar>
<test-review-function v-if="activeIndex === 'functional'" :redirectCharType="redirectCharType"
:clickType="clickType" :review-id="reviewId"></test-review-function>
<test-review-api v-if="activeIndex === 'api'" :redirectCharType="redirectCharType" :clickType="clickType"
:review-id="reviewId"></test-review-api>
<test-review-load v-if="activeIndex === 'load'" :redirectCharType="redirectCharType" :clickType="clickType"
:review-id="reviewId"></test-review-load>
<test-review-api v-if="activeIndex === 'api'" :review-id="reviewId"></test-review-api>
<test-review-load v-if="activeIndex === 'load'" :review-id="reviewId"></test-review-load>
</div>

View File

@ -0,0 +1,258 @@
<template>
<div>
<api-list-container
:is-api-list-enable="isApiListEnable"
@isApiListEnableChange="isApiListEnableChange">
<ms-environment-select :project-id="projectId" v-if="isTestPlan" :is-read-only="isReadOnly"
@setEnvironment="setEnvironment"/>
<el-input :placeholder="$t('api_monitor.please_search')" @blur="initTable" class="search-input" size="small"
@keyup.enter.native="initTable" v-model="condition.name"/>
<el-table v-loading="result.loading"
border
:data="tableData" row-key="id" class="test-content adjust-table"
@select-all="handleSelectAll"
@select="handleSelect" ref="table">
<el-table-column reserve-selection type="selection"/>
<el-table-column prop="name" :label="$t('api_test.definition.api_name')" show-overflow-tooltip/>
<el-table-column
prop="status"
column-key="api_status"
:label="$t('api_test.definition.api_status')"
show-overflow-tooltip>
<template v-slot:default="scope">
<ms-tag v-if="scope.row.status == 'Prepare'" type="info" effect="plain"
:content="$t('test_track.plan.plan_status_prepare')"/>
<ms-tag v-if="scope.row.status == 'Underway'" type="warning" effect="plain"
:content="$t('test_track.plan.plan_status_running')"/>
<ms-tag v-if="scope.row.status == 'Completed'" type="success" effect="plain"
:content="$t('test_track.plan.plan_status_completed')"/>
<ms-tag v-if="scope.row.status == 'Trash'" type="danger" effect="plain"
:content="$t('test_track.plan.plan_status_trash')"/>
</template>
</el-table-column>
<el-table-column
prop="method"
:label="$t('api_test.definition.api_type')"
show-overflow-tooltip>
<template v-slot:default="scope" class="request-method">
<el-tag size="mini"
:style="{'background-color': getColor(scope.row.method), border: getColor(true, scope.row.method)}"
class="api-el-tag">
{{ scope.row.method }}
</el-tag>
</template>
</el-table-column>
<el-table-column
prop="path"
:label="$t('api_test.definition.api_path')"
show-overflow-tooltip/>
<el-table-column width="160" :label="$t('api_test.definition.api_last_time')" prop="updateTime">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
prop="caseTotal"
:label="$t('api_test.definition.api_case_number')"
show-overflow-tooltip/>
<el-table-column
prop="caseStatus"
:label="$t('api_test.definition.api_case_status')"
show-overflow-tooltip/>
<el-table-column
prop="casePassingRate"
:label="$t('api_test.definition.api_case_passing_rate')"
show-overflow-tooltip/>
</el-table>
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/>
</api-list-container>
<table-select-count-bar :count="selectRows.size"/>
</div>
</template>
<script>
import MsTag from "../../../../common/components/MsTag";
import ApiListContainer from "@/business/components/api/definition/components/list/ApiListContainer";
import MsEnvironmentSelect from "@/business/components/api/definition/components/case/MsEnvironmentSelect";
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import TableSelectCountBar from "@/business/components/api/automation/scenario/api/TableSelectCountBar";
import {API_METHOD_COLOUR, CASE_PRIORITY} from "@/business/components/api/definition/model/JsonData";
import {_filter, _handleSelect, _handleSelectAll, _sort} from "@/common/js/tableUtils";
export default {
name: "ReviewRelevanceApiList",
components: {TableSelectCountBar, MsTablePagination, MsEnvironmentSelect, ApiListContainer, MsTag},
data() {
return {
condition: {},
selectCase: {},
result: {},
moduleId: "",
deletePath: "/test/case/delete",
selectRows: new Set(),
typeArr: [
{id: 'priority', name: this.$t('test_track.case.priority')},
],
priorityFilters: [
{text: 'P0', value: 'P0'},
{text: 'P1', value: 'P1'},
{text: 'P2', value: 'P2'},
{text: 'P3', value: 'P3'}
],
valueArr: {
priority: CASE_PRIORITY,
},
methodColorMap: new Map(API_METHOD_COLOUR),
tableData: [],
currentPage: 1,
pageSize: 10,
total: 0,
environmentId: ""
}
},
props: {
currentProtocol: String,
selectNodeIds: Array,
visible: {
type: Boolean,
default: false,
},
isApiListEnable: {
type: Boolean,
default: false,
},
isReadOnly: {
type: Boolean,
default: false
},
isCaseRelevance: {
type: Boolean,
default: false,
},
projectId: String,
reviewId: String,
isTestPlan: Boolean
},
created: function () {
this.selectRows = new Set();
this.initTable();
},
watch: {
selectNodeIds() {
this.initTable();
},
currentProtocol() {
this.initTable();
},
projectId() {
this.initTable();
}
},
computed: {},
methods: {
isApiListEnableChange(data) {
this.$emit('isApiListEnableChange', data);
},
initTable(projectId) {
this.condition.filters = {status: ["Prepare", "Underway", "Completed"]};
this.condition.moduleIds = this.selectNodeIds;
if (this.trashEnable) {
this.condition.filters = {status: ["Trash"]};
this.condition.moduleIds = [];
}
if (projectId != null && typeof projectId === 'string') {
this.condition.projectId = projectId;
} else if (this.projectId != null) {
this.condition.projectId = this.projectId;
}
if (this.currentProtocol != null) {
this.condition.protocol = this.currentProtocol;
} else {
this.condition.protocol = "HTTP";
}
let url = '/api/definition/list/';
if (this.isTestPlan) {
url = '/api/definition/list/relevance/review/';
this.condition.reviewId = this.reviewId;
}
this.result = this.$post(url + this.currentPage + "/" + this.pageSize, this.condition, response => {
this.total = response.data.itemCount;
this.tableData = response.data.listObject;
});
},
handleSelect(selection, row) {
_handleSelect(this, selection, row, this.selectRows);
},
showExecResult(row) {
this.visible = false;
this.$emit('showExecResult', row);
},
filter(filters) {
_filter(filters, this.condition);
this.initTable();
},
sort(column) {
//
if (this.condition.orders) {
this.condition.orders = [];
}
_sort(column, this.condition);
this.initTable();
},
handleSelectAll(selection) {
_handleSelectAll(this, selection, this.tableData, this.selectRows);
},
buildPagePath(path) {
return path + "/" + this.currentPage + "/" + this.pageSize;
},
getColor(method) {
return this.methodColorMap.get(method);
},
setEnvironment(data) {
this.environmentId = data.id;
},
clearSelection() {
this.selectRows = new Set();
if (this.$refs.table) {
this.$refs.table.clearSelection();
}
}
},
}
</script>
<style scoped>
.operate-button > div {
display: inline-block;
margin-left: 10px;
}
.request-method {
padding: 0 5px;
color: #1E90FF;
}
.api-el-tag {
color: white;
}
.search-input {
float: right;
width: 30%;
margin-bottom: 20px;
margin-right: 20px;
}
</style>

View File

@ -0,0 +1,243 @@
<template>
<div>
<api-list-container
:is-api-list-enable="isApiListEnable"
@isApiListEnableChange="isApiListEnableChange">
<ms-environment-select :project-id="projectId" v-if="isTestPlan" :is-read-only="isReadOnly"
@setEnvironment="setEnvironment"/>
<el-input :placeholder="$t('api_test.definition.request.select_case')" @blur="initTable"
@keyup.enter.native="initTable" class="search-input" size="small" v-model="condition.name"/>
<el-table v-loading="result.loading"
border
:data="tableData"
row-key="id"
class="test-content adjust-table"
@select-all="handleSelectAll"
@filter-change="filter"
@sort-change="sort"
@select="handleSelect" ref="table">
<el-table-column reserve-selection type="selection"/>
<el-table-column prop="name" :label="$t('api_test.definition.api_name')" show-overflow-tooltip/>
<el-table-column
prop="priority"
:filters="priorityFilters"
column-key="priority"
:label="$t('test_track.case.priority')"
show-overflow-tooltip>
<template v-slot:default="scope">
<priority-table-item :value="scope.row.priority"/>
</template>
</el-table-column>
<el-table-column
prop="path"
:label="$t('api_test.definition.api_path')"
show-overflow-tooltip/>
<el-table-column
prop="createUser"
:label="'创建人'"
show-overflow-tooltip/>
<el-table-column
sortable="custom"
width="160"
:label="$t('api_test.definition.api_last_time')"
prop="updateTime">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
</el-table>
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/>
</api-list-container>
<table-select-count-bar :count="selectRows.size"/>
</div>
</template>
<script>
import ApiListContainer from "@/business/components/api/definition/components/list/ApiListContainer";
import MsEnvironmentSelect from "@/business/components/api/definition/components/case/MsEnvironmentSelect";
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import TableSelectCountBar from "@/business/components/api/automation/scenario/api/TableSelectCountBar";
import {API_METHOD_COLOUR, CASE_PRIORITY} from "@/business/components/api/definition/model/JsonData";
import {_filter, _handleSelect, _handleSelectAll, _sort} from "@/common/js/tableUtils";
import PriorityTableItem from "@/business/components/track/common/tableItems/planview/PriorityTableItem";
export default {
name: "ReviewRelevanceCaseList",
components: {PriorityTableItem, TableSelectCountBar, MsTablePagination, MsEnvironmentSelect, ApiListContainer},
data() {
return {
condition: {},
selectCase: {},
result: {},
moduleId: "",
selectRows: new Set(),
typeArr: [
{id: 'priority', name: this.$t('test_track.case.priority')},
],
priorityFilters: [
{text: 'P0', value: 'P0'},
{text: 'P1', value: 'P1'},
{text: 'P2', value: 'P2'},
{text: 'P3', value: 'P3'}
],
valueArr: {
priority: CASE_PRIORITY,
},
methodColorMap: new Map(API_METHOD_COLOUR),
tableData: [],
currentPage: 1,
pageSize: 10,
total: 0,
environmentId: ""
}
},
props: {
currentProtocol: String,
selectNodeIds: Array,
visible: {
type: Boolean,
default: false,
},
isApiListEnable: {
type: Boolean,
default: false,
},
isReadOnly: {
type: Boolean,
default: false
},
isCaseRelevance: {
type: Boolean,
default: false,
},
projectId: String,
reviewId: String,
isTestPlan: Boolean
},
created: function () {
this.initTable();
},
watch: {
selectNodeIds() {
this.initTable();
},
currentProtocol() {
this.initTable();
},
projectId() {
this.initTable();
}
},
methods: {
isApiListEnableChange(data) {
this.$emit('isApiListEnableChange', data);
},
initTable(projectId) {
this.condition.status = "";
this.condition.moduleIds = this.selectNodeIds;
if (projectId != null && typeof projectId === 'string') {
this.condition.projectId = projectId;
} else if (this.projectId != null) {
this.condition.projectId = this.projectId;
}
if (this.currentProtocol != null) {
this.condition.protocol = this.currentProtocol;
}
let url = '/api/testcase/list/';
if (this.isTestPlan) {
url = '/test/case/review/api/case/relevance/list/';
this.condition.reviewId = this.reviewId;
}
this.result = this.$post(url + this.currentPage + "/" + this.pageSize, this.condition, response => {
this.total = response.data.itemCount;
this.tableData = response.data.listObject;
});
},
handleSelect(selection, row) {
_handleSelect(this, selection, row, this.selectRows);
},
showExecResult(row) {
this.visible = false;
this.$emit('showExecResult', row);
},
filter(filters) {
_filter(filters, this.condition);
this.initTable();
},
sort(column) {
//
if (this.condition.orders) {
this.condition.orders = [];
}
_sort(column, this.condition);
this.initTable();
},
handleSelectAll(selection) {
_handleSelectAll(this, selection, this.tableData, this.selectRows);
},
buildPagePath(path) {
return path + "/" + this.currentPage + "/" + this.pageSize;
},
handleTestCase(testCase) {
this.$get('/api/definition/get/' + testCase.apiDefinitionId, (response) => {
let api = response.data;
let selectApi = api;
let request = {};
if (Object.prototype.toString.call(api.request).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') {
request = api.request;
} else {
request = JSON.parse(api.request);
}
if (!request.hashTree) {
request.hashTree = [];
}
selectApi.url = request.path;
this.$refs.caseList.open(selectApi, testCase.id);
});
},
setEnvironment(data) {
this.environmentId = data.id;
},
clearSelection() {
this.selectRows = new Set();
if (this.$refs.table) {
this.$refs.table.clearSelection();
}
}
},
}
</script>
<style scoped>
.operate-button > div {
display: inline-block;
margin-left: 10px;
}
.request-method {
padding: 0 5px;
color: #1E90FF;
}
.api-el-tag {
color: white;
}
.search-input {
float: right;
width: 300px;
/*margin-bottom: 20px;*/
margin-right: 20px;
}
</style>

View File

@ -0,0 +1,178 @@
<template>
<div>
<el-card class="table-card" v-loading="result.loading">
<env-popover :env-map="projectEnvMap" :project-ids="projectIds" @setProjectEnvMap="setProjectEnvMap"
:project-list="projectList" ref="envPopover" class="env-popover"/>
<el-table ref="scenarioTable" border :data="tableData" class="adjust-table" @select-all="handleSelectAll"
@select="handleSelect">
<el-table-column type="selection"/>
<el-table-column prop="name" :label="$t('api_test.automation.scenario_name')"
show-overflow-tooltip/>
<el-table-column prop="level" :label="$t('api_test.automation.case_level')"
show-overflow-tooltip>
<template v-slot:default="scope">
<ms-tag v-if="scope.row.level == 'P0'" type="info" effect="plain" content="P0"/>
<ms-tag v-if="scope.row.level == 'P1'" type="warning" effect="plain" content="P1"/>
<ms-tag v-if="scope.row.level == 'P2'" type="success" effect="plain" content="P2"/>
<ms-tag v-if="scope.row.level == 'P3'" type="danger" effect="plain" content="P3"/>
</template>
</el-table-column>
<el-table-column prop="tagNames" :label="$t('api_test.automation.tag')" min-width="120">
<template v-slot:default="scope">
<ms-tag v-for="itemName in scope.row.tags" :key="itemName" type="success" effect="plain" :content="itemName"
style="margin-left: 5px"/>
</template>
</el-table-column>
<el-table-column prop="userId" :label="$t('api_test.automation.creator')" show-overflow-tooltip/>
<el-table-column prop="updateTime" :label="$t('api_test.automation.update_time')" width="180">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column prop="stepTotal" :label="$t('api_test.automation.step')" show-overflow-tooltip/>
<el-table-column prop="lastResult" :label="$t('api_test.automation.last_result')">
<template v-slot:default="{row}">
<el-link type="success" @click="showReport(row)" v-if="row.lastResult === 'Success'">
{{ $t('api_test.automation.success') }}
</el-link>
<el-link type="danger" @click="showReport(row)" v-if="row.lastResult === 'Fail'">
{{ $t('api_test.automation.fail') }}
</el-link>
</template>
</el-table-column>
<el-table-column prop="passRate" :label="$t('api_test.automation.passing_rate')"
show-overflow-tooltip/>
</el-table>
<ms-table-pagination :change="search" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/>
</el-card>
</div>
</template>
<script>
import {_handleSelect, _handleSelectAll} from "@/common/js/tableUtils";
import MsTag from "@/business/components/common/components/MsTag";
import EnvPopover from "@/business/components/api/automation/scenario/EnvPopover";
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
export default {
name: "ReviewRelevanceScenarioList",
components: {MsTablePagination, EnvPopover, MsTag},
props: {
referenced: {
type: Boolean,
default: false,
},
selectNodeIds: Array,
projectId: String,
reviewId: String,
},
data() {
return {
result: {},
condition: {},
currentScenario: {},
schedule: {},
selectAll: false,
tableData: [],
currentPage: 1,
pageSize: 10,
total: 0,
reportId: "",
infoDb: false,
selectRows: new Set(),
projectEnvMap: new Map(),
projectList: [],
projectIds: new Set(),
}
},
watch: {
selectNodeIds() {
this.search();
},
projectId() {
this.search();
},
},
created() {
this.getWsProjects();
},
methods: {
search() {
this.projectEnvMap.clear();
this.projectIds.clear();
if (!this.projectId) {
return;
}
this.selectRows = new Set();
this.loading = true;
this.condition.filters = {status: ["Prepare", "Underway", "Completed"]};
this.condition.moduleIds = this.selectNodeIds;
if (this.projectId != null) {
this.condition.projectId = this.projectId;
}
if (this.reviewId != null) {
this.condition.reviewId = this.reviewId;
}
let url = "/test/case/review/scenario/case/relevance/list/" + this.currentPage + "/" + this.pageSize;
this.result = this.$post(url, this.condition, response => {
let data = response.data;
this.total = data.itemCount;
this.tableData = data.listObject;
this.tableData.forEach(item => {
if (item.tags && item.tags.length > 0) {
item.tags = JSON.parse(item.tags);
}
});
});
},
handleSelectAll(selection) {
_handleSelectAll(this, selection, this.tableData, this.selectRows);
this.initProjectIds();
},
handleSelect(selection, row) {
_handleSelect(this, selection, row, this.selectRows);
this.initProjectIds();
},
setProjectEnvMap(projectEnvMap) {
this.projectEnvMap = projectEnvMap;
},
getWsProjects() {
this.$get("/project/listAll", res => {
this.projectList = res.data;
})
},
initProjectIds() {
this.projectIds.clear();
this.selectRows.forEach(row => {
row.projectIds.forEach(id => {
this.projectIds.add(id);
})
})
},
checkEnv() {
return this.$refs.envPopover.checkEnv();
}
}
}
</script>
<style scoped>
/deep/ .el-drawer__header {
margin-bottom: 0px;
}
.env-popover {
float: right;
margin-top: 4px;
}
</style>

View File

@ -61,39 +61,43 @@
@relevanceCase="openTestCaseRelevanceDialog"
ref="apiScenarioList"/>
</template>
<test-case-api-relevance
<test-review-relevance-api
@refresh="refresh"
:review-id="reviewId"
:model="model"
ref="apiCaseRelevance"/>
<test-case-scenario-relevance
ref="apiCaseRelevance"
/>
<test-review-relevance-scenario
@refresh="refresh"
:review-id="reviewId"
:model="model"
ref="scenarioCaseRelevance"/>
ref="scenarioCaseRelevance"
/>
</ms-test-plan-common-component>
</template>
<script>
import MsTestPlanCommonComponent from "@/business/components/track/plan/view/comonents/base/TestPlanCommonComponent";
import TestCaseScenarioRelevance from "@/business/components/track/plan/view/comonents/api/TestCaseScenarioRelevance";
import MsTestPlanApiScenarioList from "@/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList";
import MsApiScenarioModule from "@/business/components/api/automation/scenario/ApiScenarioModule";
import ApiCaseSimpleList from "@/business/components/api/definition/components/list/ApiCaseSimpleList";
import TestCaseApiRelevance from "@/business/components/track/plan/view/comonents/api/TestCaseApiRelevance";
import TestPlanApiCaseList from "@/business/components/track/plan/view/comonents/api/TestPlanApiCaseList";
import TestCaseRelevance from "@/business/components/track/plan/view/comonents/functional/TestCaseFunctionalRelevance";
import NodeTree from "@/business/components/track/common/NodeTree";
import MsApiModule from "../../../../api/definition/components/module/ApiModule"
import TestReviewRelevanceApi from "@/business/components/track/review/view/components/TestReviewRelevanceApi";
import TestReviewRelevanceScenario
from "@/business/components/track/review/view/components/TestReviewRelevanceScenario";
export default {
name: "TestReviewApi",
components: {
TestCaseScenarioRelevance,
TestReviewRelevanceScenario,
TestReviewRelevanceApi,
MsTestPlanApiScenarioList,
MsApiScenarioModule,
ApiCaseSimpleList,
TestCaseApiRelevance,
TestPlanApiCaseList,
MsTestPlanCommonComponent,
TestCaseRelevance,
@ -185,5 +189,15 @@ export default {
</script>
<style scoped>
.model-change-radio {
height: 25px;
line-height: 25px;
margin: 5px 10px;
}
/deep/ .run-button {
background-color: #409EFF;
border-color: #409EFF;
}
</style>

View File

@ -44,7 +44,6 @@
<script>
import MsTestPlanCommonComponent from "@/business/components/track/plan/view/comonents/base/TestPlanCommonComponent";
import FunctionalTestCaseList from "@/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList";
import MsNodeTree from "@/business/components/track/common/NodeTree";
import TestReviewRelevance from "@/business/components/track/review/view/components/TestReviewRelevance";
import TestReviewTestCaseList from "@/business/components/track/review/view/components/TestReviewTestCaseList";
@ -58,7 +57,7 @@ export default {
TestReviewMinder,
MsTabButton,
TestReviewTestCaseList,
TestReviewRelevance, MsNodeTree, FunctionalTestCaseList, MsTestPlanCommonComponent
TestReviewRelevance, MsNodeTree, MsTestPlanCommonComponent
},
data() {
return {

View File

@ -82,6 +82,10 @@
</el-container>
<template v-slot:footer>
<div style="margin-bottom: 15px">
<el-checkbox v-model="checked">同步添加关联的接口和性能测试</el-checkbox>
</div>
<ms-dialog-footer @cancel="dialogFormVisible = false" @confirm="saveReviewRelevance"/>
</template>

View File

@ -0,0 +1,162 @@
<template>
<test-case-relevance-base
@setProject="setProject"
@save="saveCaseRelevance"
ref="baseRelevance"
>
<template v-slot:aside>
<ms-api-module
:relevance-project-id="projectId"
@nodeSelectEvent="nodeChange"
@protocolChange="handleProtocolChange"
@refreshTable="refresh"
@setModuleOptions="setModuleOptions"
:is-read-only="true"
ref="nodeTree"
/>
</template>
<review-relevance-api-list
v-if="isApiListEnable"
:current-protocol="currentProtocol"
:select-node-ids="selectNodeIds"
:is-api-list-enable="isApiListEnable"
:project-id="projectId"
:is-test-plan="true"
:review_id="reviewId"
@isApiListEnableChange="isApiListEnableChange"
ref="apiList"/>
<review-relevance-case-list
v-if="!isApiListEnable"
:current-protocol="currentProtocol"
:select-node-ids="selectNodeIds"
:is-api-list-enable="isApiListEnable"
:project-id="projectId"
:is-test-plan="true"
:review-id="reviewId"
@isApiListEnableChange="isApiListEnableChange"
ref="apiCaseList"/>
</test-case-relevance-base>
</template>
<script>
import TestCaseRelevanceBase from "@/business/components/track/plan/view/comonents/base/TestCaseRelevanceBase";
import MsApiModule from "@/business/components/api/definition/components/module/ApiModule";
import ReviewRelevanceApiList from "@/business/components/track/review/view/components/ReviewRelevanceApiList";
import ReviewRelevanceCaseList from "@/business/components/track/review/view/components/ReviewRelevanceCaseList";
export default {
name: "TestReviewRelevanceApi",
components: {ReviewRelevanceCaseList, ReviewRelevanceApiList, MsApiModule, TestCaseRelevanceBase},
data() {
return {
showCasePage: true,
currentProtocol: null,
currentModule: null,
selectNodeIds: [],
moduleOptions: {},
trashEnable: false,
isApiListEnable: true,
condition: {},
currentRow: {},
projectId: ""
};
},
props: {
reviewId: {
type: String
}
},
watch: {
reviewId() {
this.condition.reviewId = this.reviewId;
},
},
methods: {
open() {
this.init();
this.$refs.baseRelevance.open();
},
init() {
if (this.$refs.apiList) {
this.$refs.apiList.initTable();
}
if (this.$refs.apiCaseList) {
this.$refs.apiCaseList.initTable();
}
if (this.$refs.nodeTree) {
this.$refs.nodeTree.list();
}
},
setProject(projectId) {
this.projectId = projectId;
},
isApiListEnableChange(data) {
this.isApiListEnable = data;
},
refresh(data) {
if (this.isApiListEnable) {
this.$refs.apiList.initTable(data);
} else {
this.$refs.apiCaseList.initTable(data);
}
},
nodeChange(node, nodeIds, pNodes) {
this.selectNodeIds = nodeIds;
},
handleProtocolChange(protocol) {
this.currentProtocol = protocol;
},
setModuleOptions(data) {
this.moduleOptions = data;
},
saveCaseRelevance() {
let param = {};
let url = '';
let environmentId = undefined;
let selectIds = [];
if (this.isApiListEnable) {
url = '/api/definition/relevance/review';
environmentId = this.$refs.apiList.environmentId;
selectIds = Array.from(this.$refs.apiList.selectRows).map(row => row.id);
} else {
url = '/api/testcase/relevance/review';
environmentId = this.$refs.apiCaseList.environmentId;
selectIds = Array.from(this.$refs.apiCaseList.selectRows).map(row => row.id);
}
if (!environmentId) {
this.$warning(this.$t('api_test.environment.select_environment'));
return;
}
param.reviewId = this.reviewId;
param.selectIds = selectIds;
param.environmentId = environmentId;
this.result = this.$post(url, param, () => {
this.$success(this.$t('commons.save_success'));
this.$emit('refresh');
this.refresh();
this.$refs.baseRelevance.close();
});
},
}
}
</script>
<style scoped>
/deep/ .select-menu {
margin-bottom: 15px;
}
/deep/ .environment-select {
float: right;
margin-right: 10px;
}
</style>

View File

@ -0,0 +1,125 @@
<template>
<test-case-relevance-base
@setProject="setProject"
@save="saveCaseRelevance"
ref="baseRelevance">
<template v-slot:aside>
<ms-api-scenario-module
@nodeSelectEvent="nodeChange"
@refreshTable="refresh"
@setModuleOptions="setModuleOptions"
:relevance-project-id="projectId"
:is-read-only="true"
ref="nodeTree"
/>
</template>
<review-relevance-scenario-list
:select-node-ids="selectNodeIds"
:trash-enable="trashEnable"
:review-id="reviewId"
:project-id="projectId"
ref="apiScenarioList"/>
</test-case-relevance-base>
</template>
<script>
import TestCaseRelevanceBase from "@/business/components/track/plan/view/comonents/base/TestCaseRelevanceBase";
import MsApiScenarioModule from "@/business/components/api/automation/scenario/ApiScenarioModule";
import ReviewRelevanceScenarioList
from "@/business/components/track/review/view/components/ReviewRelevanceScenarioList";
import {strMapToObj} from "@/common/js/utils";
export default {
name: "TestReviewRelevanceScenario",
components: {ReviewRelevanceScenarioList, MsApiScenarioModule, TestCaseRelevanceBase},
data() {
return {
showCasePage: true,
currentProtocol: null,
currentModule: null,
selectNodeIds: [],
moduleOptions: {},
trashEnable: false,
condition: {},
currentRow: {},
projectId: ""
};
},
props: {
reviewId: {
type: String
},
},
watch: {
reviewId() {
this.condition.reviewId = this.reviewId;
},
},
methods: {
open() {
this.$refs.baseRelevance.open();
if (this.$refs.apiScenarioList) {
this.$refs.apiScenarioList.search();
}
},
setProject(projectId) {
this.projectId = projectId;
},
refresh(data) {
this.$refs.apiScenarioList.search(data);
},
nodeChange(node, nodeIds, pNodes) {
this.selectNodeIds = nodeIds;
},
handleProtocolChange(protocol) {
this.currentProtocol = protocol;
},
setModuleOptions(data) {
this.moduleOptions = data;
},
saveCaseRelevance() {
const sign = this.$refs.apiScenarioList.checkEnv();
if (!sign) {
return false;
}
let param = {};
let url = '/api/automation/relevance/review';
let rows = this.$refs.apiScenarioList.selectRows;
const envMap = this.$refs.apiScenarioList.projectEnvMap;
let map = new Map();
rows.forEach(row => {
map.set(row.id, row.projectIds);
})
param.reviewId = this.reviewId;
param.mapping = strMapToObj(map);
param.envMap = strMapToObj(envMap);
this.result = this.$post(url, param, () => {
this.$success(this.$t('commons.save_success'));
this.$emit('refresh');
this.refresh();
this.$refs.baseRelevance.close();
});
},
}
}
</script>
<style scoped>
/deep/ .select-menu {
margin-bottom: 15px;
}
/deep/ .environment-select {
float: right;
margin-right: 10px;
}
/deep/ .module-input {
width: 243px;
}
</style>

4
yarn.lock Normal file
View File

@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1