From 0c5cf3f18f9cd4f64ff1c525c75aa57808bb92b0 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Wed, 10 Jan 2024 15:23:42 +0800 Subject: [PATCH] =?UTF-8?q?2024-1-10-1=20=E8=AE=BE=E5=A4=87-=E7=9C=8B?= =?UTF-8?q?=E6=9D=BF-=E5=B9=B4=E6=9C=88=E6=97=A5-=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=A8=B3=E5=AE=9A=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DeviceInterfaceController.java | 1 + .../com/op/device/domain/EquOperation.java | 11 ++++++++ .../impl/DeviceInterfaceServiceImpl.java | 6 ++--- .../mapper/device/DeviceInterfaceMapper.xml | 26 ++++++++++++++----- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java b/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java index ff68332d..230388cd 100644 --- a/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java +++ b/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java @@ -52,6 +52,7 @@ public class DeviceInterfaceController { /** * 设备稳定性-MTBF top10 * 公式:实际运转时间/停机次数 + * 分为每日/每月/每年 * @param equOperation * @return */ diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquOperation.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquOperation.java index a9f42b88..2bb2389b 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquOperation.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquOperation.java @@ -112,6 +112,9 @@ public class EquOperation extends BaseEntity { // 创建日期结束 private String createTimeEnd; + //时间维度 区分每日/每月/每年 + private String timeDimension; + //MTBF接口字段 //序号 private String serialNumber; @@ -377,6 +380,14 @@ public class EquOperation extends BaseEntity { return shutdownTimes; } + //时间维度 + public void setTimeDimension(String timeDimension) { + this.timeDimension = timeDimension; + } + public String getTimeDimension() { + return timeDimension; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 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 220857f9..2e248f6c 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 @@ -117,14 +117,14 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService { public AjaxResult getEquipmentStabilityList(EquOperation equOperation) { //查询所有设备(设备停用的除外) //判断查询年/月/日 - //需要加逻辑 - //当日时间 equOperation.setCreateTime(DateUtils.getNowDate()); + if(equOperation.getTimeDimension()==null){ + equOperation.setTimeDimension("dd"); + } List equipmentList = deviceInterfaceMapper.getMTBFList(equOperation); return success(equipmentList); } - /** * 完好设备占比 * 公式:维修/故障设备 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 0cbc365c..88eb010a 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,15 +76,27 @@