|
12 | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
13 | 13 | import org.springframework.web.bind.annotation.RestController; |
14 | 14 | import top.cadecode.uniboot.common.annotation.ApiFormat; |
| 15 | +import top.cadecode.uniboot.common.mybatis.handler.BoolToIntTypeHandler; |
15 | 16 | import top.cadecode.uniboot.common.response.PageResult; |
16 | 17 | import top.cadecode.uniboot.system.bean.po.SysLog; |
17 | 18 | import top.cadecode.uniboot.system.bean.vo.SysLogVo.SysLogPageVo; |
@@ -44,14 +45,12 @@ public class SysLogController { |
44 | 45 | @PostMapping("page") |
45 | 46 | public PageResult<SysLogPageVo> page(@RequestBody @Valid SysLogPageRequest request) { |
46 | 47 | Page<SysLog> page = logService.lambdaQuery() |
47 | | - .setEntity(SysLog.builder() |
48 | | - .exceptional(request.getExceptional()) |
49 | | - .build()) |
50 | 48 | .ge(ObjectUtil.isNotEmpty(request.getStartTime()), SysLog::getCreateTime, request.getStartTime()) |
51 | 49 | .le(ObjectUtil.isNotEmpty(request.getEndTime()), SysLog::getCreateTime, request.getEndTime()) |
52 | 50 | .in(ObjectUtil.isNotEmpty(request.getLogTypeList()), SysLog::getLogType, request.getLogTypeList()) |
53 | 51 | .likeRight(ObjectUtil.isNotEmpty(request.getAccessUser()), SysLog::getAccessUser, request.getAccessUser()) |
54 | 52 | .like(ObjectUtil.isNotEmpty(request.getUrl()), SysLog::getUrl, request.getUrl()) |
| 53 | + .eq(ObjectUtil.isNotNull(request.getExceptional()), SysLog::getExceptional, BoolToIntTypeHandler.mapping(request.getExceptional())) |
55 | 54 | .orderByDesc(SysLog::getCreateTime) |
56 | 55 | .page(new Page<>(request.getPageNumber(), request.getPageSize())); |
57 | 56 | List<SysLogPageVo> voList = SysLogConvert.INSTANCE.poToVo(page.getRecords()); |
|
0 commit comments