From 7f2628410a8478c838e17b7644c6fddb647b8fba Mon Sep 17 00:00:00 2001 From: A0010407 Date: Wed, 28 Feb 2024 11:06:27 +0800 Subject: [PATCH] =?UTF-8?q?2024-2-28=20=E8=AE=BE=E5=A4=87=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=20=E8=AE=BE=E5=A4=87=E5=AE=8C=E5=A5=BD=E7=8E=87?= =?UTF-8?q?=E7=9C=8B=E6=9D=BF=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DeviceInterfaceServiceImpl.java | 5 +++++ .../mapper/device/DeviceInterfaceMapper.xml | 14 ++------------ 2 files changed, 7 insertions(+), 12 deletions(-) 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 ff917fbcb..f40788982 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 781de59da..e79b6eced 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' - +