sqls="SELECT count("+field+") FROM \"tdl_policy\".\""+device+"\" WHERE \"tdl\"='"+devList.get(i)+"' and time>="+startTime+" and time <="+resultCircuitVo.getEndTime()*1000000l;
sqls="SELECT count("+field+") FROM \"tdl_policy\".\""+device+"\" WHERE \"event\" = '"+event+"' and \"tdl\"='"+devList.get(i)+"' and time>="+startTime+" and time <="+resultCircuitVo.getEndTime()*1000000l;
}else{
sqls="SELECT count("+field+") FROM \"tdl_policy\".\""+device+"\" WHERE \"tdl\"='"+devList.get(i)+"' and time>="+startTime+" and time <="+System.currentTimeMillis()*1000000l;
sqls="SELECT count("+field+") FROM \"tdl_policy\".\""+device+"\" WHERE \"event\" = '"+event+"' and \"tdl\"='"+devList.get(i)+"' and time>="+startTime+" and time <="+System.currentTimeMillis()*1000000l;
sql="SELECT \"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\"where time >= "+startTime+" and time<= "+time+" ORDER BY time ";
sql="SELECT \"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\"where \"data_type\" = 'location' and time >= "+startTime+" and time<= "+time+" ORDER BY time ";
}else{
sql="SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\"where time >= "+startTime+" and time<= "+time+" ORDER BY time ";
sql="SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\"where \"data_type\" = 'location' and time >= "+startTime+" and time<= "+time+" ORDER BY time ";
}
}else{
if("baidu".equals(searchLocationVo.getType())){
sql="SELECT \"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\"where time >= "+startTime+" ORDER BY time ";
sql="SELECT \"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\"where \"data_type\" = 'location' and time >= "+startTime+" ORDER BY time ";
}else{
sql="SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\"where time >= "+startTime+" ORDER BY time ";
sql="SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\"where \"data_type\" = 'location' and time >= "+startTime+" ORDER BY time ";
}
}
//获取tdl信息
...
...
@@ -150,11 +148,10 @@ public class DataController {
sql3="SELECT \"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" where time >= "+startTime+" and time<="+t+" ORDER BY time desc limit 1;"+sql3;
sql3="SELECT \"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" where \"data_type\" = 'location' and time >= "+startTime+" and time<="+t+" ORDER BY time desc limit 1;"+sql3;
}else{
sql3="SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\" where time >= "+startTime+" and time<="+t+" ORDER BY time desc limit 1;"+sql3;
sql3="SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\" where \"data_type\" = 'location' and time >= "+startTime+" and time<="+t+" ORDER BY time desc limit 1;"+sql3;
sqls="SELECT count("+list.get(j)+") FROM \"tdl_policy\".\""+device+"\" WHERE \"tdl\"='"+devList.get(i)+"' and time>="+startTime+" and time <="+resultCircuitVo.getEndTime()*1000000l;
}else{
sqls="SELECT count("+list.get(j)+") FROM \"tdl_policy\".\""+device+"\" WHERE \"tdl\"='"+devList.get(i)+"' and time>="+startTime+" and time <="+System.currentTimeMillis()*1000000l;
sql="SELECT "+list.get(j)+" FROM \"tdl_policy\".\""+device+"\" where \"tdl\"='"+devList.get(i)+"' and time >="+startTime+" and time<="+resultCircuitVo.getEndTime()*1000000l+" ORDER BY time ";
}else{
sql="SELECT "+list.get(j)+" FROM \"tdl_policy\".\""+device+"\" where \"tdl\"='"+devList.get(i)+"' and time >="+startTime+" ORDER BY time";
// if (resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0) {
// sql = "SELECT " + list.get(j) + " FROM \"tdl_policy\".\"" + device + "\" where \"tdl\"='" + devList.get(i) + "' and time >=" + startTime + " and time<=" + resultCircuitVo.getEndTime() * 1000000l + " ORDER BY time ";
// } else {
// sql = "SELECT " + list.get(j) + " FROM \"tdl_policy\".\"" + device + "\" where \"tdl\"='" + devList.get(i) + "' and time >=" + startTime + " ORDER BY time";