From 307d9a78b2b558152fe1a952b1aed3fad40d9b8d Mon Sep 17 00:00:00 2001 From: qinjie <463333974@qq.com> Date: Sun, 8 Dec 2024 21:18:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/isu/gaswellwatch/dao/DeviceDao.java | 3 ++- .../service/impl/DeviceServiceImpl.java | 8 ++++++-- .../com/isu/gaswellwatch/vo/DeviceHistoryVO.java | 15 +++++++++++++++ .../java/com/isu/gaswellwatch/vo/DeviceVO.java | 2 +- src/main/resources/mapper/DeviceDao.xml | 8 +++++++- 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/isu/gaswellwatch/dao/DeviceDao.java b/src/main/java/com/isu/gaswellwatch/dao/DeviceDao.java index af7948d..d77e020 100644 --- a/src/main/java/com/isu/gaswellwatch/dao/DeviceDao.java +++ b/src/main/java/com/isu/gaswellwatch/dao/DeviceDao.java @@ -30,7 +30,8 @@ public interface DeviceDao extends BaseMapper { @Param("startTime")Date startTime, @Param("endTime")Date endTime, @Param("deviceId") Long deviceId, - @Param("tableName") String tableName); + @Param("tableName") String tableName, + @Param("deviceProduct") String deviceProduct); Page deviceOptLogPage(Page objectPage, @Param("startTime")Date startTime, diff --git a/src/main/java/com/isu/gaswellwatch/service/impl/DeviceServiceImpl.java b/src/main/java/com/isu/gaswellwatch/service/impl/DeviceServiceImpl.java index d8e2abd..280179b 100644 --- a/src/main/java/com/isu/gaswellwatch/service/impl/DeviceServiceImpl.java +++ b/src/main/java/com/isu/gaswellwatch/service/impl/DeviceServiceImpl.java @@ -82,7 +82,7 @@ public class DeviceServiceImpl extends ServiceImpl implements deviceVO.setOnline(online == null ? "" : online.toString()); Object gas_status = this.redisTemplate.opsForHash().get(deviceKey, "wellStatus"); - deviceVO.setWellCtl(gas_status == null ? "" : gas_status.toString()); + deviceVO.setWellStatus(gas_status == null ? "" : gas_status.toString()); Object runMode = this.redisTemplate.opsForHash().get(deviceKey, "runMode"); if (runMode == null) { @@ -189,7 +189,11 @@ public class DeviceServiceImpl extends ServiceImpl implements end = simpleDateFormat.parse(endTime); } String tableName = Redis2DBPersistenceService.DEFAULT_DATA_TABLE + deviceId; - Page page = this.deviceDao.historyPage(new Page<>(currentPage, pageSize), start, end, deviceId, tableName); + + //判断设备品牌 + DeviceVO device = this.getDevice(deviceId); + + Page page = this.deviceDao.historyPage(new Page<>(currentPage, pageSize), start, end, deviceId, tableName,device.getProduct().getCode()); List deviceHistoryVO = page.getRecords(); if (CollectionUtil.isNotEmpty(deviceHistoryVO)) { Map runModeMap = this.dictionaryService.getValueMapByType("runMode"); diff --git a/src/main/java/com/isu/gaswellwatch/vo/DeviceHistoryVO.java b/src/main/java/com/isu/gaswellwatch/vo/DeviceHistoryVO.java index 0d30a87..a53d9f3 100644 --- a/src/main/java/com/isu/gaswellwatch/vo/DeviceHistoryVO.java +++ b/src/main/java/com/isu/gaswellwatch/vo/DeviceHistoryVO.java @@ -39,5 +39,20 @@ public class DeviceHistoryVO extends Model { /** 柱塞状态 */ private String plugStatus; + /** 气井状态 */ + private String wellStatus; + + /** 倒计时 */ + private String statusEndTime; + + /** 温度 */ + private String temperature; + + /** 湿度 */ + private String humidity; + + /** 太阳能电压 */ + private String solarVoltage; + } diff --git a/src/main/java/com/isu/gaswellwatch/vo/DeviceVO.java b/src/main/java/com/isu/gaswellwatch/vo/DeviceVO.java index 631f494..9966567 100644 --- a/src/main/java/com/isu/gaswellwatch/vo/DeviceVO.java +++ b/src/main/java/com/isu/gaswellwatch/vo/DeviceVO.java @@ -71,7 +71,7 @@ public class DeviceVO extends Model { private String plugStatus; /** 生产状态 */ - private String wellCtl; + private String wellStatus; } diff --git a/src/main/resources/mapper/DeviceDao.xml b/src/main/resources/mapper/DeviceDao.xml index daa621e..559ee52 100644 --- a/src/main/resources/mapper/DeviceDao.xml +++ b/src/main/resources/mapper/DeviceDao.xml @@ -70,7 +70,12 @@