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> </select>
<sql id="queryWhereConditionByBaseQueryRequest"> <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"> <if test="request.condition.keyword != null">
( (
case_review.name like concat('%', #{request.keyword},'%') case_review.name like concat('%', #{request.keyword},'%')
@ -355,7 +364,7 @@
<update id="batchMoveModule"> <update id="batchMoveModule">
update case_review update case_review
set module_id = #{request.moduleId}, set module_id = #{request.moveModuleId},
update_user = #{userId}, update_user = #{userId},
update_time = UNIX_TIMESTAMP()*1000 update_time = UNIX_TIMESTAMP()*1000
where id in where id in

View File

@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* @author guoyuqi * @author guoyuqi
@ -15,7 +16,10 @@ public class CaseReviewBatchRequest extends TableBatchProcessDTO implements Seri
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
private String projectId; private String projectId;
@Schema(description = "模块ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "目标模块id", requiredMode = Schema.RequiredMode.REQUIRED)
private String moduleId; 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(); String moduleId = caseReviews.get(0).getModuleId();
CaseReviewBatchRequest request = new CaseReviewBatchRequest(); CaseReviewBatchRequest request = new CaseReviewBatchRequest();
request.setProjectId(projectId); request.setProjectId(projectId);
request.setModuleId("CASE_REVIEW_REAL_MODULE_ID2"); request.setMoveModuleId("CASE_REVIEW_REAL_MODULE_ID2");
request.setSelectAll(false); request.setSelectAll(false);
this.requestPostWithOkAndReturn(BATCH_MOVE_CASE_REVIEW, request); this.requestPostWithOkAndReturn(BATCH_MOVE_CASE_REVIEW, request);
request.setSelectAll(true); request.setSelectAll(true);
@ -482,7 +482,7 @@ public class CaseReviewControllerTests extends BaseTest {
Assertions.assertFalse(StringUtils.equals(moduleId, moduleIdNew)); Assertions.assertFalse(StringUtils.equals(moduleId, moduleIdNew));
request = new CaseReviewBatchRequest(); request = new CaseReviewBatchRequest();
request.setProjectId(projectId); request.setProjectId(projectId);
request.setModuleId("CASE_REVIEW_REAL_MODULE_ID2"); request.setMoveModuleId("CASE_REVIEW_REAL_MODULE_ID2");
request.setSelectAll(false); request.setSelectAll(false);
request.setExcludeIds(List.of(caseReviews.get(0).getId())); request.setExcludeIds(List.of(caseReviews.get(0).getId()));
this.requestPostWithOkAndReturn(BATCH_MOVE_CASE_REVIEW, request); this.requestPostWithOkAndReturn(BATCH_MOVE_CASE_REVIEW, request);