fix: 修复jenkins查询测试列表的时候没有版本信息的问题

This commit is contained in:
CaptainB 2022-02-15 13:19:11 +08:00 committed by shiziyuan9527
parent 724db7acd6
commit 5fcfc3f9ca
1 changed files with 9 additions and 11 deletions

View File

@ -351,28 +351,26 @@
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
</select>
<select id="listByMethod" resultType="io.metersphere.track.dto.TestCaseDTO">
select id,name,project_id,'性能测试' as type from load_test
select load_test.id, load_test.name, load_test.project_id,'性能测试' as type, project_version.name as version_name
from load_test inner join project_version on project_version.project_id = load_test.project_id and project_version.id = load_test.version_id
<where>
<if test="request.projectId!=null">
and project_id= #{request.projectId}
and load_test.project_id= #{request.projectId}
</if>
</where>
UNION ALL
select id,name,project_id,'接口场景' as type from api_scenario
select api_scenario.id, api_scenario.name, api_scenario.project_id,'接口场景' as type, project_version.name as version_name
from api_scenario inner join project_version on project_version.project_id = api_scenario.project_id and project_version.id = api_scenario.version_id
<where>
<if test="request.projectId!=null">
and project_id= #{request.projectId}
and api_scenario.project_id= #{request.projectId}
</if>
</where>
and api_scenario.status!='Trash'
UNION ALL
select b.id,b.name,b.project_id,'接口用例' as type from api_test_case b
inner join
api_definition a
on
b.api_definition_id = a.id
and a.status != 'Trash'
select b.id,b.name,b.project_id,'接口用例' as type, project_version.name as version_name
from api_test_case b inner join api_definition a on b.api_definition_id = a.id and a.status != 'Trash'
inner join project_version on project_version.project_id = a.project_id and project_version.id = a.version_id
<where>
<if test="request.projectId!=null">
and b.project_id= #{request.projectId}