|
|
@ -5,6 +5,7 @@ import cn.hutool.core.util.IdUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.tduck.cloud.common.constant.CommonConstants; |
|
|
|
import com.tduck.cloud.common.util.LoginUserUtil; |
|
|
|
import com.tduck.cloud.common.util.Result; |
|
|
|
import com.tduck.cloud.common.validator.ValidatorUtils; |
|
|
@ -74,7 +75,7 @@ public class ProjectTemplateController { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 分页查询项目模板 |
|
|
|
* 分页查询项目模板 查询自己客户id和default的模版 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
@ -82,7 +83,7 @@ public class ProjectTemplateController { |
|
|
|
public Result queryProjectTemplates(QueryProjectTemplateRequest.Page request) { |
|
|
|
return Result.success(projectTemplateService.page(request.toMybatisPage(), |
|
|
|
Wrappers.<ProjectTemplateEntity>lambdaQuery() |
|
|
|
.eq(ProjectTemplateEntity::getCustomerId, LoginUserUtil.get().getCustomerId()) |
|
|
|
.and(wq->wq.eq(ProjectTemplateEntity::getCustomerId, CommonConstants.DEFAULT_EPMET_CUSTOMER_ID).or().eq(ProjectTemplateEntity::getCustomerId, LoginUserUtil.get().getCustomerId())) |
|
|
|
.eq(ObjectUtil.isNotNull(request.getType()), ProjectTemplateEntity::getCategoryId, request.getType()) |
|
|
|
.like(StrUtil.isNotBlank(request.getName()), ProjectTemplateEntity::getName, request.getName()) |
|
|
|
.orderByDesc(ProjectTemplateEntity::getUpdatedTime))); |
|
|
|