diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java index ff917fbc..f4078898 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java @@ -140,6 +140,11 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService { //查询所有设备(设备停用的除外) // CAST(SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END)*100.00/COUNT(*) as decimal(18,2)) AS intactRate EquOperation equipmentIntactRate = deviceInterfaceMapper.getEquipmentIntactRate(equOperation); + Double totalEquipment = new Double(equipmentIntactRate.getTotalEquipment()); + Double operationEquipment = new Double(equipmentIntactRate.getOperationEquipment()); + Double intactRate = operationEquipment*100/totalEquipment; + String douStr = String.format("%.2f", intactRate); + equipmentIntactRate.setIntactRate(douStr); return success(equipmentIntactRate); } diff --git a/op-modules/op-device/src/main/resources/mapper/device/DeviceInterfaceMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/DeviceInterfaceMapper.xml index 781de59d..e79b6ece 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/DeviceInterfaceMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/DeviceInterfaceMapper.xml @@ -76,7 +76,7 @@ where dict_label = 'device_refresh_time' - +