diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java
index e46a1c2383..a4400e008b 100644
--- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java
+++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java
@@ -239,6 +239,10 @@ public class ApiDefinitionService {
}
}
}
+ //update userId
+ if(request.getUserId().equals("currentUserId")){
+ request.setUserId(SessionUtils.getUserId());
+ }
return request;
}
diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml
index 3f5f849476..14c47d2abb 100644
--- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml
+++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml
@@ -162,7 +162,7 @@
- and api_definition.user_id
+ and api_definition.create_user
diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml
index 0cb8acc730..08188d2150 100644
--- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml
+++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml
@@ -275,6 +275,9 @@
+
+ and (api_scenario.status is null or api_scenario.status != 'Trash')
+
and api_scenario.last_result IS NULL
diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml
index b805e5d44b..10dd69c9bb 100644
--- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml
+++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml
@@ -397,7 +397,7 @@
and (t1.status is null or t1.status != 'Trash')
- and (t1.update_time >= 'request.updateTime' or t2.status = 'error')
+ and (t1.update_time >= #{request.updateTime} or t2.status = 'error')
GROUP BY t1.id,
t1.project_id,
diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml
index 4f68d87f1b..c69bcfbba5 100644
--- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml
+++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml
@@ -50,6 +50,9 @@
and test_case_review.name like CONCAT('%', #{request.name},'%')
+
+ and test_case_review.id in (select test_case_review_users.review_id from test_case_review_users where test_case_review_users.user_id = #{request.reviewerId})
+
and test_case_review.project_id = #{request.projectId}
diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml
index 3a696bf3d9..bc2bff3b90 100644
--- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml
+++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml
@@ -119,6 +119,10 @@
from test_plan
LEFT JOIN schedule ON schedule.resource_id = test_plan.id
JOIN project on project.id = test_plan.project_id
+
+ JOIN test_plan_principal ON test_plan_principal.test_plan_id = test_plan.id
+ JOIN test_plan_test_case on test_plan_test_case.plan_id = test_plan.id
+
@@ -159,13 +163,19 @@
+
+ AND ( test_plan.creator = '${@io.metersphere.commons.utils.SessionUtils@getUserId()}' or test_plan_principal.principal_id = '${@io.metersphere.commons.utils.SessionUtils@getUserId()}' or test_plan_test_case.executor = '${@io.metersphere.commons.utils.SessionUtils@getUserId()}')
+
+
order by
test_plan.${order.name} ${order.type}
+
+