设备统计接口

This commit is contained in:
kerwincui
2022-06-06 17:45:36 +08:00
parent 1aa94d3e50
commit 653eee4e76
12 changed files with 182 additions and 7 deletions

View File

@@ -24,6 +24,13 @@ public interface IDeviceService
*/
public Device selectDeviceByDeviceId(Long deviceId);
/**
* 查询设备统计信息
*
* @return 设备
*/
public DeviceStatistic selectDeviceStatistic();
/**
* 根据设备编号查询设备
*

View File

@@ -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);
}

View File

@@ -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;
}
/**
* 根据设备编号查询设备
*