refactor: 测试用例关注人多选

This commit is contained in:
CaptainB 2021-10-24 12:05:20 +08:00 committed by 刘瑞斌
parent 0b8bd15baa
commit 06b7c6a2d8
11 changed files with 383 additions and 328 deletions

View File

@ -9,8 +9,6 @@ public class TestCase implements Serializable {
private String nodeId;
private String testId;
private String nodePath;
private String projectId;
@ -29,6 +27,8 @@ public class TestCase implements Serializable {
private Long updateTime;
private String testId;
private Integer sort;
private Integer num;
@ -43,14 +43,12 @@ public class TestCase implements Serializable {
private String demandName;
private String followPeople;
private String status;
private String stepModel;
private String customNum;
private String stepModel;
private String createUser;
private String originalStatus;
@ -61,5 +59,7 @@ public class TestCase implements Serializable {
private Long order;
private String demandPlatform;
private static final long serialVersionUID = 1L;
}

View File

@ -244,76 +244,6 @@ public class TestCaseExample {
return (Criteria) this;
}
public Criteria andTestIdIsNull() {
addCriterion("test_id is null");
return (Criteria) this;
}
public Criteria andTestIdIsNotNull() {
addCriterion("test_id is not null");
return (Criteria) this;
}
public Criteria andTestIdEqualTo(String value) {
addCriterion("test_id =", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotEqualTo(String value) {
addCriterion("test_id <>", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdGreaterThan(String value) {
addCriterion("test_id >", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdGreaterThanOrEqualTo(String value) {
addCriterion("test_id >=", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLessThan(String value) {
addCriterion("test_id <", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLessThanOrEqualTo(String value) {
addCriterion("test_id <=", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLike(String value) {
addCriterion("test_id like", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotLike(String value) {
addCriterion("test_id not like", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdIn(List<String> values) {
addCriterion("test_id in", values, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotIn(List<String> values) {
addCriterion("test_id not in", values, "testId");
return (Criteria) this;
}
public Criteria andTestIdBetween(String value1, String value2) {
addCriterion("test_id between", value1, value2, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotBetween(String value1, String value2) {
addCriterion("test_id not between", value1, value2, "testId");
return (Criteria) this;
}
public Criteria andNodePathIsNull() {
addCriterion("node_path is null");
return (Criteria) this;
@ -924,6 +854,76 @@ public class TestCaseExample {
return (Criteria) this;
}
public Criteria andTestIdIsNull() {
addCriterion("test_id is null");
return (Criteria) this;
}
public Criteria andTestIdIsNotNull() {
addCriterion("test_id is not null");
return (Criteria) this;
}
public Criteria andTestIdEqualTo(String value) {
addCriterion("test_id =", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotEqualTo(String value) {
addCriterion("test_id <>", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdGreaterThan(String value) {
addCriterion("test_id >", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdGreaterThanOrEqualTo(String value) {
addCriterion("test_id >=", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLessThan(String value) {
addCriterion("test_id <", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLessThanOrEqualTo(String value) {
addCriterion("test_id <=", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLike(String value) {
addCriterion("test_id like", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotLike(String value) {
addCriterion("test_id not like", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdIn(List<String> values) {
addCriterion("test_id in", values, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotIn(List<String> values) {
addCriterion("test_id not in", values, "testId");
return (Criteria) this;
}
public Criteria andTestIdBetween(String value1, String value2) {
addCriterion("test_id between", value1, value2, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotBetween(String value1, String value2) {
addCriterion("test_id not between", value1, value2, "testId");
return (Criteria) this;
}
public Criteria andSortIsNull() {
addCriterion("sort is null");
return (Criteria) this;
@ -1394,76 +1394,6 @@ public class TestCaseExample {
return (Criteria) this;
}
public Criteria andFollowPeopleIsNull() {
addCriterion("follow_people is null");
return (Criteria) this;
}
public Criteria andFollowPeopleIsNotNull() {
addCriterion("follow_people is not null");
return (Criteria) this;
}
public Criteria andFollowPeopleEqualTo(String value) {
addCriterion("follow_people =", value, "followPeople");
return (Criteria) this;
}
public Criteria andFollowPeopleNotEqualTo(String value) {
addCriterion("follow_people <>", value, "followPeople");
return (Criteria) this;
}
public Criteria andFollowPeopleGreaterThan(String value) {
addCriterion("follow_people >", value, "followPeople");
return (Criteria) this;
}
public Criteria andFollowPeopleGreaterThanOrEqualTo(String value) {
addCriterion("follow_people >=", value, "followPeople");
return (Criteria) this;
}
public Criteria andFollowPeopleLessThan(String value) {
addCriterion("follow_people <", value, "followPeople");
return (Criteria) this;
}
public Criteria andFollowPeopleLessThanOrEqualTo(String value) {
addCriterion("follow_people <=", value, "followPeople");
return (Criteria) this;
}
public Criteria andFollowPeopleLike(String value) {
addCriterion("follow_people like", value, "followPeople");
return (Criteria) this;
}
public Criteria andFollowPeopleNotLike(String value) {
addCriterion("follow_people not like", value, "followPeople");
return (Criteria) this;
}
public Criteria andFollowPeopleIn(List<String> values) {
addCriterion("follow_people in", values, "followPeople");
return (Criteria) this;
}
public Criteria andFollowPeopleNotIn(List<String> values) {
addCriterion("follow_people not in", values, "followPeople");
return (Criteria) this;
}
public Criteria andFollowPeopleBetween(String value1, String value2) {
addCriterion("follow_people between", value1, value2, "followPeople");
return (Criteria) this;
}
public Criteria andFollowPeopleNotBetween(String value1, String value2) {
addCriterion("follow_people not between", value1, value2, "followPeople");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
@ -1534,76 +1464,6 @@ public class TestCaseExample {
return (Criteria) this;
}
public Criteria andStepModelIsNull() {
addCriterion("step_model is null");
return (Criteria) this;
}
public Criteria andStepModelIsNotNull() {
addCriterion("step_model is not null");
return (Criteria) this;
}
public Criteria andStepModelEqualTo(String value) {
addCriterion("step_model =", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelNotEqualTo(String value) {
addCriterion("step_model <>", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelGreaterThan(String value) {
addCriterion("step_model >", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelGreaterThanOrEqualTo(String value) {
addCriterion("step_model >=", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelLessThan(String value) {
addCriterion("step_model <", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelLessThanOrEqualTo(String value) {
addCriterion("step_model <=", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelLike(String value) {
addCriterion("step_model like", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelNotLike(String value) {
addCriterion("step_model not like", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelIn(List<String> values) {
addCriterion("step_model in", values, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelNotIn(List<String> values) {
addCriterion("step_model not in", values, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelBetween(String value1, String value2) {
addCriterion("step_model between", value1, value2, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelNotBetween(String value1, String value2) {
addCriterion("step_model not between", value1, value2, "stepModel");
return (Criteria) this;
}
public Criteria andCustomNumIsNull() {
addCriterion("custom_num is null");
return (Criteria) this;
@ -1674,6 +1534,76 @@ public class TestCaseExample {
return (Criteria) this;
}
public Criteria andStepModelIsNull() {
addCriterion("step_model is null");
return (Criteria) this;
}
public Criteria andStepModelIsNotNull() {
addCriterion("step_model is not null");
return (Criteria) this;
}
public Criteria andStepModelEqualTo(String value) {
addCriterion("step_model =", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelNotEqualTo(String value) {
addCriterion("step_model <>", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelGreaterThan(String value) {
addCriterion("step_model >", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelGreaterThanOrEqualTo(String value) {
addCriterion("step_model >=", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelLessThan(String value) {
addCriterion("step_model <", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelLessThanOrEqualTo(String value) {
addCriterion("step_model <=", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelLike(String value) {
addCriterion("step_model like", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelNotLike(String value) {
addCriterion("step_model not like", value, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelIn(List<String> values) {
addCriterion("step_model in", values, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelNotIn(List<String> values) {
addCriterion("step_model not in", values, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelBetween(String value1, String value2) {
addCriterion("step_model between", value1, value2, "stepModel");
return (Criteria) this;
}
public Criteria andStepModelNotBetween(String value1, String value2) {
addCriterion("step_model not between", value1, value2, "stepModel");
return (Criteria) this;
}
public Criteria andCreateUserIsNull() {
addCriterion("create_user is null");
return (Criteria) this;
@ -2003,6 +1933,76 @@ public class TestCaseExample {
addCriterion("`order` not between", value1, value2, "order");
return (Criteria) this;
}
public Criteria andDemandPlatformIsNull() {
addCriterion("demand_platform is null");
return (Criteria) this;
}
public Criteria andDemandPlatformIsNotNull() {
addCriterion("demand_platform is not null");
return (Criteria) this;
}
public Criteria andDemandPlatformEqualTo(String value) {
addCriterion("demand_platform =", value, "demandPlatform");
return (Criteria) this;
}
public Criteria andDemandPlatformNotEqualTo(String value) {
addCriterion("demand_platform <>", value, "demandPlatform");
return (Criteria) this;
}
public Criteria andDemandPlatformGreaterThan(String value) {
addCriterion("demand_platform >", value, "demandPlatform");
return (Criteria) this;
}
public Criteria andDemandPlatformGreaterThanOrEqualTo(String value) {
addCriterion("demand_platform >=", value, "demandPlatform");
return (Criteria) this;
}
public Criteria andDemandPlatformLessThan(String value) {
addCriterion("demand_platform <", value, "demandPlatform");
return (Criteria) this;
}
public Criteria andDemandPlatformLessThanOrEqualTo(String value) {
addCriterion("demand_platform <=", value, "demandPlatform");
return (Criteria) this;
}
public Criteria andDemandPlatformLike(String value) {
addCriterion("demand_platform like", value, "demandPlatform");
return (Criteria) this;
}
public Criteria andDemandPlatformNotLike(String value) {
addCriterion("demand_platform not like", value, "demandPlatform");
return (Criteria) this;
}
public Criteria andDemandPlatformIn(List<String> values) {
addCriterion("demand_platform in", values, "demandPlatform");
return (Criteria) this;
}
public Criteria andDemandPlatformNotIn(List<String> values) {
addCriterion("demand_platform not in", values, "demandPlatform");
return (Criteria) this;
}
public Criteria andDemandPlatformBetween(String value1, String value2) {
addCriterion("demand_platform between", value1, value2, "demandPlatform");
return (Criteria) this;
}
public Criteria andDemandPlatformNotBetween(String value1, String value2) {
addCriterion("demand_platform not between", value1, value2, "demandPlatform");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -4,7 +4,6 @@
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestCase">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="node_id" jdbcType="VARCHAR" property="nodeId" />
<result column="test_id" jdbcType="VARCHAR" property="testId" />
<result column="node_path" jdbcType="VARCHAR" property="nodePath" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
@ -14,6 +13,7 @@
<result column="method" jdbcType="VARCHAR" property="method" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="test_id" jdbcType="VARCHAR" property="testId" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="num" jdbcType="INTEGER" property="num" />
<result column="other_test_name" jdbcType="VARCHAR" property="otherTestName" />
@ -21,15 +21,15 @@
<result column="tags" jdbcType="VARCHAR" property="tags" />
<result column="demand_id" jdbcType="VARCHAR" property="demandId" />
<result column="demand_name" jdbcType="VARCHAR" property="demandName" />
<result column="follow_people" jdbcType="VARCHAR" property="followPeople" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="step_model" jdbcType="VARCHAR" property="stepModel" />
<result column="custom_num" jdbcType="VARCHAR" property="customNum" />
<result column="step_model" jdbcType="VARCHAR" property="stepModel" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="original_status" jdbcType="VARCHAR" property="originalStatus" />
<result column="delete_time" jdbcType="BIGINT" property="deleteTime" />
<result column="delete_user_id" jdbcType="VARCHAR" property="deleteUserId" />
<result column="order" jdbcType="BIGINT" property="order" />
<result column="demand_platform" jdbcType="VARCHAR" property="demandPlatform" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestCaseWithBLOBs">
<result column="prerequisite" jdbcType="LONGVARCHAR" property="prerequisite" />
@ -98,10 +98,10 @@
</where>
</sql>
<sql id="Base_Column_List">
id, node_id, test_id, node_path, project_id, `name`, `type`, maintainer, priority,
`method`, create_time, update_time, sort, num, other_test_name, review_status, tags,
demand_id, demand_name, follow_people, `status`, step_model, custom_num, create_user,
original_status, delete_time, delete_user_id, `order`
id, node_id, node_path, project_id, `name`, `type`, maintainer, priority, `method`,
create_time, update_time, test_id, sort, num, other_test_name, review_status, tags,
demand_id, demand_name, `status`, custom_num, step_model, create_user, original_status,
delete_time, delete_user_id, `order`, demand_platform
</sql>
<sql id="Blob_Column_List">
prerequisite, remark, steps, step_description, expected_result, custom_fields
@ -155,28 +155,28 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
insert into test_case (id, node_id, test_id,
node_path, project_id, `name`,
`type`, maintainer, priority,
`method`, create_time, update_time,
insert into test_case (id, node_id, node_path,
project_id, `name`, `type`,
maintainer, priority, `method`,
create_time, update_time, test_id,
sort, num, other_test_name,
review_status, tags, demand_id,
demand_name, follow_people, `status`,
step_model, custom_num, create_user,
original_status, delete_time, delete_user_id,
`order`, prerequisite, remark,
demand_name, `status`, custom_num,
step_model, create_user, original_status,
delete_time, delete_user_id, `order`,
demand_platform, prerequisite, remark,
steps, step_description, expected_result,
custom_fields)
values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR},
#{nodePath,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{type,jdbcType=VARCHAR}, #{maintainer,jdbcType=VARCHAR}, #{priority,jdbcType=VARCHAR},
#{method,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=VARCHAR}, #{nodePath,jdbcType=VARCHAR},
#{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{maintainer,jdbcType=VARCHAR}, #{priority,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{testId,jdbcType=VARCHAR},
#{sort,jdbcType=INTEGER}, #{num,jdbcType=INTEGER}, #{otherTestName,jdbcType=VARCHAR},
#{reviewStatus,jdbcType=VARCHAR}, #{tags,jdbcType=VARCHAR}, #{demandId,jdbcType=VARCHAR},
#{demandName,jdbcType=VARCHAR}, #{followPeople,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{stepModel,jdbcType=VARCHAR}, #{customNum,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
#{originalStatus,jdbcType=VARCHAR}, #{deleteTime,jdbcType=BIGINT}, #{deleteUserId,jdbcType=VARCHAR},
#{order,jdbcType=BIGINT}, #{prerequisite,jdbcType=LONGVARCHAR}, #{remark,jdbcType=LONGVARCHAR},
#{demandName,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{customNum,jdbcType=VARCHAR},
#{stepModel,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{originalStatus,jdbcType=VARCHAR},
#{deleteTime,jdbcType=BIGINT}, #{deleteUserId,jdbcType=VARCHAR}, #{order,jdbcType=BIGINT},
#{demandPlatform,jdbcType=VARCHAR}, #{prerequisite,jdbcType=LONGVARCHAR}, #{remark,jdbcType=LONGVARCHAR},
#{steps,jdbcType=LONGVARCHAR}, #{stepDescription,jdbcType=LONGVARCHAR}, #{expectedResult,jdbcType=LONGVARCHAR},
#{customFields,jdbcType=LONGVARCHAR})
</insert>
@ -189,9 +189,6 @@
<if test="nodeId != null">
node_id,
</if>
<if test="testId != null">
test_id,
</if>
<if test="nodePath != null">
node_path,
</if>
@ -219,6 +216,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="testId != null">
test_id,
</if>
<if test="sort != null">
sort,
</if>
@ -240,18 +240,15 @@
<if test="demandName != null">
demand_name,
</if>
<if test="followPeople != null">
follow_people,
</if>
<if test="status != null">
`status`,
</if>
<if test="stepModel != null">
step_model,
</if>
<if test="customNum != null">
custom_num,
</if>
<if test="stepModel != null">
step_model,
</if>
<if test="createUser != null">
create_user,
</if>
@ -267,6 +264,9 @@
<if test="order != null">
`order`,
</if>
<if test="demandPlatform != null">
demand_platform,
</if>
<if test="prerequisite != null">
prerequisite,
</if>
@ -293,9 +293,6 @@
<if test="nodeId != null">
#{nodeId,jdbcType=VARCHAR},
</if>
<if test="testId != null">
#{testId,jdbcType=VARCHAR},
</if>
<if test="nodePath != null">
#{nodePath,jdbcType=VARCHAR},
</if>
@ -323,6 +320,9 @@
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="testId != null">
#{testId,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
@ -344,18 +344,15 @@
<if test="demandName != null">
#{demandName,jdbcType=VARCHAR},
</if>
<if test="followPeople != null">
#{followPeople,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="stepModel != null">
#{stepModel,jdbcType=VARCHAR},
</if>
<if test="customNum != null">
#{customNum,jdbcType=VARCHAR},
</if>
<if test="stepModel != null">
#{stepModel,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
@ -371,6 +368,9 @@
<if test="order != null">
#{order,jdbcType=BIGINT},
</if>
<if test="demandPlatform != null">
#{demandPlatform,jdbcType=VARCHAR},
</if>
<if test="prerequisite != null">
#{prerequisite,jdbcType=LONGVARCHAR},
</if>
@ -406,9 +406,6 @@
<if test="record.nodeId != null">
node_id = #{record.nodeId,jdbcType=VARCHAR},
</if>
<if test="record.testId != null">
test_id = #{record.testId,jdbcType=VARCHAR},
</if>
<if test="record.nodePath != null">
node_path = #{record.nodePath,jdbcType=VARCHAR},
</if>
@ -436,6 +433,9 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.testId != null">
test_id = #{record.testId,jdbcType=VARCHAR},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
@ -457,18 +457,15 @@
<if test="record.demandName != null">
demand_name = #{record.demandName,jdbcType=VARCHAR},
</if>
<if test="record.followPeople != null">
follow_people = #{record.followPeople,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.stepModel != null">
step_model = #{record.stepModel,jdbcType=VARCHAR},
</if>
<if test="record.customNum != null">
custom_num = #{record.customNum,jdbcType=VARCHAR},
</if>
<if test="record.stepModel != null">
step_model = #{record.stepModel,jdbcType=VARCHAR},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
@ -484,6 +481,9 @@
<if test="record.order != null">
`order` = #{record.order,jdbcType=BIGINT},
</if>
<if test="record.demandPlatform != null">
demand_platform = #{record.demandPlatform,jdbcType=VARCHAR},
</if>
<if test="record.prerequisite != null">
prerequisite = #{record.prerequisite,jdbcType=LONGVARCHAR},
</if>
@ -511,7 +511,6 @@
update test_case
set id = #{record.id,jdbcType=VARCHAR},
node_id = #{record.nodeId,jdbcType=VARCHAR},
test_id = #{record.testId,jdbcType=VARCHAR},
node_path = #{record.nodePath,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
@ -521,6 +520,7 @@
`method` = #{record.method,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
test_id = #{record.testId,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=INTEGER},
num = #{record.num,jdbcType=INTEGER},
other_test_name = #{record.otherTestName,jdbcType=VARCHAR},
@ -528,15 +528,15 @@
tags = #{record.tags,jdbcType=VARCHAR},
demand_id = #{record.demandId,jdbcType=VARCHAR},
demand_name = #{record.demandName,jdbcType=VARCHAR},
follow_people = #{record.followPeople,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
step_model = #{record.stepModel,jdbcType=VARCHAR},
custom_num = #{record.customNum,jdbcType=VARCHAR},
step_model = #{record.stepModel,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR},
original_status = #{record.originalStatus,jdbcType=VARCHAR},
delete_time = #{record.deleteTime,jdbcType=BIGINT},
delete_user_id = #{record.deleteUserId,jdbcType=VARCHAR},
`order` = #{record.order,jdbcType=BIGINT},
demand_platform = #{record.demandPlatform,jdbcType=VARCHAR},
prerequisite = #{record.prerequisite,jdbcType=LONGVARCHAR},
remark = #{record.remark,jdbcType=LONGVARCHAR},
steps = #{record.steps,jdbcType=LONGVARCHAR},
@ -551,7 +551,6 @@
update test_case
set id = #{record.id,jdbcType=VARCHAR},
node_id = #{record.nodeId,jdbcType=VARCHAR},
test_id = #{record.testId,jdbcType=VARCHAR},
node_path = #{record.nodePath,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
@ -561,6 +560,7 @@
`method` = #{record.method,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
test_id = #{record.testId,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=INTEGER},
num = #{record.num,jdbcType=INTEGER},
other_test_name = #{record.otherTestName,jdbcType=VARCHAR},
@ -568,15 +568,15 @@
tags = #{record.tags,jdbcType=VARCHAR},
demand_id = #{record.demandId,jdbcType=VARCHAR},
demand_name = #{record.demandName,jdbcType=VARCHAR},
follow_people = #{record.followPeople,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
step_model = #{record.stepModel,jdbcType=VARCHAR},
custom_num = #{record.customNum,jdbcType=VARCHAR},
step_model = #{record.stepModel,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR},
original_status = #{record.originalStatus,jdbcType=VARCHAR},
delete_time = #{record.deleteTime,jdbcType=BIGINT},
delete_user_id = #{record.deleteUserId,jdbcType=VARCHAR},
`order` = #{record.order,jdbcType=BIGINT}
`order` = #{record.order,jdbcType=BIGINT},
demand_platform = #{record.demandPlatform,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -587,9 +587,6 @@
<if test="nodeId != null">
node_id = #{nodeId,jdbcType=VARCHAR},
</if>
<if test="testId != null">
test_id = #{testId,jdbcType=VARCHAR},
</if>
<if test="nodePath != null">
node_path = #{nodePath,jdbcType=VARCHAR},
</if>
@ -617,6 +614,9 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="testId != null">
test_id = #{testId,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
@ -638,18 +638,15 @@
<if test="demandName != null">
demand_name = #{demandName,jdbcType=VARCHAR},
</if>
<if test="followPeople != null">
follow_people = #{followPeople,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="stepModel != null">
step_model = #{stepModel,jdbcType=VARCHAR},
</if>
<if test="customNum != null">
custom_num = #{customNum,jdbcType=VARCHAR},
</if>
<if test="stepModel != null">
step_model = #{stepModel,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
@ -665,6 +662,9 @@
<if test="order != null">
`order` = #{order,jdbcType=BIGINT},
</if>
<if test="demandPlatform != null">
demand_platform = #{demandPlatform,jdbcType=VARCHAR},
</if>
<if test="prerequisite != null">
prerequisite = #{prerequisite,jdbcType=LONGVARCHAR},
</if>
@ -689,7 +689,6 @@
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
update test_case
set node_id = #{nodeId,jdbcType=VARCHAR},
test_id = #{testId,jdbcType=VARCHAR},
node_path = #{nodePath,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
@ -699,6 +698,7 @@
`method` = #{method,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
test_id = #{testId,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
num = #{num,jdbcType=INTEGER},
other_test_name = #{otherTestName,jdbcType=VARCHAR},
@ -706,15 +706,15 @@
tags = #{tags,jdbcType=VARCHAR},
demand_id = #{demandId,jdbcType=VARCHAR},
demand_name = #{demandName,jdbcType=VARCHAR},
follow_people = #{followPeople,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
step_model = #{stepModel,jdbcType=VARCHAR},
custom_num = #{customNum,jdbcType=VARCHAR},
step_model = #{stepModel,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR},
original_status = #{originalStatus,jdbcType=VARCHAR},
delete_time = #{deleteTime,jdbcType=BIGINT},
delete_user_id = #{deleteUserId,jdbcType=VARCHAR},
`order` = #{order,jdbcType=BIGINT},
demand_platform = #{demandPlatform,jdbcType=VARCHAR},
prerequisite = #{prerequisite,jdbcType=LONGVARCHAR},
remark = #{remark,jdbcType=LONGVARCHAR},
steps = #{steps,jdbcType=LONGVARCHAR},
@ -726,7 +726,6 @@
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCase">
update test_case
set node_id = #{nodeId,jdbcType=VARCHAR},
test_id = #{testId,jdbcType=VARCHAR},
node_path = #{nodePath,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
@ -736,6 +735,7 @@
`method` = #{method,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
test_id = #{testId,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
num = #{num,jdbcType=INTEGER},
other_test_name = #{otherTestName,jdbcType=VARCHAR},
@ -743,15 +743,15 @@
tags = #{tags,jdbcType=VARCHAR},
demand_id = #{demandId,jdbcType=VARCHAR},
demand_name = #{demandName,jdbcType=VARCHAR},
follow_people = #{followPeople,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
step_model = #{stepModel,jdbcType=VARCHAR},
custom_num = #{customNum,jdbcType=VARCHAR},
step_model = #{stepModel,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR},
original_status = #{originalStatus,jdbcType=VARCHAR},
delete_time = #{deleteTime,jdbcType=BIGINT},
delete_user_id = #{deleteUserId,jdbcType=VARCHAR},
`order` = #{order,jdbcType=BIGINT}
`order` = #{order,jdbcType=BIGINT},
demand_platform = #{demandPlatform,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -5,7 +5,6 @@ import com.github.pagehelper.PageHelper;
import io.metersphere.base.domain.FileMetadata;
import io.metersphere.base.domain.LoadTest;
import io.metersphere.base.domain.Schedule;
import io.metersphere.base.domain.User;
import io.metersphere.commons.constants.NoticeConstants;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.PermissionConstants;

View File

@ -336,9 +336,9 @@ public class TestCaseController {
@PostMapping("/save")
@MsAuditLog(module = "track_test_case", type = OperLogConstants.CREATE, title = "#testCaseWithBLOBs.name", content = "#msClass.getLogDetails(#testCaseWithBLOBs.id)", msClass = TestCaseService.class)
public TestCaseWithBLOBs saveTestCase(@RequestBody TestCaseWithBLOBs testCaseWithBLOBs) {
testCaseWithBLOBs.setId(UUID.randomUUID().toString());
return testCaseService.addTestCase(testCaseWithBLOBs);
public TestCaseWithBLOBs saveTestCase(@RequestBody EditTestCaseRequest request) {
request.setId(UUID.randomUUID().toString());
return testCaseService.addTestCase(request);
}
@PostMapping("/minder/edit")
@ -347,4 +347,9 @@ public class TestCaseController {
public void minderEdit(@RequestBody TestCaseMinderEditRequest request) {
testCaseService.minderEdit(request);
}
@GetMapping("/follow/{caseId}")
public List<String> getFollows(@PathVariable String caseId) {
return testCaseService.getFollows(caseId);
}
}

View File

@ -12,6 +12,7 @@ import java.util.List;
@Setter
public class EditTestCaseRequest extends TestCaseWithBLOBs {
private List<FileMetadata> updatedFileList;
private List<String> follows;
/**
* 复制测试用例后要进行复制的文件Id list
*/

View File

@ -140,6 +140,8 @@ public class TestCaseService {
@Resource
@Lazy
private PerformanceTestService performanceTestService;
@Resource
private TestCaseFollowMapper testCaseFollowMapper;
private void setNode(TestCaseWithBLOBs testCase) {
if (StringUtils.isEmpty(testCase.getNodeId()) || "default-module".equals(testCase.getNodeId())) {
@ -153,25 +155,40 @@ public class TestCaseService {
}
}
public TestCaseWithBLOBs addTestCase(TestCaseWithBLOBs testCase) {
testCase.setName(testCase.getName());
checkTestCaseExist(testCase);
testCase.setId(testCase.getId());
testCase.setCreateTime(System.currentTimeMillis());
testCase.setUpdateTime(System.currentTimeMillis());
checkTestCustomNum(testCase);
testCase.setNum(getNextNum(testCase.getProjectId()));
if (StringUtils.isBlank(testCase.getCustomNum())) {
testCase.setCustomNum(testCase.getNum().toString());
public TestCaseWithBLOBs addTestCase(EditTestCaseRequest request) {
request.setName(request.getName());
checkTestCaseExist(request);
request.setId(request.getId());
request.setCreateTime(System.currentTimeMillis());
request.setUpdateTime(System.currentTimeMillis());
checkTestCustomNum(request);
request.setNum(getNextNum(request.getProjectId()));
if (StringUtils.isBlank(request.getCustomNum())) {
request.setCustomNum(request.getNum().toString());
}
request.setReviewStatus(TestCaseReviewStatus.Prepare.name());
request.setDemandId(request.getDemandId());
request.setDemandName(request.getDemandName());
request.setCreateUser(SessionUtils.getUserId());
this.setNode(request);
request.setOrder(ServiceUtils.getNextOrder(request.getProjectId(), extTestCaseMapper::getLastOrder));
testCaseMapper.insert(request);
saveFollows(request.getId(), request.getFollows());
return request;
}
private void saveFollows(String caseId, List<String> follows) {
TestCaseFollowExample example = new TestCaseFollowExample();
example.createCriteria().andCaseIdEqualTo(caseId);
testCaseFollowMapper.deleteByExample(example);
if (!CollectionUtils.isEmpty(follows)) {
for (String follow : follows) {
TestCaseFollow caseFollow = new TestCaseFollow();
caseFollow.setCaseId(caseId);
caseFollow.setFollowId(follow);
testCaseFollowMapper.insert(caseFollow);
}
}
testCase.setReviewStatus(TestCaseReviewStatus.Prepare.name());
testCase.setDemandId(testCase.getDemandId());
testCase.setDemandName(testCase.getDemandName());
testCase.setCreateUser(SessionUtils.getUserId());
this.setNode(testCase);
testCase.setOrder(ServiceUtils.getNextOrder(testCase.getProjectId(), extTestCaseMapper::getLastOrder));
testCaseMapper.insert(testCase);
return testCase;
}
private void checkTestCustomNum(TestCaseWithBLOBs testCase) {
@ -1465,7 +1482,9 @@ public class TestCaseService {
if (StringUtils.isBlank(item.getId()) || item.getId().length() < 20) {
item.setId(UUID.randomUUID().toString());
item.setMaintainer(SessionUtils.getUserId());
addTestCase(item);
EditTestCaseRequest editTestCaseRequest = new EditTestCaseRequest();
BeanUtils.copyBean(editTestCaseRequest, item);
addTestCase(editTestCaseRequest);
changeOrder(item, request.getProjectId());
} else {
TestCaseWithBLOBs dbCase = finalTestCaseMap.get(item.getId());
@ -2018,4 +2037,15 @@ public class TestCaseService {
public int getRelationshipCount(String id) {
return relationshipEdgeService.getRelationshipCount(id, extTestCaseMapper::countByIds);
}
public List<String> getFollows(String caseId) {
List<String> result = new ArrayList<>();
if (StringUtils.isBlank(caseId)) {
return result;
}
TestCaseFollowExample example = new TestCaseFollowExample();
example.createCriteria().andCaseIdEqualTo(caseId);
List<TestCaseFollow> follows = testCaseFollowMapper.selectByExample(example);
return follows.stream().map(TestCaseFollow::getFollowId).distinct().collect(Collectors.toList());
}
}

View File

@ -397,3 +397,19 @@ SELECT id, follow_people
FROM api_test_case
WHERE follow_people IS NOT NULL;
ALTER TABLE api_test_case DROP COLUMN follow_people;
-- 测试用例关注人
CREATE TABLE IF NOT EXISTS `test_case_follow`
(
`case_id` VARCHAR(50) DEFAULT NULL,
`follow_id` VARCHAR(50) DEFAULT NULL,
UNIQUE KEY `test_case_follow_scenario_id_follow_id_pk` (`case_id`, `follow_id`),
KEY `test_case_follow_id_index` (`follow_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- 测试用例数据迁移
INSERT INTO test_case_follow
SELECT id, follow_people
FROM test_case
WHERE follow_people IS NOT NULL AND follow_people != '';
ALTER TABLE test_case DROP COLUMN follow_people;

View File

@ -71,14 +71,14 @@
<!--<table tableName="test_plan"/>-->
<!--<table tableName="api_scenario_report"/>-->
<!--<table tableName="test_case_review"/>-->
<!--<table tableName="test_case"/>-->
<table tableName="test_case_follow"/>
<!--<table tableName="test_case_review_api_case"/>
<table tableName="test_case_review_load"/>
<table tableName="test_case_review_scenario"/>
<table tableName="test_plan"/>
<table tableName="test_case_test"/>-->
<!-- <table tableName="api_test_environment"></table>-->
<table tableName="api_scenario">
<table tableName="test_case">
<ignoreColumn column="follow_people"/>
</table>
<!-- <table tableName="custom_field"></table>-->

View File

@ -22,7 +22,8 @@
</el-form-item>
<el-form-item :label="$t('api_test.automation.scenario.follow_people')" prop="followPeople">
<el-select v-model="testCaseForm.followPeople"
<el-select v-model="testCaseForm.follows"
multiple
:placeholder="$t('api_test.automation.scenario.follow_people')" filterable size="small"
style="width: 100%">
<el-option

View File

@ -51,8 +51,8 @@
<el-col :span="6">
<el-form-item :label="$t('api_test.automation.follow_people')" :label-width="formLabelWidth"
prop="followPeople">
<el-select v-model="form.followPeople"
clearable
<el-select v-model="form.follows"
clearable multiple
:placeholder="$t('api_test.automation.follow_people')" filterable size="small">
<el-option
v-for="item in maintainerOptions"
@ -354,6 +354,9 @@
this.form.module = this.treeNodes[0].id;
this.form.nodePath = this.treeNodes[0].path;
}
this.$get('/test/case/follow/' + this.currentTestCaseInfo.id, response =>{
this.form.follows = response.data;
})
},
methods: {
openHis() {