完善 BPM Model 的搜索功能

This commit is contained in:
YunaiV
2022-01-02 08:49:35 +08:00
parent d8bbc71543
commit 430f1369be
4 changed files with 39 additions and 5 deletions

View File

@ -14,7 +14,13 @@ import lombok.ToString;
@ToString(callSuper = true)
public class ModelPageReqVO extends PageParam {
@ApiModelProperty(value = "名字", example = "芋道")
@ApiModelProperty(value = "标识", example = "process1641042089407", notes = "精准匹配")
private String key;
@ApiModelProperty(value = "名字", example = "芋道", notes = "模糊匹配")
private String name;
@ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1")
private String category;
}

View File

@ -55,9 +55,15 @@ public class BpmModelServiceImpl implements BpmModelService {
@Override
public PageResult<BpmModelPageItemRespVO> getModelPage(ModelPageReqVO pageVO) {
ModelQuery modelQuery = repositoryService.createModelQuery();
if (StrUtil.isNotBlank(pageVO.getKey())) {
modelQuery.modelKey(pageVO.getKey());
}
if (StrUtil.isNotBlank(pageVO.getName())) {
modelQuery.modelNameLike("%" + pageVO.getName() + "%"); // 模糊匹配
}
if (StrUtil.isNotBlank(pageVO.getCategory())) {
modelQuery.modelCategory(pageVO.getCategory());
}
// 执行查询
List<Model> models = modelQuery.orderByCreateTime().desc()
.listPage(PageUtils.getStart(pageVO), pageVO.getPageSize());