|
|
@ -300,13 +300,17 @@ public class UserController { |
|
|
|
* 远程搜索 |
|
|
|
* 远程搜索 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping("/listBySearch") |
|
|
|
@GetMapping("/listBySearch") |
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
@ApiOperationSupport(order = 16) |
|
|
|
@ApiOperation(value = "远程搜索", notes = "传入") |
|
|
|
@ApiOperation(value = "远程搜索", notes = "传入") |
|
|
|
public R<List<User>> listBySearch(String search) { |
|
|
|
public R<List<User>> listBySearch(@RequestParam Map<String, Object> map) { |
|
|
|
QueryWrapper<User> queryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<User> queryWrapper = new QueryWrapper<>(); |
|
|
|
if (io.micrometer.core.instrument.util.StringUtils.isNotEmpty(search)) { |
|
|
|
if (map != null && map.containsKey("search")) { |
|
|
|
queryWrapper.lambda().like(User::getName, search).or().like(User::getCode, search); |
|
|
|
queryWrapper.lambda().like(User::getName, map.get("search")).or().like(User::getCode, map.get("search")); |
|
|
|
|
|
|
|
if (map.get("search").toString().matches("\\d+")) { |
|
|
|
|
|
|
|
queryWrapper.lambda().or().eq(User::getId, Long.parseLong(map.get("search").toString())); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
queryWrapper.lambda().eq(User::getIsDeleted, DafConstant.DB_NOT_DELETED); |
|
|
|
queryWrapper.lambda().orderByAsc(User::getCreateTime); |
|
|
|
queryWrapper.lambda().orderByAsc(User::getCreateTime); |
|
|
|
queryWrapper.lambda().last(" LIMIT 50"); |
|
|
|
queryWrapper.lambda().last(" LIMIT 50"); |
|
|
|
List<User> list = userService.list(queryWrapper); |
|
|
|
List<User> list = userService.list(queryWrapper); |
|
|
|