diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseScheduleMapper.xml b/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseScheduleMapper.xml
index ba7127daef..0b6546c532 100644
--- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseScheduleMapper.xml
+++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseScheduleMapper.xml
@@ -127,16 +127,17 @@
WHERE sch.`enable` = true
AND sch.project_id = #{projectId,jdbcType=VARCHAR}
- AND (
- sch.group IN ('SWAGGER_IMPORT')
+ AND
+ (sch.group IN ('API_SCENARIO_TEST')
and
resource_id IN (SELECT id FROM api_scenario WHERE status != 'Trash' AND version_id = #{versionId})
)
- AND sch.group IN ('API_SCENARIO_TEST','SWAGGER_IMPORT')
+ AND (sch.group IN ('SWAGGER_IMPORT')
+ or (sch.group IN ('API_SCENARIO_TEST')
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)))
ORDER BY sch.update_time DESC