Commit 5827e98cc11a343ae29f25ee54074de4831cfa3e
1 parent
641a7822
掉线异常数据表
Showing
1 changed file
with
6 additions
and
4 deletions
src/main/java/com/bsth/service/excep/impl/OfflineServiceImpl.java
| @@ -43,15 +43,16 @@ public class OfflineServiceImpl implements OfflineService { | @@ -43,15 +43,16 @@ public class OfflineServiceImpl implements OfflineService { | ||
| 43 | String days_year=map.get("days_year").toString(); | 43 | String days_year=map.get("days_year").toString(); |
| 44 | String line_id=map.get("line_id").toString(); | 44 | String line_id=map.get("line_id").toString(); |
| 45 | String device_id=map.get("device_id").toString(); | 45 | String device_id=map.get("device_id").toString(); |
| 46 | + String ts=map.get("ts").toString(); | ||
| 46 | String sql="SELECT t.line_id,t.device_id,MIN(ts) as ts,days_year FROM bsth_c_gps_info t " | 47 | String sql="SELECT t.line_id,t.device_id,MIN(ts) as ts,days_year FROM bsth_c_gps_info t " |
| 47 | - + " WHERE t.line_id='"+line_id+"' and t.device_id='"+device_id+"' and t.days_year='"+days_year+"' " | 48 | + + " WHERE t.line_id='"+line_id+"' and t.device_id='"+device_id+"' and t.days_year='"+days_year+"' and t.ts>='"+ts+"' " |
| 48 | + " GROUP BY t.device_id,t.line_id "; | 49 | + " GROUP BY t.device_id,t.line_id "; |
| 49 | - sql +=" order by ts limit ?,?"; | 50 | + sql +=" order by ts "; |
| 50 | try { | 51 | try { |
| 51 | conn = DBUtils_MS.getConnection(); | 52 | conn = DBUtils_MS.getConnection(); |
| 52 | ps = conn.prepareStatement(sql); | 53 | ps = conn.prepareStatement(sql); |
| 53 | - ps.setInt(1,0*10); // O-最大条数 -- M-起始条数 | ||
| 54 | - ps.setInt(2, 100000000); // O-最小条数 -- M-显示条数 | 54 | +// ps.setInt(1,0*10); // O-最大条数 -- M-起始条数 |
| 55 | +// ps.setInt(2, 1000000); // O-最小条数 -- M-显示条数 | ||
| 55 | rs = ps.executeQuery(); | 56 | rs = ps.executeQuery(); |
| 56 | list = resultSet(rs); | 57 | list = resultSet(rs); |
| 57 | } catch (SQLException e) { | 58 | } catch (SQLException e) { |
| @@ -258,6 +259,7 @@ public class OfflineServiceImpl implements OfflineService { | @@ -258,6 +259,7 @@ public class OfflineServiceImpl implements OfflineService { | ||
| 258 | gpsmap.put("device_id",deviceid ); | 259 | gpsmap.put("device_id",deviceid ); |
| 259 | gpsmap.put("line_id", lineid); | 260 | gpsmap.put("line_id", lineid); |
| 260 | gpsmap.put("days_year", str); | 261 | gpsmap.put("days_year", str); |
| 262 | + gpsmap.put("ts", d1); | ||
| 261 | List<Offline> gps=findGPS(gpsmap); | 263 | List<Offline> gps=findGPS(gpsmap); |
| 262 | if(gps.size()>0){ | 264 | if(gps.size()>0){ |
| 263 | Long ts= gps.get(0).getTs(); | 265 | Long ts= gps.get(0).getTs(); |