Merge remote-tracking branch 'origin/master'

This commit is contained in:
Captain.B 2021-03-18 14:01:18 +08:00
commit adb843fa49
20 changed files with 346 additions and 234 deletions

View File

@ -1,8 +1,9 @@
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
import java.io.Serializable;
@Data
public class TestCaseReviewScenario implements Serializable {
private String id;
@ -13,8 +14,6 @@ public class TestCaseReviewScenario implements Serializable {
private String status;
private String environment;
private Long createTime;
private Long updateTime;
@ -25,5 +24,7 @@ public class TestCaseReviewScenario implements Serializable {
private String reportId;
private String environment;
private static final long serialVersionUID = 1L;
}

View File

@ -384,76 +384,6 @@ public class TestCaseReviewScenarioExample {
return (Criteria) this;
}
public Criteria andEnvironmentIsNull() {
addCriterion("environment is null");
return (Criteria) this;
}
public Criteria andEnvironmentIsNotNull() {
addCriterion("environment is not null");
return (Criteria) this;
}
public Criteria andEnvironmentEqualTo(String value) {
addCriterion("environment =", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentNotEqualTo(String value) {
addCriterion("environment <>", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentGreaterThan(String value) {
addCriterion("environment >", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentGreaterThanOrEqualTo(String value) {
addCriterion("environment >=", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentLessThan(String value) {
addCriterion("environment <", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentLessThanOrEqualTo(String value) {
addCriterion("environment <=", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentLike(String value) {
addCriterion("environment like", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentNotLike(String value) {
addCriterion("environment not like", value, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentIn(List<String> values) {
addCriterion("environment in", values, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentNotIn(List<String> values) {
addCriterion("environment not in", values, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentBetween(String value1, String value2) {
addCriterion("environment between", value1, value2, "environment");
return (Criteria) this;
}
public Criteria andEnvironmentNotBetween(String value1, String value2) {
addCriterion("environment not between", value1, value2, "environment");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;

View File

@ -1,8 +1,9 @@
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
import java.io.Serializable;
@Data
public class TestPlan implements Serializable {
private String id;
@ -41,6 +42,8 @@ public class TestPlan implements Serializable {
private String projectId;
private Integer executionTimes;
private String tags;
private static final long serialVersionUID = 1L;

View File

@ -1303,6 +1303,66 @@ public class TestPlanExample {
addCriterion("project_id not between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andExecutionTimesIsNull() {
addCriterion("execution_times is null");
return (Criteria) this;
}
public Criteria andExecutionTimesIsNotNull() {
addCriterion("execution_times is not null");
return (Criteria) this;
}
public Criteria andExecutionTimesEqualTo(Integer value) {
addCriterion("execution_times =", value, "executionTimes");
return (Criteria) this;
}
public Criteria andExecutionTimesNotEqualTo(Integer value) {
addCriterion("execution_times <>", value, "executionTimes");
return (Criteria) this;
}
public Criteria andExecutionTimesGreaterThan(Integer value) {
addCriterion("execution_times >", value, "executionTimes");
return (Criteria) this;
}
public Criteria andExecutionTimesGreaterThanOrEqualTo(Integer value) {
addCriterion("execution_times >=", value, "executionTimes");
return (Criteria) this;
}
public Criteria andExecutionTimesLessThan(Integer value) {
addCriterion("execution_times <", value, "executionTimes");
return (Criteria) this;
}
public Criteria andExecutionTimesLessThanOrEqualTo(Integer value) {
addCriterion("execution_times <=", value, "executionTimes");
return (Criteria) this;
}
public Criteria andExecutionTimesIn(List<Integer> values) {
addCriterion("execution_times in", values, "executionTimes");
return (Criteria) this;
}
public Criteria andExecutionTimesNotIn(List<Integer> values) {
addCriterion("execution_times not in", values, "executionTimes");
return (Criteria) this;
}
public Criteria andExecutionTimesBetween(Integer value1, Integer value2) {
addCriterion("execution_times between", value1, value2, "executionTimes");
return (Criteria) this;
}
public Criteria andExecutionTimesNotBetween(Integer value1, Integer value2) {
addCriterion("execution_times not between", value1, value2, "executionTimes");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -2,9 +2,10 @@ package io.metersphere.base.mapper;
import io.metersphere.base.domain.TestCaseReviewScenario;
import io.metersphere.base.domain.TestCaseReviewScenarioExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TestCaseReviewScenarioMapper {
long countByExample(TestCaseReviewScenarioExample example);
@ -16,15 +17,21 @@ public interface TestCaseReviewScenarioMapper {
int insertSelective(TestCaseReviewScenario record);
List<TestCaseReviewScenario> selectByExampleWithBLOBs(TestCaseReviewScenarioExample example);
List<TestCaseReviewScenario> selectByExample(TestCaseReviewScenarioExample example);
TestCaseReviewScenario selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") TestCaseReviewScenario record, @Param("example") TestCaseReviewScenarioExample example);
int updateByExampleWithBLOBs(@Param("record") TestCaseReviewScenario record, @Param("example") TestCaseReviewScenarioExample example);
int updateByExample(@Param("record") TestCaseReviewScenario record, @Param("example") TestCaseReviewScenarioExample example);
int updateByPrimaryKeySelective(TestCaseReviewScenario record);
int updateByPrimaryKeyWithBLOBs(TestCaseReviewScenario record);
int updateByPrimaryKey(TestCaseReviewScenario record);
}

View File

@ -2,16 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.base.mapper.TestCaseReviewScenarioMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestCaseReviewScenario">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="test_case_review_id" jdbcType="VARCHAR" property="testCaseReviewId" />
<result column="api_scenario_id" jdbcType="VARCHAR" property="apiScenarioId" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="environment" jdbcType="VARCHAR" property="environment" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="pass_rate" jdbcType="VARCHAR" property="passRate" />
<result column="last_result" jdbcType="VARCHAR" property="lastResult" />
<result column="report_id" jdbcType="VARCHAR" property="reportId" />
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="test_case_review_id" jdbcType="VARCHAR" property="testCaseReviewId"/>
<result column="api_scenario_id" jdbcType="VARCHAR" property="apiScenarioId"/>
<result column="status" jdbcType="VARCHAR" property="status"/>
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
<result column="pass_rate" jdbcType="VARCHAR" property="passRate"/>
<result column="last_result" jdbcType="VARCHAR" property="lastResult"/>
<result column="report_id" jdbcType="VARCHAR" property="reportId"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestCaseReviewScenario">
<result column="environment" jdbcType="LONGVARCHAR" property="environment"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -72,26 +74,49 @@
</where>
</sql>
<sql id="Base_Column_List">
id, test_case_review_id, api_scenario_id, `status`, environment, create_time, update_time,
pass_rate, last_result, report_id
id, test_case_review_id, api_scenario_id, `status`, create_time, update_time, pass_rate,
last_result, report_id
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestCaseReviewScenarioExample" resultMap="BaseResultMap">
<sql id="Blob_Column_List">
environment
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseReviewScenarioExample"
resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from test_case_review_scenario
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestCaseReviewScenarioExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from test_case_review_scenario
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from test_case_review_scenario
where id = #{id,jdbcType=VARCHAR}
</select>
@ -106,14 +131,14 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseReviewScenario">
insert into test_case_review_scenario (id, test_case_review_id, api_scenario_id,
`status`, environment, create_time,
update_time, pass_rate, last_result,
report_id)
values (#{id,jdbcType=VARCHAR}, #{testCaseReviewId,jdbcType=VARCHAR}, #{apiScenarioId,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{environment,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{passRate,jdbcType=VARCHAR}, #{lastResult,jdbcType=VARCHAR},
#{reportId,jdbcType=VARCHAR})
insert into test_case_review_scenario (id, test_case_review_id, api_scenario_id,
`status`, create_time, update_time,
pass_rate, last_result, report_id,
environment)
values (#{id,jdbcType=VARCHAR}, #{testCaseReviewId,jdbcType=VARCHAR}, #{apiScenarioId,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{passRate,jdbcType=VARCHAR}, #{lastResult,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR},
#{environment,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseReviewScenario">
insert into test_case_review_scenario
@ -130,9 +155,6 @@
<if test="status != null">
`status`,
</if>
<if test="environment != null">
environment,
</if>
<if test="createTime != null">
create_time,
</if>
@ -148,6 +170,9 @@
<if test="reportId != null">
report_id,
</if>
<if test="environment != null">
environment,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -162,9 +187,6 @@
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="environment != null">
#{environment,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
@ -180,6 +202,9 @@
<if test="reportId != null">
#{reportId,jdbcType=VARCHAR},
</if>
<if test="environment != null">
#{environment,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.TestCaseReviewScenarioExample" resultType="java.lang.Long">
@ -203,9 +228,6 @@
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.environment != null">
environment = #{record.environment,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
@ -221,22 +243,40 @@
<if test="record.reportId != null">
report_id = #{record.reportId,jdbcType=VARCHAR},
</if>
<if test="record.environment != null">
environment = #{record.environment,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update test_case_review_scenario
set id = #{record.id,jdbcType=VARCHAR},
test_case_review_id = #{record.testCaseReviewId,jdbcType=VARCHAR},
api_scenario_id = #{record.apiScenarioId,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
pass_rate = #{record.passRate,jdbcType=VARCHAR},
last_result = #{record.lastResult,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=VARCHAR},
environment = #{record.environment,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update test_case_review_scenario
set id = #{record.id,jdbcType=VARCHAR},
test_case_review_id = #{record.testCaseReviewId,jdbcType=VARCHAR},
api_scenario_id = #{record.apiScenarioId,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
environment = #{record.environment,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
pass_rate = #{record.passRate,jdbcType=VARCHAR},
last_result = #{record.lastResult,jdbcType=VARCHAR},
test_case_review_id = #{record.testCaseReviewId,jdbcType=VARCHAR},
api_scenario_id = #{record.apiScenarioId,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
pass_rate = #{record.passRate,jdbcType=VARCHAR},
last_result = #{record.lastResult,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -254,9 +294,6 @@
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="environment != null">
environment = #{environment,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
@ -272,18 +309,33 @@
<if test="reportId != null">
report_id = #{reportId,jdbcType=VARCHAR},
</if>
<if test="environment != null">
environment = #{environment,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseReviewScenario">
update test_case_review_scenario
set test_case_review_id = #{testCaseReviewId,jdbcType=VARCHAR},
api_scenario_id = #{apiScenarioId,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
pass_rate = #{passRate,jdbcType=VARCHAR},
last_result = #{lastResult,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=VARCHAR},
environment = #{environment,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCaseReviewScenario">
update test_case_review_scenario
set test_case_review_id = #{testCaseReviewId,jdbcType=VARCHAR},
api_scenario_id = #{apiScenarioId,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
environment = #{environment,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
pass_rate = #{passRate,jdbcType=VARCHAR},
api_scenario_id = #{apiScenarioId,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
pass_rate = #{passRate,jdbcType=VARCHAR},
last_result = #{lastResult,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}

View File

@ -20,6 +20,7 @@
<result column="actual_start_time" jdbcType="BIGINT" property="actualStartTime" />
<result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="execution_times" jdbcType="INTEGER" property="executionTimes"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestPlan">
<result column="tags" jdbcType="LONGVARCHAR" property="tags" />
@ -85,7 +86,7 @@
<sql id="Base_Column_List">
id, workspace_id, report_id, `name`, description, `status`, stage, principal, test_case_match_rule,
executor_match_rule, create_time, update_time, actual_end_time, planned_start_time,
planned_end_time, actual_start_time, creator, project_id
planned_end_time, actual_start_time, creator, project_id, execution_times
</sql>
<sql id="Blob_Column_List">
tags
@ -139,20 +140,20 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestPlan">
insert into test_plan (id, workspace_id, report_id,
`name`, description, `status`,
stage, principal, test_case_match_rule,
executor_match_rule, create_time, update_time,
actual_end_time, planned_start_time, planned_end_time,
actual_start_time, creator, project_id,
tags)
values (#{id,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{stage,jdbcType=VARCHAR}, #{principal,jdbcType=VARCHAR}, #{testCaseMatchRule,jdbcType=VARCHAR},
#{executorMatchRule,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{actualEndTime,jdbcType=BIGINT}, #{plannedStartTime,jdbcType=BIGINT}, #{plannedEndTime,jdbcType=BIGINT},
#{actualStartTime,jdbcType=BIGINT}, #{creator,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
#{tags,jdbcType=LONGVARCHAR})
insert into test_plan (id, workspace_id, report_id,
`name`, description, `status`,
stage, principal, test_case_match_rule,
executor_match_rule, create_time, update_time,
actual_end_time, planned_start_time, planned_end_time,
actual_start_time, creator, project_id,
execution_times, tags)
values (#{id,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{stage,jdbcType=VARCHAR}, #{principal,jdbcType=VARCHAR}, #{testCaseMatchRule,jdbcType=VARCHAR},
#{executorMatchRule,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{actualEndTime,jdbcType=BIGINT}, #{plannedStartTime,jdbcType=BIGINT}, #{plannedEndTime,jdbcType=BIGINT},
#{actualStartTime,jdbcType=BIGINT}, #{creator,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
#{executionTimes,jdbcType=INTEGER}, #{tags,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestPlan">
insert into test_plan
@ -211,6 +212,9 @@
<if test="projectId != null">
project_id,
</if>
<if test="executionTimes != null">
execution_times,
</if>
<if test="tags != null">
tags,
</if>
@ -270,6 +274,9 @@
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="executionTimes != null">
#{executionTimes,jdbcType=INTEGER},
</if>
<if test="tags != null">
#{tags,jdbcType=LONGVARCHAR},
</if>
@ -338,6 +345,9 @@
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.executionTimes != null">
execution_times = #{record.executionTimes,jdbcType=INTEGER},
</if>
<if test="record.tags != null">
tags = #{record.tags,jdbcType=LONGVARCHAR},
</if>
@ -356,17 +366,18 @@
`status` = #{record.status,jdbcType=VARCHAR},
stage = #{record.stage,jdbcType=VARCHAR},
principal = #{record.principal,jdbcType=VARCHAR},
test_case_match_rule = #{record.testCaseMatchRule,jdbcType=VARCHAR},
executor_match_rule = #{record.executorMatchRule,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
actual_end_time = #{record.actualEndTime,jdbcType=BIGINT},
planned_start_time = #{record.plannedStartTime,jdbcType=BIGINT},
planned_end_time = #{record.plannedEndTime,jdbcType=BIGINT},
actual_start_time = #{record.actualStartTime,jdbcType=BIGINT},
creator = #{record.creator,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
tags = #{record.tags,jdbcType=LONGVARCHAR}
test_case_match_rule = #{record.testCaseMatchRule,jdbcType=VARCHAR},
executor_match_rule = #{record.executorMatchRule,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
actual_end_time = #{record.actualEndTime,jdbcType=BIGINT},
planned_start_time = #{record.plannedStartTime,jdbcType=BIGINT},
planned_end_time = #{record.plannedEndTime,jdbcType=BIGINT},
actual_start_time = #{record.actualStartTime,jdbcType=BIGINT},
creator = #{record.creator,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
execution_times = #{record.executionTimes,jdbcType=INTEGER},
tags = #{record.tags,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -380,17 +391,18 @@
description = #{record.description,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
stage = #{record.stage,jdbcType=VARCHAR},
principal = #{record.principal,jdbcType=VARCHAR},
test_case_match_rule = #{record.testCaseMatchRule,jdbcType=VARCHAR},
executor_match_rule = #{record.executorMatchRule,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
actual_end_time = #{record.actualEndTime,jdbcType=BIGINT},
planned_start_time = #{record.plannedStartTime,jdbcType=BIGINT},
planned_end_time = #{record.plannedEndTime,jdbcType=BIGINT},
actual_start_time = #{record.actualStartTime,jdbcType=BIGINT},
creator = #{record.creator,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR}
principal = #{record.principal,jdbcType=VARCHAR},
test_case_match_rule = #{record.testCaseMatchRule,jdbcType=VARCHAR},
executor_match_rule = #{record.executorMatchRule,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
actual_end_time = #{record.actualEndTime,jdbcType=BIGINT},
planned_start_time = #{record.plannedStartTime,jdbcType=BIGINT},
planned_end_time = #{record.plannedEndTime,jdbcType=BIGINT},
actual_start_time = #{record.actualStartTime,jdbcType=BIGINT},
creator = #{record.creator,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
execution_times = #{record.executionTimes,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -449,6 +461,9 @@
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="executionTimes != null">
execution_times = #{executionTimes,jdbcType=INTEGER},
</if>
<if test="tags != null">
tags = #{tags,jdbcType=LONGVARCHAR},
</if>
@ -457,45 +472,47 @@
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestPlan">
update test_plan
set workspace_id = #{workspaceId,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
stage = #{stage,jdbcType=VARCHAR},
principal = #{principal,jdbcType=VARCHAR},
test_case_match_rule = #{testCaseMatchRule,jdbcType=VARCHAR},
executor_match_rule = #{executorMatchRule,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
actual_end_time = #{actualEndTime,jdbcType=BIGINT},
planned_start_time = #{plannedStartTime,jdbcType=BIGINT},
planned_end_time = #{plannedEndTime,jdbcType=BIGINT},
actual_start_time = #{actualStartTime,jdbcType=BIGINT},
creator = #{creator,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
tags = #{tags,jdbcType=LONGVARCHAR}
set workspace_id = #{workspaceId,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
stage = #{stage,jdbcType=VARCHAR},
principal = #{principal,jdbcType=VARCHAR},
test_case_match_rule = #{testCaseMatchRule,jdbcType=VARCHAR},
executor_match_rule = #{executorMatchRule,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
actual_end_time = #{actualEndTime,jdbcType=BIGINT},
planned_start_time = #{plannedStartTime,jdbcType=BIGINT},
planned_end_time = #{plannedEndTime,jdbcType=BIGINT},
actual_start_time = #{actualStartTime,jdbcType=BIGINT},
creator = #{creator,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
execution_times = #{executionTimes,jdbcType=INTEGER},
tags = #{tags,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestPlan">
update test_plan
set workspace_id = #{workspaceId,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
stage = #{stage,jdbcType=VARCHAR},
principal = #{principal,jdbcType=VARCHAR},
test_case_match_rule = #{testCaseMatchRule,jdbcType=VARCHAR},
executor_match_rule = #{executorMatchRule,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
actual_end_time = #{actualEndTime,jdbcType=BIGINT},
planned_start_time = #{plannedStartTime,jdbcType=BIGINT},
planned_end_time = #{plannedEndTime,jdbcType=BIGINT},
actual_start_time = #{actualStartTime,jdbcType=BIGINT},
creator = #{creator,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR}
set workspace_id = #{workspaceId,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
stage = #{stage,jdbcType=VARCHAR},
principal = #{principal,jdbcType=VARCHAR},
test_case_match_rule = #{testCaseMatchRule,jdbcType=VARCHAR},
executor_match_rule = #{executorMatchRule,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
actual_end_time = #{actualEndTime,jdbcType=BIGINT},
planned_start_time = #{plannedStartTime,jdbcType=BIGINT},
planned_end_time = #{plannedEndTime,jdbcType=BIGINT},
actual_start_time = #{actualStartTime,jdbcType=BIGINT},
creator = #{creator,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
execution_times = #{executionTimes,jdbcType=INTEGER}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -79,8 +79,9 @@ public class TestPlanController {
@PostMapping("/add")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public void addTestPlan(@RequestBody AddTestPlanRequest testPlan) {
testPlanService.addTestPlan(testPlan);
public String addTestPlan(@RequestBody AddTestPlanRequest testPlan) {
return testPlanService.addTestPlan(testPlan);
}
@PostMapping("/edit")

View File

@ -91,7 +91,9 @@ public class TestPlanReportService {
*/
public TestPlanReport genTestPlanReport(String planId, String userId,String triggerMode) {
TestPlan testPlan = testPlanMapper.selectByPrimaryKey(planId);
testPlan.setExecutionTimes(1);
testPlan.setExecutionTimes(testPlan.getExecutionTimes() + 1);
testPlanMapper.updateByPrimaryKey(testPlan);
TestPlanApiCaseExample apiExample = new TestPlanApiCaseExample();
apiExample.createCriteria().andTestPlanIdEqualTo(planId);
List<String> apiCaseIdList = testPlanApiCaseMapper.selectByExample(apiExample)

View File

@ -158,4 +158,7 @@ SET file_metadata.project_id = temp.project_id;
UPDATE file_metadata JOIN (SELECT file_id, project_id
FROM api_test_file
JOIN api_test ON test_id = api_test.id) temp ON file_id = file_metadata.id
SET file_metadata.project_id = temp.project_id;
SET file_metadata.project_id = temp.project_id;
-- add execution_times testPlan
alter table test_plan
add execution_times int null;

View File

@ -75,7 +75,7 @@
<table tableName="test_case_review_api_case"/>
<table tableName="test_case_review_load"/>
<table tableName="test_case_review_scenario"/>
<table tableName="test_plan"/>
</context>
</generatorConfiguration>

View File

@ -35,6 +35,9 @@ export const Test_Plan_List = [
{id: 'plannedEndTime', label: i18n.t('test_track.plan.planned_end_time')},
{id: 'actualStartTime', label: i18n.t('test_track.plan.actual_start_time')},
{id: 'actualEndTime', label: i18n.t('test_track.plan.actual_end_time')},
{id:'tags',label:i18n.t('commons.tag')},
{id:'executionTimes',label:i18n.t('commons.execution_times')},
{id:'passRate',label:i18n.t('commons.pass_rate')}
]
//接口定义-api列表
export const Api_List = [

View File

@ -136,12 +136,12 @@
<el-row>
<el-col :span="10">
<el-form-item label="关联需求" :label-width="formLabelWidth" prop="demandId">
<el-select filterable :disabled="readOnly" v-model="form.demandId" @visible-change="visibleChange"
<el-select filterable :disabled="readOnly" v-model="form.demandId"
:placeholder="$t('test_track.case.input_type')" class="ms-case-input">
<el-option
v-for="item in demandOptions"
:key="item.id"
:label="item.platform + ': '+item.name"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
@ -761,31 +761,18 @@ export default {
});
}
},
visibleChange(flag) {
if (flag) {
this.getDemandOptions()
}
},
getDemandOptions() {
if (this.demandOptions.length === 0) {
this.projectId = getCurrentProjectID();
this.result = {loading : true};
this.$get("demand/list/" + this.projectId).then(response => {
this.demandOptions = response.data.data;
this.demandOptions.unshift({id: 'other', name: this.$t('test_track.case.other'), platform: 'Other'})
this.result = {loading : false};
}).catch(() => {
this.result = {loading : false};
})
}
this.projectId = getCurrentProjectID()
this.result = this.$get("demand/list/" + this.projectId, response => {
this.demandOptions = response.data;
this.demandOptions.unshift({id: 'other', name: this.$t('test_track.case.other')})
});
},
getSelectOptions() {
this.getModuleOptions();
this.getMaintainerOptions();
this.getTestOptions();
if (this.type === 'edit') {
this.getDemandOptions();
}
// this.getDemandOptions()
},
resetForm() {

View File

@ -92,6 +92,27 @@
show-overflow-tooltip
:key="index">
</el-table-column>
<el-table-column v-if="item.id == 'tags'" prop="tags"
:label="$t('api_test.automation.tag')" :key="index">
<template v-slot:default="scope">
<ms-tag v-for="(itemName,index) in scope.row.tags" :key="index" type="success" effect="plain"
:content="itemName" style="margin-left: 5px"></ms-tag>
</template>
</el-table-column>
<el-table-column
v-if="item.id == 'executionTimes'"
prop="executionTimes"
:label="$t('commons.execution_times')"
show-overflow-tooltip
:key="index">
</el-table-column>
<el-table-column
v-if="item.id == 'passRate'"
prop="passRate"
:label="$t('commons.pass_rate')"
show-overflow-tooltip
:key="index">
</el-table-column>
<el-table-column
v-if="item.id == 'plannedStartTime'"
sortable
@ -206,11 +227,13 @@ import {TEST_CASE_LIST, TEST_PLAN_LIST} from "@/common/js/constants";
import {Test_Plan_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
import MsTag from "@/business/components/common/components/MsTag";
export default {
name: "TestPlanList",
components: {
MsTag,
HeaderLabelOperate,
HeaderCustom,
MsDeleteConfirm,
@ -281,8 +304,19 @@ export default {
let data = response.data;
this.total = data.itemCount;
this.tableData = data.listObject;
this.tableData.forEach(item => {
if (item.tags && item.tags.length > 0) {
item.tags = JSON.parse(item.tags);
}
item.passRate=item.passRate+'%'
})
console.log(this.tableData)
});
},
copyData(status) {
return JSON.parse(JSON.stringify(this.dataMap.get(status)))
},
buildPagePath(path) {
return path + "/" + this.currentPage + "/" + this.pageSize;
},

View File

@ -19,7 +19,7 @@
<slot name="footer"></slot>
</div>
<div v-else>
<div style="margin-bottom: 15px;margin-right: 0">
<div style="margin-bottom: 15px" v-if="flag">
<el-checkbox v-model="checked">同步添加关联的接口和性能测试</el-checkbox>
</div>
<ms-dialog-footer @cancel="close" @confirm="save"/>
@ -44,7 +44,7 @@
},
data() {
return {
checked: true,
checked:true,
result: {},
currentProject: {},
projectId: '',
@ -62,6 +62,9 @@
default() {
return this.$t('test_track.plan_view.relevance_test_case');
}
},
flag:{
type:Boolean,
}
},
watch: {
@ -74,7 +77,7 @@
},
save() {
this.$emit('save', this.checked);
this.$emit('save',this.checked);
},
close() {

View File

@ -4,6 +4,7 @@
@setProject="setProject"
@save="saveCaseRelevance"
:plan-id="planId"
:flag="true"
ref="baseRelevance">
<template v-slot:aside>

View File

@ -1,11 +1,7 @@
<template>
<div class="card-container">
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="initTableData"
<ms-table-header :is-,tester-permission="true" :condition.sync="condition" @search="initTableData"
:show-create="false" :tip="$t('commons.search_by_name_or_id')">
<template v-slot:title>
<node-breadcrumb class="table-title" :nodes="selectParentNodes" @refresh="refresh"
:title="$t('test_track.review_view.all_case')"/>
</template>
<template v-slot:button>
<ms-table-button :is-tester-permission="true" icon="el-icon-video-play"
:content="$t('test_track.review_view.start_review')" @click="startReview"/>
@ -471,5 +467,11 @@ export default {
.ms-table-header {
margin: 20px;
}
/deep/ .table-title {
height: 0px;
font-weight: bold;
font-size: 0px;
}
</style>

View File

@ -1,5 +1,7 @@
export default {
commons: {
pass_rate:'Pass rate',
execution_times:'Execution times',
cover: 'Cover',
not_cover: 'Not Cover',
import: 'Import',

View File

@ -1,5 +1,7 @@
export default {
commons: {
pass_rate:'通过率',
execution_times:'执行次数',
cover: '覆盖',
not_cover: '不覆盖',
import: '导入',

View File

@ -1,5 +1,7 @@
export default {
commons: {
pass_rate:'通過率',
execution_times:'執行次數',
cover: '覆蓋',
not_cover: '不覆蓋',
import: '導入',