change - 箱壳设备参数

master
wenjy 2 years ago
parent d934a59092
commit 359e114942

@ -3,6 +3,9 @@ package com.productionboard.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.productionboard.entity.TankShellDevice.TankShellDevicePrameterValue; import com.productionboard.entity.TankShellDevice.TankShellDevicePrameterValue;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* @author WenJY * @author WenJY
@ -10,4 +13,10 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface TankShellDevicePrameterValueMapper extends BaseMapper<TankShellDevicePrameterValue> { public interface TankShellDevicePrameterValueMapper extends BaseMapper<TankShellDevicePrameterValue> {
@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<TankShellDevicePrameterValue> SelectDevicePrameterValues();
} }

@ -93,7 +93,7 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
@Override @Override
public String getDeviceParameterValue() { public String getDeviceParameterValue() {
Calendar calendar = Calendar.getInstance(); /*Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date()); calendar.setTime(new Date());
calendar.add(Calendar.MINUTE,-1); calendar.add(Calendar.MINUTE,-1);
QueryWrapper<TankShellDevicePrameterValue> wrapper = new QueryWrapper<TankShellDevicePrameterValue>(); QueryWrapper<TankShellDevicePrameterValue> wrapper = new QueryWrapper<TankShellDevicePrameterValue>();
@ -102,7 +102,8 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
.and(x-> .and(x->
x.like("prameterName","伺服").or().like("prameterName","伺服") x.like("prameterName","伺服").or().like("prameterName","伺服")
); );
List<TankShellDevicePrameterValue> tankShellDevicePrameterValues = tankShellDevicePrameterValueMapper.selectList(wrapper); List<TankShellDevicePrameterValue> tankShellDevicePrameterValues = tankShellDevicePrameterValueMapper.selectList(wrapper);*/
List<TankShellDevicePrameterValue> tankShellDevicePrameterValues = tankShellDevicePrameterValueMapper.SelectDevicePrameterValues();
return JSONArray.toJSONString(tankShellDevicePrameterValues); return JSONArray.toJSONString(tankShellDevicePrameterValues);
} }

Loading…
Cancel
Save