diff --git a/backend/src/main/java/io/metersphere/base/domain/LoadTest.java b/backend/src/main/java/io/metersphere/base/domain/LoadTest.java index 5bc027979d..c9d88025fd 100644 --- a/backend/src/main/java/io/metersphere/base/domain/LoadTest.java +++ b/backend/src/main/java/io/metersphere/base/domain/LoadTest.java @@ -33,5 +33,7 @@ public class LoadTest implements Serializable { private String followPeople; + private Long order; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/LoadTestExample.java b/backend/src/main/java/io/metersphere/base/domain/LoadTestExample.java index 10b63d049e..85e943d83a 100644 --- a/backend/src/main/java/io/metersphere/base/domain/LoadTestExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/LoadTestExample.java @@ -1043,6 +1043,66 @@ public class LoadTestExample { 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 values) { + addCriterion("`order` in", values, "order"); + return (Criteria) this; + } + + public Criteria andOrderNotIn(List 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 { diff --git a/backend/src/main/java/io/metersphere/base/mapper/LoadTestMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/LoadTestMapper.xml index 5d3d83c072..265b074580 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/LoadTestMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/LoadTestMapper.xml @@ -16,6 +16,7 @@ + @@ -81,7 +82,7 @@ id, project_id, `name`, description, create_time, update_time, `status`, test_resource_pool_id, - user_id, num, create_user, scenario_version, scenario_id, follow_people + user_id, num, create_user, scenario_version, scenario_id, follow_people, `order` load_configuration, advanced_configuration @@ -139,14 +140,16 @@ description, create_time, update_time, `status`, test_resource_pool_id, user_id, num, create_user, scenario_version, - scenario_id, follow_people, load_configuration, - advanced_configuration) + scenario_id, follow_people, `order`, + load_configuration, advanced_configuration + ) values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR}, #{testResourcePoolId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, #{createUser,jdbcType=VARCHAR}, #{scenarioVersion,jdbcType=INTEGER}, - #{scenarioId,jdbcType=VARCHAR}, #{followPeople,jdbcType=VARCHAR}, #{loadConfiguration,jdbcType=LONGVARCHAR}, - #{advancedConfiguration,jdbcType=LONGVARCHAR}) + #{scenarioId,jdbcType=VARCHAR}, #{followPeople,jdbcType=VARCHAR}, #{order,jdbcType=BIGINT}, + #{loadConfiguration,jdbcType=LONGVARCHAR}, #{advancedConfiguration,jdbcType=LONGVARCHAR} + ) insert into load_test @@ -193,6 +196,9 @@ follow_people, + + `order`, + load_configuration, @@ -243,6 +249,9 @@ #{followPeople,jdbcType=VARCHAR}, + + #{order,jdbcType=BIGINT}, + #{loadConfiguration,jdbcType=LONGVARCHAR}, @@ -302,6 +311,9 @@ follow_people = #{record.followPeople,jdbcType=VARCHAR}, + + `order` = #{record.order,jdbcType=BIGINT}, + load_configuration = #{record.loadConfiguration,jdbcType=LONGVARCHAR}, @@ -329,6 +341,7 @@ scenario_version = #{record.scenarioVersion,jdbcType=INTEGER}, scenario_id = #{record.scenarioId,jdbcType=VARCHAR}, follow_people = #{record.followPeople,jdbcType=VARCHAR}, + `order` = #{record.order,jdbcType=BIGINT}, load_configuration = #{record.loadConfiguration,jdbcType=LONGVARCHAR}, advanced_configuration = #{record.advancedConfiguration,jdbcType=LONGVARCHAR} @@ -350,7 +363,8 @@ create_user = #{record.createUser,jdbcType=VARCHAR}, scenario_version = #{record.scenarioVersion,jdbcType=INTEGER}, scenario_id = #{record.scenarioId,jdbcType=VARCHAR}, - follow_people = #{record.followPeople,jdbcType=VARCHAR} + follow_people = #{record.followPeople,jdbcType=VARCHAR}, + `order` = #{record.order,jdbcType=BIGINT} @@ -397,6 +411,9 @@ follow_people = #{followPeople,jdbcType=VARCHAR}, + + `order` = #{order,jdbcType=BIGINT}, + load_configuration = #{loadConfiguration,jdbcType=LONGVARCHAR}, @@ -421,6 +438,7 @@ scenario_version = #{scenarioVersion,jdbcType=INTEGER}, scenario_id = #{scenarioId,jdbcType=VARCHAR}, follow_people = #{followPeople,jdbcType=VARCHAR}, + `order` = #{order,jdbcType=BIGINT}, load_configuration = #{loadConfiguration,jdbcType=LONGVARCHAR}, advanced_configuration = #{advancedConfiguration,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=VARCHAR} @@ -439,7 +457,8 @@ create_user = #{createUser,jdbcType=VARCHAR}, scenario_version = #{scenarioVersion,jdbcType=INTEGER}, scenario_id = #{scenarioId,jdbcType=VARCHAR}, - follow_people = #{followPeople,jdbcType=VARCHAR} + follow_people = #{followPeople,jdbcType=VARCHAR}, + `order` = #{order,jdbcType=BIGINT} where id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java index 794382bb4f..ea3627f472 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java @@ -22,4 +22,11 @@ public interface ExtLoadTestMapper { List getProjectFiles(@Param("projectId") String projectId, @Param("loadTypes") List loadType, @Param("request") QueryProjectFileRequest request); + List selectProjectIds(); + + List getIdsOrderByCreateTime(@Param("projectId") String projectId); + + Long getPreOrder(@Param("projectId")String projectId, @Param("baseOrder") Long baseOrder); + + Long getLastOrder(@Param("projectId")String projectId, @Param("baseOrder") Long baseOrder); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml index e058c5c8fa..fa50404ab3 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml @@ -156,4 +156,27 @@ order by update_time DESC - \ No newline at end of file + + + + + + + + diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml index 854ba95a67..a415c31d68 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml @@ -119,6 +119,7 @@ +