refactor(用例评审): 批量移动加模块查询条件

This commit is contained in:
guoyuqi 2023-12-05 17:58:47 +08:00 committed by Craftsman
parent 06ba806ba7
commit 44372debc6
3 changed files with 18 additions and 5 deletions

View File

@ -65,6 +65,15 @@
</select>
<sql id="queryWhereConditionByBaseQueryRequest">
<if test="request.moduleIds != null and request.moduleIds.size() > 0">
case_review.module_id in
<foreach collection="request.moduleIds" item="moduleId" separator="," open="(" close=")">
#{moduleId}
</foreach>
<include refid="queryType">
<property name="searchMode" value="request.condition.searchMode"/>
</include>
</if>
<if test="request.condition.keyword != null">
(
case_review.name like concat('%', #{request.keyword},'%')
@ -355,7 +364,7 @@
<update id="batchMoveModule">
update case_review
set module_id = #{request.moduleId},
set module_id = #{request.moveModuleId},
update_user = #{userId},
update_time = UNIX_TIMESTAMP()*1000
where id in

View File

@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author guoyuqi
@ -15,7 +16,10 @@ public class CaseReviewBatchRequest extends TableBatchProcessDTO implements Seri
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
private String projectId;
@Schema(description = "模块ID", requiredMode = Schema.RequiredMode.REQUIRED)
private String moduleId;
@Schema(description = "目标模块id", requiredMode = Schema.RequiredMode.REQUIRED)
private String moveModuleId;
@Schema(description = "模块id")
private List<String> moduleIds;
}

View File

@ -472,7 +472,7 @@ public class CaseReviewControllerTests extends BaseTest {
String moduleId = caseReviews.get(0).getModuleId();
CaseReviewBatchRequest request = new CaseReviewBatchRequest();
request.setProjectId(projectId);
request.setModuleId("CASE_REVIEW_REAL_MODULE_ID2");
request.setMoveModuleId("CASE_REVIEW_REAL_MODULE_ID2");
request.setSelectAll(false);
this.requestPostWithOkAndReturn(BATCH_MOVE_CASE_REVIEW, request);
request.setSelectAll(true);
@ -482,7 +482,7 @@ public class CaseReviewControllerTests extends BaseTest {
Assertions.assertFalse(StringUtils.equals(moduleId, moduleIdNew));
request = new CaseReviewBatchRequest();
request.setProjectId(projectId);
request.setModuleId("CASE_REVIEW_REAL_MODULE_ID2");
request.setMoveModuleId("CASE_REVIEW_REAL_MODULE_ID2");
request.setSelectAll(false);
request.setExcludeIds(List.of(caseReviews.get(0).getId()));
this.requestPostWithOkAndReturn(BATCH_MOVE_CASE_REVIEW, request);