refactor(测试跟踪): 优化测试计划测试评审性能
--bug=1010014 --user=陈建星 【测试跟踪】github#9991,测试跟踪首页用例评审加载慢6S,优化性能 https://www.tapd.cn/55049933/s/1174639
This commit is contained in:
parent
08e6ccecc3
commit
e819578af9
|
@ -11,8 +11,6 @@ public class TestCaseReviewTestCase implements Serializable {
|
|||
|
||||
private String caseId;
|
||||
|
||||
private String status;
|
||||
|
||||
private String result;
|
||||
|
||||
private String reviewer;
|
||||
|
@ -25,5 +23,9 @@ public class TestCaseReviewTestCase implements Serializable {
|
|||
|
||||
private Long order;
|
||||
|
||||
private String status;
|
||||
|
||||
private Boolean isDel;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
|
@ -314,76 +314,6 @@ public class TestCaseReviewTestCaseExample {
|
|||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNull() {
|
||||
addCriterion("`status` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNotNull() {
|
||||
addCriterion("`status` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusEqualTo(String value) {
|
||||
addCriterion("`status` =", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotEqualTo(String value) {
|
||||
addCriterion("`status` <>", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThan(String value) {
|
||||
addCriterion("`status` >", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("`status` >=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThan(String value) {
|
||||
addCriterion("`status` <", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(String value) {
|
||||
addCriterion("`status` <=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLike(String value) {
|
||||
addCriterion("`status` like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotLike(String value) {
|
||||
addCriterion("`status` not like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIn(List<String> values) {
|
||||
addCriterion("`status` in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotIn(List<String> values) {
|
||||
addCriterion("`status` not in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusBetween(String value1, String value2) {
|
||||
addCriterion("`status` between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotBetween(String value1, String value2) {
|
||||
addCriterion("`status` not between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andResultIsNull() {
|
||||
addCriterion("`result` is null");
|
||||
return (Criteria) this;
|
||||
|
@ -773,6 +703,136 @@ public class TestCaseReviewTestCaseExample {
|
|||
addCriterion("`order` not between", value1, value2, "order");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNull() {
|
||||
addCriterion("`status` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNotNull() {
|
||||
addCriterion("`status` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusEqualTo(String value) {
|
||||
addCriterion("`status` =", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotEqualTo(String value) {
|
||||
addCriterion("`status` <>", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThan(String value) {
|
||||
addCriterion("`status` >", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("`status` >=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThan(String value) {
|
||||
addCriterion("`status` <", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(String value) {
|
||||
addCriterion("`status` <=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLike(String value) {
|
||||
addCriterion("`status` like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotLike(String value) {
|
||||
addCriterion("`status` not like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIn(List<String> values) {
|
||||
addCriterion("`status` in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotIn(List<String> values) {
|
||||
addCriterion("`status` not in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusBetween(String value1, String value2) {
|
||||
addCriterion("`status` between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotBetween(String value1, String value2) {
|
||||
addCriterion("`status` not between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelIsNull() {
|
||||
addCriterion("is_del is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelIsNotNull() {
|
||||
addCriterion("is_del is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelEqualTo(Boolean value) {
|
||||
addCriterion("is_del =", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelNotEqualTo(Boolean value) {
|
||||
addCriterion("is_del <>", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelGreaterThan(Boolean value) {
|
||||
addCriterion("is_del >", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelGreaterThanOrEqualTo(Boolean value) {
|
||||
addCriterion("is_del >=", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelLessThan(Boolean value) {
|
||||
addCriterion("is_del <", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelLessThanOrEqualTo(Boolean value) {
|
||||
addCriterion("is_del <=", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelIn(List<Boolean> values) {
|
||||
addCriterion("is_del in", values, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelNotIn(List<Boolean> values) {
|
||||
addCriterion("is_del not in", values, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelBetween(Boolean value1, Boolean value2) {
|
||||
addCriterion("is_del between", value1, value2, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelNotBetween(Boolean value1, Boolean value2) {
|
||||
addCriterion("is_del not between", value1, value2, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
@ -867,4 +927,4 @@ public class TestCaseReviewTestCaseExample {
|
|||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,8 +15,6 @@ public class TestPlanTestCase implements Serializable {
|
|||
|
||||
private String executor;
|
||||
|
||||
private String status;
|
||||
|
||||
private String remark;
|
||||
|
||||
private Long createTime;
|
||||
|
@ -29,5 +27,9 @@ public class TestPlanTestCase implements Serializable {
|
|||
|
||||
private Long order;
|
||||
|
||||
private String status;
|
||||
|
||||
private Boolean isDel;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
|
@ -454,76 +454,6 @@ public class TestPlanTestCaseExample {
|
|||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNull() {
|
||||
addCriterion("`status` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNotNull() {
|
||||
addCriterion("`status` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusEqualTo(String value) {
|
||||
addCriterion("`status` =", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotEqualTo(String value) {
|
||||
addCriterion("`status` <>", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThan(String value) {
|
||||
addCriterion("`status` >", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("`status` >=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThan(String value) {
|
||||
addCriterion("`status` <", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(String value) {
|
||||
addCriterion("`status` <=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLike(String value) {
|
||||
addCriterion("`status` like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotLike(String value) {
|
||||
addCriterion("`status` not like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIn(List<String> values) {
|
||||
addCriterion("`status` in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotIn(List<String> values) {
|
||||
addCriterion("`status` not in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusBetween(String value1, String value2) {
|
||||
addCriterion("`status` between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotBetween(String value1, String value2) {
|
||||
addCriterion("`status` not between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRemarkIsNull() {
|
||||
addCriterion("remark is null");
|
||||
return (Criteria) this;
|
||||
|
@ -903,6 +833,136 @@ public class TestPlanTestCaseExample {
|
|||
addCriterion("`order` not between", value1, value2, "order");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNull() {
|
||||
addCriterion("`status` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNotNull() {
|
||||
addCriterion("`status` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusEqualTo(String value) {
|
||||
addCriterion("`status` =", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotEqualTo(String value) {
|
||||
addCriterion("`status` <>", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThan(String value) {
|
||||
addCriterion("`status` >", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("`status` >=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThan(String value) {
|
||||
addCriterion("`status` <", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(String value) {
|
||||
addCriterion("`status` <=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLike(String value) {
|
||||
addCriterion("`status` like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotLike(String value) {
|
||||
addCriterion("`status` not like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIn(List<String> values) {
|
||||
addCriterion("`status` in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotIn(List<String> values) {
|
||||
addCriterion("`status` not in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusBetween(String value1, String value2) {
|
||||
addCriterion("`status` between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotBetween(String value1, String value2) {
|
||||
addCriterion("`status` not between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelIsNull() {
|
||||
addCriterion("is_del is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelIsNotNull() {
|
||||
addCriterion("is_del is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelEqualTo(Boolean value) {
|
||||
addCriterion("is_del =", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelNotEqualTo(Boolean value) {
|
||||
addCriterion("is_del <>", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelGreaterThan(Boolean value) {
|
||||
addCriterion("is_del >", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelGreaterThanOrEqualTo(Boolean value) {
|
||||
addCriterion("is_del >=", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelLessThan(Boolean value) {
|
||||
addCriterion("is_del <", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelLessThanOrEqualTo(Boolean value) {
|
||||
addCriterion("is_del <=", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelIn(List<Boolean> values) {
|
||||
addCriterion("is_del in", values, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelNotIn(List<Boolean> values) {
|
||||
addCriterion("is_del not in", values, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelBetween(Boolean value1, Boolean value2) {
|
||||
addCriterion("is_del between", value1, value2, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelNotBetween(Boolean value1, Boolean value2) {
|
||||
addCriterion("is_del not between", value1, value2, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
@ -997,4 +1057,4 @@ public class TestPlanTestCaseExample {
|
|||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -27,4 +27,4 @@ public interface TestCaseReviewTestCaseMapper {
|
|||
int updateByPrimaryKeySelective(TestCaseReviewTestCase record);
|
||||
|
||||
int updateByPrimaryKey(TestCaseReviewTestCase record);
|
||||
}
|
||||
}
|
|
@ -5,13 +5,14 @@
|
|||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="review_id" jdbcType="VARCHAR" property="reviewId" />
|
||||
<result column="case_id" jdbcType="VARCHAR" property="caseId" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="result" jdbcType="VARCHAR" property="result" />
|
||||
<result column="reviewer" jdbcType="VARCHAR" property="reviewer" />
|
||||
<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" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="is_del" jdbcType="BIT" property="isDel" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
|
@ -72,8 +73,8 @@
|
|||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, review_id, case_id, `status`, `result`, reviewer, create_time, update_time, create_user,
|
||||
`order`
|
||||
id, review_id, case_id, `result`, reviewer, create_time, update_time, create_user,
|
||||
`order`, `status`, is_del
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestCaseReviewTestCaseExample" resultMap="BaseResultMap">
|
||||
select
|
||||
|
@ -90,7 +91,7 @@
|
|||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from test_case_review_test_case
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
|
@ -106,14 +107,14 @@
|
|||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseReviewTestCase">
|
||||
insert into test_case_review_test_case (id, review_id, case_id,
|
||||
`status`, `result`, reviewer,
|
||||
create_time, update_time, create_user,
|
||||
`order`)
|
||||
values (#{id,jdbcType=VARCHAR}, #{reviewId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR},
|
||||
#{status,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, #{reviewer,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR},
|
||||
#{order,jdbcType=BIGINT})
|
||||
insert into test_case_review_test_case (id, review_id, case_id,
|
||||
`result`, reviewer, create_time,
|
||||
update_time, create_user, `order`,
|
||||
`status`, is_del)
|
||||
values (#{id,jdbcType=VARCHAR}, #{reviewId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR},
|
||||
#{result,jdbcType=VARCHAR}, #{reviewer,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
|
||||
#{updateTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR}, #{order,jdbcType=BIGINT},
|
||||
#{status,jdbcType=VARCHAR}, #{isDel,jdbcType=BIT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseReviewTestCase">
|
||||
insert into test_case_review_test_case
|
||||
|
@ -127,9 +128,6 @@
|
|||
<if test="caseId != null">
|
||||
case_id,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status`,
|
||||
</if>
|
||||
<if test="result != null">
|
||||
`result`,
|
||||
</if>
|
||||
|
@ -148,6 +146,12 @@
|
|||
<if test="order != null">
|
||||
`order`,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status`,
|
||||
</if>
|
||||
<if test="isDel != null">
|
||||
is_del,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
|
@ -159,9 +163,6 @@
|
|||
<if test="caseId != null">
|
||||
#{caseId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="result != null">
|
||||
#{result,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
@ -180,6 +181,12 @@
|
|||
<if test="order != null">
|
||||
#{order,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isDel != null">
|
||||
#{isDel,jdbcType=BIT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="io.metersphere.base.domain.TestCaseReviewTestCaseExample" resultType="java.lang.Long">
|
||||
|
@ -200,9 +207,6 @@
|
|||
<if test="record.caseId != null">
|
||||
case_id = #{record.caseId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.result != null">
|
||||
`result` = #{record.result,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
@ -221,6 +225,12 @@
|
|||
<if test="record.order != null">
|
||||
`order` = #{record.order,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.isDel != null">
|
||||
is_del = #{record.isDel,jdbcType=BIT},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
|
@ -231,13 +241,14 @@
|
|||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
review_id = #{record.reviewId,jdbcType=VARCHAR},
|
||||
case_id = #{record.caseId,jdbcType=VARCHAR},
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
`result` = #{record.result,jdbcType=VARCHAR},
|
||||
reviewer = #{record.reviewer,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
create_user = #{record.createUser,jdbcType=VARCHAR},
|
||||
`order` = #{record.order,jdbcType=BIGINT}
|
||||
`order` = #{record.order,jdbcType=BIGINT},
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
is_del = #{record.isDel,jdbcType=BIT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
|
@ -251,9 +262,6 @@
|
|||
<if test="caseId != null">
|
||||
case_id = #{caseId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="result != null">
|
||||
`result` = #{result,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
@ -272,6 +280,12 @@
|
|||
<if test="order != null">
|
||||
`order` = #{order,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isDel != null">
|
||||
is_del = #{isDel,jdbcType=BIT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
|
@ -279,13 +293,14 @@
|
|||
update test_case_review_test_case
|
||||
set review_id = #{reviewId,jdbcType=VARCHAR},
|
||||
case_id = #{caseId,jdbcType=VARCHAR},
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
`result` = #{result,jdbcType=VARCHAR},
|
||||
reviewer = #{reviewer,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
create_user = #{createUser,jdbcType=VARCHAR},
|
||||
`order` = #{order,jdbcType=BIGINT}
|
||||
`order` = #{order,jdbcType=BIGINT},
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
is_del = #{isDel,jdbcType=BIT}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
||||
</mapper>
|
|
@ -7,13 +7,14 @@
|
|||
<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="create_user" jdbcType="VARCHAR" property="createUser" />
|
||||
<result column="issues_count" jdbcType="INTEGER" property="issuesCount" />
|
||||
<result column="order" jdbcType="BIGINT" property="order" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="is_del" jdbcType="BIT" property="isDel" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestPlanTestCaseWithBLOBs">
|
||||
<result column="results" jdbcType="LONGVARCHAR" property="results" />
|
||||
|
@ -79,8 +80,8 @@
|
|||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, plan_id, case_id, report_id, executor, `status`, remark, create_time, update_time,
|
||||
create_user, issues_count, `order`
|
||||
id, plan_id, case_id, report_id, executor, remark, create_time, update_time, create_user,
|
||||
issues_count, `order`, `status`, is_del
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
results, issues, actual_result
|
||||
|
@ -116,7 +117,7 @@
|
|||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
|
@ -134,18 +135,18 @@
|
|||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.TestPlanTestCaseWithBLOBs">
|
||||
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 into test_plan_test_case (id, plan_id, case_id,
|
||||
report_id, executor, remark,
|
||||
create_time, update_time, create_user,
|
||||
issues_count, `order`, `status`,
|
||||
is_del, results, issues,
|
||||
actual_result)
|
||||
values (#{id,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR},
|
||||
#{reportId,jdbcType=VARCHAR}, #{executor,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR},
|
||||
#{issuesCount,jdbcType=INTEGER}, #{order,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR},
|
||||
#{isDel,jdbcType=BIT}, #{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
|
||||
|
@ -165,9 +166,6 @@
|
|||
<if test="executor != null">
|
||||
executor,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status`,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
|
@ -186,6 +184,12 @@
|
|||
<if test="order != null">
|
||||
`order`,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status`,
|
||||
</if>
|
||||
<if test="isDel != null">
|
||||
is_del,
|
||||
</if>
|
||||
<if test="results != null">
|
||||
results,
|
||||
</if>
|
||||
|
@ -212,9 +216,6 @@
|
|||
<if test="executor != null">
|
||||
#{executor,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
@ -233,6 +234,12 @@
|
|||
<if test="order != null">
|
||||
#{order,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isDel != null">
|
||||
#{isDel,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="results != null">
|
||||
#{results,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -268,9 +275,6 @@
|
|||
<if test="record.executor != null">
|
||||
executor = #{record.executor,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
@ -289,6 +293,12 @@
|
|||
<if test="record.order != null">
|
||||
`order` = #{record.order,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.isDel != null">
|
||||
is_del = #{record.isDel,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.results != null">
|
||||
results = #{record.results,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -310,13 +320,14 @@
|
|||
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},
|
||||
create_user = #{record.createUser,jdbcType=VARCHAR},
|
||||
issues_count = #{record.issuesCount,jdbcType=INTEGER},
|
||||
`order` = #{record.order,jdbcType=BIGINT},
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
is_del = #{record.isDel,jdbcType=BIT},
|
||||
results = #{record.results,jdbcType=LONGVARCHAR},
|
||||
issues = #{record.issues,jdbcType=LONGVARCHAR},
|
||||
actual_result = #{record.actualResult,jdbcType=LONGVARCHAR}
|
||||
|
@ -331,13 +342,14 @@
|
|||
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},
|
||||
create_user = #{record.createUser,jdbcType=VARCHAR},
|
||||
issues_count = #{record.issuesCount,jdbcType=INTEGER},
|
||||
`order` = #{record.order,jdbcType=BIGINT}
|
||||
`order` = #{record.order,jdbcType=BIGINT},
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
is_del = #{record.isDel,jdbcType=BIT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
|
@ -357,9 +369,6 @@
|
|||
<if test="executor != null">
|
||||
executor = #{executor,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
@ -378,6 +387,12 @@
|
|||
<if test="order != null">
|
||||
`order` = #{order,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isDel != null">
|
||||
is_del = #{isDel,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="results != null">
|
||||
results = #{results,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -396,13 +411,14 @@
|
|||
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},
|
||||
create_user = #{createUser,jdbcType=VARCHAR},
|
||||
issues_count = #{issuesCount,jdbcType=INTEGER},
|
||||
`order` = #{order,jdbcType=BIGINT},
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
is_del = #{isDel,jdbcType=BIT},
|
||||
results = #{results,jdbcType=LONGVARCHAR},
|
||||
issues = #{issues,jdbcType=LONGVARCHAR},
|
||||
actual_result = #{actualResult,jdbcType=LONGVARCHAR}
|
||||
|
@ -414,13 +430,14 @@
|
|||
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},
|
||||
create_user = #{createUser,jdbcType=VARCHAR},
|
||||
issues_count = #{issuesCount,jdbcType=INTEGER},
|
||||
`order` = #{order,jdbcType=BIGINT}
|
||||
`order` = #{order,jdbcType=BIGINT},
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
is_del = #{isDel,jdbcType=BIT}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
||||
</mapper>
|
|
@ -334,9 +334,8 @@
|
|||
</select>
|
||||
<select id="testPlanTestCaseCount" resultType="io.metersphere.api.dto.definition.ParamsDTO">
|
||||
select t.plan_id as id, COUNT(*) as value from test_plan_test_case t
|
||||
inner join test_case on t.case_id = test_case.id
|
||||
<where>
|
||||
(test_case.status != 'Trash' or test_case.status is null )
|
||||
t.is_del = 0
|
||||
<if test="planIds != null and planIds.size() > 0">
|
||||
and t.plan_id IN
|
||||
<foreach collection="planIds" item="id" separator="," open="(" close=")">
|
||||
|
@ -392,4 +391,4 @@
|
|||
set actual_end_time = null
|
||||
where id = #{0}
|
||||
</update>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
@ -2,10 +2,7 @@ package io.metersphere.base.mapper.ext;
|
|||
|
||||
import io.metersphere.base.domain.TestCase;
|
||||
import io.metersphere.controller.request.BaseQueryRequest;
|
||||
import io.metersphere.track.dto.PlanReportCaseDTO;
|
||||
import io.metersphere.track.dto.TestCaseReportStatusResultDTO;
|
||||
import io.metersphere.track.dto.TestCaseTestDTO;
|
||||
import io.metersphere.track.dto.TestPlanCaseDTO;
|
||||
import io.metersphere.track.dto.*;
|
||||
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
|
||||
import io.metersphere.track.request.testplancase.TestPlanFuncCaseConditions;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
@ -72,4 +69,6 @@ public interface ExtTestPlanTestCaseMapper {
|
|||
Long getLastOrder(@Param("planId") String planId, @Param("baseOrder") Long baseOrder);
|
||||
|
||||
List<TestCase> getTestCaseWithNodeInfo(@Param("planId") String planId);
|
||||
|
||||
List<CountMapDTO> getExecResultMapByPlanId(@Param("planId") String planId);
|
||||
}
|
||||
|
|
|
@ -240,22 +240,19 @@
|
|||
|
||||
<select id="list" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
||||
select test_plan_test_case.id as id, test_case.id as caseId, test_case.name, test_case.priority,
|
||||
test_case.type,test_case.test_id as testId,test_case.node_id, test_case.tags, test_case.maintainer,
|
||||
test_case.type, test_case.test_id as testId,test_case.node_id, test_case.tags, test_case.maintainer,
|
||||
test_case.custom_fields,
|
||||
test_case.node_path, test_case.method, if(pa.type_value = 'false', cast(test_case.num as char),
|
||||
test_case.custom_num) as customNum, test_plan_test_case.executor, test_plan_test_case.status,
|
||||
test_case.node_path, test_case.method,
|
||||
test_case.num, test_case.custom_num,
|
||||
test_case.project_id,
|
||||
test_plan_test_case.executor, test_plan_test_case.status,
|
||||
test_plan_test_case.actual_result,
|
||||
test_plan_test_case.update_time, test_plan_test_case.create_time,test_case_node.name as model, project.name as
|
||||
projectName, test_plan_test_case.issues_count as issuesCount,
|
||||
test_plan_test_case.plan_id as planId,test_case.version_id as versionId,
|
||||
project_version.name as versionName
|
||||
test_plan_test_case.update_time, test_plan_test_case.create_time,
|
||||
test_plan_test_case.issues_count as issuesCount,
|
||||
test_plan_test_case.plan_id as planId,
|
||||
test_case.version_id as versionId
|
||||
from test_plan_test_case
|
||||
inner join test_case on test_plan_test_case.case_id = test_case.id
|
||||
left join test_case_node on test_case_node.id = test_case.node_id
|
||||
inner join project on project.id = test_case.project_id
|
||||
inner join project_application pa on pa.project_id = project.id and pa.type = 'CASE_CUSTOM_NUM'
|
||||
left join project_version on project_version.id = test_case.version_id and project.id =
|
||||
project_version.project_id
|
||||
<include refid="queryWhereCondition"/>
|
||||
<if test="request.orders != null and request.orders.size() > 0">
|
||||
order by
|
||||
|
@ -531,8 +528,6 @@
|
|||
</if>
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deleteByTestCaseID" parameterType="java.lang.String">
|
||||
delete
|
||||
from test_plan_api_case
|
||||
|
@ -572,6 +567,12 @@
|
|||
join test_case tc on tptc.case_id = tc.id
|
||||
where tptc.plan_id = #{planId}
|
||||
</select>
|
||||
<select id="getExecResultMapByPlanId" resultType="io.metersphere.track.dto.CountMapDTO">
|
||||
select status as `key`, count(*) as `value`
|
||||
from test_plan_test_case
|
||||
where plan_id = #{planId} and is_del = 0
|
||||
group by status
|
||||
</select>
|
||||
|
||||
<sql id="queryVersionCondition">
|
||||
<if test="request.versionId != null">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package io.metersphere.base.mapper.ext;
|
||||
|
||||
import io.metersphere.track.dto.CountMapDTO;
|
||||
import io.metersphere.track.dto.TestReviewCaseDTO;
|
||||
import io.metersphere.track.request.testreview.QueryCaseReviewRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
@ -15,14 +16,6 @@ public interface ExtTestReviewCaseMapper {
|
|||
|
||||
List<String> findRelateTestReviewId(@Param("userId") String userId, @Param("workspaceId") String workspaceId, @Param("projectId") String projectId);
|
||||
|
||||
/**
|
||||
* 根据项目 ids 查询 TestReviewCaseDTO 列表
|
||||
*
|
||||
* @param ids project id list
|
||||
* @return List<TestReviewCaseDTO>
|
||||
*/
|
||||
List<TestReviewCaseDTO> listTestCaseByProjectIds(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取 TestReviewTestCase 详细信息
|
||||
*
|
||||
|
@ -45,4 +38,6 @@ public interface ExtTestReviewCaseMapper {
|
|||
Long getPreOrder(@Param("reviewId")String reviewId, @Param("baseOrder") Long baseOrder);
|
||||
|
||||
Long getLastOrder(@Param("reviewId")String reviewId, @Param("baseOrder") Long baseOrder);
|
||||
|
||||
List<CountMapDTO> getStatusMapByReviewId(@Param("reviewId") String reviewId);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,6 @@
|
|||
</include>
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="list" resultType="io.metersphere.track.dto.TestReviewCaseDTO">
|
||||
select test_case_review_test_case.id as id, test_case_review_test_case.reviewer,
|
||||
test_case_review_test_case.update_time, test_case_review_test_case.review_id as reviewId,
|
||||
|
@ -172,6 +171,7 @@
|
|||
<property name="versionTable" value="test_case"/>
|
||||
</include>
|
||||
<include refid="filter"/>
|
||||
and test_case_review_test_case.is_del = 0
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="filter">
|
||||
|
@ -417,14 +417,6 @@
|
|||
and project.workspace_id = #{workspaceId}
|
||||
and test_case_review.project_id = #{projectId}
|
||||
</select>
|
||||
<select id="listTestCaseByProjectIds" resultType="io.metersphere.track.dto.TestReviewCaseDTO">
|
||||
select distinct * from test_case_review_test_case, test_case
|
||||
where test_case_review_test_case.case_id = test_case.id
|
||||
and test_case.project_id in
|
||||
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="listForMinder" resultType="io.metersphere.track.dto.TestReviewCaseDTO">
|
||||
select tcrtc.id as id,
|
||||
tcrtc.review_id as reviewId,
|
||||
|
@ -466,6 +458,12 @@
|
|||
</if>
|
||||
order by `order` desc limit 1;
|
||||
</select>
|
||||
<select id="getStatusMapByReviewId" resultType="io.metersphere.track.dto.CountMapDTO">
|
||||
select status as `key`, count(*) as `value`
|
||||
from test_case_review_test_case
|
||||
where review_id = #{reviewId} and is_del = 0
|
||||
group by status
|
||||
</select>
|
||||
|
||||
<sql id="queryVersionCondition">
|
||||
<if test="request.versionId != null">
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package io.metersphere.commons.constants;
|
||||
|
||||
public enum FunctionCaseStatus {
|
||||
Trash, Prepare, Underway, Completed
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package io.metersphere.track.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CountMapDTO {
|
||||
private String key;
|
||||
private Integer value;
|
||||
}
|
|
@ -26,9 +26,9 @@ import io.metersphere.notice.sender.NoticeModel;
|
|||
import io.metersphere.notice.service.NoticeSendService;
|
||||
import io.metersphere.service.SystemParameterService;
|
||||
import io.metersphere.service.UserService;
|
||||
import io.metersphere.track.dto.CountMapDTO;
|
||||
import io.metersphere.track.dto.TestCaseDTO;
|
||||
import io.metersphere.track.dto.TestCaseReviewDTO;
|
||||
import io.metersphere.track.dto.TestReviewCaseDTO;
|
||||
import io.metersphere.track.dto.TestReviewDTOWithMetric;
|
||||
import io.metersphere.track.request.testreview.*;
|
||||
import org.apache.commons.beanutils.BeanMap;
|
||||
|
@ -446,25 +446,11 @@ public class TestCaseReviewService {
|
|||
request.setProjectId(projectId);
|
||||
request.setReviewIds(extTestReviewCaseMapper.findRelateTestReviewId(user.getId(), workspaceId, projectId));
|
||||
|
||||
List<String> projectIds = extProjectMapper.getProjectIdByWorkspaceId(workspaceId);
|
||||
|
||||
List<TestReviewDTOWithMetric> testReviews = extTestCaseReviewMapper.listRelate(request);
|
||||
|
||||
Map<String, List<TestReviewCaseDTO>> testCaseMap = new HashMap<>();
|
||||
listTestCaseByProjectIds(projectIds).forEach(testCase -> {
|
||||
List<TestReviewCaseDTO> list = testCaseMap.get(testCase.getReviewId());
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
list.add(testCase);
|
||||
testCaseMap.put(testCase.getReviewId(), list);
|
||||
} else {
|
||||
list.add(testCase);
|
||||
}
|
||||
});
|
||||
|
||||
if (!CollectionUtils.isEmpty(testReviews)) {
|
||||
testReviews.forEach(testReview -> {
|
||||
List<TestReviewCaseDTO> testCases = testCaseMap.get(testReview.getId());
|
||||
List<CountMapDTO> countMapDTOS = extTestReviewCaseMapper.getStatusMapByReviewId(testReview.getId());
|
||||
|
||||
TestCaseReviewUsersExample testCaseReviewUsersExample = new TestCaseReviewUsersExample();
|
||||
testCaseReviewUsersExample.createCriteria().andReviewIdEqualTo(testReview.getId());
|
||||
|
@ -481,18 +467,15 @@ public class TestCaseReviewService {
|
|||
testReview.setReviewed(0);
|
||||
testReview.setTotal(0);
|
||||
testReview.setPass(0);
|
||||
if (testCases != null) {
|
||||
testReview.setTotal(testCases.size());
|
||||
testCases.forEach(testCase -> {
|
||||
if (!StringUtils.equals(testCase.getReviewStatus(), TestReviewCaseStatus.Prepare.name())) {
|
||||
testReview.setReviewed(testReview.getReviewed() + 1);
|
||||
}
|
||||
if (StringUtils.equals(testCase.getReviewStatus(), TestReviewCaseStatus.Pass.name())) {
|
||||
testReview.setPass(testReview.getPass() + 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
countMapDTOS.forEach(item -> {
|
||||
testReview.setTotal(testReview.getTotal() + item.getValue());
|
||||
if (!StringUtils.equals(item.getKey(), TestReviewCaseStatus.Prepare.name())) {
|
||||
testReview.setReviewed(testReview.getReviewed() + 1);
|
||||
}
|
||||
if (StringUtils.equals(item.getKey(), TestReviewCaseStatus.Pass.name())) {
|
||||
testReview.setPass(testReview.getPass() + 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
return testReviews;
|
||||
|
@ -519,13 +502,6 @@ public class TestCaseReviewService {
|
|||
return name;
|
||||
}
|
||||
|
||||
private List<TestReviewCaseDTO> listTestCaseByProjectIds(List<String> projectIds) {
|
||||
if (CollectionUtils.isEmpty(projectIds)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return extTestReviewCaseMapper.listTestCaseByProjectIds(projectIds);
|
||||
}
|
||||
|
||||
/*编辑,新建,完成,删除通知内容*/
|
||||
private String getReviewContext(SaveTestCaseReviewRequest reviewRequest, String type) {
|
||||
|
||||
|
|
|
@ -163,6 +163,12 @@ public class TestCaseService {
|
|||
@Lazy
|
||||
@Resource
|
||||
private ProjectApplicationService projectApplicationService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private TestPlanTestCaseService testPlanTestCaseService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private TestReviewTestCaseService testReviewTestCaseService;
|
||||
|
||||
private ThreadLocal<Integer> importCreateNum = new ThreadLocal<>();
|
||||
private ThreadLocal<Integer> beforeImportCreateNum = new ThreadLocal<>();
|
||||
|
@ -627,6 +633,8 @@ public class TestCaseService {
|
|||
|
||||
DeleteTestCaseRequest request = new DeleteTestCaseRequest();
|
||||
BeanUtils.copyBean(request, testCase);
|
||||
testPlanTestCaseService.deleteToGc(Arrays.asList(testCaseId));
|
||||
testReviewTestCaseService.deleteToGc(Arrays.asList(testCaseId));
|
||||
return extTestCaseMapper.deleteToGc(request);
|
||||
}
|
||||
|
||||
|
@ -643,6 +651,8 @@ public class TestCaseService {
|
|||
DeleteTestCaseRequest request = new DeleteTestCaseRequest();
|
||||
BeanUtils.copyBean(request, testCase);
|
||||
request.setIds(ids);
|
||||
testPlanTestCaseService.deleteToGc(ids);
|
||||
testReviewTestCaseService.deleteToGc(ids);
|
||||
return extTestCaseMapper.deleteToGc(request);
|
||||
}
|
||||
|
||||
|
@ -2202,12 +2212,11 @@ public class TestCaseService {
|
|||
}
|
||||
|
||||
public void reduction(TestCaseBatchRequest request) {
|
||||
TestCaseExample example = this.getBatchExample(request);
|
||||
if (CollectionUtils.isNotEmpty(request.getIds())) {
|
||||
extTestCaseMapper.checkOriginalStatusByIds(request.getIds());
|
||||
|
||||
//检查原来模块是否还在
|
||||
example = new TestCaseExample();
|
||||
TestCaseExample example = new TestCaseExample();
|
||||
// 关联版本之后,必须查询每一个数据的所有版本,依次还原
|
||||
example.createCriteria().andIdIn(request.getIds());
|
||||
List<TestCase> reductionCaseList = testCaseMapper.selectByExample(example);
|
||||
|
@ -2236,6 +2245,8 @@ public class TestCaseService {
|
|||
}
|
||||
}
|
||||
extTestCaseMapper.reduction(request.getIds());
|
||||
testPlanTestCaseService.reduction(request.getIds());
|
||||
testReviewTestCaseService.reduction(request.getIds());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -373,16 +373,19 @@ public class TestPlanService {
|
|||
testPlan.setPassed(0);
|
||||
testPlan.setTotal(0);
|
||||
|
||||
List<String> functionalExecResults = extTestPlanTestCaseMapper.getExecResultByPlanId(testPlan.getId());
|
||||
functionalExecResults.forEach(item -> {
|
||||
if (!StringUtils.equals(item, TestPlanTestCaseStatus.Prepare.name())
|
||||
&& !StringUtils.equals(item, TestPlanTestCaseStatus.Underway.name())) {
|
||||
testPlan.setTested(testPlan.getTested() + 1);
|
||||
if (StringUtils.equals(item, TestPlanTestCaseStatus.Pass.name())) {
|
||||
testPlan.setPassed(testPlan.getPassed() + 1);
|
||||
List<CountMapDTO> statusCountMap = extTestPlanTestCaseMapper.getExecResultMapByPlanId(testPlan.getId());
|
||||
Integer functionalExecTotal = 0;
|
||||
|
||||
for (CountMapDTO item : statusCountMap) {
|
||||
functionalExecTotal++;
|
||||
if (!StringUtils.equals(item.getKey(), TestPlanTestCaseStatus.Prepare.name())
|
||||
&& !StringUtils.equals(item.getKey(), TestPlanTestCaseStatus.Underway.name())) {
|
||||
testPlan.setTested(testPlan.getTested() + item.getValue());
|
||||
if (StringUtils.equals(item.getKey(), TestPlanTestCaseStatus.Pass.name())) {
|
||||
testPlan.setPassed(testPlan.getPassed() + item.getValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
List<String> apiExecResults = testPlanApiCaseService.getExecResultByPlanId(testPlan.getId());
|
||||
apiExecResults.forEach(item -> {
|
||||
|
@ -414,7 +417,7 @@ public class TestPlanService {
|
|||
}
|
||||
});
|
||||
|
||||
testPlan.setTotal(apiExecResults.size() + scenarioExecResults.size() + functionalExecResults.size() + loadResults.size());
|
||||
testPlan.setTotal(apiExecResults.size() + scenarioExecResults.size() + functionalExecTotal + loadResults.size());
|
||||
|
||||
testPlan.setPassRate(MathUtils.getPercentWithDecimal(testPlan.getTested() == 0 ? 0 : testPlan.getPassed() * 1.0 / testPlan.getTotal()));
|
||||
testPlan.setTestRate(MathUtils.getPercentWithDecimal(testPlan.getTotal() == 0 ? 0 : testPlan.getTested() * 1.0 / testPlan.getTotal()));
|
||||
|
|
|
@ -17,6 +17,7 @@ import io.metersphere.dto.ProjectConfig;
|
|||
import io.metersphere.log.vo.DetailColumn;
|
||||
import io.metersphere.log.vo.OperatingLogDetails;
|
||||
import io.metersphere.service.ProjectApplicationService;
|
||||
import io.metersphere.service.ProjectService;
|
||||
import io.metersphere.service.UserService;
|
||||
import io.metersphere.track.dto.*;
|
||||
import io.metersphere.track.request.testcase.TestPlanCaseBatchRequest;
|
||||
|
@ -70,7 +71,7 @@ public class TestPlanTestCaseService {
|
|||
@Resource
|
||||
private TestCaseService testCaseService;
|
||||
@Resource
|
||||
private TestCaseIssueService testCaseIssueService;
|
||||
private ProjectService projectService;
|
||||
@Resource
|
||||
private ProjectApplicationService projectApplicationService;
|
||||
|
||||
|
@ -87,6 +88,22 @@ public class TestPlanTestCaseService {
|
|||
public List<TestPlanCaseDTO> list(QueryTestPlanCaseRequest request) {
|
||||
request.setOrders(ServiceUtils.getDefaultSortOrder(request.getOrders()));
|
||||
List<TestPlanCaseDTO> list = extTestPlanTestCaseMapper.list(request);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return list;
|
||||
}
|
||||
Project project = projectService.getProjectById(list.get(0).getProjectId());
|
||||
|
||||
ProjectApplication projectApplication = projectApplicationService.getProjectApplication(project.getId(), "CASE_CUSTOM_NUM");
|
||||
list.forEach(item -> {
|
||||
// 设置项目名称
|
||||
item.setProjectName(project.getName());
|
||||
if (StringUtils.equals(projectApplication.getTypeValue(), "false")) {
|
||||
// 如果配置是不启用自定义字段,则设置为 num
|
||||
item.setCustomNum(item.getNum().toString());
|
||||
}
|
||||
});
|
||||
// 设置版本信息
|
||||
ServiceUtils.buildVersionInfo(list);
|
||||
QueryMemberRequest queryMemberRequest = new QueryMemberRequest();
|
||||
queryMemberRequest.setProjectId(request.getProjectId());
|
||||
Map<String, String> userMap = userService.getProjectMemberList(queryMemberRequest)
|
||||
|
@ -127,6 +144,21 @@ public class TestPlanTestCaseService {
|
|||
return testPlanTestCaseMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public int deleteToGc(List<String> caseIds) {
|
||||
return updateIsDel(caseIds, true);
|
||||
}
|
||||
|
||||
private int updateIsDel(List<String> caseIds, Boolean isDel) {
|
||||
if (CollectionUtils.isNotEmpty(caseIds)) {
|
||||
TestPlanTestCaseExample example = new TestPlanTestCaseExample();
|
||||
example.createCriteria().andCaseIdIn(caseIds);
|
||||
TestPlanTestCaseWithBLOBs record = new TestPlanTestCaseWithBLOBs();
|
||||
record.setIsDel(isDel);
|
||||
return testPlanTestCaseMapper.updateByExampleSelective(record, example);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void editTestCaseBath(TestPlanCaseBatchRequest request) {
|
||||
TestPlanTestCaseExample testPlanTestCaseExample = getBatchExample(request);
|
||||
TestPlanTestCaseWithBLOBs testPlanTestCase = new TestPlanTestCaseWithBLOBs();
|
||||
|
@ -452,4 +484,7 @@ public class TestPlanTestCaseService {
|
|||
testPlanTestCaseMapper::updateByPrimaryKeySelective);
|
||||
}
|
||||
|
||||
public int reduction(List<String> caseIds) {
|
||||
return updateIsDel(caseIds, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,6 +107,21 @@ public class TestReviewTestCaseService {
|
|||
return testCaseReviewTestCaseMapper.deleteByPrimaryKey(request.getId());
|
||||
}
|
||||
|
||||
public int deleteToGc(List<String> caseIds) {
|
||||
return updateIsDel(caseIds, true);
|
||||
}
|
||||
|
||||
private int updateIsDel(List<String> caseIds, Boolean isDel) {
|
||||
if (CollectionUtils.isEmpty(caseIds)) {
|
||||
return 0;
|
||||
}
|
||||
TestCaseReviewTestCaseExample example = new TestCaseReviewTestCaseExample();
|
||||
example.createCriteria().andCaseIdIn(caseIds);
|
||||
TestCaseReviewTestCase record = new TestCaseReviewTestCase();
|
||||
record.setIsDel(isDel);
|
||||
return testCaseReviewTestCaseMapper.updateByExampleSelective(record, example);
|
||||
}
|
||||
|
||||
private void checkReviewer(String reviewId) {
|
||||
List<String> userIds = testCaseReviewService.getTestCaseReviewerIds(reviewId);
|
||||
String currentId = SessionUtils.getUser().getId();
|
||||
|
@ -368,4 +383,8 @@ public class TestReviewTestCaseService {
|
|||
extTestReviewCaseMapper::getLastOrder,
|
||||
testCaseReviewTestCaseMapper::updateByPrimaryKeySelective);
|
||||
}
|
||||
|
||||
public int reduction(List<String> ids) {
|
||||
return updateIsDel(ids, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import io.metersphere.commons.utils.DateUtils;
|
|||
import io.metersphere.commons.utils.MathUtils;
|
||||
import io.metersphere.performance.base.ChartsData;
|
||||
import io.metersphere.service.ProjectService;
|
||||
import io.metersphere.track.dto.CountMapDTO;
|
||||
import io.metersphere.track.dto.TestPlanDTOWithMetric;
|
||||
import io.metersphere.track.response.BugStatustics;
|
||||
import io.metersphere.track.response.TestPlanBugCount;
|
||||
|
@ -168,16 +169,16 @@ public class TrackService {
|
|||
testPlan.setPassed(0);
|
||||
testPlan.setTotal(0);
|
||||
|
||||
List<String> functionalExecResults = extTestPlanTestCaseMapper.getExecResultByPlanId(planId);
|
||||
functionalExecResults.forEach(item -> {
|
||||
if (!StringUtils.equals(item, TestPlanTestCaseStatus.Prepare.name())
|
||||
&& !StringUtils.equals(item, TestPlanTestCaseStatus.Underway.name())) {
|
||||
testPlan.setTested(testPlan.getTested() + 1);
|
||||
if (StringUtils.equals(item, TestPlanTestCaseStatus.Pass.name())) {
|
||||
testPlan.setPassed(testPlan.getPassed() + 1);
|
||||
List<CountMapDTO> statusCountMap = extTestPlanTestCaseMapper.getExecResultMapByPlanId(testPlan.getId());
|
||||
for (CountMapDTO item : statusCountMap) {
|
||||
if (!StringUtils.equals(item.getKey(), TestPlanTestCaseStatus.Prepare.name())
|
||||
&& !StringUtils.equals(item.getKey(), TestPlanTestCaseStatus.Underway.name())) {
|
||||
testPlan.setTested(testPlan.getTested() + item.getValue());
|
||||
if (StringUtils.equals(item.getKey(), TestPlanTestCaseStatus.Pass.name())) {
|
||||
testPlan.setPassed(testPlan.getPassed() + item.getValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
List<String> apiExecResults = testPlanApiCaseService.getExecResultByPlanId(planId);
|
||||
apiExecResults.forEach(item -> {
|
||||
|
|
Loading…
Reference in New Issue