| | |
| | | // 时间段
|
| | | String perid_Time = "";
|
| | | Calendar now = Calendar.getInstance();
|
| | | int nowflow=0;
|
| | | int dayflow=0;
|
| | | try {
|
| | | while(rs.next()){
|
| | |
|
| | | int nowflows=rs.getInt("nowflow");
|
| | | int dayflows=rs.getInt("dayflow");
|
| | | // 年份,季度,月份
|
| | | Date dev_recordtime = rs.getTimestamp("record_time");
|
| | | // 获取具体年份,月份和该月的总天数
|
| | |
| | | }
|
| | | //System.out.println(perid_Times+" "+perid_Time+" "+nowflows);
|
| | | if(perid_Times.equals(perid_Time)){
|
| | | nowflow+=nowflows;
|
| | | dayflow+=dayflows;
|
| | | }else{
|
| | | if(perid_Time.equals("")){
|
| | | perid_Time=perid_Times;
|
| | | nowflow+=nowflows;
|
| | | dayflow+=dayflows;
|
| | | continue;
|
| | | }
|
| | | Stationtraffic st=new Stationtraffic();
|
| | | st.setDev_id(rs.getInt("dev_id"));
|
| | | st.setNowflow(nowflow);
|
| | | st.setDayflow(dayflow);
|
| | | st.setStationName(rs.getString("stationName"));
|
| | | st.setStationName1(rs.getString("stationName1"));
|
| | | st.setStationName2(rs.getString("stationName2"));
|
| | |
| | | st.setStationName5(rs.getString("stationName5"));
|
| | | st.setNote(perid_Time);
|
| | | list.add(st);
|
| | | nowflow=0;
|
| | | nowflow+=nowflows;
|
| | | dayflow=0;
|
| | | dayflow+=dayflows;
|
| | | perid_Time=perid_Times;
|
| | |
|
| | | }
|
| | | if(rs.isLast()){
|
| | | Stationtraffic st=new Stationtraffic();
|
| | | st.setDev_id(rs.getInt("dev_id"));
|
| | | st.setNowflow(nowflow);
|
| | | st.setDayflow(dayflow);
|
| | | st.setStationName(rs.getString("stationName"));
|
| | | st.setStationName1(rs.getString("stationName1"));
|
| | | st.setStationName2(rs.getString("stationName2"));
|