bugfix: 修复查询预约时没有设备导致查询预约sql拼接错误的问题
This commit is contained in:
parent
ec9a40be88
commit
999c399dd8
@ -129,6 +129,9 @@ public class ReservationServiceImpl implements ReservationService {
|
||||
List<Device> devices = deviceMapper.selectList(new LambdaQueryWrapper<Device>()
|
||||
.eq(Device::getTeamId, user.getTeamId())
|
||||
.select());
|
||||
if (devices.isEmpty()) {
|
||||
return (Page<ReservationVO>) PageUtil.EMPTY_PAGE;
|
||||
}
|
||||
List<Role> userRole = roleMapper.selectRoleByUserId(userId);
|
||||
ReservationStatus status;
|
||||
if (userRole.stream().anyMatch(r -> r.getCode().equals("LEADER"))) {
|
||||
|
@ -2,8 +2,13 @@ package github.benjamin.equipreservebackend.utils;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class PageUtil {
|
||||
|
||||
public static final Page<?> EMPTY_PAGE = new Page<>(1, 10, 0)
|
||||
.setRecords(Collections.emptyList());
|
||||
|
||||
public static <T> Page<T> copyPage(Page<?> page) {
|
||||
return new Page<T>(page.getCurrent(), page.getSize(), page.getTotal(), page.searchCount());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user