diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiCaseMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiCaseMapper.xml
index 5307617e03..c186935a3e 100644
--- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiCaseMapper.xml
+++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiCaseMapper.xml
@@ -913,12 +913,13 @@
END AS execResult,
test_plan.group_id AS testPlanGroupId
from test_plan_api_case resource
+ INNER JOIN api_test_case apiCase ON resource.api_case_id = apiCase.id
INNER JOIN test_plan ON test_plan.id = resource.test_plan_id
- where test_plan.id IN
+ where resource.test_plan_id IN
#{testPlanId}
- AND test_plan.status != 'ARCHIVED'
+ AND apiCase.deleted IS FALSE