fix:接口测试-接口定义,使用用例状态筛选,只能筛选当前页面

This commit is contained in:
wenyann 2021-05-31 13:13:03 +08:00 committed by 刘瑞斌
parent c8eecf587e
commit 5573b9fd61
9 changed files with 378 additions and 104 deletions

View File

@ -113,19 +113,6 @@ public class ApiDefinitionService {
request = this.initRequest(request, true, true); request = this.initRequest(request, true, true);
List<ApiDefinitionResult> resList = extApiDefinitionMapper.list(request); List<ApiDefinitionResult> resList = extApiDefinitionMapper.list(request);
calculateResult(resList, request.getProjectId()); calculateResult(resList, request.getProjectId());
ApiDefinitionRequest finalRequest = request;
/* List<ApiDefinitionResult> resListFilters = new ArrayList<>();
if (finalRequest.getFilters().size() > 1) {
if (null != finalRequest.getFilters().get("case_status")) {
resListFilters = resList.stream()
.filter((ApiDefinitionResult b) -> finalRequest.getFilters().get("case_status").contains(b.getCaseStatus()))
.collect(Collectors.toList());
return resListFilters;
}
}*/
return resList; return resList;
} }
@ -884,6 +871,7 @@ public class ApiDefinitionService {
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders())); request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
List<ApiDefinitionResult> resList = extApiDefinitionMapper.listRelevanceReview(request); List<ApiDefinitionResult> resList = extApiDefinitionMapper.listRelevanceReview(request);
calculateResult(resList, request.getProjectId()); calculateResult(resList, request.getProjectId());
resList = extApiDefinitionMapper.list(request);
return resList; return resList;
} }
@ -911,6 +899,7 @@ public class ApiDefinitionService {
res.setCaseStatus("-"); res.setCaseStatus("-");
} }
apiDefinitionMapper.updateByPrimaryKey(res);
if (StringUtils.equalsIgnoreCase("esb", res.getMethod())) { if (StringUtils.equalsIgnoreCase("esb", res.getMethod())) {
esbApiParamService.handleApiEsbParams(res); esbApiParamService.handleApiEsbParams(res);
} }

View File

