sql="SELECT \"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\"where \"data_type\" = 'location' and time >= "+startTime+" and time<= "+time+" ORDER BY time ";
sql="SELECT \"bdlng\",\"bdlat\",\"motion\" FROM \"tdl_policy\".\""+device+"\"where \"data_type\" = 'location' and time >= "+startTime+" and time<= "+time+" ORDER BY time ";
}else{
}else{
sql="SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\"where \"data_type\" = 'location' and time >= "+startTime+" and time<= "+time+" ORDER BY time ";
sql="SELECT \"lng\",\"lat\",\"motion\" FROM \"tdl_policy\".\""+device+"\"where \"data_type\" = 'location' and time >= "+startTime+" and time<= "+time+" ORDER BY time ";
}
}
}else{
}else{
if("baidu".equals(searchLocationVo.getType())){
if("baidu".equals(searchLocationVo.getType())){
sql="SELECT \"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\"where \"data_type\" = 'location' and time >= "+startTime+" ORDER BY time ";
// sql = "SELECT \"bdlng\",\"bdlat\",\"motion\" FROM \"tdl_policy\".\"" + device + "\"where \"data_type\" = 'location' and time >= " + startTime + " ORDER BY time ";
sql="SELECT \"bdlng\",\"bdlat\",\"motion\" FROM \"tdl_policy\".\""+device+"\"where \"data_type\" = 'location' and time >= 1552579200000000000 ORDER BY time ";
}else{
}else{
sql="SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\"where \"data_type\" = 'location' and time >= "+startTime+" ORDER BY time ";
sql="SELECT \"lng\",\"lat\",\"motion\" FROM \"tdl_policy\".\""+device+"\"where \"data_type\" = 'location' and time >= "+startTime+" ORDER BY time ";
}
}
}
}
//获取tdl信息
//获取tdl信息
...
@@ -151,11 +151,7 @@ public class DataController {
...
@@ -151,11 +151,7 @@ public class DataController {
sqls="SELECT \"tdl\",\"p\",\"T\",\"h\",\"a0\",\"a1\",\"ta\",\"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" WHERE time >="+startTime+" and time <="+resultCircuitVo.getEndTime()*1000000l+" ORDER BY time ";
sqls="SELECT \"tdl\",\"p\",\"T\",\"h\",\"a0\",\"a1\",\"ta\",\"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" WHERE time >="+startTime+" and time <="+resultCircuitVo.getEndTime()*1000000l+" ORDER BY time ";
...
@@ -493,32 +514,25 @@ public class DataController {
...
@@ -493,32 +514,25 @@ public class DataController {
sqls="SELECT \"tdl\",\"p\",\"T\",\"h\",\"a1\",\"ta\",\"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" WHERE time >="+startTime+" and time <="+resultCircuitVo.getEndTime()*1000000l+" ORDER BY time ";
sqls="SELECT \"tdl\",\"p\",\"T\",\"h\",\"a1\",\"ta\",\"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" WHERE time >="+startTime+" and time <="+resultCircuitVo.getEndTime()*1000000l+" ORDER BY time ";
...
@@ -617,38 +651,35 @@ public class DataController {
...
@@ -617,38 +651,35 @@ public class DataController {
// String[] rowsName = new String[]{"时间","压力(MPa)","温度(℃)","湿度(%RH)","震动能量(w)","震动强度(g)","倾斜角度(°)","经度","纬度"};
// File file = new File("./export");
// if(!file.exists()){
// file.mkdir();
// }
// try {
// String sqls = "";
// if (resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0) {
// sqls = "SELECT \"tdl\",\"p\",\"T\",\"h\",\"a0\",\"a1\",\"ta\",\"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" WHERE time >=" +startTime +" and time <=" +resultCircuitVo.getEndTime() * 1000000l+" ORDER BY time ";
// } else {
// sqls = "SELECT \"tdl\",\"p\",\"T\",\"h\",\"a0\",\"a1\",\"ta\",\"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" WHERE time >=" +startTime +" and time <=" +System.currentTimeMillis() * 1000000l+" ORDER BY time ";
// rowsName = new String[]{"时间","圧力(MPa)","温度(℃)","湿度(%RH)","振動エネルギー(w)","振動(g)","回転(°)","経度","緯度"};
// }else{
// rowsName = new String[]{"Time","Pressure(MPa)","Temperature(℃)","Humidity(%RH)","Shock Intensity(w)","Shock(g)","Tilt(°)","Longitude","Latitude"};
//
// }
// File file = new File("./export");
// if(!file.exists()){
// file.mkdir();
// }
// try {
// String sqls = "";
// if (resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0) {
// sqls = "SELECT \"tdl\",\"p\",\"T\",\"h\",\"a0\",\"a1\",\"ta\",\"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" WHERE time >=" +startTime +" and time <=" +resultCircuitVo.getEndTime() * 1000000l+" ORDER BY time ";
// } else {
// sqls = "SELECT \"tdl\",\"p\",\"T\",\"h\",\"a0\",\"a1\",\"ta\",\"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" WHERE time >=" +startTime +" and time <=" +System.currentTimeMillis() * 1000000l+" ORDER BY time ";
// rowsName = new String[]{"时间","圧力(MPa)","海抜(m)","温度(℃)","湿度(%RH)","振動(g)","回転(°)","経度","緯度"};
// }else{
// rowsName = new String[]{"Time","Pressure(MPa)","Altitude(m)","Temperature(℃)","Humidity(%RH)","Shock(g)","Tilt(°)","Longitude","Latitude"};
//
// }
// File file = new File("./export");
// if(!file.exists()){
// file.mkdir();
// }
// DecimalFormat df = new DecimalFormat("0.00");
// df.getRoundingMode();
// try {
// String sqls = "";
// if (resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0) {
// sqls = "SELECT \"tdl\",\"p\",\"T\",\"h\",\"a1\",\"ta\",\"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" WHERE time >=" +startTime +" and time <=" +resultCircuitVo.getEndTime() * 1000000l+" ORDER BY time ";
// } else {
// sqls = "SELECT \"tdl\",\"p\",\"T\",\"h\",\"a1\",\"ta\",\"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" WHERE time >=" +startTime +" and time <=" +System.currentTimeMillis() * 1000000l+" ORDER BY time ";
// if (resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0) {
// Long time = resultCircuitVo.getEndTime() * 1000000l;
// if ("baidu".equals(searchLocationVo.getType())) {
// 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 \"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 \"data_type\" = 'location' and time >= " + startTime + " ORDER BY time ";
// } else {
// sql = "SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\"" + device + "\"where \"data_type\" = 'location' and time >= " + startTime + " ORDER BY time ";
// if (resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0) {
// Long time = resultCircuitVo.getEndTime() * 1000000l;
// sql2 = "SELECT \"a1\" FROM \"tdl_policy\".\"" + device + "\" where \"event\" = 'Shock event' and \"a1\" >= 1.5 and time >= " + startTime + " and time<=" + time + " ORDER BY time";
// } else {
// sql2 = "SELECT \"a1\" FROM \"tdl_policy\".\"" + device + "\" where \"event\" = 'Shock event' and \"a1\" >= 1.5 and time >= " + startTime + " ORDER BY time";
// if (queryResult2.getResults().get(0).getSeries() != null) {
// //获取震动的时间戳
// timeList = getTime(queryResult2);
// }
// if (timeList.size() > 0) {
// //获取震动数据的坐标
// String sql3 = "";
// for (String time : timeList) {
// Long t = Long.valueOf(time) * 1000000l;
// if ("baidu".equals(searchLocationVo.getType())) {
// 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 \"data_type\" = 'location' and time >= " + startTime + " and time<=" + t + " ORDER BY time desc limit 1;" + sql3;
// String[] rowsName = new String[]{"时间","压力(MPa)","温度(℃)","湿度(%RH)","震动能量(w)","震动强度(g)","倾斜角度(°)","经度","纬度"};
// File file = new File("./export");
// if(!file.exists()){
// file.mkdir();
// }
// try {
// String sqls = "";
// if (resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0) {
// sqls = "SELECT \"tdl\",\"p\",\"T\",\"h\",\"a0\",\"a1\",\"ta\",\"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" WHERE time >=" +startTime +" and time <=" +resultCircuitVo.getEndTime() * 1000000l+" ORDER BY time ";
// } else {
// sqls = "SELECT \"tdl\",\"p\",\"T\",\"h\",\"a0\",\"a1\",\"ta\",\"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" WHERE time >=" +startTime +" and time <=" +System.currentTimeMillis() * 1000000l+" ORDER BY time ";