fix(测试计划): 关联测试用例ID排序按钮不生效

--bug=1007613 --user=lyh 【github#7338】关联测试用例ID排序按钮不生效
https://www.tapd.cn/55049933/s/1062512
This commit is contained in:
shiziyuan9527 2021-11-01 16:22:47 +08:00 committed by shiziyuan9527
parent efe10af491
commit 8b1062d550
2 changed files with 5 additions and 2 deletions

View File

@ -130,7 +130,7 @@
left join test_plan_test_case as T2 on test_case.id=T2.case_id and T2.plan_id =#{request.planId} left join test_plan_test_case as T2 on test_case.id=T2.case_id and T2.plan_id =#{request.planId}
<include refid="notInQueryWhereCondition"></include> <include refid="notInQueryWhereCondition"></include>
and T2.case_id is null and T2.case_id is null
ORDER BY test_case.update_time DESC <include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
</select> </select>
<select id="getTestCaseNames" resultType="io.metersphere.base.domain.TestCase"> <select id="getTestCaseNames" resultType="io.metersphere.base.domain.TestCase">
@ -338,7 +338,7 @@
</if> </if>
</foreach> </foreach>
</if> </if>
<if test="request.filters == null || request.filters.size() == 0 "> <if test="request.filters == null || request.filters.size() == 0 || !request.filters.entrySet().contains('status')">
and (test_case.status is null or test_case.status != 'Trash') and (test_case.status is null or test_case.status != 'Trash')
</if> </if>
</sql> </sql>

View File

@ -454,6 +454,9 @@ public class TestCaseService {
*/ */
public List<TestCase> getTestCaseRelateList(QueryTestCaseRequest request) { public List<TestCase> getTestCaseRelateList(QueryTestCaseRequest request) {
setDefaultOrder(request); setDefaultOrder(request);
request.getOrders().forEach(order -> {
order.setPrefix("test_case");
});
return getTestCaseByNotInPlan(request); return getTestCaseByNotInPlan(request);
} }