Commit 7fed2fc7 authored by Carit Zhu's avatar Carit Zhu 🎱

Add gateway name for WarehouseLogVo and GatewayOnLineVo, and add TDL name for…

Add gateway name for WarehouseLogVo and GatewayOnLineVo, and add TDL name for TDLDeviceVo and TDLDeviceDetailVo which will be returned by getDetails interface in WarehouseController.
parent 39627f24
......@@ -7,6 +7,8 @@ public class GatewayOnLineVo {
private String type;
private String name;
private Integer state;
private Long startTime;
......@@ -23,6 +25,14 @@ public class GatewayOnLineVo {
this.gSN = gSN;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
......
......@@ -3,6 +3,8 @@ package com.example.tdl.domain.vo;
public class TDLDeviceDetailVo {
private String TDLSN;
private String TDLName;
private String pressure;
private String temperature;
......@@ -23,6 +25,14 @@ public class TDLDeviceDetailVo {
this.TDLSN = TDLSN;
}
public String getTDLName() {
return TDLName;
}
public void setTDLName(String TDLName) {
this.TDLName = TDLName;
}
public String getPressure() {
return pressure;
}
......
......@@ -4,6 +4,8 @@ public class TDLDeviceVo {
private String TDLSN;
private String TDLName;
private String offsetJson;
public String getTDLSN() {
......@@ -14,6 +16,14 @@ public class TDLDeviceVo {
this.TDLSN = TDLSN;
}
public String getTDLName() {
return TDLName;
}
public void setTDLName(String TDLName) {
this.TDLName = TDLName;
}
public String getOffsetJson() {
return offsetJson;
}
......
......@@ -10,6 +10,8 @@ public class WarehouseLogVo {
private String device;
private String deviceName;
private Long createTime;
private Long endTime;
......@@ -46,6 +48,14 @@ public class WarehouseLogVo {
this.device = device;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public Long getCreateTime() {
return createTime;
}
......
......@@ -319,6 +319,7 @@ public class WarehouseController {
GatewayOnLineVo gatewayOnLineVo = new GatewayOnLineVo();
gatewayOnLineVo.setgSN(list.get(a).getSN());
gatewayOnLineVo.setType(list.get(a).getType());
gatewayOnLineVo.setName(list.get(a).getDeviceName());
Object data = infoRedisService.getHash("DeviceOnline", list.get(a).getDevice() );
if(data !=null){
OnlineVo onlineVo = gson.fromJson(data.toString(),OnlineVo.class);
......@@ -364,6 +365,7 @@ public class WarehouseController {
tdlDeviceDetailVo.setHumidity("NA");
}
tdlDeviceDetailVo.setTDLSN(tdlDeviceVo.getTDLSN().replace("TDL-","").trim());
tdlDeviceDetailVo.setTDLName(tdlDeviceVo.getTDLName());
tdlDeviceDetailVo.setOffsetJson(tdlDeviceVo.getOffsetJson());
tdlDeviceDetailVos.add(tdlDeviceDetailVo);
}
......
......@@ -82,7 +82,7 @@
</select>
<select id="getTdlByGatewaySN" parameterType="String" resultType="com.example.tdl.domain.vo.TDLDeviceVo">
select CONCAT("TDL-",TDLSN) TDLSN,offsetJson from tdldevice t,gateway g
select CONCAT("TDL-",TDLSN) TDLSN, TDLName, offsetJson from tdldevice t, gateway g
where t.gateway_id = g.id
and g.SN =#{SN,jdbcType=VARCHAR}
and g.type=#{type,jdbcType=VARCHAR}
......
......@@ -61,11 +61,12 @@
AND endTime is null
</select>
<select id="getByWarehouse" parameterType="String" resultType="com.example.tdl.domain.vo.WarehouseLogVo">
select DISTINCT CONCAT(gatewaytype,"_",gatewaySN) device, tgl.gatewaySN SN,gatewaytype type,w.warehouseNo
from tdl_gateway_log tgl,warehouse w
select DISTINCT CONCAT(gatewaytype,"_",gatewaySN) device, tgl.gatewaySN SN, gatewaytype type, name deviceName, w.warehouseNo
from tdl_gateway_log tgl, warehouse w, gateway g
where tgl.warehouseNo = w.warehouseNo
and tgl.gatewaySN = g.SN
and tgl.gatewayType = g.type
and w.warehouseNo=#{warehouseNo,jdbcType=VARCHAR}
and ISNULL(endTime)
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment