Browse Source

收藏分页

ppt-20260120
review512jwy@163.com 4 weeks ago
parent
commit
8d578e825d
  1. 1
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/FavoritedDeviceMapperExt.xml
  2. 13
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/FavoritedDeviceServiceImpl.java

1
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/FavoritedDeviceMapperExt.xml

@ -19,6 +19,7 @@
left join type ty on ty.id = dinfo.type_id left join type ty on ty.id = dinfo.type_id
WHERE WHERE
dinfo.flag != 1 AND basic_monitoring_asset.flag != 1 dinfo.flag != 1 AND basic_monitoring_asset.flag != 1
AND (dinfo.device_id LIKE '%\_85' or dinfo.device_id LIKE '%\_85_9003' or dinfo.device_id LIKE '%\_131_5')
AND basic_space.flag != 1 AND basic_floor.flag != 1 AND basic_building.flag != 1 AND basic_space.flag != 1 AND basic_floor.flag != 1 AND basic_building.flag != 1
<if test="buildingId != null"> <if test="buildingId != null">
AND basic_building.building_id = #{buildingId} AND basic_building.building_id = #{buildingId}

13
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/FavoritedDeviceServiceImpl.java

@ -125,7 +125,18 @@ public class FavoritedDeviceServiceImpl implements FavoritedDeviceService {
resultList.add(data); resultList.add(data);
} }
return new PageInfo<>(resultList); // -------------------- 保留 PageHelper 分页信息 --------------------
PageInfo<FavoritedDeviceVO> pageInfo = new PageInfo<>(favoritedDeviceVOList);
PageInfo<Object> resultPageInfo = new PageInfo<>();
resultPageInfo.setList(resultList);
resultPageInfo.setPageNum(pageInfo.getPageNum());
resultPageInfo.setPageSize(pageInfo.getPageSize());
resultPageInfo.setTotal(pageInfo.getTotal());
resultPageInfo.setPages(pageInfo.getPages());
resultPageInfo.setHasNextPage(pageInfo.isHasNextPage());
resultPageInfo.setHasPreviousPage(pageInfo.isHasPreviousPage());
return resultPageInfo;
} }
private Map<String, DeviceAlarmData> buildAlarmDataMap(Long companyId, Integer languageType, List<String> deviceIds) { private Map<String, DeviceAlarmData> buildAlarmDataMap(Long companyId, Integer languageType, List<String> deviceIds) {

Loading…
Cancel
Save