Skip to content

Commit b240728

Browse files
committed
fix: 修改查询条件顺序
1 parent c86a2eb commit b240728

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

application/src/main/java/top/cadecode/uniboot/controller/system/SysLogController.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.springframework.web.bind.annotation.RequestMapping;
1313
import org.springframework.web.bind.annotation.RestController;
1414
import top.cadecode.uniboot.common.annotation.ApiFormat;
15+
import top.cadecode.uniboot.common.mybatis.handler.BoolToIntTypeHandler;
1516
import top.cadecode.uniboot.common.response.PageResult;
1617
import top.cadecode.uniboot.system.bean.po.SysLog;
1718
import top.cadecode.uniboot.system.bean.vo.SysLogVo.SysLogPageVo;
@@ -44,14 +45,12 @@ public class SysLogController {
4445
@PostMapping("page")
4546
public PageResult<SysLogPageVo> page(@RequestBody @Valid SysLogPageRequest request) {
4647
Page<SysLog> page = logService.lambdaQuery()
47-
.setEntity(SysLog.builder()
48-
.exceptional(request.getExceptional())
49-
.build())
5048
.ge(ObjectUtil.isNotEmpty(request.getStartTime()), SysLog::getCreateTime, request.getStartTime())
5149
.le(ObjectUtil.isNotEmpty(request.getEndTime()), SysLog::getCreateTime, request.getEndTime())
5250
.in(ObjectUtil.isNotEmpty(request.getLogTypeList()), SysLog::getLogType, request.getLogTypeList())
5351
.likeRight(ObjectUtil.isNotEmpty(request.getAccessUser()), SysLog::getAccessUser, request.getAccessUser())
5452
.like(ObjectUtil.isNotEmpty(request.getUrl()), SysLog::getUrl, request.getUrl())
53+
.eq(ObjectUtil.isNotNull(request.getExceptional()), SysLog::getExceptional, BoolToIntTypeHandler.mapping(request.getExceptional()))
5554
.orderByDesc(SysLog::getCreateTime)
5655
.page(new Page<>(request.getPageNumber(), request.getPageSize()));
5756
List<SysLogPageVo> voList = SysLogConvert.INSTANCE.poToVo(page.getRecords());

0 commit comments

Comments
 (0)