sql="SELECT \"battery\" FROM \"tdl_policy\".\""+gatewayVo.getgType()+"_"+gatewayVo.getgSN()+"\" where time >="+circuitVo.getStartTime()+" and time<="+circuitVo.getEndTime()*1000000l+" ORDER BY time desc limit 1";
}else{
sql="SELECT \"battery\" FROM \"tdl_policy\".\""+gatewayVo.getgType()+"_"+gatewayVo.getgSN()+"\" where time >="+circuitVo.getStartTime()+" ORDER BY time desc limit 1";
sql1="SELECT \"b\" FROM \"tdl_policy\".\""+gatewayVo.getgType()+"_"+gatewayVo.getgSN()+"\" where \"tdl\"='"+TDL.get(i)+"' and time >="+circuitVo.getStartTime()+" and time<="+circuitVo.getEndTime()*1000000l+" ORDER BY time desc limit 1";
}else{
sql1="SELECT \"b\" FROM \"tdl_policy\".\""+gatewayVo.getgType()+"_"+gatewayVo.getgSN()+"\" where \"tdl\"='"+TDL.get(i)+"' and time >="+circuitVo.getStartTime()+" ORDER BY time desc limit 1";
Stringsql="SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\" where time >= "+circuitList.get(i).getStartTime()*1000000l+" ORDER BY time desc limit 1";
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";
@@ -269,12 +434,10 @@ public class HomePageController {
Stringsql="SELECT \"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" where \"data_type\" = 'location' and time >= "+startTime+" ORDER BY time desc limit 1";
Stringsql="SELECT \"battery\" FROM \"tdl_policy\".\""+device+"\" where time >="+gatewayOnLineVos.get(a).getStartTime()*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+" ORDER BY time desc limit 1 ";
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 ";
SELECT c.transportationNo,cargoNo,(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence LIMIT 1)) startCity,startTime,
(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence DESC LIMIT 1)) endCity,endTime
from circuit c where c.state=1
and c.circuitState = 1
AND company_id=(SELECT id from company where companyNo=#{companyNo,jdbcType=VARCHAR})