fix(测试跟踪): 公共用例库多标签筛选问题

This commit is contained in:
song-cc-rock 2023-06-02 11:10:35 +08:00 committed by fit2-zhao
parent 7d68f83f23
commit cd617558a3
5 changed files with 18 additions and 47 deletions

View File

@ -69,11 +69,6 @@ public class BaseQueryRequest {
*/
private Map<String, Object> combine;
/**
* 要查询的字段
*/
private List<String> selectFields;
/**
* 版本 ID
*/

View File

@ -288,20 +288,13 @@
project_version.id as versionId,
test_case.last_execute_result,
test_case.prerequisite, test_case.steps, remark, test_case.expected_result, test_case.step_description,
<if test="request.selectFields != null and request.selectFields.size() > 0">
<foreach collection="request.selectFields" item="field" separator=",">
${field}
</foreach>
</if>
<if test="request.selectFields == null or request.selectFields.size() == 0">
test_case.id, test_case.node_id, test_case.node_path, test_case.project_id, test_case.`name`,
test_case.`type`, test_case.maintainer, test_case.priority, test_case.`method`,
test_case.create_time, test_case.update_time, test_case.test_id, test_case.sort, test_case.num,
test_case.review_status, test_case.tags,
test_case.demand_id, test_case.demand_name, test_case.`status`,
test_case.custom_num, test_case.step_model, test_case.create_user,
test_case.ref_id,test_case.latest
</if>
test_case.id, test_case.node_id, test_case.node_path, test_case.project_id, test_case.`name`,
test_case.`type`, test_case.maintainer, test_case.priority, test_case.`method`,
test_case.create_time, test_case.update_time, test_case.test_id, test_case.sort, test_case.num,
test_case.review_status, test_case.tags,
test_case.demand_id, test_case.demand_name, test_case.`status`,
test_case.custom_num, test_case.step_model, test_case.create_user,
test_case.ref_id,test_case.latest
from test_case
left join project_version on project_version.id = test_case.version_id
<include refid="queryWhereCondition"/>
@ -311,22 +304,15 @@
<select id="publicList" resultType="io.metersphere.dto.TestCaseDTO">
select
test_case.last_execute_result,
<if test="request.selectFields != null and request.selectFields.size() > 0">
<foreach collection="request.selectFields" item="field" separator=",">
${field}
</foreach>
</if>
<if test="request.selectFields == null or request.selectFields.size() == 0">
test_case.id, test_case.node_id, test_case.node_path, test_case.project_id, test_case.`name`,
test_case.version_id,
test_case.`type`, test_case.maintainer, test_case.priority, test_case.`method`,
test_case.create_time, test_case.update_time, test_case.test_id, test_case.sort, test_case.num,
test_case.review_status, test_case.tags,
test_case.demand_id, test_case.demand_name, test_case.`status`,
test_case.custom_num, test_case.step_model, test_case.create_user,
test_case.custom_fields,test_case.case_public ,
project.workspace_id , project.name as projectName ,test_case.ref_id ,test_case.`order`
</if>
test_case.id, test_case.node_id, test_case.node_path, test_case.project_id, test_case.`name`,
test_case.version_id,
test_case.`type`, test_case.maintainer, test_case.priority, test_case.`method`,
test_case.create_time, test_case.update_time, test_case.test_id, test_case.sort, test_case.num,
test_case.review_status, test_case.tags,
test_case.demand_id, test_case.demand_name, test_case.`status`,
test_case.custom_num, test_case.step_model, test_case.create_user,
test_case.custom_fields,test_case.case_public ,
project.workspace_id , project.name as projectName ,test_case.ref_id ,test_case.`order`
from test_case
inner join project on test_case.project_id = project.id and workspace_id = #{request.workspaceId}
inner join project_version ON test_case.version_id = project_version.id
@ -398,9 +384,6 @@
test_case.`${order.name}` ${order.type}
</foreach>
</if>
<if test="request.pageCount != 0">
limit ${request.pageStart}, ${request.pageCount}
</if>
</select>
<select id="getMaxNumByProjectId" resultType="io.metersphere.base.domain.TestCase">

View File

@ -25,15 +25,6 @@ public class TestCaseBatchRequest extends TestCaseWithBLOBs {
*/
private Boolean exportAll = false;
/**
* v2.9 大批量导出分页参数
* pageStart: 偏移量
* pageCount: 数目
*/
private int pageStart = 0;
private int pageCount = 0;
@Getter
@Setter
public static class CustomFiledRequest {

View File

@ -265,6 +265,7 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
}
public List<TestCaseNodeDTO> getPublicCaseNode(String workspaceId, QueryTestCaseRequest request) {
ServiceUtils.buildCombineTagsToSupportMultiple(request);
request.setWorkspaceId(workspaceId);
request.setProjectId(null);
request.setNodeIds(null);

View File

@ -883,6 +883,7 @@ public class TestCaseService {
}
public List<TestCaseDTO> publicListTestCase(QueryTestCaseRequest request) {
ServiceUtils.buildCombineTagsToSupportMultiple(request);
List<TestCaseDTO> returnList = extTestCaseMapper.publicList(request);
ServiceUtils.buildProjectInfo(returnList);
buildUserInfo(returnList);