mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-19 17:35:54 +08:00
设备统计接口
This commit is contained in:
@@ -24,6 +24,13 @@ public interface IDeviceService
|
||||
*/
|
||||
public Device selectDeviceByDeviceId(Long deviceId);
|
||||
|
||||
/**
|
||||
* 查询设备统计信息
|
||||
*
|
||||
* @return 设备
|
||||
*/
|
||||
public DeviceStatistic selectDeviceStatistic();
|
||||
|
||||
/**
|
||||
* 根据设备编号查询设备
|
||||
*
|
||||
|
||||
@@ -47,7 +47,6 @@ public class DeviceLogServiceImpl implements IDeviceLogService
|
||||
@Override
|
||||
public List<DeviceLog> selectDeviceLogList(DeviceLog deviceLog)
|
||||
{
|
||||
// deviceLogMapper.selectDeviceLogList(deviceLog);
|
||||
return logService.selectDeviceLogList(deviceLog);
|
||||
}
|
||||
|
||||
@@ -60,7 +59,6 @@ public class DeviceLogServiceImpl implements IDeviceLogService
|
||||
@Override
|
||||
public List<MonitorModel> selectMonitorList(DeviceLog deviceLog)
|
||||
{
|
||||
// return deviceLogMapper.selectMonitorList(deviceLog);
|
||||
return logService.selectMonitorList(deviceLog);
|
||||
}
|
||||
|
||||
@@ -74,7 +72,6 @@ public class DeviceLogServiceImpl implements IDeviceLogService
|
||||
public int insertDeviceLog(DeviceLog deviceLog)
|
||||
{
|
||||
deviceLog.setCreateTime(DateUtils.getNowDate());
|
||||
// return deviceLogMapper.insertDeviceLog(deviceLog);
|
||||
return logService.saveDeviceLog(deviceLog);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,25 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||
return deviceMapper.selectDeviceByDeviceId(deviceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备统计信息
|
||||
*
|
||||
* @return 设备
|
||||
*/
|
||||
@Override
|
||||
public DeviceStatistic selectDeviceStatistic() {
|
||||
// 获取设备、产品和告警数量
|
||||
DeviceStatistic statistic=deviceMapper.selectDeviceProductAlertCount();
|
||||
// 获取属性、功能和事件
|
||||
DeviceStatistic thingsCount=logService.selectCategoryLogCount();
|
||||
// 组合属性、功能、事件和监测数据
|
||||
statistic.setPropertyCount(thingsCount.getPropertyCount());
|
||||
statistic.setFunctionCount(thingsCount.getFunctionCount());
|
||||
statistic.setEventCount(thingsCount.getEventCount());
|
||||
statistic.setMonitorCount(thingsCount.getMonitorCount());
|
||||
return statistic;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编号查询设备
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user