添加主机身份卡片视图.
This commit is contained in:
@@ -21,6 +21,9 @@ import javax.validation.constraints.Size;
|
||||
@Schema(name = "HostIdentityQueryRequest", description = "主机身份 查询请求对象")
|
||||
public class HostIdentityQueryRequest extends PageRequest {
|
||||
|
||||
@Schema(description = "搜索")
|
||||
private String searchValue;
|
||||
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.orion.lang.define.wrapper.DataGrid;
|
||||
import com.orion.lang.utils.Strings;
|
||||
import com.orion.ops.framework.common.constant.Const;
|
||||
import com.orion.ops.framework.common.constant.ErrorMessage;
|
||||
import com.orion.ops.framework.common.security.PasswordModifier;
|
||||
@@ -216,11 +217,17 @@ public class HostIdentityServiceImpl implements HostIdentityService {
|
||||
* @return wrapper
|
||||
*/
|
||||
private LambdaQueryWrapper<HostIdentityDO> buildQueryWrapper(HostIdentityQueryRequest request) {
|
||||
String searchValue = request.getSearchValue();
|
||||
return hostIdentityDAO.wrapper()
|
||||
.eq(HostIdentityDO::getId, request.getId())
|
||||
.like(HostIdentityDO::getName, request.getName())
|
||||
.like(HostIdentityDO::getUsername, request.getUsername())
|
||||
.eq(HostIdentityDO::getKeyId, request.getKeyId());
|
||||
.eq(HostIdentityDO::getKeyId, request.getKeyId())
|
||||
.and(Strings.isNotEmpty(searchValue), c -> c
|
||||
.eq(HostIdentityDO::getId, searchValue).or()
|
||||
.like(HostIdentityDO::getName, searchValue).or()
|
||||
.like(HostIdentityDO::getUsername, searchValue)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -257,6 +257,7 @@ public class HostServiceImpl implements HostService {
|
||||
.like(HostDO::getCode, request.getCode())
|
||||
.like(HostDO::getAddress, request.getAddress())
|
||||
.and(Strings.isNotEmpty(searchValue), c -> c
|
||||
.eq(HostDO::getId, searchValue).or()
|
||||
.like(HostDO::getName, searchValue).or()
|
||||
.like(HostDO::getCode, searchValue).or()
|
||||
.like(HostDO::getAddress, searchValue)
|
||||
|
||||
Reference in New Issue
Block a user