优化代码

pull/47/head
smallbun 2023-09-10 22:28:33 +08:00
parent be09062d44
commit 43af7e668f
3 changed files with 22 additions and 2 deletions

View File

@ -21,6 +21,8 @@ import java.io.Serializable;
import org.springdoc.core.annotations.ParameterObject;
import cn.topiam.employee.common.enums.app.AppGroupType;
import lombok.Data;
import io.swagger.v3.oas.annotations.Parameter;
@ -41,12 +43,18 @@ public class AppGroupQuery implements Serializable {
*
*/
@Parameter(description = "分组名称")
private String name;
private String name;
/**
*
*/
@Parameter(description = "分组编码")
private String code;
private String code;
/**
*
*/
@Parameter(description = "分组类型")
private AppGroupType type;
}

View File

@ -19,6 +19,7 @@ package cn.topiam.employee.common.repository.app.impl;
import java.util.List;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
@ -77,6 +78,11 @@ public class AppGroupRepositoryCustomizedImpl implements AppGroupRepositoryCusto
builder.append(" AND `group`.code_ like '%").append(query.getCode()).append("%'");
}
//分组类型
if (ObjectUtils.isNotEmpty(query.getType())) {
builder.append(" AND `group`.type_ like '%").append(query.getType().getCode()).append("%'");
}
builder.append(" ORDER BY `group`.create_time DESC");
//@formatter:on
String sql = builder.toString();

View File

@ -55,6 +55,12 @@ public class AppGroupListResult implements Serializable {
@Parameter(description = "分组编码")
private String code;
/**
*
*/
@Parameter(description = "应用数量")
private Integer appCount;
/**
*
*/