@ -41,5 +41,11 @@ public class ApiDefinition implements Serializable {
private String createUser; private String createUser;
private String caseTotal;
private String caseStatus;
private String casePassingRate;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -1333,6 +1333,216 @@ public class ApiDefinitionExample {
addCriterion("create_user not between", value1, value2, "createUser"); addCriterion("create_user not between", value1, value2, "createUser");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCaseTotalIsNull() {
addCriterion("case_total is null");
return (Criteria) this;
}
public Criteria andCaseTotalIsNotNull() {
addCriterion("case_total is not null");
return (Criteria) this;
}
public Criteria andCaseTotalEqualTo(String value) {
addCriterion("case_total =", value, "caseTotal");
return (Criteria) this;
}
public Criteria andCaseTotalNotEqualTo(String value) {
addCriterion("case_total <>", value, "caseTotal");
return (Criteria) this;
}
public Criteria andCaseTotalGreaterThan(String value) {
addCriterion("case_total >", value, "caseTotal");
return (Criteria) this;
}
public Criteria andCaseTotalGreaterThanOrEqualTo(String value) {
addCriterion("case_total >=", value, "caseTotal");
return (Criteria) this;
}
public Criteria andCaseTotalLessThan(String value) {
addCriterion("case_total <", value, "caseTotal");
return (Criteria) this;
}
public Criteria andCaseTotalLessThanOrEqualTo(String value) {
addCriterion("case_total <=", value, "caseTotal");
return (Criteria) this;
}
public Criteria andCaseTotalLike(String value) {
addCriterion("case_total like", value, "caseTotal");
return (Criteria) this;
}
public Criteria andCaseTotalNotLike(String value) {
addCriterion("case_total not like", value, "caseTotal");
return (Criteria) this;
}
public Criteria andCaseTotalIn(List<String> values) {
addCriterion("case_total in", values, "caseTotal");
return (Criteria) this;
}
public Criteria andCaseTotalNotIn(List<String> values) {
addCriterion("case_total not in", values, "caseTotal");
return (Criteria) this;
}
public Criteria andCaseTotalBetween(String value1, String value2) {
addCriterion("case_total between", value1, value2, "caseTotal");
return (Criteria) this;
}
public Criteria andCaseTotalNotBetween(String value1, String value2) {
addCriterion("case_total not between", value1, value2, "caseTotal");
return (Criteria) this;
}
public Criteria andCaseStatusIsNull() {
addCriterion("case_status is null");
return (Criteria) this;
}
public Criteria andCaseStatusIsNotNull() {
addCriterion("case_status is not null");
return (Criteria) this;
}
public Criteria andCaseStatusEqualTo(String value) {
addCriterion("case_status =", value, "caseStatus");
return (Criteria) this;
}
public Criteria andCaseStatusNotEqualTo(String value) {
addCriterion("case_status <>", value, "caseStatus");
return (Criteria) this;
}
public Criteria andCaseStatusGreaterThan(String value) {
addCriterion("case_status >", value, "caseStatus");
return (Criteria) this;
}
public Criteria andCaseStatusGreaterThanOrEqualTo(String value) {
addCriterion("case_status >=", value, "caseStatus");
return (Criteria) this;
}
public Criteria andCaseStatusLessThan(String value) {
addCriterion("case_status <", value, "caseStatus");
return (Criteria) this;
}
public Criteria andCaseStatusLessThanOrEqualTo(String value) {
addCriterion("case_status <=", value, "caseStatus");
return (Criteria) this;
}
public Criteria andCaseStatusLike(String value) {
addCriterion("case_status like", value, "caseStatus");
return (Criteria) this;
}
public Criteria andCaseStatusNotLike(String value) {
addCriterion("case_status not like", value, "caseStatus");
return (Criteria) this;
}
public Criteria andCaseStatusIn(List<String> values) {
addCriterion("case_status in", values, "caseStatus");
return (Criteria) this;
}
public Criteria andCaseStatusNotIn(List<String> values) {
addCriterion("case_status not in", values, "caseStatus");
return (Criteria) this;
}
public Criteria andCaseStatusBetween(String value1, String value2) {
addCriterion("case_status between", value1, value2, "caseStatus");
return (Criteria) this;
}
public Criteria andCaseStatusNotBetween(String value1, String value2) {
addCriterion("case_status not between", value1, value2, "caseStatus");
return (Criteria) this;
}
public Criteria andCasePassingRateIsNull() {
addCriterion("case_passing_rate is null");
return (Criteria) this;
}
public Criteria andCasePassingRateIsNotNull() {
addCriterion("case_passing_rate is not null");
return (Criteria) this;
}
public Criteria andCasePassingRateEqualTo(String value) {
addCriterion("case_passing_rate =", value, "casePassingRate");
return (Criteria) this;
}
public Criteria andCasePassingRateNotEqualTo(String value) {
addCriterion("case_passing_rate <>", value, "casePassingRate");
return (Criteria) this;
}
public Criteria andCasePassingRateGreaterThan(String value) {
addCriterion("case_passing_rate >", value, "casePassingRate");
return (Criteria) this;
}
public Criteria andCasePassingRateGreaterThanOrEqualTo(String value) {
addCriterion("case_passing_rate >=", value, "casePassingRate");
return (Criteria) this;
}
public Criteria andCasePassingRateLessThan(String value) {
addCriterion("case_passing_rate <", value, "casePassingRate");
return (Criteria) this;
}
public Criteria andCasePassingRateLessThanOrEqualTo(String value) {
addCriterion("case_passing_rate <=", value, "casePassingRate");
return (Criteria) this;
}
public Criteria andCasePassingRateLike(String value) {
addCriterion("case_passing_rate like", value, "casePassingRate");
return (Criteria) this;
}
public Criteria andCasePassingRateNotLike(String value) {
addCriterion("case_passing_rate not like", value, "casePassingRate");
return (Criteria) this;
}
public Criteria andCasePassingRateIn(List<String> values) {
addCriterion("case_passing_rate in", values, "casePassingRate");
return (Criteria) this;
}
public Criteria andCasePassingRateNotIn(List<String> values) {
addCriterion("case_passing_rate not in", values, "casePassingRate");
return (Criteria) this;
}
public Criteria andCasePassingRateBetween(String value1, String value2) {
addCriterion("case_passing_rate between", value1, value2, "casePassingRate");
return (Criteria) this;
}
public Criteria andCasePassingRateNotBetween(String value1, String value2) {
addCriterion("case_passing_rate not between", value1, value2, "casePassingRate");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {

View File

@ -10,16 +10,19 @@
<result column="environment_id" jdbcType="VARCHAR" property="environmentId" /> <result column="environment_id" jdbcType="VARCHAR" property="environmentId" />
<result column="schedule" jdbcType="VARCHAR" property="schedule" /> <result column="schedule" jdbcType="VARCHAR" property="schedule" />
<result column="status" jdbcType="VARCHAR" property="status" /> <result column="status" jdbcType="VARCHAR" property="status" />
<result column="module_id" jdbcType="VARCHAR" property="moduleId" /> <result column="module_id" jdbcType="VARCHAR" property="moduleId"/>
<result column="user_id" jdbcType="VARCHAR" property="userId" /> <result column="user_id" jdbcType="VARCHAR" property="userId"/>
<result column="create_time" jdbcType="BIGINT" property="createTime" /> <result column="create_time" jdbcType="BIGINT" property="createTime"/>
<result column="update_time" jdbcType="BIGINT" property="updateTime" /> <result column="update_time" jdbcType="BIGINT" property="updateTime"/>
<result column="protocol" jdbcType="VARCHAR" property="protocol" /> <result column="protocol" jdbcType="VARCHAR" property="protocol"/>
<result column="path" jdbcType="VARCHAR" property="path" /> <result column="path" jdbcType="VARCHAR" property="path"/>
<result column="num" jdbcType="INTEGER" property="num" /> <result column="num" jdbcType="INTEGER" property="num"/>
<result column="tags" jdbcType="VARCHAR" property="tags" /> <result column="tags" jdbcType="VARCHAR" property="tags"/>
<result column="original_state" jdbcType="VARCHAR" property="originalState" /> <result column="original_state" jdbcType="VARCHAR" property="originalState"/>
<result column="create_user" jdbcType="VARCHAR" property="createUser" /> <result column="create_user" jdbcType="VARCHAR" property="createUser"/>
<result column="case_total" jdbcType="VARCHAR" property="caseTotal"/>
<result column="case_status" jdbcType="VARCHAR" property="caseStatus"/>
<result column="case_passing_rate" jdbcType="VARCHAR" property="casePassingRate"/>
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiDefinitionWithBLOBs"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
<result column="description" jdbcType="LONGVARCHAR" property="description" /> <result column="description" jdbcType="LONGVARCHAR" property="description" />
@ -87,7 +90,7 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, project_id, `name`, `method`, module_path, environment_id, schedule, `status`, id, project_id, `name`, `method`, module_path, environment_id, schedule, `status`,
module_id, user_id, create_time, update_time, protocol, `path`, num, tags, original_state, module_id, user_id, create_time, update_time, protocol, `path`, num, tags, original_state,
create_user create_user, case_total, case_status, case_passing_rate
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
description, request, response description, request, response
@ -141,22 +144,22 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs"> <insert id="insert" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
insert into api_definition (id, project_id, `name`, insert into api_definition (id, project_id, `name`,
`method`, module_path, environment_id, `method`, module_path, environment_id,
schedule, `status`, module_id, schedule, `status`, module_id,
user_id, create_time, update_time, user_id, create_time, update_time,
protocol, `path`, num, protocol, `path`, num,
tags, original_state, create_user, tags, original_state, create_user,
description, request, response case_total, case_status, case_passing_rate,
) description, request, response)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{method,jdbcType=VARCHAR}, #{modulePath,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, #{modulePath,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR},
#{schedule,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{moduleId,jdbcType=VARCHAR}, #{schedule,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{moduleId,jdbcType=VARCHAR},
#{userId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{userId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{protocol,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, #{protocol,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER},
#{tags,jdbcType=VARCHAR}, #{originalState,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{tags,jdbcType=VARCHAR}, #{originalState,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
#{description,jdbcType=LONGVARCHAR}, #{request,jdbcType=LONGVARCHAR}, #{response,jdbcType=LONGVARCHAR} #{caseTotal,jdbcType=VARCHAR}, #{caseStatus,jdbcType=VARCHAR}, #{casePassingRate,jdbcType=VARCHAR},
) #{description,jdbcType=LONGVARCHAR}, #{request,jdbcType=LONGVARCHAR}, #{response,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs"> <insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
insert into api_definition insert into api_definition
@ -215,6 +218,15 @@
<if test="createUser != null"> <if test="createUser != null">
create_user, create_user,
</if> </if>
<if test="caseTotal != null">
case_total,
</if>
<if test="caseStatus != null">
case_status,
</if>
<if test="casePassingRate != null">
case_passing_rate,
</if>
<if test="description != null"> <if test="description != null">
description, description,
</if> </if>
@ -280,6 +292,15 @@
<if test="createUser != null"> <if test="createUser != null">
#{createUser,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
</if> </if>
<if test="caseTotal != null">
#{caseTotal,jdbcType=VARCHAR},
</if>
<if test="caseStatus != null">
#{caseStatus,jdbcType=VARCHAR},
</if>
<if test="casePassingRate != null">
#{casePassingRate,jdbcType=VARCHAR},
</if>
<if test="description != null"> <if test="description != null">
#{description,jdbcType=LONGVARCHAR}, #{description,jdbcType=LONGVARCHAR},
</if> </if>
@ -354,6 +375,15 @@
<if test="record.createUser != null"> <if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR}, create_user = #{record.createUser,jdbcType=VARCHAR},
</if> </if>
<if test="record.caseTotal != null">
case_total = #{record.caseTotal,jdbcType=VARCHAR},
</if>
<if test="record.caseStatus != null">
case_status = #{record.caseStatus,jdbcType=VARCHAR},
</if>
<if test="record.casePassingRate != null">
case_passing_rate = #{record.casePassingRate,jdbcType=VARCHAR},
</if>
<if test="record.description != null"> <if test="record.description != null">
description = #{record.description,jdbcType=LONGVARCHAR}, description = #{record.description,jdbcType=LONGVARCHAR},
</if> </if>
@ -378,19 +408,22 @@
environment_id = #{record.environmentId,jdbcType=VARCHAR}, environment_id = #{record.environmentId,jdbcType=VARCHAR},
schedule = #{record.schedule,jdbcType=VARCHAR}, schedule = #{record.schedule,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR}, `status` = #{record.status,jdbcType=VARCHAR},
module_id = #{record.moduleId,jdbcType=VARCHAR}, module_id = #{record.moduleId,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR}, user_id = #{record.userId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
protocol = #{record.protocol,jdbcType=VARCHAR}, protocol = #{record.protocol,jdbcType=VARCHAR},
`path` = #{record.path,jdbcType=VARCHAR}, `path` = #{record.path,jdbcType=VARCHAR},
num = #{record.num,jdbcType=INTEGER}, num = #{record.num,jdbcType=INTEGER},
tags = #{record.tags,jdbcType=VARCHAR}, tags = #{record.tags,jdbcType=VARCHAR},
original_state = #{record.originalState,jdbcType=VARCHAR}, original_state = #{record.originalState,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR}, create_user = #{record.createUser,jdbcType=VARCHAR},
description = #{record.description,jdbcType=LONGVARCHAR}, case_total = #{record.caseTotal,jdbcType=VARCHAR},
request = #{record.request,jdbcType=LONGVARCHAR}, case_status = #{record.caseStatus,jdbcType=VARCHAR},
response = #{record.response,jdbcType=LONGVARCHAR} case_passing_rate = #{record.casePassingRate,jdbcType=VARCHAR},
description = #{record.description,jdbcType=LONGVARCHAR},
request = #{record.request,jdbcType=LONGVARCHAR},
response = #{record.response,jdbcType=LONGVARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -404,17 +437,20 @@
module_path = #{record.modulePath,jdbcType=VARCHAR}, module_path = #{record.modulePath,jdbcType=VARCHAR},
environment_id = #{record.environmentId,jdbcType=VARCHAR}, environment_id = #{record.environmentId,jdbcType=VARCHAR},
schedule = #{record.schedule,jdbcType=VARCHAR}, schedule = #{record.schedule,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR}, `status` = #{record.status,jdbcType=VARCHAR},
module_id = #{record.moduleId,jdbcType=VARCHAR}, module_id = #{record.moduleId,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR}, user_id = #{record.userId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
protocol = #{record.protocol,jdbcType=VARCHAR}, protocol = #{record.protocol,jdbcType=VARCHAR},
`path` = #{record.path,jdbcType=VARCHAR}, `path` = #{record.path,jdbcType=VARCHAR},
num = #{record.num,jdbcType=INTEGER}, num = #{record.num,jdbcType=INTEGER},
tags = #{record.tags,jdbcType=VARCHAR}, tags = #{record.tags,jdbcType=VARCHAR},
original_state = #{record.originalState,jdbcType=VARCHAR}, original_state = #{record.originalState,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR} create_user = #{record.createUser,jdbcType=VARCHAR},
case_total = #{record.caseTotal,jdbcType=VARCHAR},
case_status = #{record.caseStatus,jdbcType=VARCHAR},
case_passing_rate = #{record.casePassingRate,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -473,6 +509,15 @@
<if test="createUser != null"> <if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR}, create_user = #{createUser,jdbcType=VARCHAR},
</if> </if>
<if test="caseTotal != null">
case_total = #{caseTotal,jdbcType=VARCHAR},
</if>
<if test="caseStatus != null">
case_status = #{caseStatus,jdbcType=VARCHAR},
</if>
<if test="casePassingRate != null">
case_passing_rate = #{casePassingRate,jdbcType=VARCHAR},
</if>
<if test="description != null"> <if test="description != null">
description = #{description,jdbcType=LONGVARCHAR}, description = #{description,jdbcType=LONGVARCHAR},
</if> </if>
@ -487,47 +532,53 @@
</update> </update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs"> <update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
update api_definition update api_definition
set project_id = #{projectId,jdbcType=VARCHAR}, set project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR}, `name` = #{name,jdbcType=VARCHAR},
`method` = #{method,jdbcType=VARCHAR}, `method` = #{method,jdbcType=VARCHAR},
module_path = #{modulePath,jdbcType=VARCHAR}, module_path = #{modulePath,jdbcType=VARCHAR},
environment_id = #{environmentId,jdbcType=VARCHAR}, environment_id = #{environmentId,jdbcType=VARCHAR},
schedule = #{schedule,jdbcType=VARCHAR}, schedule = #{schedule,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR}, `status` = #{status,jdbcType=VARCHAR},
module_id = #{moduleId,jdbcType=VARCHAR}, module_id = #{moduleId,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR}, user_id = #{userId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
protocol = #{protocol,jdbcType=VARCHAR}, protocol = #{protocol,jdbcType=VARCHAR},
`path` = #{path,jdbcType=VARCHAR}, `path` = #{path,jdbcType=VARCHAR},
num = #{num,jdbcType=INTEGER}, num = #{num,jdbcType=INTEGER},
tags = #{tags,jdbcType=VARCHAR}, tags = #{tags,jdbcType=VARCHAR},
original_state = #{originalState,jdbcType=VARCHAR}, original_state = #{originalState,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR}, create_user = #{createUser,jdbcType=VARCHAR},
description = #{description,jdbcType=LONGVARCHAR}, case_total = #{caseTotal,jdbcType=VARCHAR},
request = #{request,jdbcType=LONGVARCHAR}, case_status = #{caseStatus,jdbcType=VARCHAR},
response = #{response,jdbcType=LONGVARCHAR} case_passing_rate = #{casePassingRate,jdbcType=VARCHAR},
description = #{description,jdbcType=LONGVARCHAR},
request = #{request,jdbcType=LONGVARCHAR},
response = #{response,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiDefinition"> <update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiDefinition">
update api_definition update api_definition
set project_id = #{projectId,jdbcType=VARCHAR}, set project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR}, `name` = #{name,jdbcType=VARCHAR},
`method` = #{method,jdbcType=VARCHAR}, `method` = #{method,jdbcType=VARCHAR},
module_path = #{modulePath,jdbcType=VARCHAR}, module_path = #{modulePath,jdbcType=VARCHAR},
environment_id = #{environmentId,jdbcType=VARCHAR}, environment_id = #{environmentId,jdbcType=VARCHAR},
schedule = #{schedule,jdbcType=VARCHAR}, schedule = #{schedule,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR}, `status` = #{status,jdbcType=VARCHAR},
module_id = #{moduleId,jdbcType=VARCHAR}, module_id = #{moduleId,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR}, user_id = #{userId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
protocol = #{protocol,jdbcType=VARCHAR}, protocol = #{protocol,jdbcType=VARCHAR},
`path` = #{path,jdbcType=VARCHAR}, `path` = #{path,jdbcType=VARCHAR},
num = #{num,jdbcType=INTEGER}, num = #{num,jdbcType=INTEGER},
tags = #{tags,jdbcType=VARCHAR}, tags = #{tags,jdbcType=VARCHAR},
original_state = #{originalState,jdbcType=VARCHAR}, original_state = #{originalState,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR} create_user = #{createUser,jdbcType=VARCHAR},
case_total = #{caseTotal,jdbcType=VARCHAR},
case_status = #{caseStatus,jdbcType=VARCHAR},
case_passing_rate = #{casePassingRate,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>

View File

@ -515,6 +515,12 @@
#{value} #{value}
</foreach> </foreach>
</when> </when>
<when test="key=='case_status'">
and api_definition.case_status in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
</choose> </choose>
</if> </if>
</foreach> </foreach>

View File

@ -71,4 +71,11 @@ values ('test_case_list',
'[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"createUser","label":"创建人"},{"id":"priority","label":"用例等级"},{"id":"reviewStatus","label":"评审状态"},{"id":"tags","label":"标签"},{"id":"nodePath","label":"所属模块"},{"id":"updateTime","label":"更新时间"}]'); '[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"createUser","label":"创建人"},{"id":"priority","label":"用例等级"},{"id":"reviewStatus","label":"评审状态"},{"id":"tags","label":"标签"},{"id":"nodePath","label":"所属模块"},{"id":"updateTime","label":"更新时间"}]');
insert into system_header (type, props) insert into system_header (type, props)
values ('test_plan_scenario_case', values ('test_plan_scenario_case',
'[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"level","label":"用例等级"},{"id":"tagNames","label":"标签"},{"id":"userId","label":"创建人"},{"id":"updateTime","label":"最后更新时间"},{"id":"stepTotal","label":"通过"},{"id":"lastResult","label":"失败"},{"id":"passRate","label":"通过率"}]'); '[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"level","label":"用例等级"},{"id":"tagNames","label":"标签"},{"id":"userId","label":"创建人"},{"id":"updateTime","label":"最后更新时间"},{"id":"stepTotal","label":"通过"},{"id":"lastResult","label":"失败"},{"id":"passRate","label":"通过率"}]');
-- 接口定义添加用例总数,用例状态,用例通过率字段
alter table api_definition
add case_total varchar(100) null;
alter table api_definition
add case_status varchar(100) null;
alter table api_definition
add case_passing_rate varchar(100) null;

