diff --git a/src/main/java/com/biutag/supervision/service/ConfinementService.java b/src/main/java/com/biutag/supervision/service/ConfinementService.java index 9ce0903..6402d0a 100644 --- a/src/main/java/com/biutag/supervision/service/ConfinementService.java +++ b/src/main/java/com/biutag/supervision/service/ConfinementService.java @@ -48,7 +48,7 @@ public class ConfinementService extends ServiceImpl GetExportData(ConfinementQueryParam param){ QueryWrapper queryWrapper = new QueryWrapper<>(); //查询条件:id、姓名、部门、事由、禁闭时间(大于或者等于开始时间,小于或者等于结束时间) - if(StrUtil.isNotEmpty(param.getId())){ - queryWrapper.like(StrUtil.isBlank(param.getId()),"c1.id",StrUtil.trim(param.getId())); - } - if(StrUtil.isNotEmpty(param.getName())){ - queryWrapper.like(StrUtil.isBlank(param.getName()), "c1.name", StrUtil.trim(param.getName())); - } + queryWrapper.like(StrUtil.isNotBlank(param.getId()),"c1.id",StrUtil.trim(param.getId())) + .or().like(StrUtil.isNotBlank(param.getName()), "c1.name", StrUtil.trim(param.getName())); if(StrUtil.isNotEmpty(param.getMatter())){ - queryWrapper.like(StrUtil.isBlank(param.getMatter()), "c1.matter", StrUtil.trim(param.getMatter())); + queryWrapper.or().like(StrUtil.isBlank(param.getMatter()), "c1.matter", StrUtil.trim(param.getMatter())); } - if (CollectionUtils.isNotEmpty(param.getConfinementTime())) { queryWrapper.le("c1.end_time", param.getConfinementTime().get(1)) .ge("c1.start_time", param.getConfinementTime().get(0)); @@ -98,5 +93,6 @@ public class ConfinementService extends ServiceImpl