fix: 我的待办查询 我创建的用例查询修改 我创建的缺陷查询

用例审核查询
接口负责人查询
接口自动化查询
This commit is contained in:
guoyuqi 2021-10-26 16:18:22 +08:00 committed by 刘瑞斌
parent 87db8a6c66
commit 586304c90b
9 changed files with 31 additions and 2 deletions

View File

@ -239,6 +239,10 @@ public class ApiDefinitionService {
}
}
}
//update userId
if(request.getUserId().equals("currentUserId")){
request.setUserId(SessionUtils.getUserId());
}
return request;
}

View File

@ -162,7 +162,7 @@
</if>
</if>
<if test="${condition}.creator != null">
and api_definition.user_id
and api_definition.create_user
<include refid="condition">
<property name="object" value="${condition}.creator"/>
</include>

View File

@ -275,6 +275,9 @@
</if>
</foreach>
</if>
<if test="request.filters == null || request.filters.size() == 0 ">
and (api_scenario.status is null or api_scenario.status != 'Trash')
</if>
<if test="request.executeStatus == 'unExecute'">
and api_scenario.last_result IS NULL
</if>

View File

@ -397,7 +397,7 @@
and (t1.status is null or t1.status != 'Trash')
</if>
<if test="request.toUpdate !=null and request.toUpdate == true">
and (t1.update_time >= 'request.updateTime' or t2.status = 'error')
and (t1.update_time >= #{request.updateTime} or t2.status = 'error')
</if>
GROUP BY t1.id,
t1.project_id,

View File

@ -50,6 +50,9 @@
<if test="request.name != null">
and test_case_review.name like CONCAT('%', #{request.name},'%')
</if>
<if test="request.reviewerId != null">
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})
</if>
<if test="request.projectId != null">
and test_case_review.project_id = #{request.projectId}
</if>

View File

@ -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
<if test="request.executorOrPrincipal != null">
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
</if>
<where>
<if test="request.combine != null">
<include refid="combine">
@ -159,13 +163,19 @@
</if>
</foreach>
</if>
<if test="request.executorOrPrincipal != null">
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()}')
</if>
</where>
<if test="request.orders != null and request.orders.size() > 0">
order by
<foreach collection="request.orders" separator="," item="order">
test_plan.${order.name} ${order.type}
</foreach>
</if>
</select>
<select id="planList" resultMap="BaseResultMap"
parameterType="io.metersphere.track.request.testcase.QueryTestPlanRequest">

View File

@ -31,4 +31,7 @@ public class QueryTestPlanRequest extends TestPlan {
private String projectId;
private String projectName;
//执行人或者负责人
private String executorOrPrincipal;
}

View File

@ -40,4 +40,6 @@ public class QueryCaseReviewRequest extends TestCaseReviewTestCase {
private String projectId;
private String projectName;
private String reviewerId;
}

View File

@ -157,6 +157,10 @@ public class TestCaseReviewService {
if (StringUtils.isBlank(projectId)) {
return new ArrayList<>();
}
//update reviewerId
if(request.getReviewerId().equals("currentUserId")){
request.setReviewerId(SessionUtils.getUserId());
}
return extTestCaseReviewMapper.list(request);
}