feat: 接口定义支持自定义顺序 (#6078)

* feat: 测试计划功能用例支持自定义顺序

* feat: 测试计划接口用例支持自定义排序

* feat: 测试计划场景测试支持自定义排序

* feat: 测试计划性能测试支持自定义顺序

* feat: 接口定义支持自定义顺序

Co-authored-by: chenjianxing <jianxing.chen@fit2cloud.com>
Co-authored-by: jianxing <41557596+AgAngle@users.noreply.github.com>
This commit is contained in:
metersphere-bot 2021-09-10 15:16:43 +08:00 committed by GitHub
parent faa608003c
commit ab961ed5cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 1272 additions and 478 deletions

View File

@ -24,6 +24,7 @@ import io.metersphere.commons.constants.PermissionConstants;
import io.metersphere.commons.json.JSONSchemaGenerator;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.ResetOrderRequest;
import io.metersphere.controller.request.ScheduleRequest;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.notice.annotation.SendNotice;
@ -299,4 +300,8 @@ public class ApiDefinitionController {
return apiTestEnvironmentService.getMockEnvironmentByProjectId(projectId);
}
@PostMapping("/edit/order")
public void orderCase(@RequestBody ResetOrderRequest request) {
apiDefinitionService.updateOrder(request);
}
}

View File

