From 359e114942718351221724dd5a3194e9c7f0caeb Mon Sep 17 00:00:00 2001 From: wenjy Date: Thu, 9 Jun 2022 15:19:55 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E7=AE=B1=E5=A3=B3=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/TankShellDevicePrameterValueMapper.java | 9 +++++++++ .../service/impl/TankShellDeviceInfoServiceImpl.java | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java b/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java index dd84cca..1211453 100644 --- a/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java +++ b/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java @@ -3,6 +3,9 @@ package com.productionboard.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.productionboard.entity.TankShellDevice.TankShellDevicePrameterValue; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Select; + +import java.util.List; /** * @author WenJY @@ -10,4 +13,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface TankShellDevicePrameterValueMapper extends BaseMapper { + + @Select("select t2.DEVICEID,t2.PRAMETERNAME, t2.VALUE, t2.CREATETIME\n" + + "from (select * from BASIC_SCADA_DEVICEPARAMETER@SCADA_DBLINK where Device_id = 'XKCX001' and PARAMETER_ID = '2') t1\n" + + " left join SCADA_PRAMERTER_VALUE t2 on t1.PARAMETER_NAME = t2.PRAMETERNAME\n" + + "where CREATETIME = (select max(CREATETIME) from SCADA_PRAMERTER_VALUE where DEVICEID = T2.DEVICEID)") + List SelectDevicePrameterValues(); } diff --git a/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java b/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java index 8a2ccec..9b04982 100644 --- a/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java +++ b/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java @@ -93,7 +93,7 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi @Override public String getDeviceParameterValue() { - Calendar calendar = Calendar.getInstance(); + /*Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.add(Calendar.MINUTE,-1); QueryWrapper wrapper = new QueryWrapper(); @@ -102,7 +102,8 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi .and(x-> x.like("prameterName","伺服").or().like("prameterName","伺服") ); - List tankShellDevicePrameterValues = tankShellDevicePrameterValueMapper.selectList(wrapper); + List tankShellDevicePrameterValues = tankShellDevicePrameterValueMapper.selectList(wrapper);*/ + List tankShellDevicePrameterValues = tankShellDevicePrameterValueMapper.SelectDevicePrameterValues(); return JSONArray.toJSONString(tankShellDevicePrameterValues); }