fix(接口测试): 修复首页按版本筛选定时任务失败的缺陷

--bug=1027662 --user=王孝刚 【接口测试】首页-运行中的定时任务-按版本筛选不显示对应版本定时任务
https://www.tapd.cn/55049933/s/1390948
This commit is contained in:
wxg0103 2023-07-10 17:57:00 +08:00 committed by fit2-zhao
parent 03b7ab74ef
commit fc9e7a20f1
1 changed files with 5 additions and 4 deletions

View File

@ -127,16 +127,17 @@
WHERE sch.`enable` = true WHERE sch.`enable` = true
AND sch.project_id = #{projectId,jdbcType=VARCHAR} AND sch.project_id = #{projectId,jdbcType=VARCHAR}
<if test="versionId != null"> <if test="versionId != null">
AND ( AND
sch.group IN ('SWAGGER_IMPORT') (sch.group IN ('API_SCENARIO_TEST')
and and
resource_id IN (SELECT id FROM api_scenario WHERE status != 'Trash' AND version_id = #{versionId}) resource_id IN (SELECT id FROM api_scenario WHERE status != 'Trash' AND version_id = #{versionId})
) )
</if> </if>
<if test="versionId == null"> <if test="versionId == null">
AND sch.group IN ('API_SCENARIO_TEST','SWAGGER_IMPORT') AND (sch.group IN ('SWAGGER_IMPORT')
or (sch.group IN ('API_SCENARIO_TEST')
and and
resource_id IN (SELECT id FROM api_scenario WHERE status != 'Trash' AND latest = 1) resource_id IN (SELECT id FROM api_scenario WHERE status != 'Trash' AND latest = 1)))
</if> </if>
ORDER BY sch.update_time DESC ORDER BY sch.update_time DESC
</select> </select>