@ -134,6 +134,8 @@ public class ApiAutomationService {
private ResourcePoolCalculation resourcePoolCalculation;
@Resource
private NodeKafkaService nodeKafkaService;
@Resource
private ExtTestPlanScenarioCaseMapper extTestPlanScenarioCaseMapper;
public ApiScenarioWithBLOBs getDto(String id) {
return apiScenarioMapper.selectByPrimaryKey(id);
@ -1576,7 +1578,8 @@ public class ApiAutomationService {
if (set.isEmpty()) {
return;
}
set.forEach(id -> {
Long nextOrder = ServiceUtils.getNextOrder(request.getPlanId(), extTestPlanScenarioCaseMapper::getLastOrder);
for (String id : set) {
Map<String, String> newEnvMap = new HashMap<>(16);
if (envMap != null && !envMap.isEmpty()) {
List<String> list = mapping.get(id);
@ -1592,8 +1595,10 @@ public class ApiAutomationService {
testPlanApiScenario.setCreateTime(System.currentTimeMillis());
testPlanApiScenario.setUpdateTime(System.currentTimeMillis());
testPlanApiScenario.setEnvironment(JSON.toJSONString(newEnvMap));
testPlanApiScenario.setOrder(nextOrder);
nextOrder += 5000;
testPlanApiScenarioMapper.insert(testPlanApiScenario);
});
}
}
public void relevanceReview(ApiCaseRelevanceRequest request) {

View File

@ -29,6 +29,7 @@ import io.metersphere.base.mapper.ext.*;
import io.metersphere.commons.constants.*;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.*;
import io.metersphere.controller.request.ResetOrderRequest;
import io.metersphere.controller.request.ScheduleRequest;
import io.metersphere.dto.BaseSystemConfigDTO;
import io.metersphere.i18n.Translator;
@ -145,7 +146,7 @@ public class ApiDefinitionService {
*/
private ApiDefinitionRequest initRequest(ApiDefinitionRequest request, boolean setDefultOrders, boolean checkThisWeekData) {
if (setDefultOrders) {
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
request.setOrders(ServiceUtils.getDefaultSortOrder(request.getOrders()));
}
if (checkThisWeekData) {
if (request.isSelectThisWeedData()) {
@ -406,6 +407,7 @@ public class ApiDefinitionService {
test.setModulePath(request.getModulePath());
test.setModuleId(request.getModuleId());
test.setFollowPeople(request.getFollowPeople());
test.setOrder(ServiceUtils.getNextOrder(request.getProjectId(), extApiDefinitionMapper::getLastOrder));
if (StringUtils.isEmpty(request.getModuleId()) || "default-module".equals(request.getModuleId())) {
ApiModuleExample example = new ApiModuleExample();
example.createCriteria().andProjectIdEqualTo(test.getProjectId()).andProtocolEqualTo(test.getProtocol()).andNameEqualTo("未规划接口");
@ -1017,14 +1019,14 @@ public class ApiDefinitionService {
}
public List<ApiDefinitionResult> listRelevance(ApiDefinitionRequest request) {
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
request.setOrders(ServiceUtils.getDefaultSortOrder(request.getOrders()));
List<ApiDefinitionResult> resList = extApiDefinitionMapper.listRelevance(request);
calculateResult(resList, request.getProjectId());
return resList;
}
public List<ApiDefinitionResult> listRelevanceReview(ApiDefinitionRequest request) {
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
request.setOrders(ServiceUtils.getDefaultSortOrder(request.getOrders()));
List<ApiDefinitionResult> resList = extApiDefinitionMapper.listRelevanceReview(request);
calculateResult(resList, request.getProjectId());
resList = extApiDefinitionMapper.list(request);
@ -1359,4 +1361,22 @@ public class ApiDefinitionService {
ApiDefinitionExecResult result = extApiDefinitionExecResultMapper.selectPlanApiMaxResultByTestIdAndType(testId, type);
return buildAPIReportResult(result);
}
public void initOrderField() {
ServiceUtils.initOrderField(ApiDefinitionWithBLOBs.class, ApiDefinitionMapper.class,
extApiDefinitionMapper::selectProjectIds,
extApiDefinitionMapper::getIdsOrderByUpdateTime);
}
/**
* 用例自定义排序
* @param request
*/
public void updateOrder(ResetOrderRequest request) {
ServiceUtils.updateOrderField(request, ApiDefinitionWithBLOBs.class,
apiDefinitionMapper::selectByPrimaryKey,
extApiDefinitionMapper::getPreOrder,
extApiDefinitionMapper::getLastOrder,
apiDefinitionMapper::updateByPrimaryKeySelective);
}
}

View File

@ -94,6 +94,8 @@ public class ApiTestCaseService {
@Resource
@Lazy
private APITestService apiTestService;
@Resource
private ExtTestPlanApiCaseMapper extTestPlanApiCaseMapper;
private static final String BODY_FILE_DIR = FileUtils.BODY_FILE_DIR;
@ -438,7 +440,9 @@ public class ApiTestCaseService {
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
ExtTestPlanApiCaseMapper batchMapper = sqlSession.getMapper(ExtTestPlanApiCaseMapper.class);
apiTestCases.forEach(apiTestCase -> {
Long nextOrder = ServiceUtils.getNextOrder(request.getPlanId(), extTestPlanApiCaseMapper::getLastOrder);
for (ApiTestCase apiTestCase: apiTestCases) {
TestPlanApiCase testPlanApiCase = new TestPlanApiCase();
testPlanApiCase.setId(UUID.randomUUID().toString());
testPlanApiCase.setCreateUser(SessionUtils.getUserId());
@ -447,8 +451,11 @@ public class ApiTestCaseService {
testPlanApiCase.setEnvironmentId(request.getEnvironmentId());
testPlanApiCase.setCreateTime(System.currentTimeMillis());
testPlanApiCase.setUpdateTime(System.currentTimeMillis());
testPlanApiCase.setOrder(nextOrder);
nextOrder += 5000;
batchMapper.insertIfNotExists(testPlanApiCase);
});
}
TestPlan testPlan = testPlanMapper.selectByPrimaryKey(request.getPlanId());
if (StringUtils.equals(testPlan.getStatus(), TestPlanStatus.Prepare.name())
|| StringUtils.equals(testPlan.getStatus(), TestPlanStatus.Completed.name())) {

View File

@ -13,6 +13,10 @@ public class ApiDefinition implements Serializable {
private String method;
private String protocol;
private String path;
private String modulePath;
private String environmentId;
@ -29,10 +33,6 @@ public class ApiDefinition implements Serializable {
private Long updateTime;
private String protocol;
private String path;
private Integer num;
private String tags;
@ -53,5 +53,7 @@ public class ApiDefinition implements Serializable {
private String followPeople;
private Long order;
private static final long serialVersionUID = 1L;
}

View File

@ -384,6 +384,146 @@ public class ApiDefinitionExample {
return (Criteria) this;
}
public Criteria andProtocolIsNull() {
addCriterion("protocol is null");
return (Criteria) this;
}
public Criteria andProtocolIsNotNull() {
addCriterion("protocol is not null");
return (Criteria) this;
}
public Criteria andProtocolEqualTo(String value) {
addCriterion("protocol =", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotEqualTo(String value) {
addCriterion("protocol <>", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolGreaterThan(String value) {
addCriterion("protocol >", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolGreaterThanOrEqualTo(String value) {
addCriterion("protocol >=", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLessThan(String value) {
addCriterion("protocol <", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLessThanOrEqualTo(String value) {
addCriterion("protocol <=", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLike(String value) {
addCriterion("protocol like", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotLike(String value) {
addCriterion("protocol not like", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolIn(List<String> values) {
addCriterion("protocol in", values, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotIn(List<String> values) {
addCriterion("protocol not in", values, "protocol");
return (Criteria) this;
}
public Criteria andProtocolBetween(String value1, String value2) {
addCriterion("protocol between", value1, value2, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotBetween(String value1, String value2) {
addCriterion("protocol not between", value1, value2, "protocol");
return (Criteria) this;
}
public Criteria andPathIsNull() {
addCriterion("`path` is null");
return (Criteria) this;
}
public Criteria andPathIsNotNull() {
addCriterion("`path` is not null");
return (Criteria) this;
}
public Criteria andPathEqualTo(String value) {
addCriterion("`path` =", value, "path");
return (Criteria) this;
}
public Criteria andPathNotEqualTo(String value) {
addCriterion("`path` <>", value, "path");
return (Criteria) this;
}
public Criteria andPathGreaterThan(String value) {
addCriterion("`path` >", value, "path");
return (Criteria) this;
}
public Criteria andPathGreaterThanOrEqualTo(String value) {
addCriterion("`path` >=", value, "path");
return (Criteria) this;
}
public Criteria andPathLessThan(String value) {
addCriterion("`path` <", value, "path");
return (Criteria) this;
}
public Criteria andPathLessThanOrEqualTo(String value) {
addCriterion("`path` <=", value, "path");
return (Criteria) this;
}
public Criteria andPathLike(String value) {
addCriterion("`path` like", value, "path");
return (Criteria) this;
}
public Criteria andPathNotLike(String value) {
addCriterion("`path` not like", value, "path");
return (Criteria) this;
}
public Criteria andPathIn(List<String> values) {
addCriterion("`path` in", values, "path");
return (Criteria) this;
}
public Criteria andPathNotIn(List<String> values) {
addCriterion("`path` not in", values, "path");
return (Criteria) this;
}
public Criteria andPathBetween(String value1, String value2) {
addCriterion("`path` between", value1, value2, "path");
return (Criteria) this;
}
public Criteria andPathNotBetween(String value1, String value2) {
addCriterion("`path` not between", value1, value2, "path");
return (Criteria) this;
}
public Criteria andModulePathIsNull() {
addCriterion("module_path is null");
return (Criteria) this;
@ -924,146 +1064,6 @@ public class ApiDefinitionExample {
return (Criteria) this;
}
public Criteria andProtocolIsNull() {
addCriterion("protocol is null");
return (Criteria) this;
}
public Criteria andProtocolIsNotNull() {
addCriterion("protocol is not null");
return (Criteria) this;
}
public Criteria andProtocolEqualTo(String value) {
addCriterion("protocol =", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotEqualTo(String value) {
addCriterion("protocol <>", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolGreaterThan(String value) {
addCriterion("protocol >", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolGreaterThanOrEqualTo(String value) {
addCriterion("protocol >=", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLessThan(String value) {
addCriterion("protocol <", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLessThanOrEqualTo(String value) {
addCriterion("protocol <=", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLike(String value) {
addCriterion("protocol like", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotLike(String value) {
addCriterion("protocol not like", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolIn(List<String> values) {
addCriterion("protocol in", values, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotIn(List<String> values) {
addCriterion("protocol not in", values, "protocol");
return (Criteria) this;
}
public Criteria andProtocolBetween(String value1, String value2) {
addCriterion("protocol between", value1, value2, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotBetween(String value1, String value2) {
addCriterion("protocol not between", value1, value2, "protocol");
return (Criteria) this;
}
public Criteria andPathIsNull() {
addCriterion("`path` is null");
return (Criteria) this;
}
public Criteria andPathIsNotNull() {
addCriterion("`path` is not null");
return (Criteria) this;
}
public Criteria andPathEqualTo(String value) {
addCriterion("`path` =", value, "path");
return (Criteria) this;
}
public Criteria andPathNotEqualTo(String value) {
addCriterion("`path` <>", value, "path");
return (Criteria) this;
}
public Criteria andPathGreaterThan(String value) {
addCriterion("`path` >", value, "path");
return (Criteria) this;
}
public Criteria andPathGreaterThanOrEqualTo(String value) {
addCriterion("`path` >=", value, "path");
return (Criteria) this;
}
public Criteria andPathLessThan(String value) {
addCriterion("`path` <", value, "path");
return (Criteria) this;
}
public Criteria andPathLessThanOrEqualTo(String value) {
addCriterion("`path` <=", value, "path");
return (Criteria) this;
}
public Criteria andPathLike(String value) {
addCriterion("`path` like", value, "path");
return (Criteria) this;
}
public Criteria andPathNotLike(String value) {
addCriterion("`path` not like", value, "path");
return (Criteria) this;
}
public Criteria andPathIn(List<String> values) {
addCriterion("`path` in", values, "path");
return (Criteria) this;
}
public Criteria andPathNotIn(List<String> values) {
addCriterion("`path` not in", values, "path");
return (Criteria) this;
}
public Criteria andPathBetween(String value1, String value2) {
addCriterion("`path` between", value1, value2, "path");
return (Criteria) this;
}
public Criteria andPathNotBetween(String value1, String value2) {
addCriterion("`path` not between", value1, value2, "path");
return (Criteria) this;
}
public Criteria andNumIsNull() {
addCriterion("num is null");
return (Criteria) this;
@ -1743,6 +1743,66 @@ public class ApiDefinitionExample {
addCriterion("follow_people not between", value1, value2, "followPeople");
return (Criteria) this;
}
public Criteria andOrderIsNull() {
addCriterion("`order` is null");
return (Criteria) this;
}
public Criteria andOrderIsNotNull() {
addCriterion("`order` is not null");
return (Criteria) this;
}
public Criteria andOrderEqualTo(Long value) {
addCriterion("`order` =", value, "order");
return (Criteria) this;
}
public Criteria andOrderNotEqualTo(Long value) {
addCriterion("`order` <>", value, "order");
return (Criteria) this;
}
public Criteria andOrderGreaterThan(Long value) {
addCriterion("`order` >", value, "order");
return (Criteria) this;
}
public Criteria andOrderGreaterThanOrEqualTo(Long value) {
addCriterion("`order` >=", value, "order");
return (Criteria) this;
}
public Criteria andOrderLessThan(Long value) {
addCriterion("`order` <", value, "order");
return (Criteria) this;
}
public Criteria andOrderLessThanOrEqualTo(Long value) {
addCriterion("`order` <=", value, "order");
return (Criteria) this;
}
public Criteria andOrderIn(List<Long> values) {
addCriterion("`order` in", values, "order");
return (Criteria) this;
}
public Criteria andOrderNotIn(List<Long> values) {
addCriterion("`order` not in", values, "order");
return (Criteria) this;
}
public Criteria andOrderBetween(Long value1, Long value2) {
addCriterion("`order` between", value1, value2, "order");
return (Criteria) this;
}
public Criteria andOrderNotBetween(Long value1, Long value2) {
addCriterion("`order` not between", value1, value2, "order");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -21,5 +21,7 @@ public class TestPlanApiCase implements Serializable {
private String createUser;
private Long order;
private static final long serialVersionUID = 1L;
}

View File

@ -643,6 +643,66 @@ public class TestPlanApiCaseExample {
addCriterion("create_user not between", value1, value2, "createUser");
return (Criteria) this;
}
public Criteria andOrderIsNull() {
addCriterion("`order` is null");
return (Criteria) this;
}
public Criteria andOrderIsNotNull() {
addCriterion("`order` is not null");
return (Criteria) this;
}
public Criteria andOrderEqualTo(Long value) {
addCriterion("`order` =", value, "order");
return (Criteria) this;
}
public Criteria andOrderNotEqualTo(Long value) {
addCriterion("`order` <>", value, "order");
return (Criteria) this;
}
public Criteria andOrderGreaterThan(Long value) {
addCriterion("`order` >", value, "order");
return (Criteria) this;
}
public Criteria andOrderGreaterThanOrEqualTo(Long value) {
addCriterion("`order` >=", value, "order");
return (Criteria) this;
}
public Criteria andOrderLessThan(Long value) {
addCriterion("`order` <", value, "order");
return (Criteria) this;
}
public Criteria andOrderLessThanOrEqualTo(Long value) {
addCriterion("`order` <=", value, "order");
return (Criteria) this;
}
public Criteria andOrderIn(List<Long> values) {
addCriterion("`order` in", values, "order");
return (Criteria) this;
}
public Criteria andOrderNotIn(List<Long> values) {
addCriterion("`order` not in", values, "order");
return (Criteria) this;
}
public Criteria andOrderBetween(Long value1, Long value2) {
addCriterion("`order` between", value1, value2, "order");
return (Criteria) this;
}
public Criteria andOrderNotBetween(Long value1, Long value2) {
addCriterion("`order` not between", value1, value2, "order");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -25,6 +25,8 @@ public class TestPlanApiScenario implements Serializable {
private String createUser;
private Long order;
private String environment;
private static final long serialVersionUID = 1L;

View File

@ -783,6 +783,66 @@ public class TestPlanApiScenarioExample {
addCriterion("create_user not between", value1, value2, "createUser");
return (Criteria) this;
}
public Criteria andOrderIsNull() {
addCriterion("`order` is null");
return (Criteria) this;
}
public Criteria andOrderIsNotNull() {
addCriterion("`order` is not null");
return (Criteria) this;
}
public Criteria andOrderEqualTo(Long value) {
addCriterion("`order` =", value, "order");
return (Criteria) this;
}
public Criteria andOrderNotEqualTo(Long value) {
addCriterion("`order` <>", value, "order");
return (Criteria) this;
}
public Criteria andOrderGreaterThan(Long value) {
addCriterion("`order` >", value, "order");
return (Criteria) this;
}
public Criteria andOrderGreaterThanOrEqualTo(Long value) {
addCriterion("`order` >=", value, "order");
return (Criteria) this;
}
public Criteria andOrderLessThan(Long value) {
addCriterion("`order` <", value, "order");
return (Criteria) this;
}
public Criteria andOrderLessThanOrEqualTo(Long value) {
addCriterion("`order` <=", value, "order");
return (Criteria) this;
}
public Criteria andOrderIn(List<Long> values) {
addCriterion("`order` in", values, "order");
return (Criteria) this;
}
public Criteria andOrderNotIn(List<Long> values) {
addCriterion("`order` not in", values, "order");
return (Criteria) this;
}
public Criteria andOrderBetween(Long value1, Long value2) {
addCriterion("`order` between", value1, value2, "order");
return (Criteria) this;
}
public Criteria andOrderNotBetween(Long value1, Long value2) {
addCriterion("`order` not between", value1, value2, "order");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -11,10 +11,10 @@ public class TestPlanLoadCase implements Serializable {
private String loadCaseId;
private String loadReportId;
private String status;
private String loadReportId;
private Long createTime;
private Long updateTime;
@ -23,6 +23,8 @@ public class TestPlanLoadCase implements Serializable {
private String testResourcePoolId;
private Long order;
private String loadConfiguration;
private static final long serialVersionUID = 1L;

View File

@ -314,76 +314,6 @@ public class TestPlanLoadCaseExample {
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 Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
@ -454,6 +384,76 @@ public class TestPlanLoadCaseExample {
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 Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
@ -713,6 +713,66 @@ public class TestPlanLoadCaseExample {
addCriterion("test_resource_pool_id not between", value1, value2, "testResourcePoolId");
return (Criteria) this;
}
public Criteria andOrderIsNull() {
addCriterion("`order` is null");
return (Criteria) this;
}
public Criteria andOrderIsNotNull() {
addCriterion("`order` is not null");
return (Criteria) this;
}
public Criteria andOrderEqualTo(Long value) {
addCriterion("`order` =", value, "order");
return (Criteria) this;
}
public Criteria andOrderNotEqualTo(Long value) {
addCriterion("`order` <>", value, "order");
return (Criteria) this;
}
public Criteria andOrderGreaterThan(Long value) {
addCriterion("`order` >", value, "order");
return (Criteria) this;
}
public Criteria andOrderGreaterThanOrEqualTo(Long value) {
addCriterion("`order` >=", value, "order");
return (Criteria) this;
}
public Criteria andOrderLessThan(Long value) {
addCriterion("`order` <", value, "order");
return (Criteria) this;
}
public Criteria andOrderLessThanOrEqualTo(Long value) {
addCriterion("`order` <=", value, "order");
return (Criteria) this;
}
public Criteria andOrderIn(List<Long> values) {
addCriterion("`order` in", values, "order");
return (Criteria) this;
}
public Criteria andOrderNotIn(List<Long> values) {
addCriterion("`order` not in", values, "order");
return (Criteria) this;
}
public Criteria andOrderBetween(Long value1, Long value2) {
addCriterion("`order` between", value1, value2, "order");
return (Criteria) this;
}
public Criteria andOrderNotBetween(Long value1, Long value2) {
addCriterion("`order` not between", value1, value2, "order");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -11,6 +11,8 @@ public class TestPlanTestCase implements Serializable {
private String caseId;
private String reportId;
private String executor;
private String status;
@ -21,11 +23,11 @@ public class TestPlanTestCase implements Serializable {
private Long updateTime;
private String reportId;
private String createUser;
private Integer issuesCount;
private Long order;
private static final long serialVersionUID = 1L;
}
}

View File

@ -314,6 +314,76 @@ public class TestPlanTestCaseExample {
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 Criteria andExecutorIsNull() {
addCriterion("executor is null");
return (Criteria) this;
@ -644,76 +714,6 @@ public class TestPlanTestCaseExample {
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 Criteria andCreateUserIsNull() {
addCriterion("create_user is null");
return (Criteria) this;
@ -843,6 +843,66 @@ public class TestPlanTestCaseExample {
addCriterion("issues_count not between", value1, value2, "issuesCount");
return (Criteria) this;
}
public Criteria andOrderIsNull() {
addCriterion("`order` is null");
return (Criteria) this;
}
public Criteria andOrderIsNotNull() {
addCriterion("`order` is not null");
return (Criteria) this;
}
public Criteria andOrderEqualTo(Long value) {
addCriterion("`order` =", value, "order");
return (Criteria) this;
}
public Criteria andOrderNotEqualTo(Long value) {
addCriterion("`order` <>", value, "order");
return (Criteria) this;
}
public Criteria andOrderGreaterThan(Long value) {
addCriterion("`order` >", value, "order");
return (Criteria) this;
}
public Criteria andOrderGreaterThanOrEqualTo(Long value) {
addCriterion("`order` >=", value, "order");
return (Criteria) this;
}
public Criteria andOrderLessThan(Long value) {
addCriterion("`order` <", value, "order");
return (Criteria) this;
}
public Criteria andOrderLessThanOrEqualTo(Long value) {
addCriterion("`order` <=", value, "order");
return (Criteria) this;
}
public Criteria andOrderIn(List<Long> values) {
addCriterion("`order` in", values, "order");
return (Criteria) this;
}
public Criteria andOrderNotIn(List<Long> values) {
addCriterion("`order` not in", values, "order");
return (Criteria) this;
}
public Criteria andOrderBetween(Long value1, Long value2) {
addCriterion("`order` between", value1, value2, "order");
return (Criteria) this;
}
public Criteria andOrderNotBetween(Long value1, Long value2) {
addCriterion("`order` not between", value1, value2, "order");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
@ -937,4 +997,4 @@ public class TestPlanTestCaseExample {
this(condition, value, secondValue, null);
}
}
}
}

View File

@ -6,6 +6,8 @@
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="method" jdbcType="VARCHAR" property="method" />
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
<result column="path" jdbcType="VARCHAR" property="path" />
<result column="module_path" jdbcType="VARCHAR" property="modulePath" />
<result column="environment_id" jdbcType="VARCHAR" property="environmentId" />
<result column="schedule" jdbcType="VARCHAR" property="schedule" />
@ -14,8 +16,6 @@
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
<result column="path" jdbcType="VARCHAR" property="path" />
<result column="num" jdbcType="INTEGER" property="num" />
<result column="tags" jdbcType="VARCHAR" property="tags" />
<result column="original_state" jdbcType="VARCHAR" property="originalState" />
@ -26,6 +26,7 @@
<result column="delete_time" jdbcType="BIGINT" property="deleteTime" />
<result column="delete_user_id" jdbcType="VARCHAR" property="deleteUserId" />
<result column="follow_people" jdbcType="VARCHAR" property="followPeople" />
<result column="order" jdbcType="BIGINT" property="order" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
<result column="description" jdbcType="LONGVARCHAR" property="description" />
@ -91,10 +92,10 @@
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, `name`, `method`, module_path, environment_id, schedule, `status`,
module_id, user_id, create_time, update_time, protocol, `path`, num, tags, original_state,
id, project_id, `name`, `method`, protocol, `path`, module_path, environment_id,
schedule, `status`, module_id, user_id, create_time, update_time, num, tags, original_state,
create_user, case_total, case_status, case_passing_rate, delete_time, delete_user_id,
follow_people
follow_people, `order`
</sql>
<sql id="Blob_Column_List">
description, request, response
@ -149,25 +150,25 @@
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
insert into api_definition (id, project_id, `name`,
`method`, module_path, environment_id,
schedule, `status`, module_id,
user_id, create_time, update_time,
protocol, `path`, num,
`method`, protocol, `path`,
module_path, environment_id, schedule,
`status`, module_id, user_id,
create_time, update_time, num,
tags, original_state, create_user,
case_total, case_status, case_passing_rate,
delete_time, delete_user_id, follow_people,
description, request, response
)
`order`, description, request,
response)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{method,jdbcType=VARCHAR}, #{modulePath,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR},
#{schedule,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{moduleId,jdbcType=VARCHAR},
#{userId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{protocol,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER},
#{method,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR},
#{modulePath,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR}, #{schedule,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{moduleId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{num,jdbcType=INTEGER},
#{tags,jdbcType=VARCHAR}, #{originalState,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
#{caseTotal,jdbcType=VARCHAR}, #{caseStatus,jdbcType=VARCHAR}, #{casePassingRate,jdbcType=VARCHAR},
#{deleteTime,jdbcType=BIGINT}, #{deleteUserId,jdbcType=VARCHAR}, #{followPeople,jdbcType=VARCHAR},
#{description,jdbcType=LONGVARCHAR}, #{request,jdbcType=LONGVARCHAR}, #{response,jdbcType=LONGVARCHAR}
)
#{order,jdbcType=BIGINT}, #{description,jdbcType=LONGVARCHAR}, #{request,jdbcType=LONGVARCHAR},
#{response,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
insert into api_definition
@ -184,6 +185,12 @@
<if test="method != null">
`method`,
</if>
<if test="protocol != null">
protocol,
</if>
<if test="path != null">
`path`,
</if>
<if test="modulePath != null">
module_path,
</if>
@ -208,12 +215,6 @@
<if test="updateTime != null">
update_time,
</if>
<if test="protocol != null">
protocol,
</if>
<if test="path != null">
`path`,
</if>
<if test="num != null">
num,
</if>
@ -244,6 +245,9 @@
<if test="followPeople != null">
follow_people,
</if>
<if test="order != null">
`order`,
</if>
<if test="description != null">
description,
</if>
@ -267,6 +271,12 @@
<if test="method != null">
#{method,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
#{protocol,jdbcType=VARCHAR},
</if>
<if test="path != null">
#{path,jdbcType=VARCHAR},
</if>
<if test="modulePath != null">
#{modulePath,jdbcType=VARCHAR},
</if>
@ -291,12 +301,6 @@
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="protocol != null">
#{protocol,jdbcType=VARCHAR},
</if>
<if test="path != null">
#{path,jdbcType=VARCHAR},
</if>
<if test="num != null">
#{num,jdbcType=INTEGER},
</if>
@ -327,6 +331,9 @@
<if test="followPeople != null">
#{followPeople,jdbcType=VARCHAR},
</if>
<if test="order != null">
#{order,jdbcType=BIGINT},
</if>
<if test="description != null">
#{description,jdbcType=LONGVARCHAR},
</if>
@ -359,6 +366,12 @@
<if test="record.method != null">
`method` = #{record.method,jdbcType=VARCHAR},
</if>
<if test="record.protocol != null">
protocol = #{record.protocol,jdbcType=VARCHAR},
</if>
<if test="record.path != null">
`path` = #{record.path,jdbcType=VARCHAR},
</if>
<if test="record.modulePath != null">
module_path = #{record.modulePath,jdbcType=VARCHAR},
</if>
@ -383,12 +396,6 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.protocol != null">
protocol = #{record.protocol,jdbcType=VARCHAR},
</if>
<if test="record.path != null">
`path` = #{record.path,jdbcType=VARCHAR},
</if>
<if test="record.num != null">
num = #{record.num,jdbcType=INTEGER},
</if>
@ -419,6 +426,9 @@
<if test="record.followPeople != null">
follow_people = #{record.followPeople,jdbcType=VARCHAR},
</if>
<if test="record.order != null">
`order` = #{record.order,jdbcType=BIGINT},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=LONGVARCHAR},
</if>
@ -439,6 +449,8 @@
project_id = #{record.projectId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`method` = #{record.method,jdbcType=VARCHAR},
protocol = #{record.protocol,jdbcType=VARCHAR},
`path` = #{record.path,jdbcType=VARCHAR},
module_path = #{record.modulePath,jdbcType=VARCHAR},
environment_id = #{record.environmentId,jdbcType=VARCHAR},
schedule = #{record.schedule,jdbcType=VARCHAR},
@ -447,8 +459,6 @@
user_id = #{record.userId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
protocol = #{record.protocol,jdbcType=VARCHAR},
`path` = #{record.path,jdbcType=VARCHAR},
num = #{record.num,jdbcType=INTEGER},
tags = #{record.tags,jdbcType=VARCHAR},
original_state = #{record.originalState,jdbcType=VARCHAR},
@ -459,6 +469,7 @@
delete_time = #{record.deleteTime,jdbcType=BIGINT},
delete_user_id = #{record.deleteUserId,jdbcType=VARCHAR},
follow_people = #{record.followPeople,jdbcType=VARCHAR},
`order` = #{record.order,jdbcType=BIGINT},
description = #{record.description,jdbcType=LONGVARCHAR},
request = #{record.request,jdbcType=LONGVARCHAR},
response = #{record.response,jdbcType=LONGVARCHAR}
@ -472,6 +483,8 @@
project_id = #{record.projectId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`method` = #{record.method,jdbcType=VARCHAR},
protocol = #{record.protocol,jdbcType=VARCHAR},
`path` = #{record.path,jdbcType=VARCHAR},
module_path = #{record.modulePath,jdbcType=VARCHAR},
environment_id = #{record.environmentId,jdbcType=VARCHAR},
schedule = #{record.schedule,jdbcType=VARCHAR},
@ -480,8 +493,6 @@
user_id = #{record.userId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
protocol = #{record.protocol,jdbcType=VARCHAR},
`path` = #{record.path,jdbcType=VARCHAR},
num = #{record.num,jdbcType=INTEGER},
tags = #{record.tags,jdbcType=VARCHAR},
original_state = #{record.originalState,jdbcType=VARCHAR},
@ -491,7 +502,8 @@
case_passing_rate = #{record.casePassingRate,jdbcType=VARCHAR},
delete_time = #{record.deleteTime,jdbcType=BIGINT},
delete_user_id = #{record.deleteUserId,jdbcType=VARCHAR},
follow_people = #{record.followPeople,jdbcType=VARCHAR}
follow_people = #{record.followPeople,jdbcType=VARCHAR},
`order` = #{record.order,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -508,6 +520,12 @@
<if test="method != null">
`method` = #{method,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
protocol = #{protocol,jdbcType=VARCHAR},
</if>
<if test="path != null">
`path` = #{path,jdbcType=VARCHAR},
</if>
<if test="modulePath != null">
module_path = #{modulePath,jdbcType=VARCHAR},
</if>
@ -532,12 +550,6 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="protocol != null">
protocol = #{protocol,jdbcType=VARCHAR},
</if>
<if test="path != null">
`path` = #{path,jdbcType=VARCHAR},
</if>
<if test="num != null">
num = #{num,jdbcType=INTEGER},
</if>
@ -568,6 +580,9 @@
<if test="followPeople != null">
follow_people = #{followPeople,jdbcType=VARCHAR},
</if>
<if test="order != null">
`order` = #{order,jdbcType=BIGINT},
</if>
<if test="description != null">
description = #{description,jdbcType=LONGVARCHAR},
</if>
@ -585,6 +600,8 @@
set project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
`method` = #{method,jdbcType=VARCHAR},
protocol = #{protocol,jdbcType=VARCHAR},
`path` = #{path,jdbcType=VARCHAR},
module_path = #{modulePath,jdbcType=VARCHAR},
environment_id = #{environmentId,jdbcType=VARCHAR},
schedule = #{schedule,jdbcType=VARCHAR},
@ -593,8 +610,6 @@
user_id = #{userId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
protocol = #{protocol,jdbcType=VARCHAR},
`path` = #{path,jdbcType=VARCHAR},
num = #{num,jdbcType=INTEGER},
tags = #{tags,jdbcType=VARCHAR},
original_state = #{originalState,jdbcType=VARCHAR},
@ -605,6 +620,7 @@
delete_time = #{deleteTime,jdbcType=BIGINT},
delete_user_id = #{deleteUserId,jdbcType=VARCHAR},
follow_people = #{followPeople,jdbcType=VARCHAR},
`order` = #{order,jdbcType=BIGINT},
description = #{description,jdbcType=LONGVARCHAR},
request = #{request,jdbcType=LONGVARCHAR},
response = #{response,jdbcType=LONGVARCHAR}
@ -615,6 +631,8 @@
set project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
`method` = #{method,jdbcType=VARCHAR},
protocol = #{protocol,jdbcType=VARCHAR},
`path` = #{path,jdbcType=VARCHAR},
module_path = #{modulePath,jdbcType=VARCHAR},
environment_id = #{environmentId,jdbcType=VARCHAR},
schedule = #{schedule,jdbcType=VARCHAR},
@ -623,8 +641,6 @@
user_id = #{userId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
protocol = #{protocol,jdbcType=VARCHAR},
`path` = #{path,jdbcType=VARCHAR},
num = #{num,jdbcType=INTEGER},
tags = #{tags,jdbcType=VARCHAR},
original_state = #{originalState,jdbcType=VARCHAR},
@ -634,7 +650,8 @@
case_passing_rate = #{casePassingRate,jdbcType=VARCHAR},
delete_time = #{deleteTime,jdbcType=BIGINT},
delete_user_id = #{deleteUserId,jdbcType=VARCHAR},
follow_people = #{followPeople,jdbcType=VARCHAR}
follow_people = #{followPeople,jdbcType=VARCHAR},
`order` = #{order,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -10,6 +10,7 @@
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="order" jdbcType="BIGINT" property="order" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -71,7 +72,7 @@
</sql>
<sql id="Base_Column_List">
id, test_plan_id, api_case_id, `status`, environment_id, create_time, update_time,
create_user
create_user, `order`
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestPlanApiCaseExample" resultMap="BaseResultMap">
select
@ -106,10 +107,12 @@
<insert id="insert" parameterType="io.metersphere.base.domain.TestPlanApiCase">
insert into test_plan_api_case (id, test_plan_id, api_case_id,
`status`, environment_id, create_time,
update_time, create_user)
update_time, create_user, `order`
)
values (#{id,jdbcType=VARCHAR}, #{testPlanId,jdbcType=VARCHAR}, #{apiCaseId,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR})
#{updateTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR}, #{order,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestPlanApiCase">
insert into test_plan_api_case
@ -138,6 +141,9 @@
<if test="createUser != null">
create_user,
</if>
<if test="order != null">
`order`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -164,6 +170,9 @@
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="order != null">
#{order,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.TestPlanApiCaseExample" resultType="java.lang.Long">
@ -199,6 +208,9 @@
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.order != null">
`order` = #{record.order,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -213,7 +225,8 @@
environment_id = #{record.environmentId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR}
create_user = #{record.createUser,jdbcType=VARCHAR},
`order` = #{record.order,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -242,6 +255,9 @@
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="order != null">
`order` = #{order,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
@ -253,7 +269,8 @@
environment_id = #{environmentId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR}
create_user = #{createUser,jdbcType=VARCHAR},
`order` = #{order,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -12,6 +12,7 @@
<result column="last_result" jdbcType="VARCHAR" property="lastResult" />
<result column="report_id" jdbcType="VARCHAR" property="reportId" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="order" jdbcType="BIGINT" property="order" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestPlanApiScenario">
<result column="environment" jdbcType="LONGVARCHAR" property="environment" />
@ -76,7 +77,7 @@
</sql>
<sql id="Base_Column_List">
id, test_plan_id, api_scenario_id, `status`, create_time, update_time, pass_rate,
last_result, report_id, create_user
last_result, report_id, create_user, `order`
</sql>
<sql id="Blob_Column_List">
environment
@ -133,11 +134,13 @@
insert into test_plan_api_scenario (id, test_plan_id, api_scenario_id,
`status`, create_time, update_time,
pass_rate, last_result, report_id,
create_user, environment)
create_user, `order`, environment
)
values (#{id,jdbcType=VARCHAR}, #{testPlanId,jdbcType=VARCHAR}, #{apiScenarioId,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{passRate,jdbcType=VARCHAR}, #{lastResult,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR},
#{createUser,jdbcType=VARCHAR}, #{environment,jdbcType=LONGVARCHAR})
#{createUser,jdbcType=VARCHAR}, #{order,jdbcType=BIGINT}, #{environment,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestPlanApiScenario">
insert into test_plan_api_scenario
@ -172,6 +175,9 @@
<if test="createUser != null">
create_user,
</if>
<if test="order != null">
`order`,
</if>
<if test="environment != null">
environment,
</if>
@ -207,6 +213,9 @@
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="order != null">
#{order,jdbcType=BIGINT},
</if>
<if test="environment != null">
#{environment,jdbcType=LONGVARCHAR},
</if>
@ -251,6 +260,9 @@
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.order != null">
`order` = #{record.order,jdbcType=BIGINT},
</if>
<if test="record.environment != null">
environment = #{record.environment,jdbcType=LONGVARCHAR},
</if>
@ -271,6 +283,7 @@
last_result = #{record.lastResult,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR},
`order` = #{record.order,jdbcType=BIGINT},
environment = #{record.environment,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -287,7 +300,8 @@
pass_rate = #{record.passRate,jdbcType=VARCHAR},
last_result = #{record.lastResult,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR}
create_user = #{record.createUser,jdbcType=VARCHAR},
`order` = #{record.order,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -322,6 +336,9 @@
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="order != null">
`order` = #{order,jdbcType=BIGINT},
</if>
<if test="environment != null">
environment = #{environment,jdbcType=LONGVARCHAR},
</if>
@ -339,6 +356,7 @@
last_result = #{lastResult,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR},
`order` = #{order,jdbcType=BIGINT},
environment = #{environment,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
@ -352,7 +370,8 @@
pass_rate = #{passRate,jdbcType=VARCHAR},
last_result = #{lastResult,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR}
create_user = #{createUser,jdbcType=VARCHAR},
`order` = #{order,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -5,12 +5,13 @@
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="test_plan_id" jdbcType="VARCHAR" property="testPlanId" />
<result column="load_case_id" jdbcType="VARCHAR" property="loadCaseId" />
<result column="load_report_id" jdbcType="VARCHAR" property="loadReportId" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="load_report_id" jdbcType="VARCHAR" property="loadReportId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="test_resource_pool_id" jdbcType="VARCHAR" property="testResourcePoolId" />
<result column="order" jdbcType="BIGINT" property="order" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestPlanLoadCase">
<result column="load_configuration" jdbcType="LONGVARCHAR" property="loadConfiguration" />
@ -74,8 +75,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, test_plan_id, load_case_id, load_report_id, `status`, create_time, update_time,
create_user, test_resource_pool_id
id, test_plan_id, load_case_id, `status`, load_report_id, create_time, update_time,
create_user, test_resource_pool_id, `order`
</sql>
<sql id="Blob_Column_List">
load_configuration
@ -130,13 +131,13 @@
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestPlanLoadCase">
insert into test_plan_load_case (id, test_plan_id, load_case_id,
load_report_id, `status`, create_time,
`status`, load_report_id, create_time,
update_time, create_user, test_resource_pool_id,
load_configuration)
`order`, load_configuration)
values (#{id,jdbcType=VARCHAR}, #{testPlanId,jdbcType=VARCHAR}, #{loadCaseId,jdbcType=VARCHAR},
#{loadReportId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{status,jdbcType=VARCHAR}, #{loadReportId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR}, #{testResourcePoolId,jdbcType=VARCHAR},
#{loadConfiguration,jdbcType=LONGVARCHAR})
#{order,jdbcType=BIGINT}, #{loadConfiguration,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestPlanLoadCase">
insert into test_plan_load_case
@ -150,12 +151,12 @@
<if test="loadCaseId != null">
load_case_id,
</if>
<if test="loadReportId != null">
load_report_id,
</if>
<if test="status != null">
`status`,
</if>
<if test="loadReportId != null">
load_report_id,
</if>
<if test="createTime != null">
create_time,
</if>
@ -168,6 +169,9 @@
<if test="testResourcePoolId != null">
test_resource_pool_id,
</if>
<if test="order != null">
`order`,
</if>
<if test="loadConfiguration != null">
load_configuration,
</if>
@ -182,12 +186,12 @@
<if test="loadCaseId != null">
#{loadCaseId,jdbcType=VARCHAR},
</if>
<if test="loadReportId != null">
#{loadReportId,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="loadReportId != null">
#{loadReportId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
@ -200,6 +204,9 @@
<if test="testResourcePoolId != null">
#{testResourcePoolId,jdbcType=VARCHAR},
</if>
<if test="order != null">
#{order,jdbcType=BIGINT},
</if>
<if test="loadConfiguration != null">
#{loadConfiguration,jdbcType=LONGVARCHAR},
</if>
@ -223,12 +230,12 @@
<if test="record.loadCaseId != null">
load_case_id = #{record.loadCaseId,jdbcType=VARCHAR},
</if>
<if test="record.loadReportId != null">
load_report_id = #{record.loadReportId,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.loadReportId != null">
load_report_id = #{record.loadReportId,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
@ -241,6 +248,9 @@
<if test="record.testResourcePoolId != null">
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR},
</if>
<if test="record.order != null">
`order` = #{record.order,jdbcType=BIGINT},
</if>
<if test="record.loadConfiguration != null">
load_configuration = #{record.loadConfiguration,jdbcType=LONGVARCHAR},
</if>
@ -254,12 +264,13 @@
set id = #{record.id,jdbcType=VARCHAR},
test_plan_id = #{record.testPlanId,jdbcType=VARCHAR},
load_case_id = #{record.loadCaseId,jdbcType=VARCHAR},
load_report_id = #{record.loadReportId,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
load_report_id = #{record.loadReportId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR},
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR},
`order` = #{record.order,jdbcType=BIGINT},
load_configuration = #{record.loadConfiguration,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -270,12 +281,13 @@
set id = #{record.id,jdbcType=VARCHAR},
test_plan_id = #{record.testPlanId,jdbcType=VARCHAR},
load_case_id = #{record.loadCaseId,jdbcType=VARCHAR},
load_report_id = #{record.loadReportId,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
load_report_id = #{record.loadReportId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR},
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR}
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR},
`order` = #{record.order,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -289,12 +301,12 @@
<if test="loadCaseId != null">
load_case_id = #{loadCaseId,jdbcType=VARCHAR},
</if>
<if test="loadReportId != null">
load_report_id = #{loadReportId,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="loadReportId != null">
load_report_id = #{loadReportId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
@ -307,6 +319,9 @@
<if test="testResourcePoolId != null">
test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR},
</if>
<if test="order != null">
`order` = #{order,jdbcType=BIGINT},
</if>
<if test="loadConfiguration != null">
load_configuration = #{loadConfiguration,jdbcType=LONGVARCHAR},
</if>
@ -317,12 +332,13 @@
update test_plan_load_case
set test_plan_id = #{testPlanId,jdbcType=VARCHAR},
load_case_id = #{loadCaseId,jdbcType=VARCHAR},
load_report_id = #{loadReportId,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
load_report_id = #{loadReportId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR},
test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR},
`order` = #{order,jdbcType=BIGINT},
load_configuration = #{loadConfiguration,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
@ -330,12 +346,13 @@
update test_plan_load_case
set test_plan_id = #{testPlanId,jdbcType=VARCHAR},
load_case_id = #{loadCaseId,jdbcType=VARCHAR},
load_report_id = #{loadReportId,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
load_report_id = #{loadReportId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR},
test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR}
test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR},
`order` = #{order,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -5,14 +5,15 @@
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="plan_id" jdbcType="VARCHAR" property="planId" />
<result column="case_id" jdbcType="VARCHAR" property="caseId" />
<result column="report_id" jdbcType="VARCHAR" property="reportId" />
<result column="executor" jdbcType="VARCHAR" property="executor" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="report_id" jdbcType="VARCHAR" property="reportId" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="issues_count" jdbcType="INTEGER" property="issuesCount" />
<result column="order" jdbcType="BIGINT" property="order" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestPlanTestCaseWithBLOBs">
<result column="results" jdbcType="LONGVARCHAR" property="results" />
@ -78,8 +79,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, plan_id, case_id, executor, `status`, remark, create_time, update_time, report_id,
create_user, issues_count
id, plan_id, case_id, report_id, executor, `status`, remark, create_time, update_time,
create_user, issues_count, `order`
</sql>
<sql id="Blob_Column_List">
results, issues, actual_result
@ -115,7 +116,7 @@
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
@ -133,16 +134,18 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestPlanTestCaseWithBLOBs">
insert into test_plan_test_case (id, plan_id, case_id,
executor, `status`, remark,
create_time, update_time, report_id,
create_user, issues_count, results,
issues, actual_result)
values (#{id,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR},
#{executor,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{reportId,jdbcType=VARCHAR},
#{createUser,jdbcType=VARCHAR}, #{issuesCount,jdbcType=INTEGER}, #{results,jdbcType=LONGVARCHAR},
#{issues,jdbcType=LONGVARCHAR}, #{actualResult,jdbcType=LONGVARCHAR})
insert into test_plan_test_case (id, plan_id, case_id,
report_id, executor, `status`,
remark, create_time, update_time,
create_user, issues_count, `order`,
results, issues, actual_result
)
values (#{id,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR},
#{reportId,jdbcType=VARCHAR}, #{executor,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{createUser,jdbcType=VARCHAR}, #{issuesCount,jdbcType=INTEGER}, #{order,jdbcType=BIGINT},
#{results,jdbcType=LONGVARCHAR}, #{issues,jdbcType=LONGVARCHAR}, #{actualResult,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestPlanTestCaseWithBLOBs">
insert into test_plan_test_case
@ -156,6 +159,9 @@
<if test="caseId != null">
case_id,
</if>
<if test="reportId != null">
report_id,
</if>
<if test="executor != null">
executor,
</if>
@ -171,15 +177,15 @@
<if test="updateTime != null">
update_time,
</if>
<if test="reportId != null">
report_id,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="issuesCount != null">
issues_count,
</if>
<if test="order != null">
`order`,
</if>
<if test="results != null">
results,
</if>
@ -200,6 +206,9 @@
<if test="caseId != null">
#{caseId,jdbcType=VARCHAR},
</if>
<if test="reportId != null">
#{reportId,jdbcType=VARCHAR},
</if>
<if test="executor != null">
#{executor,jdbcType=VARCHAR},
</if>
@ -215,15 +224,15 @@
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="reportId != null">
#{reportId,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="issuesCount != null">
#{issuesCount,jdbcType=INTEGER},
</if>
<if test="order != null">
#{order,jdbcType=BIGINT},
</if>
<if test="results != null">
#{results,jdbcType=LONGVARCHAR},
</if>
@ -253,6 +262,9 @@
<if test="record.caseId != null">
case_id = #{record.caseId,jdbcType=VARCHAR},
</if>
<if test="record.reportId != null">
report_id = #{record.reportId,jdbcType=VARCHAR},
</if>
<if test="record.executor != null">
executor = #{record.executor,jdbcType=VARCHAR},
</if>
@ -268,15 +280,15 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.reportId != null">
report_id = #{record.reportId,jdbcType=VARCHAR},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.issuesCount != null">
issues_count = #{record.issuesCount,jdbcType=INTEGER},
</if>
<if test="record.order != null">
`order` = #{record.order,jdbcType=BIGINT},
</if>
<if test="record.results != null">
results = #{record.results,jdbcType=LONGVARCHAR},
</if>
@ -296,14 +308,15 @@
set id = #{record.id,jdbcType=VARCHAR},
plan_id = #{record.planId,jdbcType=VARCHAR},
case_id = #{record.caseId,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=VARCHAR},
executor = #{record.executor,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
report_id = #{record.reportId,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR},
issues_count = #{record.issuesCount,jdbcType=INTEGER},
`order` = #{record.order,jdbcType=BIGINT},
results = #{record.results,jdbcType=LONGVARCHAR},
issues = #{record.issues,jdbcType=LONGVARCHAR},
actual_result = #{record.actualResult,jdbcType=LONGVARCHAR}
@ -316,14 +329,15 @@
set id = #{record.id,jdbcType=VARCHAR},
plan_id = #{record.planId,jdbcType=VARCHAR},
case_id = #{record.caseId,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=VARCHAR},
executor = #{record.executor,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
report_id = #{record.reportId,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR},
issues_count = #{record.issuesCount,jdbcType=INTEGER}
issues_count = #{record.issuesCount,jdbcType=INTEGER},
`order` = #{record.order,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -337,6 +351,9 @@
<if test="caseId != null">
case_id = #{caseId,jdbcType=VARCHAR},
</if>
<if test="reportId != null">
report_id = #{reportId,jdbcType=VARCHAR},
</if>
<if test="executor != null">
executor = #{executor,jdbcType=VARCHAR},
</if>
@ -352,15 +369,15 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="reportId != null">
report_id = #{reportId,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="issuesCount != null">
issues_count = #{issuesCount,jdbcType=INTEGER},
</if>
<if test="order != null">
`order` = #{order,jdbcType=BIGINT},
</if>
<if test="results != null">
results = #{results,jdbcType=LONGVARCHAR},
</if>
@ -377,14 +394,15 @@
update test_plan_test_case
set plan_id = #{planId,jdbcType=VARCHAR},
case_id = #{caseId,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=VARCHAR},
executor = #{executor,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
report_id = #{reportId,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR},
issues_count = #{issuesCount,jdbcType=INTEGER},
`order` = #{order,jdbcType=BIGINT},
results = #{results,jdbcType=LONGVARCHAR},
issues = #{issues,jdbcType=LONGVARCHAR},
actual_result = #{actualResult,jdbcType=LONGVARCHAR}
@ -394,14 +412,15 @@
update test_plan_test_case
set plan_id = #{planId,jdbcType=VARCHAR},
case_id = #{caseId,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=VARCHAR},
executor = #{executor,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
report_id = #{reportId,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR},
issues_count = #{issuesCount,jdbcType=INTEGER}
issues_count = #{issuesCount,jdbcType=INTEGER},
`order` = #{order,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
</mapper>

View File

@ -58,4 +58,13 @@ public interface ExtApiDefinitionMapper {
ApiDefinition selectUrlAndMethodById(String id);
int checkOriginalStatusByIds(@Param("ids")List<String> ids);
List<String> selectProjectIds();
List<String> getIdsOrderByUpdateTime(@Param("projectId") String projectId);
Long getPreOrder(@Param("projectId")String projectId, @Param("baseOrder") Long baseOrder);
Long getLastOrder(@Param("projectId")String projectId, @Param("baseOrder") Long baseOrder);
}

View File

@ -627,4 +627,28 @@
</if>
</where>
</sql>
<select id="selectProjectIds" resultType="java.lang.String">
select DISTINCT project_id from api_definition;
</select>
<select id="getIdsOrderByUpdateTime" resultType="java.lang.String">
select id from api_definition where project_id = #{projectId} order by update_time ASC;
</select>
<select id="getLastOrder" resultType="java.lang.Long">
select `order` from api_definition where project_id = #{projectId}
<if test="baseOrder != null">
and `order` &gt; #{baseOrder}
</if>
order by `order` desc limit 1;
</select>
<select id="getPreOrder" resultType="java.lang.Long">
select `order` from api_definition where project_id = #{projectId}
<if test="baseOrder != null">
and `order` &lt; #{baseOrder}
</if>
order by `order` desc limit 1;
</select>
</mapper>

View File

@ -36,5 +36,13 @@ public interface ExtTestPlanApiCaseMapper {
List<TestPlanFailureApiDTO> getFailureList(@Param("planId") String planId, @Param("status") String status);
List<TestPlanFailureApiDTO> getFailureListByIds(@Param("caseIdList") Collection<String> caseIdList, @Param("planId") String planId, @Param("status") String status);
List<String> selectPlanIds();
List<String> getIdsOrderByUpdateTime(@Param("planId") String planId);
Long getPreOrder(@Param("planId")String planId, @Param("baseOrder") Long baseOrder);
Long getLastOrder(@Param("planId")String planId, @Param("baseOrder") Long baseOrder);
}

View File

@ -4,8 +4,8 @@
<insert id="insertIfNotExists" parameterType="io.metersphere.base.domain.TestPlanApiCase">
INSERT INTO test_plan_api_case(id, test_plan_id, api_case_id, environment_id, create_time, update_time, create_user)
SELECT #{request.id}, #{request.testPlanId}, #{request.apiCaseId}, #{request.environmentId}, #{request.createTime}, #{request.updateTime}, #{request.createUser}
INSERT INTO test_plan_api_case(id, test_plan_id, api_case_id, environment_id, create_time, update_time, create_user, `order`)
SELECT #{request.id}, #{request.testPlanId}, #{request.apiCaseId}, #{request.environmentId}, #{request.createTime}, #{request.updateTime}, #{request.createUser}, #{request.order}
FROM DUAL
WHERE NOT EXISTS(
SELECT id FROM
@ -112,7 +112,7 @@
order by
<foreach collection="request.orders" separator="," item="order">
<choose>
<when test="order.name == 'update_time'">
<when test="order.name == 'update_time' or order.name == 'order'">
t.${order.name} ${order.type}
</when>
<when test="order.name == 'create_user'">
@ -203,7 +203,7 @@
order by
<foreach collection="request.orders" separator="," item="order">
<choose>
<when test="order.name == 'update_time'">
<when test="order.name == 'update_time' or order.name == 'order'" >
t.${order.name} ${order.type}
</when>
<when test="order.name == 'create_user'">
@ -290,4 +290,27 @@
</foreach>
</select>
<select id="selectPlanIds" resultType="java.lang.String">
select DISTINCT test_plan_id from test_plan_api_case;
</select>
<select id="getIdsOrderByUpdateTime" resultType="java.lang.String">
select id from test_plan_api_case where test_plan_id = #{planId} order by update_time ASC;
</select>
<select id="getLastOrder" resultType="java.lang.Long">
select `order` from test_plan_api_case where test_plan_id = #{planId}
<if test="baseOrder != null">
and `order` &gt; #{baseOrder}
</if>
order by `order` desc limit 1;
</select>
<select id="getPreOrder" resultType="java.lang.Long">
select `order` from test_plan_api_case where test_plan_id = #{planId}
<if test="baseOrder != null">
and `order` &lt; #{baseOrder}
</if>
order by `order` desc limit 1;
</select>
</mapper>

View File

@ -27,4 +27,12 @@ public interface ExtTestPlanLoadCaseMapper {
List<TestPlanLoadCaseDTO> getCases(@Param("planId") String planId, @Param("status") String status);
List<TestPlanLoadCaseDTO> getCasesByIds(@Param("ids") Collection<String> ids, @Param("planId") String planId, @Param("status") String status);
List<String> selectPlanIds();
List<String> getIdsOrderByUpdateTime(@Param("planId") String planId);
Long getPreOrder(@Param("planId")String planId, @Param("baseOrder") Long baseOrder);
Long getLastOrder(@Param("planId")String planId, @Param("baseOrder") Long baseOrder);
}

View File

@ -289,4 +289,27 @@
</foreach>
</select>
<select id="selectPlanIds" resultType="java.lang.String">
select DISTINCT test_plan_id from test_plan_load_case;
</select>
<select id="getIdsOrderByUpdateTime" resultType="java.lang.String">
select id from test_plan_load_case where test_plan_id = #{planId} order by update_time ASC;
</select>
<select id="getLastOrder" resultType="java.lang.Long">
select `order` from test_plan_load_case where test_plan_id = #{planId}
<if test="baseOrder != null">
and `order` &gt; #{baseOrder}
</if>
order by `order` desc limit 1;
</select>
<select id="getPreOrder" resultType="java.lang.Long">
select `order` from test_plan_load_case where test_plan_id = #{planId}
<if test="baseOrder != null">
and `order` &lt; #{baseOrder}
</if>
order by `order` desc limit 1;
</select>
</mapper>

View File

@ -36,4 +36,12 @@ public interface ExtTestPlanScenarioCaseMapper {
List<Integer> getUnderwaySteps(@Param("ids") List<String> underwayIds);
String getProjectIdById(String testPlanScenarioId);
List<String> selectPlanIds();
List<String> getIdsOrderByUpdateTime(@Param("planId") String planId);
Long getPreOrder(@Param("planId")String planId, @Param("baseOrder") Long baseOrder);
Long getLastOrder(@Param("planId")String planId, @Param("baseOrder") Long baseOrder);
}

View File

@ -76,7 +76,7 @@
order by
<foreach collection="request.orders" separator="," item="order">
<choose>
<when test="order.name == 'update_time'">
<when test="order.name == 'update_time' or order.name == 'order'">
t.${order.name} ${order.type}
</when>
<otherwise>
@ -136,7 +136,7 @@
order by
<foreach collection="request.orders" separator="," item="order">
<choose>
<when test="order.name == 'update_time'">
<when test="order.name == 'update_time' or order.name == 'order'">
t.${order.name} ${order.type}
</when>
<otherwise>
@ -253,4 +253,26 @@
)
</select>
<select id="selectPlanIds" resultType="java.lang.String">
select DISTINCT test_plan_id from test_plan_api_scenario;
</select>
<select id="getIdsOrderByUpdateTime" resultType="java.lang.String">
select id from test_plan_api_scenario where test_plan_id = #{planId} order by update_time ASC;
</select>
<select id="getLastOrder" resultType="java.lang.Long">
select `order` from test_plan_api_scenario where test_plan_id = #{planId}
<if test="baseOrder != null">
and `order` &gt; #{baseOrder}
</if>
order by `order` desc limit 1;
</select>
<select id="getPreOrder" resultType="java.lang.Long">
select `order` from test_plan_api_scenario where test_plan_id = #{planId}
<if test="baseOrder != null">
and `order` &lt; #{baseOrder}
</if>
order by `order` desc limit 1;
</select>
</mapper>

View File

@ -62,4 +62,12 @@ public interface ExtTestPlanTestCaseMapper {
List<PlanReportCaseDTO> selectForPlanReport(String planId);
List<TestPlanCaseDTO> getCases(@Param("planId") String planId, @Param("status") String status);
List<String> selectPlanIds();
List<String> getIdsOrderByUpdateTime(@Param("planId") String planId);
Long getPreOrder(@Param("planId")String planId, @Param("baseOrder") Long baseOrder);
Long getLastOrder(@Param("planId")String planId, @Param("baseOrder") Long baseOrder);
}

View File

@ -245,10 +245,10 @@
customNum ${order.type}
</when>
<when test="order.name == 'name'">
test_case.name ${order.type}
test_case.name ${order.type}
</when>
<otherwise>
${order.name} ${order.type}
test_plan_test_case.${order.name} ${order.type}
</otherwise>
</choose>
</foreach>
@ -515,4 +515,27 @@
from test_plan_api_case
where api_case_id = #{id,jdbcType=VARCHAR}
</delete>
<select id="selectPlanIds" resultType="java.lang.String">
select DISTINCT plan_id from test_plan_test_case;
</select>
<select id="getIdsOrderByUpdateTime" resultType="java.lang.String">
select id from test_plan_test_case where plan_id = #{planId} order by update_time ASC;
</select>
<select id="getLastOrder" resultType="java.lang.Long">
select `order` from test_plan_test_case where plan_id = #{planId}
<if test="baseOrder != null">
and `order` &gt; #{baseOrder}
</if>
order by `order` desc limit 1;
</select>
<select id="getPreOrder" resultType="java.lang.Long">
select `order` from test_plan_test_case where plan_id = #{planId}
<if test="baseOrder != null">
and `order` &lt; #{baseOrder}
</if>
order by `order` desc limit 1;
</select>
</mapper>

View File

@ -187,12 +187,12 @@ public class ServiceUtils {
// 追加到参考对象的之后
order = targetOrder - 5000;
// 因为是降序排则查找比目标 order 小的一个order
lastOrPreOrder = getPreOrderFunc.apply(request.getProjectId(), targetOrder);
lastOrPreOrder = getPreOrderFunc.apply(request.getGroupId(), targetOrder);
} else {
// 追加到前面
order = targetOrder + 5000;
// 因为是降序排则查找比目标 order 更大的一个order
lastOrPreOrder = getLastOrderFunc.apply(request.getProjectId(), targetOrder);
lastOrPreOrder = getLastOrderFunc.apply(request.getGroupId(), targetOrder);
}
if (lastOrPreOrder != null) {
// 如果不是第一个或最后一个则取中间值
@ -212,12 +212,12 @@ public class ServiceUtils {
/**
* 创建时获取下一个 order
* @param projectId
* @param groupId
* @param getLastOrderFunc
* @return
*/
public static Long getNextOrder(String projectId, BiFunction<String, Long, Long> getLastOrderFunc) {
Long lastOrder = getLastOrderFunc.apply(projectId, null);
public static Long getNextOrder(String groupId, BiFunction<String, Long, Long> getLastOrderFunc) {
Long lastOrder = getLastOrderFunc.apply(groupId, null);
return (lastOrder == null ? 0 : lastOrder) + 5000;
}
}

View File

@ -7,7 +7,9 @@ public class ResetOrderRequest {
private String moveId;
private String targetId;
private String moveMode;
private String projectId;
// 项目id或者测试计划id
private String groupId;
public enum MoveMode {
BEFORE, AFTER

View File

@ -3,6 +3,7 @@ package io.metersphere.listener;
import io.metersphere.api.jmeter.JMeterService;
import io.metersphere.api.jmeter.NewDriverManager;
import io.metersphere.api.service.ApiAutomationService;
import io.metersphere.api.service.ApiDefinitionService;
import io.metersphere.api.service.ApiTestCaseService;
import io.metersphere.base.domain.JarConfig;
import io.metersphere.commons.utils.LogUtil;
@ -13,8 +14,7 @@ import io.metersphere.service.ProjectService;
import io.metersphere.service.PluginService;
import io.metersphere.service.ScheduleService;
import io.metersphere.service.SystemParameterService;
import io.metersphere.track.service.IssuesService;
import io.metersphere.track.service.TestCaseService;
import io.metersphere.track.service.*;
import org.apache.commons.lang3.StringUtils;
import org.python.core.Options;
import org.python.util.PythonInterpreter;
@ -51,6 +51,16 @@ public class AppStartListener implements ApplicationListener<ApplicationReadyEve
private TestCaseService testCaseService;
@Resource
private ApiTestCaseService apiTestCaseService;
@Resource
private TestPlanTestCaseService testPlanTestCaseService;
@Resource
private TestPlanApiCaseService testPlanApiCaseService;
@Resource
private TestPlanScenarioCaseService testPlanScenarioCaseService;
@Resource
private TestPlanLoadCaseService testPlanLoadCaseService;
@Resource
private ApiDefinitionService apiDefinitionService;
@Value("${jmeter.home}")
private String jmeterHome;
@ -110,9 +120,14 @@ public class AppStartListener implements ApplicationListener<ApplicationReadyEve
initOnceOperate(issuesService::issuesCount, "init.issueCount");
initOnceOperate(performanceTestService::initScenarioLoadTest, "init.scenario.load.test");
initOnceOperate(testCaseService::initOrderField, "init.sort.test.case");
initOnceOperate(apiDefinitionService::initOrderField, "init.sort.api.test.definition");
initOnceOperate(apiTestCaseService::initOrderField, "init.sort.api.test.case");
initOnceOperate(apiAutomationService::initOrderField, "init.sort.api.scenario");
initOnceOperate(performanceTestService::initOrderField, "init.sort.load.case");
initOnceOperate(testPlanTestCaseService::initOrderField, "init.sort.plan.test.case");
initOnceOperate(testPlanApiCaseService::initOrderField, "init.sort.plan.api.case");
initOnceOperate(testPlanScenarioCaseService::initOrderField, "init.sort.plan.api.scenario");
initOnceOperate(testPlanLoadCaseService::initOrderField, "init.sort.plan.api.load");
}
/**

View File

@ -157,6 +157,7 @@ public class PluginService {
}
public void loadPlugins() {
try {
PluginExample example = new PluginExample();
List<Plugin> plugins = pluginMapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(plugins)) {
@ -167,6 +168,8 @@ public class PluginService {
this.loadJar(item.getSourcePath());
});
}
} catch (Exception e) {
LogUtil.error(e);
}
}

View File

@ -11,6 +11,7 @@ import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.PermissionConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.ResetOrderRequest;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.track.request.testcase.TestPlanApiCaseBatchRequest;
import io.metersphere.track.service.TestPlanApiCaseService;
@ -80,4 +81,9 @@ public class TestPlanApiCaseController {
public String run(@RequestBody BatchRunDefinitionRequest request) {
return testPlanApiCaseService.run(request);
}
@PostMapping("/edit/order")
public void orderCase(@RequestBody ResetOrderRequest request) {
testPlanApiCaseService.updateOrder(request);
}
}

View File

@ -7,6 +7,7 @@ import io.metersphere.base.domain.TestPlanLoadCase;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.ResetOrderRequest;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.performance.request.RunTestPlanRequest;
import io.metersphere.track.dto.TestPlanLoadCaseDTO;
@ -110,4 +111,9 @@ public class TestPlanLoadCaseController {
public TestPlanLoadCase getTestPlanLoadCase(@PathVariable String loadCaseId) {
return testPlanLoadCaseService.getTestPlanLoadCase(loadCaseId);
}
@PostMapping("/edit/order")
public void orderCase(@RequestBody ResetOrderRequest request) {
testPlanLoadCaseService.updateOrder(request);
}
}

View File

@ -7,6 +7,7 @@ import io.metersphere.commons.constants.ApiRunMode;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.ResetOrderRequest;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.track.dto.RelevanceScenarioRequest;
import io.metersphere.track.request.testcase.TestPlanScenarioCaseBatchRequest;
@ -90,4 +91,9 @@ public class TestPlanScenarioCaseController {
public Map<String, String> getScenarioCaseEnv(@RequestBody HashMap<String, String> map) {
return testPlanScenarioCaseService.getScenarioCaseEnv(map);
}
@PostMapping("/edit/order")
public void orderCase(@RequestBody ResetOrderRequest request) {
testPlanScenarioCaseService.updateOrder(request);
}
}

View File

@ -6,6 +6,7 @@ import io.metersphere.base.domain.TestPlanTestCaseWithBLOBs;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.ResetOrderRequest;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.track.dto.TestPlanCaseDTO;
import io.metersphere.track.request.testcase.TestPlanCaseBatchRequest;
@ -139,4 +140,9 @@ public class TestPlanTestCaseController {
public List<TestPlanCaseDTO> getAllCases(@PathVariable String planId) {
return testPlanTestCaseService.getAllCases(planId);
}
@PostMapping("/edit/order")
public void orderCase(@RequestBody ResetOrderRequest request) {
testPlanTestCaseService.updateOrder(request);
}
}

View File

@ -39,6 +39,7 @@ import io.metersphere.commons.constants.RunModeConstants;
import io.metersphere.commons.constants.TriggerMode;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.*;
import io.metersphere.controller.request.ResetOrderRequest;
import io.metersphere.dto.BaseSystemConfigDTO;
import io.metersphere.log.vo.OperatingLogDetails;
import io.metersphere.plugin.core.MsTestElement;
@ -104,7 +105,7 @@ public class TestPlanApiCaseService {
public List<TestPlanApiCaseDTO> list(ApiTestCaseRequest request) {
request.setProjectId(null);
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
request.setOrders(ServiceUtils.getDefaultSortOrder(request.getOrders()));
List<TestPlanApiCaseDTO> apiTestCases = extTestPlanApiCaseMapper.list(request);
if (CollectionUtils.isEmpty(apiTestCases)) {
return apiTestCases;
@ -130,7 +131,7 @@ public class TestPlanApiCaseService {
public List<String> selectIds(ApiTestCaseRequest request) {
request.setProjectId(null);
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
request.setOrders(ServiceUtils.getDefaultSortOrder(request.getOrders()));
List<String> idList = extTestPlanApiCaseMapper.selectIds(request);
return idList;
}
@ -602,4 +603,23 @@ public class TestPlanApiCaseService {
buildUserInfo(apiTestCases);
return apiTestCases;
}
public void initOrderField() {
ServiceUtils.initOrderField(TestPlanApiCase.class, TestPlanApiCaseMapper.class,
extTestPlanApiCaseMapper::selectPlanIds,
extTestPlanApiCaseMapper::getIdsOrderByUpdateTime);
}
/**
* 用例自定义排序
* @param request
*/
public void updateOrder(ResetOrderRequest request) {
ServiceUtils.updateOrderField(request, TestPlanApiCase.class,
testPlanApiCaseMapper::selectByPrimaryKey,
extTestPlanApiCaseMapper::getPreOrder,
extTestPlanApiCaseMapper::getLastOrder,
testPlanApiCaseMapper::updateByPrimaryKeySelective);
}
}

View File

@ -14,6 +14,7 @@ import io.metersphere.commons.utils.ServiceUtils;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.commons.utils.TestPlanUtils;
import io.metersphere.controller.request.OrderRequest;
import io.metersphere.controller.request.ResetOrderRequest;
import io.metersphere.log.vo.OperatingLogDetails;
import io.metersphere.performance.request.RunTestPlanRequest;
import io.metersphere.performance.service.PerformanceTestService;
@ -69,28 +70,12 @@ public class TestPlanLoadCaseService {
}
public List<TestPlanLoadCaseDTO> list(LoadCaseRequest 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);
request.setOrders(ServiceUtils.getDefaultSortOrder(request.getOrders()));
return extTestPlanLoadCaseMapper.selectTestPlanLoadCaseList(request);
}
public List<String> selectTestPlanLoadCaseIds(LoadCaseRequest 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);
request.setOrders(ServiceUtils.getDefaultSortOrder(request.getOrders()));
return extTestPlanLoadCaseMapper.selectTestPlanLoadCaseId(request);
}
@ -100,7 +85,9 @@ public class TestPlanLoadCaseService {
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
TestPlanLoadCaseMapper testPlanLoadCaseMapper = sqlSession.getMapper(TestPlanLoadCaseMapper.class);
caseIds.forEach(id -> {
Long nextOrder = ServiceUtils.getNextOrder(request.getTestPlanId(), extTestPlanLoadCaseMapper::getLastOrder);
for (String id : caseIds) {
TestPlanLoadCase t = new TestPlanLoadCase();
t.setId(UUID.randomUUID().toString());
t.setCreateUser(SessionUtils.getUserId());
@ -108,8 +95,11 @@ public class TestPlanLoadCaseService {
t.setLoadCaseId(id);
t.setCreateTime(System.currentTimeMillis());
t.setUpdateTime(System.currentTimeMillis());
t.setOrder(nextOrder);
nextOrder += 5000;
testPlanLoadCaseMapper.insert(t);
});
}
TestPlan testPlan = testPlanMapper.selectByPrimaryKey(request.getTestPlanId());
if (org.apache.commons.lang3.StringUtils.equals(testPlan.getStatus(), TestPlanStatus.Prepare.name())
|| org.apache.commons.lang3.StringUtils.equals(testPlan.getStatus(), TestPlanStatus.Completed.name())) {
@ -263,18 +253,10 @@ public class TestPlanLoadCaseService {
return new ArrayList<>();
}
List<OrderRequest> orders = request.getCondition().getOrders();
if (orders == null || orders.size() < 1) {
OrderRequest orderRequest = new OrderRequest();
orderRequest.setName("create_time");
orderRequest.setType("desc");
orders = new ArrayList<>();
orders.add(orderRequest);
}
LoadCaseRequest tableReq = new LoadCaseRequest();
tableReq.setIds(ids);
tableReq.setOrders(orders);
tableReq.setOrders(ServiceUtils.getDefaultSortOrder(tableReq.getOrders()));
List<TestPlanLoadCaseDTO> list = extTestPlanLoadCaseMapper.selectByIdIn(tableReq);
return list;
}
@ -417,4 +399,23 @@ public class TestPlanLoadCaseService {
}
return testPlanLoadCaseMapper.selectByPrimaryKey(loadCaseId);
}
public void initOrderField() {
ServiceUtils.initOrderField(TestPlanLoadCase.class, TestPlanLoadCaseMapper.class,
extTestPlanLoadCaseMapper::selectPlanIds,
extTestPlanLoadCaseMapper::getIdsOrderByUpdateTime);
}
/**
* 用例自定义排序
* @param request
*/
public void updateOrder(ResetOrderRequest request) {
ServiceUtils.updateOrderField(request, TestPlanLoadCase.class,
testPlanLoadCaseMapper::selectByPrimaryKey,
extTestPlanLoadCaseMapper::getPreOrder,
extTestPlanLoadCaseMapper::getLastOrder,
testPlanLoadCaseMapper::updateByPrimaryKeySelective);
}
}

View File

@ -16,6 +16,7 @@ import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.constants.TestPlanTestCaseStatus;
import io.metersphere.commons.utils.ServiceUtils;
import io.metersphere.commons.utils.TestPlanUtils;
import io.metersphere.controller.request.ResetOrderRequest;
import io.metersphere.log.vo.OperatingLogDetails;
import io.metersphere.service.ProjectService;
import io.metersphere.track.dto.*;
@ -57,7 +58,7 @@ public class TestPlanScenarioCaseService {
public List<ApiScenarioDTO> list(TestPlanScenarioRequest request) {
request.setProjectId(null);
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
request.setOrders(ServiceUtils.getDefaultSortOrder(request.getOrders()));
List<ApiScenarioDTO> apiTestCases = extTestPlanScenarioCaseMapper.list(request);
if (CollectionUtils.isEmpty(apiTestCases)) {
return apiTestCases;
@ -101,7 +102,7 @@ public class TestPlanScenarioCaseService {
public List<String> selectIds(TestPlanScenarioRequest request) {
request.setProjectId(null);
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
request.setOrders(ServiceUtils.getDefaultSortOrder(request.getOrders()));
List<String> idList = extTestPlanScenarioCaseMapper.selectIds(request);
return idList;
}
@ -472,4 +473,23 @@ public class TestPlanScenarioCaseService {
public String getProjectIdById(String testPlanScenarioId) {
return extTestPlanScenarioCaseMapper.getProjectIdById(testPlanScenarioId);
}
public void initOrderField() {
ServiceUtils.initOrderField(TestPlanApiScenario.class, TestPlanApiScenarioMapper.class,
extTestPlanScenarioCaseMapper::selectPlanIds,
extTestPlanScenarioCaseMapper::getIdsOrderByUpdateTime);
}
/**
* 用例自定义排序
* @param request
*/
public void updateOrder(ResetOrderRequest request) {
ServiceUtils.updateOrderField(request, TestPlanApiScenario.class,
testPlanApiScenarioMapper::selectByPrimaryKey,
extTestPlanScenarioCaseMapper::getPreOrder,
extTestPlanScenarioCaseMapper::getLastOrder,
testPlanApiScenarioMapper::updateByPrimaryKeySelective);
}
}

View File

@ -476,7 +476,8 @@ public class TestPlanService {
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
TestPlanTestCaseMapper batchMapper = sqlSession.getMapper(TestPlanTestCaseMapper.class);
testCaseIds.forEach(caseId -> {
Long nextOrder = ServiceUtils.getNextOrder(request.getPlanId(), extTestPlanTestCaseMapper::getLastOrder);
for (String caseId : testCaseIds) {
TestPlanTestCaseWithBLOBs testPlanTestCase = new TestPlanTestCaseWithBLOBs();
testPlanTestCase.setId(UUID.randomUUID().toString());
testPlanTestCase.setCreateUser(SessionUtils.getUserId());
@ -486,8 +487,10 @@ public class TestPlanService {
testPlanTestCase.setUpdateTime(System.currentTimeMillis());
testPlanTestCase.setPlanId(request.getPlanId());
testPlanTestCase.setStatus(TestPlanStatus.Prepare.name());
testPlanTestCase.setOrder(nextOrder);
nextOrder += 5000;
batchMapper.insert(testPlanTestCase);
});
}
sqlSession.flushStatements();
//同步添加关联的接口和测试用例

View File

@ -9,6 +9,7 @@ import io.metersphere.commons.constants.TestPlanTestCaseStatus;
import io.metersphere.commons.user.SessionUser;
import io.metersphere.commons.utils.*;
import io.metersphere.controller.request.OrderRequest;
import io.metersphere.controller.request.ResetOrderRequest;
import io.metersphere.controller.request.member.QueryMemberRequest;
import io.metersphere.log.vo.DetailColumn;
import io.metersphere.log.vo.OperatingLogDetails;
@ -74,7 +75,7 @@ public class TestPlanTestCaseService {
}
public List<TestPlanCaseDTO> list(QueryTestPlanCaseRequest request) {
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
request.setOrders(ServiceUtils.getDefaultSortOrder(request.getOrders()));
List<TestPlanCaseDTO> list = extTestPlanTestCaseMapper.list(request);
QueryMemberRequest queryMemberRequest = new QueryMemberRequest();
queryMemberRequest.setProjectId(request.getProjectId());
@ -411,4 +412,22 @@ public class TestPlanTestCaseService {
});
return cases;
}
public void initOrderField() {
ServiceUtils.initOrderField(TestPlanTestCaseWithBLOBs.class, TestPlanTestCaseMapper.class,
extTestPlanTestCaseMapper::selectPlanIds,
extTestPlanTestCaseMapper::getIdsOrderByUpdateTime);
}
/**
* 用例自定义排序
* @param request
*/
public void updateOrder(ResetOrderRequest request) {
ServiceUtils.updateOrderField(request, TestPlanTestCaseWithBLOBs.class,
testPlanTestCaseMapper::selectByPrimaryKey,
extTestPlanTestCaseMapper::getPreOrder,
extTestPlanTestCaseMapper::getLastOrder,
testPlanTestCaseMapper::updateByPrimaryKeySelective);
}
}

View File

@ -39,4 +39,8 @@ ALTER TABLE test_case ADD `order` bigint(20) NOT NULL COMMENT '自定义排序
ALTER TABLE api_test_case ADD `order` bigint(20) NOT NULL COMMENT '自定义排序间隔5000';
ALTER TABLE api_scenario ADD `order` bigint(20) NOT NULL COMMENT '自定义排序间隔5000';
ALTER TABLE load_test ADD `order` bigint(20) NOT NULL COMMENT '自定义排序间隔5000';
ALTER TABLE api_definition ADD `order` bigint(20) NOT NULL COMMENT '自定义排序间隔5000';
ALTER TABLE test_plan_test_case ADD `order` bigint(20) NOT NULL COMMENT '自定义排序间隔5000';
ALTER TABLE test_plan_api_case ADD `order` bigint(20) NOT NULL COMMENT '自定义排序间隔5000';
ALTER TABLE test_plan_api_scenario ADD `order` bigint(20) NOT NULL COMMENT '自定义排序间隔5000';

View File

@ -601,7 +601,7 @@ export default {
this.$nextTick(() => {
handleRowDrop(this.tableData, (param) => {
param.projectId = this.condition.projectId;
param.groupId = this.condition.projectId;
editApiScenarioCaseOrder(param);
});

View File

@ -573,7 +573,7 @@ export default {
this.$nextTick(function () {
handleRowDrop(this.tableData, (param) => {
param.projectId = this.condition.projectId;
param.groupId = this.condition.projectId;
editApiTestCaseOrder(param);
});

View File

@ -17,6 +17,8 @@
:fields.sync="fields"
:table-is-loading="this.result.loading"
:field-key="tableHeaderKey"
:enable-order-drag="enableOrderDrag"
row-key="id"
ref="table">
<ms-table-column
prop="deleteTime"
@ -207,11 +209,12 @@ import CaseBatchMove from "@/business/components/api/definition/components/basis
import {
initCondition,
getCustomTableHeader, getCustomTableWidth, buildBatchParam, checkTableRowIsSelected,
saveLastTableSortField, getLastTableSortField
saveLastTableSortField, getLastTableSortField, handleRowDrop
} from "@/common/js/tableUtils";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
import {Body} from "@/business/components/api/definition/model/ApiTestModel";
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
import {editApiDefinitionOrder} from "@/network/api";
export default {
@ -248,6 +251,7 @@ export default {
selectApi: {},
result: {},
moduleId: "",
enableOrderDrag: true,
selectDataRange: "all",
deletePath: "/test/case/delete",
buttons: [
@ -498,6 +502,8 @@ export default {
this.condition.protocol = this.currentProtocol;
}
this.enableOrderDrag = (this.condition.orders && this.condition.orders.length) > 0 ? false : true;
//
this.getSelectDataRange();
this.condition.selectThisWeedData = false;
@ -537,6 +543,16 @@ export default {
});
checkTableRowIsSelected(this, this.$refs.table);
this.$nextTick(() => {
if (this.$refs.table) {
this.$refs.table.clear();
}
handleRowDrop(this.tableData, (param) => {
param.groupId = this.condition.projectId;
editApiDefinitionOrder(param);
});
})
});
}
if (this.needRefreshModule()) {

View File

@ -206,7 +206,7 @@ export default {
this.$nextTick(() => {
handleRowDrop(this.tableData, (param) => {
param.projectId = getCurrentProjectID();
param.groupId = getCurrentProjectID();
editLoadTestCaseOrder(param);
});
if (this.$refs.table) {

View File

@ -594,7 +594,7 @@ export default {
handleRowDrop() {
this.$nextTick(() => {
handleRowDrop(this.page.data, (param) => {
param.projectId = this.projectId;
param.groupId = this.projectId;
editTestCaseOrder(param);
});
});

View File

@ -25,6 +25,8 @@
:fields.sync="fields"
:field-key="tableHeaderKey"
@refresh="initTable"
:enable-order-drag="enableOrderDrag"
row-key="id"
ref="table">
<span v-for="(item) in fields" :key="item.key">
@ -172,7 +174,7 @@ import TestPlanApiCaseResult from "./TestPlanApiCaseResult";
import {TEST_PLAN_API_CASE} from "@/common/js/constants";
import {
buildBatchParam,
checkTableRowIsSelect, deepClone, getCustomTableHeader, getCustomTableWidth,
checkTableRowIsSelect, deepClone, getCustomTableHeader, getCustomTableWidth, handleRowDrop,
} from "@/common/js/tableUtils";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
@ -182,6 +184,7 @@ import MsTableColumn from "@/business/components/common/components/table/MsTable
import MsPlanRunMode from "@/business/components/track/plan/common/PlanRunModeWithEnv";
import MsUpdateTimeColumn from "@/business/components/common/components/table/MsUpdateTimeColumn";
import MsCreateTimeColumn from "@/business/components/common/components/table/MsCreateTimeColumn";
import {editTestPlanApiCaseOrder} from "@/network/test-plan";
export default {
name: "TestPlanApiCaseList",
@ -220,6 +223,7 @@ export default {
moduleId: "",
status: 'default',
deletePath: "/test/case/delete",
enableOrderDrag: true,
operators: [
{
tip: this.$t('api_test.run'), icon: "el-icon-video-play",
@ -361,6 +365,9 @@ export default {
if (this.currentProtocol != null) {
this.condition.protocol = this.currentProtocol;
}
this.enableOrderDrag = (this.condition.orders && this.condition.orders.length) > 0 ? false : true;
if (this.clickType) {
if (this.status == 'default') {
this.condition.status = this.clickType;
@ -379,6 +386,7 @@ export default {
item.tags = JSON.parse(item.tags);
}
});
if (this.$refs.table) {
this.$refs.table.clear();
setTimeout(this.$refs.table.doLayout, 200);
@ -405,9 +413,18 @@ export default {
checkTableRowIsSelect(this, this.condition, this.tableData, this.$refs.table, this.$refs.table.selectRows);
});
}
this.handleRowDrop();
});
}
},
handleRowDrop() {
this.$nextTick(() => {
handleRowDrop(this.tableData, (param) => {
param.groupId = this.planId;
editTestPlanApiCaseOrder(param);
});
});
},
search() {
this.initTable();
},

View File

@ -19,6 +19,8 @@
@handlePageChange="search"
:fields.sync="fields"
:field-key="tableHeaderKey"
:enable-order-drag="enableOrderDrag"
row-key="id"
@refresh="search"
ref="table">
<span v-for="(item) in fields" :key="item.key">
@ -179,7 +181,7 @@ import TestPlanScenarioListHeader from "./TestPlanScenarioListHeader";
import {
initCondition,
buildBatchParam,
checkTableRowIsSelect, getCustomTableHeader, getCustomTableWidth
checkTableRowIsSelect, getCustomTableHeader, getCustomTableWidth, handleRowDrop
} from "../../../../../../../common/js/tableUtils";
import {TEST_PLAN_SCENARIO_CASE} from "@/common/js/constants";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
@ -192,6 +194,7 @@ import MsTable from "@/business/components/common/components/table/MsTable";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
import MsUpdateTimeColumn from "@/business/components/common/components/table/MsUpdateTimeColumn";
import MsCreateTimeColumn from "@/business/components/common/components/table/MsCreateTimeColumn";
import {editTestPlanScenarioCaseOrder} from "@/network/test-plan";
export default {
name: "MsTestPlanApiScenarioList",
@ -248,6 +251,7 @@ export default {
runVisible: false,
runData: [],
...API_SCENARIO_FILTERS,
enableOrderDrag: true,
operators: [
{
tip: this.$t('api_test.run'), icon: "el-icon-video-play",
@ -313,6 +317,8 @@ export default {
}
this.status = 'all';
}
this.enableOrderDrag = (this.condition.orders && this.condition.orders.length) > 0 ? false : true;
if (this.planId) {
this.condition.planId = this.planId;
let url = "/test/plan/scenario/case/list/" + this.currentPage + "/" + this.pageSize;
@ -338,6 +344,13 @@ export default {
}
})
this.loading = false;
handleRowDrop(this.tableData, (param) => {
param.groupId = this.planId;
editTestPlanScenarioCaseOrder(param);
});
if (this.$refs.table) {
this.$refs.table.selectRows.clear();
setTimeout(this.$refs.table.doLayout, 200);

View File

@ -34,6 +34,8 @@
:fields.sync="fields"
:remember-order="true"
@refresh="initTableData"
:enable-order-drag="enableOrderDrag"
row-key="id"
ref="table">
<span v-for="item in fields" :key="item.key">
@ -269,13 +271,14 @@ import MsTag from "@/business/components/common/components/MsTag";
import {
buildBatchParam, checkTableRowIsSelected,
getCustomFieldValue, getCustomTableWidth, getLastTableSortField,
getTableHeaderWithCustomFields,
getTableHeaderWithCustomFields, handleRowDrop,
initCondition,
} from "@/common/js/tableUtils";
import MsTable from "@/business/components/common/components/table/MsTable";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
import {getProjectMember} from "@/network/user";
import {getTestTemplate} from "@/network/custom-field-template";
import {editTestPlanTestCaseOrder} from "@/network/test-plan";
export default {
name: "FunctionalTestCaseList",
@ -305,6 +308,7 @@ export default {
condition: {
components: TEST_CASE_CONFIGS
},
enableOrderDrag: true,
showMyTestCase: false,
tableData: [],
currentPage: 1,
@ -447,6 +451,8 @@ export default {
},
initTableData() {
initCondition(this.condition, this.condition.selectAll);
this.enableOrderDrag = this.condition.orders.length > 0 ? false : true;
this.autoCheckStatus();
if (this.planId) {
// param.planId = this.planId;
@ -480,6 +486,13 @@ export default {
this.$set(this.tableData[i], "issuesContent", JSON.parse(this.tableData[i].issues));
}
}
this.$nextTick(() => {
handleRowDrop(this.tableData, (param) => {
param.groupId = this.planId;
editTestPlanTestCaseOrder(param);
});
});
if (this.$refs.table) {
this.$refs.table.clear();
}

View File

@ -21,6 +21,8 @@
@handlePageChange="initTable"
:fields.sync="fields"
:field-key="tableHeaderKey"
:enable-order-drag="enableOrderDrag"
row-key="id"
@refresh="initTable"
ref="table">
<span v-for="(item) in fields" :key="item.key">
@ -123,7 +125,7 @@ import MsPerformanceTestStatus from "@/business/components/performance/test/Perf
import LoadCaseReport from "@/business/components/track/plan/view/comonents/load/LoadCaseReport";
import {
buildBatchParam,
checkTableRowIsSelect, getCustomTableHeader, getCustomTableWidth
checkTableRowIsSelect, getCustomTableHeader, getCustomTableWidth, handleRowDrop
} from "@/common/js/tableUtils";
import {TEST_PLAN_LOAD_CASE} from "@/common/js/constants";
import {getCurrentUser} from "@/common/js/utils";
@ -134,6 +136,7 @@ import MsTableColumn from "@/business/components/common/components/table/MsTable
import MsCreateTimeColumn from "@/business/components/common/components/table/MsCreateTimeColumn";
import MsUpdateTimeColumn from "@/business/components/common/components/table/MsUpdateTimeColumn";
import LoadCaseConfig from "@/business/components/track/plan/view/comonents/load/LoadCaseConfig";
import {editTestPlanLoadCaseOrder} from "@/network/test-plan";
export default {
name: "TestPlanLoadCaseList",
@ -163,6 +166,7 @@ export default {
status: 'default',
screenHeight: 'calc(100vh - 250px)',//
tableHeaderKey:"TEST_PLAN_LOAD_CASE",
enableOrderDrag: true,
fields: getCustomTableHeader('TEST_PLAN_LOAD_CASE'),
fieldsWidth: getCustomTableWidth('TEST_PLAN_LOAD_CASE'),
operators: [
@ -299,6 +303,8 @@ export default {
}
this.status = 'all';
}
this.enableOrderDrag = (this.condition.orders && this.condition.orders.length) > 0 ? false : true;
if (this.planId) {
this.condition.testPlanId = this.planId;
this.$post("/test/plan/load/case/list/" + this.currentPage + "/" + this.pageSize, this.condition, response => {
@ -306,6 +312,13 @@ export default {
let {itemCount, listObject} = data;
this.total = itemCount;
this.tableData = listObject;
this.$nextTick(() => {
handleRowDrop(this.tableData, (param) => {
param.groupId = this.planId;
editTestPlanLoadCaseOrder(param);
});
});
if (this.$refs.table) {
setTimeout(this.$refs.table.doLayout, 200);
this.$nextTick(() => {

View File

@ -24,6 +24,9 @@ export function getShareScenarioReport(shareId, reportId, callback) {
return reportId ? baseGet('/share/api/scenario/report/get/' + shareId + '/' + reportId, callback) : {};
}
export function editApiDefinitionOrder(request, callback) {
return basePost('/api/definition/edit/order', request, callback);
}
export function editApiTestCaseOrder(request, callback) {
return basePost('/api/testcase/edit/order', request, callback);

View File

@ -123,3 +123,19 @@ export function checkoutLoadReport(param, callback) {
export function shareCheckoutLoadReport(shareId, param, callback) {
return basePost('/share/test/plan/load/case/report/exist/' + shareId, param, callback);
}
export function editTestPlanTestCaseOrder(request, callback) {
return basePost('/test/plan/case/edit/order', request, callback);
}
export function editTestPlanApiCaseOrder(request, callback) {
return basePost('/test/plan/api/case/edit/order', request, callback);
}
export function editTestPlanScenarioCaseOrder(request, callback) {
return basePost('/test/plan/scenario/case/edit/order', request, callback);
}
export function editTestPlanLoadCaseOrder(request, callback) {
return basePost('/test/plan/load/case/edit/order', request, callback);
}