@@ -221,15 +220,19 @@ public class WarehouseController {
simpleWarehouseVos.get(i).setHumidity("~");
continue;
}
Stringsql="";
for(intj=0,len=list.size();j<len;j++){
if(StringUtils.isEmpty(list.get(j).getTdl())){
Stringsql="";
for(DeviceVodeviceVo:list){
if(StringUtils.isEmpty(deviceVo.getTdl())){
simpleWarehouseVos.get(i).setTemp("~");
simpleWarehouseVos.get(i).setHumidity("~");
continue;
}
Stringtdl=list.get(j).getTdl().replace(",","\' or \"tdl\" = \'");
sql="SELECT \"T\",\"h\" FROM \"tdl_policy\".\""+list.get(j).getDevice()+"\" where \"tdl\" = \'"+tdl+"\' and time >="+list.get(j).getStartTime()+" GROUP BY \"tdl\" order by time desc limit 1";
Stringtdl=deviceVo.getTdl().replace(",","\' or \"tdl\" = \'");
sql="SELECT \"T\",\"h\" FROM \"tdl_policy\".\""+deviceVo.getDevice()
+"\" WHERE \"tdl\" = '"+tdl
+"' AND time >= "+deviceVo.getStartTime()
+" AND time <= "+(endTime*1000000L)
+" GROUP BY \"tdl\" ORDER BY time DESC LIMIT 1";
}
if(StringUtils.isEmpty(sql)){
simpleWarehouseVos.get(i).setTemp("~");
...
...
@@ -337,8 +340,12 @@ public class WarehouseController {
Stringsqls="SELECT \"b\", \"T\", \"h\" FROM \"tdl_policy\".\""+list.get(a).getDevice()+"\" WHERE (\"tdl\" = '"+tdlDeviceVo.getTDLSN()+"') and time>="+startTime*1000000L+" ORDER BY time DESC LIMIT 1";
Stringsqls="SELECT \"b\", \"T\", \"h\" FROM \"tdl_policy\".\""+list.get(a).getDevice()
Stringsql="SELECT \"battery\" FROM \"tdl_policy\".\""+device+"\" where time >="+gatewayOnLineVos.get(a).getStartTime()*1000000l+" ORDER BY time DESC LIMIT 1";
Stringsql="SELECT \"battery\" FROM \"tdl_policy\".\""+device
+"\" where time >= "+gatewayOnLineVos.get(a).getStartTime()*1000000L
Stringsqls="SELECT \"tdl\",\"b\",\"T\",\"h\" FROM \"tdl_policy\".\""+device+"\" WHERE \"tdl\" = '"+tdlDeviceVo.getTDLSN()+"' AND time >="+gatewayOnLineVos.get(a).getStartTime()*1000000l+" and time <="+endTime*1000000l+" ORDER BY time desc limit 1 ";
Stringsqls="SELECT \"tdl\",\"b\",\"T\",\"h\" FROM \"tdl_policy\".\""+device
+"\" WHERE \"tdl\" = '"+tdlDeviceVo.getTDLSN()
+"' AND time >= "+(gatewayOnLineVos.get(a).getStartTime()*1000000L)
@@ -1064,7 +1084,11 @@ public class WarehouseController {
warehouseDataVo.setTemperature("NA");
warehouseDataVo.setHumidity("NA");
}
Stringsql3="SELECT \"tdl\",\"T\",\"h\" FROM \"tdl_policy\".\""+device+"\" WHERE \"tdl\" = '"+tdlDeviceVo.getTDLSN()+"' AND time >="+gatewayOnLineVos.get(a).getStartTime()*1000000l+" and time <="+endTime*1000000l+" ORDER BY time ";
Stringsql3="SELECT \"tdl\",\"T\",\"h\" FROM \"tdl_policy\".\""+device
+"\" WHERE \"tdl\" = '"+tdlDeviceVo.getTDLSN()
+"' AND time >= "+(gatewayOnLineVos.get(a).getStartTime()*1000000L)
Stringsql="SELECT \"T\",\"h\" FROM \"tdl_policy\".\""+deviceMessageVo.getType()+"_"+deviceMessageVo.getSN()+"\" where \"tdl\" = \'TDL-"+searchTdlVo.getTDLSN()+"\' order by time ";
Stringsql="SELECT \"T\",\"h\" FROM \"tdl_policy\".\""+deviceMessageVo.getType()+"_"+deviceMessageVo.getSN()
+"\" WHERE \"tdl\" = 'TDL-"+searchTdlVo.getTDLSN()
Stringsql="SELECT \"battery\" FROM \"tdl_policy\".\""+device+"\" where time >="+gatewayOnLineVos.get(a).getStartTime()*1000000l+" ORDER BY time DESC LIMIT 1";
Stringsql="SELECT \"battery\" FROM \"tdl_policy\".\""+device
+"\" where time >="+(gatewayOnLineVos.get(a).getStartTime()*1000000L)
Stringsqls="SELECT \"tdl\",\"b\",\"T\",\"h\" FROM \"tdl_policy\".\""+device+"\" WHERE \"tdl\" = '"+tdls.get(b)+"' AND time >="+downloadForWarehouseVo.getStartTime()*1000000l+" and time <="+downloadForWarehouseVo.getStopTime()*1000000l+" ORDER BY time desc limit 1 ";
Stringsqls="SELECT \"tdl\",\"b\",\"T\",\"h\" FROM \"tdl_policy\".\""+device
+"\" WHERE \"tdl\" = '"+tdls.get(b)
+"' AND time >= "+downloadForWarehouseVo.getStartTime()*1000000L
+" AND time <= "+downloadForWarehouseVo.getStopTime()*1000000L
@@ -1277,7 +1308,11 @@ public class WarehouseController {
warehouseDataVo.setTemperature("NA");
warehouseDataVo.setHumidity("NA");
}
Stringsql3="SELECT \"tdl\",\"T\",\"h\" FROM \"tdl_policy\".\""+device+"\" WHERE \"tdl\" = '"+tdls.get(b)+"' AND time >="+downloadForWarehouseVo.getStartTime()*1000000l+" and time <="+downloadForWarehouseVo.getStopTime()*1000000l+" ORDER BY time ";
Stringsql3="SELECT \"tdl\",\"T\",\"h\" FROM \"tdl_policy\".\""+device
+"\" WHERE \"tdl\" = '"+tdls.get(b)
+"' AND time >= "+downloadForWarehouseVo.getStartTime()*1000000L
+" AND time <= "+downloadForWarehouseVo.getStopTime()*1000000L