View File

@ -78,7 +78,9 @@
<table tableName="test_plan"/> <table tableName="test_plan"/>
<table tableName="test_case_test"/>--> <table tableName="test_case_test"/>-->
<!-- <table tableName="api_test_environment"></table>--> <!-- <table tableName="api_test_environment"></table>-->
<!--
<table tableName="project"></table> <table tableName="project"></table>
-->
<!-- <table tableName="custom_field"></table>--> <!-- <table tableName="custom_field"></table>-->
<!-- <table tableName="test_case"></table>--> <!-- <table tableName="test_case"></table>-->
<!-- <table tableName="test_case"></table>--> <!-- <table tableName="test_case"></table>-->

View File

@ -128,6 +128,7 @@
<ms-table-column <ms-table-column
v-if="item.id == 'caseTotal'" v-if="item.id == 'caseTotal'"
prop="caseTotal" prop="caseTotal"
sortable="custom"
width="140px" width="140px"
:label="$t('api_test.definition.api_case_number')" :label="$t('api_test.definition.api_case_number')"
show-overflow-tooltip show-overflow-tooltip
@ -136,6 +137,7 @@
<ms-table-column <ms-table-column
v-if="item.id == 'caseStatus'" v-if="item.id == 'caseStatus'"
prop="caseStatus" prop="caseStatus"
:filters="caseStatusFilters"
width="130px" width="130px"
:label="$t('api_test.definition.api_case_status')" :label="$t('api_test.definition.api_case_status')"
show-overflow-tooltip show-overflow-tooltip
@ -146,6 +148,7 @@
v-if="item.id == 'casePassingRate'" v-if="item.id == 'casePassingRate'"
width="150px" width="150px"
prop="casePassingRate" prop="casePassingRate"
sortable="custom"
:label="$t('api_test.definition.api_case_passing_rate')" :label="$t('api_test.definition.api_case_passing_rate')"
show-overflow-tooltip show-overflow-tooltip
:key="index"/> :key="index"/>

View File

@ -138,9 +138,9 @@ export function _sort(column, condition) {
hasProp = true; hasProp = true;
} }
}); });
if (column.prop === 'case_passing_rate' || column.prop === 'case_total') { /* if (column.prop === 'case_passing_rate' || column.prop === 'case_total') {
hasProp = true; hasProp = true;
} }*/
if (!hasProp) { if (!hasProp) {
condition.orders.push({name: column.prop, type: column.order}); condition.orders.push({name: column.prop, type: column.order});
} }