在线设备
This commit is contained in:
@ -26,4 +26,24 @@ public class EquipmentClassificationVo {
|
||||
*/
|
||||
private Integer devices4GAndBluetooth = 0;
|
||||
|
||||
/**
|
||||
* 设备总数
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
|
||||
/**
|
||||
* 计算设备总数
|
||||
*
|
||||
* @return 设备总数
|
||||
*/
|
||||
public Integer getTotal() {
|
||||
if (total == null) {
|
||||
total = (equipment4G == null ? 0 : equipment4G) +
|
||||
(deviceBluetooth == null ? 0 : deviceBluetooth) +
|
||||
(devices4GAndBluetooth == null ? 0 : devices4GAndBluetooth);
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -630,6 +630,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
@Override
|
||||
public EquipmentClassificationVo getEquipmentClassification() {
|
||||
EquipmentClassificationVo equipmentClassification = deviceMapper.getEquipmentClassification();
|
||||
equipmentClassification.getTotal();
|
||||
return equipmentClassification;
|
||||
}
|
||||
|
||||
|
@ -321,11 +321,11 @@
|
||||
<!-- 获取数据总览 -->
|
||||
<select id="getDataOverview" resultType="com.fuyuanshen.equipment.domain.vo.DataOverviewVo">
|
||||
SELECT (SELECT COUNT(1) FROM device) AS devicesNumber,
|
||||
(SELECT COUNT(1) FROM device WHERE device_status = 1) AS equipmentOnline,
|
||||
(SELECT COUNT(1) FROM device WHERE online_status = 1) AS equipmentOnline,
|
||||
(SELECT COUNT(1) FROM device WHERE DATE (create_time) = CURDATE()) AS bindingNew, (
|
||||
SELECT COUNT (1)
|
||||
FROM device
|
||||
WHERE device_status = 2) AS equipmentAbnormal
|
||||
WHERE online_status = 2) AS equipmentAbnormal
|
||||
</select>
|
||||
|
||||
<!-- 获取设备分类 -->
|
||||
|
Reference in New Issue
Block a user