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); }