diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/ReportDetailCasePageDTO.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/ReportDetailCasePageDTO.java
index 204c66161e..14c41b9fcd 100644
--- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/ReportDetailCasePageDTO.java
+++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/ReportDetailCasePageDTO.java
@@ -28,4 +28,6 @@ public class ReportDetailCasePageDTO {
private Long bugCount;
@Schema(description = "报告详情ID")
private String reportId;
+ @Schema(description = "项目ID")
+ private String projectId;
}
diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.xml
index 702400f8a3..8cddfbbd95 100644
--- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.xml
+++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.xml
@@ -28,8 +28,8 @@
select tprac.api_case_id as id, tprac.api_case_num as num, tprac.api_case_name as name,
tprac.api_case_module as moduleName, tprac.api_case_priority as priority, tprac.api_case_execute_report_id reportId,
- ifnull(tprac.api_case_execute_result, 'PENDING') as executeResult, tprac.api_case_execute_user as executeUser, 0 as bugCount
- from test_plan_report_api_case tprac
+ ifnull(tprac.api_case_execute_result, 'PENDING') as executeResult, tprac.api_case_execute_user as executeUser, 0 as bugCount, atc.project_id projectId
+ from test_plan_report_api_case tprac left join api_test_case atc on tprac.api_case_id = atc.id
where tprac.test_plan_report_id = #{request.reportId}
diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiScenarioMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiScenarioMapper.xml
index 540f57eed7..deb3e73f64 100644
--- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiScenarioMapper.xml
+++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiScenarioMapper.xml
@@ -27,8 +27,8 @@
select distinct tpras.api_scenario_id as id, tpras.api_scenario_num as num, tpras.api_scenario_name as name,
tpras.api_scenario_module as moduleName, tpras.api_scenario_priority as priority, tpras.api_scenario_execute_report_id reportId,
- ifnull(tpras.api_scenario_execute_result, 'PENDING') as executeResult, tpras.api_scenario_execute_user as executeUser, 0 as bugCount
- from test_plan_report_api_scenario tpras
+ ifnull(tpras.api_scenario_execute_result, 'PENDING') as executeResult, tpras.api_scenario_execute_user as executeUser, 0 as bugCount, aso.project_id projectId
+ from test_plan_report_api_scenario tpras left join api_scenario aso on tpras.api_scenario_id = aso.id
where tpras.test_plan_report_id = #{request.reportId}
diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportFunctionalCaseMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportFunctionalCaseMapper.xml
index e21589fb48..d66ec46fdf 100644
--- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportFunctionalCaseMapper.xml
+++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportFunctionalCaseMapper.xml
@@ -48,8 +48,9 @@
select tprfc.function_case_id as id, tprfc.function_case_num as num, tprfc.function_case_name as name,
tprfc.function_case_module as moduleName, tprfc.function_case_priority as priority,
ifnull(tprfc.function_case_execute_result, 'PENDING') as executeResult, tprfc.function_case_execute_user as executeUser,
- ifnull(tprfc.function_case_bug_count, 0) as bugCount, tprfc.function_case_execute_report_id reportId
+ ifnull(tprfc.function_case_bug_count, 0) as bugCount, tprfc.function_case_execute_report_id reportId, fc.project_id projectId
from test_plan_report_function_case tprfc
+ left join functional_case fc on fc.id = tprfc.function_case_id
where tprfc.test_plan_report_id = #{request.reportId}