81041
2018-10-18 89262f3ad49bf1429e24e1669f340af0b5a188b4
机房事件统计
4个文件已添加
3个文件已修改
681 ■■■■■ 已修改文件
gx_tieta/src/com/fgkj/actions/Bts_station_eventAction.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/dao/AlarmDaoFactory.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/dao/BaseDAO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/dao/BaseDAOFactory.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/dao/impl/Bts_station_eventImpl.java 366 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/dto/Bts_station_event.java 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/services/Bts_station_eventService.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/actions/Bts_station_eventAction.java
New file
@@ -0,0 +1,41 @@
package com.fgkj.actions;
import java.util.List;
import com.fgkj.dto.BattInf;
import com.fgkj.dto.Bts_station_event;
import com.fgkj.dto.ServiceModel;
import com.fgkj.services.Batt_devalarm_data_historyService;
import com.fgkj.services.Bts_station_eventService;
public class Bts_station_eventAction extends ActionUtil{
    private Bts_station_eventService service = new Bts_station_eventService();
    private String json;
    private String result;
    //机房事件统计
    public String serchByCondition(){
        BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
        ServiceModel model=service.serchByCondition(binf);
        result=tojson(model);
        return SUCCESS;
    }
    //机房事件统计
    public String serchByInfo(){
        Bts_station_event bevent=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Bts_station_event.class);
        ServiceModel model=service.serchByInfo(bevent);
        result=tojson(model);
        return SUCCESS;
    }
    public String getResult() {
        return result;
    }
    public void setJson(String json) {
        this.json = json;
    }
}
gx_tieta/src/com/fgkj/dao/AlarmDaoFactory.java
@@ -12,7 +12,7 @@
    public static final int Alarm_res_Monomer =119007;   //--单体内阻
    public static final int Alarm_res_Conn =119008;      //--连接条阻抗
    
    public final static int ALM_TYPE_DisChargeMonVol_ID = 119009; //--放电过程中落后单体告警
    public static final int ALM_TYPE_DisChargeMonVol_ID = 119009; //--放电过程中落后单体告警
    
    public static final int Alarm_CapAlarm =119010;      //--容量告警告警
    public static final int Alarm_CapChange =119011;      //--容量更换告警
@@ -21,30 +21,41 @@
    public static final int ALM_TYPE_BTS9100S_FADIAN_ComError_ID =119025;      //基站发电告警
    public static final int ALM_TYPE_BTS9100S_DIAOZHAN_ComError_ID  =119026;   //基站掉站告警
    public static final int ALM_TYPE_BTS9100S_DOOROPEN_ComError_ID  =119027;   //基站开门告警
    public final static int ALM_TYPE_BTS9100S_TEMPUP_ComError_ID    = 119028;        //基站温度上限告警
    public final static int ALM_TYPE_BTS9100S_TEMPLOW_ComError_ID   = 119029;        //基站温度下限告警
    public final static int ALM_TYPE_BTS9100S_DAMPUP_ComError_ID    = 119030;        //基站湿度上限告警
    public final static int ALM_TYPE_BTS9100S_DAMPLOW_ComError_ID   = 119031;        //基站湿度下限告警
    public static final int ALM_TYPE_BTS9100S_TEMPUP_ComError_ID    = 119028;        //基站温度上限告警
    public static final int ALM_TYPE_BTS9100S_TEMPLOW_ComError_ID   = 119029;        //基站温度下限告警
    public static final int ALM_TYPE_BTS9100S_DAMPUP_ComError_ID    = 119030;        //基站湿度上限告警
    public static final int ALM_TYPE_BTS9100S_DAMPLOW_ComError_ID   = 119031;        //基站湿度下限告警
    
    public final static int ALM_SIGNAL_ID_Null = 0;
    public final static int ALM_SIGNAL_ID_OnlineVolHigh = 1;
    public final static int ALM_SIGNAL_ID_OnlineVolLow = 2;
    public final static int ALM_SIGNAL_ID_GroupVolHigh = 3;
    public final static int ALM_SIGNAL_ID_GroupVolLow = 4;
    public final static int ALM_SIGNAL_ID_ChargeCurrHigh = 5;
    public final static int ALM_SIGNAL_ID_ChargeCurrLow = 6;
    public final static int ALM_SIGNAL_ID_DisChargeCurrHigh = 7;
    public final static int ALM_SIGNAL_ID_DisChargeCurrLow = 8;
    public final static int ALM_SIGNAL_ID_MonVolHigh = 9;
    public final static int ALM_SIGNAL_ID_MonVolLow = 10;
    public final static int ALM_SIGNAL_ID_MonTmpHigh = 11;
    public final static int ALM_SIGNAL_ID_MonTmpLow = 12;
    public final static int ALM_SIGNAL_ID_MonResHigh = 13;
    public final static int ALM_SIGNAL_ID_MonResLow = 14;
    public final static int ALM_SIGNAL_ID_ConnResHigh = 15;
    public final static int ALM_SIGNAL_ID_ConnResLow = 16;
    public final static int ALM_SIGNAL_ID_DischargeMonVolHigh = 17;
    public final static int ALM_SIGNAL_ID_DischargeMonVolLow = 18;
    public static final int STATION_EVENT_TYPE_POFF=1;               //基站停电
    public static final int STATION_EVENT_TYPE_XUHANG=2;             //基站续航
    public static final int STATION_EVENT_TYPE_FADIAN=3;             //基站发电
    public static final int STATION_EVENT_TYPE_DOOROPEN=4;           //基站开门
    public static final int STATION_EVENT_TYPE_DIAOZHAN=5;           //基站掉站
    public static final int STATION_EVENT_TYPE_TEMPUP=6;             //基站温度上限
    public static final int STATION_EVENT_TYPE_TEMPLOW=7;            //基站温度下限
    public static final int STATION_EVENT_TYPE_DAMPUP=8;             //基站湿度上限
    public static final int STATION_EVENT_TYPE_DAMPLOW=9;            //基站湿度下限
    public static final int ALM_SIGNAL_ID_Null = 0;
    public static final int ALM_SIGNAL_ID_OnlineVolHigh = 1;
    public static final int ALM_SIGNAL_ID_OnlineVolLow = 2;
    public static final int ALM_SIGNAL_ID_GroupVolHigh = 3;
    public static final int ALM_SIGNAL_ID_GroupVolLow = 4;
    public static final int ALM_SIGNAL_ID_ChargeCurrHigh = 5;
    public static final int ALM_SIGNAL_ID_ChargeCurrLow = 6;
    public static final int ALM_SIGNAL_ID_DisChargeCurrHigh = 7;
    public static final int ALM_SIGNAL_ID_DisChargeCurrLow = 8;
    public static final int ALM_SIGNAL_ID_MonVolHigh = 9;
    public static final int ALM_SIGNAL_ID_MonVolLow = 10;
    public static final int ALM_SIGNAL_ID_MonTmpHigh = 11;
    public static final int ALM_SIGNAL_ID_MonTmpLow = 12;
    public static final int ALM_SIGNAL_ID_MonResHigh = 13;
    public static final int ALM_SIGNAL_ID_MonResLow = 14;
    public static final int ALM_SIGNAL_ID_ConnResHigh = 15;
    public static final int ALM_SIGNAL_ID_ConnResLow = 16;
    public static final int ALM_SIGNAL_ID_DischargeMonVolHigh = 17;
    public static final int ALM_SIGNAL_ID_DischargeMonVolLow = 18;
    public static final int Alarm_IGNAL_ID_CapAlarmLow =19;    
    public static final int Alarm_IGNAL_ID_CapAlarmHigh =20;     
    public static final int Alarm_IGNAL_ID_CapChangeLow =21;    
gx_tieta/src/com/fgkj/dao/BaseDAO.java
@@ -184,6 +184,8 @@
    
    public static final int FBS9100S_DFU_STATE=90;
    
    public static final int BTS_STATION_EVENT=91;
    public boolean add(Object obj); // 添加
    public boolean update(Object obj); // 更新
gx_tieta/src/com/fgkj/dao/BaseDAOFactory.java
@@ -36,6 +36,7 @@
import com.fgkj.dao.impl.BatttestdataDAOImpl;
import com.fgkj.dao.impl.Batttestdata_infDAOImpl;
import com.fgkj.dao.impl.BatttestdatastopDAOImpl;
import com.fgkj.dao.impl.Bts_station_eventImpl;
import com.fgkj.dao.impl.Chart_ColorImpl;
import com.fgkj.dao.impl.Cmcc_Power_DataImpl;
import com.fgkj.dao.impl.CustompageImpl;
@@ -190,6 +191,7 @@
            case 88:return new BattInf_RebuildImpl();
            case 89:return new Bts_station_stateImpl();
            case 90:return new Fbs9100s_dfu_stateImpl();
            case 91:return new Bts_station_eventImpl();
            default :return null;
        }
    }
gx_tieta/src/com/fgkj/dao/impl/Bts_station_eventImpl.java
New file
@@ -0,0 +1,366 @@
package com.fgkj.dao.impl;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.fgkj.actions.ActionUtil;
import com.fgkj.dao.AlarmDaoFactory;
import com.fgkj.dao.BaseDAO;
import com.fgkj.dao.CallBack;
import com.fgkj.dao.DAOHelper;
import com.fgkj.db.DBUtil;
import com.fgkj.dto.BattInf;
import com.fgkj.dto.Batt_Maint_Dealarm;
import com.fgkj.dto.Batt_devalarm_data_history;
import com.fgkj.dto.Bts_station_event;
import com.fgkj.dto.Page;
import com.fgkj.dto.User_inf;
public class Bts_station_eventImpl implements BaseDAO,CallBack{
    public List getResults(ResultSet rs) {
        // TODO Auto-generated method stub
        return null;
    }
    public boolean add(Object obj) {
        // TODO Auto-generated method stub
        return false;
    }
    public boolean update(Object obj) {
        // TODO Auto-generated method stub
        return false;
    }
    public boolean del(Object obj) {
        // TODO Auto-generated method stub
        return false;
    }
    public List searchAll() {
        // TODO Auto-generated method stub
        return null;
    }
    //机房事件统计
    public List serchByCondition(Object obj) {
        final BattInf binf=(BattInf) obj;
        String sql="select station_id,dev_id,station_event_type,record_datetime,station_event_trig ,tb_battinf.StationName,tb_battinf.StationName1,tb_battinf.StationName2,tb_battinf.StationName3 " +
                " from db_alarm.tb_bts_station_event,db_battinf.tb_battinf " +
                " where  tb_bts_station_event.dev_id=tb_battinf.FBSDeviceId " +
                " and  record_datetime>=?  and  record_datetime<=?  " +
                " and stationname1 like ? and stationname2 like  ? and stationname3 like ? and stationid like ? " ;
        /*//事件筛选
        String eventSqlT=" and station_event_type!=? ";
        String eventSqlF=" and station_event_type=? ";
        if(binf.getNum()==0){
            sql+=eventSqlT;
        }else{
            sql+=eventSqlF;
        }*/
        //事件唯一
        String onlySql=" and station_event_trig=1 ";
        sql+=onlySql;
        //排序
        String orderSql="  order by station_id,record_datetime,station_event_type asc  ";
        sql+=orderSql;
        System.err.println(sql);
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getBattInUseDate(),binf.getBattInUseDate1(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%"}, new CallBack() {
            public List getResults(ResultSet rs) {
                List list=new ArrayList();
                int STATION_EVENT_TYPE_POFF=0;               //基站停电
                int STATION_EVENT_TYPE_XUHANG=0;             //基站续航
                int STATION_EVENT_TYPE_FADIAN=0;             //基站发电
                int STATION_EVENT_TYPE_DOOROPEN=0;           //基站开门
                int STATION_EVENT_TYPE_DIAOZHAN=0;           //基站掉站
                int STATION_EVENT_TYPE_TEMPUP=0;             //基站温度上限
                int STATION_EVENT_TYPE_TEMPLOW=0;            //基站温度下限
                int STATION_EVENT_TYPE_DAMPUP=0;             //基站湿度上限
                int STATION_EVENT_TYPE_DAMPLOW=0;            //基站湿度下限
                int dev_id=0;
                int alm_type=0;
                // 时间段
                String perid_Time = "";
                //机房名称
                String stationName="";
                try {
                    while(rs.next()){
                        int dev_ids=rs.getInt("dev_id");
                        int alm_types=rs.getInt("station_event_type");
                        String stationNames=rs.getString("stationName");
                        // 年份,季度,月份
                        Date dev_recordtime = rs.getTimestamp("record_datetime");
                        // 获取具体年份,月份和该月的总天数
                        int year = dev_recordtime.getYear() + 1900;
                        int month = dev_recordtime.getMonth() + 1;
                        String perid_Times="";
                        if(binf.getBattGroupNum()==1){//月统计
                            perid_Times = ActionUtil.getFirstDayOfMonth(year, month - 1);
                            perid_Times += "~";
                            perid_Times += ActionUtil.getLastDayOfMonth(year, month - 1);
                        }else if (binf.getBattGroupNum()==3) {// 按年份
                            perid_Times = ActionUtil.getFirstDayOfMonth(year, 0);
                            perid_Times += "~";
                            perid_Times += ActionUtil.getLastDayOfMonth(year, 11);
                        }
                        if(perid_Times.equals(perid_Time)){
                            if(dev_ids==dev_id){
                                    if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_POFF){
                                        STATION_EVENT_TYPE_POFF+=1;
                                    }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_XUHANG){
                                        STATION_EVENT_TYPE_XUHANG+=1;
                                    }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_FADIAN){
                                        STATION_EVENT_TYPE_FADIAN+=1;
                                    }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DIAOZHAN){
                                        STATION_EVENT_TYPE_DIAOZHAN+=1;
                                    }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DOOROPEN){
                                        STATION_EVENT_TYPE_DOOROPEN+=1;
                                    }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_TEMPUP){
                                        STATION_EVENT_TYPE_TEMPUP+=1;
                                    }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_TEMPLOW){
                                        STATION_EVENT_TYPE_TEMPLOW+=1;
                                    }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DAMPUP){
                                        STATION_EVENT_TYPE_DAMPUP+=1;
                                    }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DAMPLOW){
                                        STATION_EVENT_TYPE_DAMPLOW+=1;
                                    }
                            }else{
                                Bts_station_event bevent=new Bts_station_event();
                                bevent.setStationName(stationName);
                                bevent.setDev_id(dev_id);
                                bevent.setStation_event_type_xuhang(STATION_EVENT_TYPE_XUHANG);
                                bevent.setStation_event_type_poff(STATION_EVENT_TYPE_POFF);
                                bevent.setStation_event_type_fadian(STATION_EVENT_TYPE_FADIAN);
                                bevent.setStation_event_type_diaozhan(STATION_EVENT_TYPE_DIAOZHAN);
                                bevent.setStation_event_type_dooropen(STATION_EVENT_TYPE_DOOROPEN);
                                bevent.setStation_event_type_tempup(STATION_EVENT_TYPE_TEMPUP);
                                bevent.setStation_event_type_templow(STATION_EVENT_TYPE_TEMPLOW);
                                bevent.setStation_event_type_dampup(STATION_EVENT_TYPE_DAMPUP);
                                bevent.setNote(String.valueOf(STATION_EVENT_TYPE_DAMPLOW));
                                bevent.setNote(perid_Time);
                                list.add(bevent);
                                stationName=stationNames;
                                dev_id=dev_ids;
                                STATION_EVENT_TYPE_POFF=0;
                                STATION_EVENT_TYPE_XUHANG=0;
                                STATION_EVENT_TYPE_FADIAN=0;
                                STATION_EVENT_TYPE_DIAOZHAN=0;
                                STATION_EVENT_TYPE_DOOROPEN=0;
                                STATION_EVENT_TYPE_TEMPUP    =0;        //基站温度上限告警
                                STATION_EVENT_TYPE_TEMPLOW   = 0;        //基站温度下限告警
                                STATION_EVENT_TYPE_DAMPUP    = 0;        //基站湿度上限告警
                                STATION_EVENT_TYPE_DAMPLOW   = 0;        //基站湿度下限告警
                                if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_POFF){
                                    STATION_EVENT_TYPE_POFF+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_XUHANG){
                                    STATION_EVENT_TYPE_XUHANG+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_FADIAN){
                                    STATION_EVENT_TYPE_FADIAN+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DIAOZHAN){
                                    STATION_EVENT_TYPE_DIAOZHAN+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DOOROPEN){
                                    STATION_EVENT_TYPE_DOOROPEN+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_TEMPUP){
                                    STATION_EVENT_TYPE_TEMPUP+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_TEMPLOW){
                                    STATION_EVENT_TYPE_TEMPLOW+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DAMPUP){
                                    STATION_EVENT_TYPE_DAMPUP+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DAMPLOW){
                                    STATION_EVENT_TYPE_DAMPLOW+=1;
                                }
                            }
                        }else{
                               if(perid_Time.equals("")){
                                   if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_POFF){
                                          STATION_EVENT_TYPE_POFF+=1;
                                       }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_XUHANG){
                                        STATION_EVENT_TYPE_XUHANG+=1;
                                    }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_FADIAN){
                                          STATION_EVENT_TYPE_FADIAN+=1;
                                       }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DIAOZHAN){
                                          STATION_EVENT_TYPE_DIAOZHAN+=1;
                                       }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DOOROPEN){
                                          STATION_EVENT_TYPE_DOOROPEN+=1;
                                       }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_TEMPUP){
                                        STATION_EVENT_TYPE_TEMPUP+=1;
                                    }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_TEMPLOW){
                                        STATION_EVENT_TYPE_TEMPLOW+=1;
                                    }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DAMPUP){
                                        STATION_EVENT_TYPE_DAMPUP+=1;
                                    }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DAMPLOW){
                                        STATION_EVENT_TYPE_DAMPLOW+=1;
                                    }
                                   perid_Time=perid_Times;
                                   dev_id=dev_ids;
                                   stationName=stationNames;
                                   continue;
                                }
                               Bts_station_event bevent=new Bts_station_event();
                                bevent.setStationName(stationName);
                                bevent.setDev_id(dev_id);
                                bevent.setStation_event_type_xuhang(STATION_EVENT_TYPE_XUHANG);
                                bevent.setStation_event_type_poff(STATION_EVENT_TYPE_POFF);
                                bevent.setStation_event_type_fadian(STATION_EVENT_TYPE_FADIAN);
                                bevent.setStation_event_type_diaozhan(STATION_EVENT_TYPE_DIAOZHAN);
                                bevent.setStation_event_type_dooropen(STATION_EVENT_TYPE_DOOROPEN);
                                bevent.setStation_event_type_tempup(STATION_EVENT_TYPE_TEMPUP);
                                bevent.setStation_event_type_templow(STATION_EVENT_TYPE_TEMPLOW);
                                bevent.setStation_event_type_dampup(STATION_EVENT_TYPE_DAMPUP);
                                bevent.setNote(String.valueOf(STATION_EVENT_TYPE_DAMPLOW));
                                bevent.setNote(perid_Time);
                                //System.out.println(2+" "+dalarm.getDev_ip()+" "+dalarm.getDev_id()+" "+dalarm.getNum()+" "+dalarm.getRecord_id()+" "+dalarm.getAlm_type()+" "+dalarm.getAlm_level()+" "+dalarm.getStationName());
                                list.add(bevent);
                                STATION_EVENT_TYPE_POFF=0;
                                STATION_EVENT_TYPE_XUHANG=0;
                                STATION_EVENT_TYPE_FADIAN=0;
                                STATION_EVENT_TYPE_DIAOZHAN=0;
                                STATION_EVENT_TYPE_DOOROPEN=0;
                                STATION_EVENT_TYPE_TEMPUP    =0;        //基站温度上限告警
                                STATION_EVENT_TYPE_TEMPLOW   = 0;        //基站温度下限告警
                                STATION_EVENT_TYPE_DAMPUP    = 0;        //基站湿度上限告警
                                STATION_EVENT_TYPE_DAMPLOW   = 0;        //基站湿度下限告警
                                if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_POFF){
                                    STATION_EVENT_TYPE_POFF+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_XUHANG){
                                    STATION_EVENT_TYPE_XUHANG+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_FADIAN){
                                    STATION_EVENT_TYPE_FADIAN+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DIAOZHAN){
                                    STATION_EVENT_TYPE_DIAOZHAN+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DOOROPEN){
                                    STATION_EVENT_TYPE_DOOROPEN+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_TEMPUP){
                                    STATION_EVENT_TYPE_TEMPUP+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_TEMPLOW){
                                    STATION_EVENT_TYPE_TEMPLOW+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DAMPUP){
                                    STATION_EVENT_TYPE_DAMPUP+=1;
                                }else if(alm_types==AlarmDaoFactory.STATION_EVENT_TYPE_DAMPLOW){
                                    STATION_EVENT_TYPE_DAMPLOW+=1;
                                }
                                dev_id=dev_ids;
                                stationName=stationNames;
                                perid_Time=perid_Times;
                        }
                       if(rs.isLast()){
                           Bts_station_event bevent=new Bts_station_event();
                            bevent.setStationName(stationName);
                            bevent.setDev_id(dev_id);
                            bevent.setStation_event_type_xuhang(STATION_EVENT_TYPE_XUHANG);
                            bevent.setStation_event_type_poff(STATION_EVENT_TYPE_POFF);
                            bevent.setStation_event_type_fadian(STATION_EVENT_TYPE_FADIAN);
                            bevent.setStation_event_type_diaozhan(STATION_EVENT_TYPE_DIAOZHAN);
                            bevent.setStation_event_type_dooropen(STATION_EVENT_TYPE_DOOROPEN);
                            bevent.setStation_event_type_tempup(STATION_EVENT_TYPE_TEMPUP);
                            bevent.setStation_event_type_templow(STATION_EVENT_TYPE_TEMPLOW);
                            bevent.setStation_event_type_dampup(STATION_EVENT_TYPE_DAMPUP);
                            bevent.setNote(String.valueOf(STATION_EVENT_TYPE_DAMPLOW));
                            bevent.setNote(perid_Time);
                            list.add(bevent);
                        }
                    }
                } catch (SQLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                return list;
            }
        });
        return list;
    }
    //机房事件统计(详情)
    public List serchByInfo(Object obj) {
        Bts_station_event bevent=(Bts_station_event) obj;
        String sql="select station_id,dev_id,station_event_type,record_datetime,station_event_trig ,tb_battinf.StationName,tb_battinf.StationName1,tb_battinf.StationName2,tb_battinf.StationName3 " +
                " from tb_bts_station_event,db_battinf.tb_battinf " +
                " where  tb_bts_station_event.dev_id=tb_battinf.FBSDeviceId " +
                " and dev_id=?  " +
                " and  record_datetime>=?  and  record_datetime<=? " +
                " order by station_id,station_event_type,record_datetime,station_event_trig asc ";
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{bevent.getDev_id(),bevent.getRecord_datetime(),bevent.getRecord_datetime_end()}, new CallBack() {
            public List getResults(ResultSet rs) {
                List list=new ArrayList();
                try {
                    while(rs.next()){
                        Bts_station_event b=new Bts_station_event();
                        b.setStation_id(rs.getInt("station_id"));
                        b.setDev_id(rs.getInt("dev_id"));
                        b.setRecord_datetime(rs.getTimestamp("record_datetime"));
                        b.setStation_event_type(rs.getInt("station_event_type"));
                        b.setStation_event_trig(rs.getInt("station_event_trig"));
                        b.setStationName(rs.getString("stationName"));
                        list.add(b);
                    }
                } catch (SQLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                return list;
            }
        });
        return list;
    }
    public static void main(String[] args) throws ParseException {
        Bts_station_eventImpl bimpl=new Bts_station_eventImpl();
        Page p = new Page();
        p.setPageCurr(1);
        p.setPageSize(10);
        /*条件所存放的位置前台:tb_batt_maint_inf
         * 在线电压:usr_id
         * 组端电压:fault_type_id
         * 充电电流:fault_level
         * 放电电流:record_uid
         * 单体电压:maint_type_id
         * 单体温度:maint_done
         * 单体内阻:maint_close
         * 连接条阻抗:master_id
         * */
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date1 = sdf.parse("2000-01-01 00:00:00");
        Date date2 = sdf.parse("2020-01-01 00:00:00");
        BattInf binf = new BattInf();
        binf.setNum(0);
        binf.setStationName("");
        binf.setStationName1("");
        binf.setStationName2("");
        binf.setStationName3("");
        binf.setStationId("");
        binf.setBattGroupNum(1);
        binf.setBattInUseDate(ActionUtil.getSimpDate(date1));
        binf.setBattInUseDate1(ActionUtil.getSimpDate(date2));
        User_inf uinf=new User_inf();
        uinf.setUId(1002);
        Batt_Maint_Dealarm bmd = new Batt_Maint_Dealarm();
        bmd.setPage(p);
        bmd.setBinf(binf);
        bmd.setUinf(uinf);
        List<Bts_station_event> list=bimpl.serchByCondition(binf);
        System.out.println(list.size());
        for (Bts_station_event b : list) {
            System.out.println(b.getNote()+" "+b.getDev_id()+" "+b.getStation_event_type_poff()+" "+b.getStation_event_type_xuhang()+" "+b.getStation_event_type_fadian()+" "+b.getStation_event_type_diaozhan()+" "+b.getStation_event_type_dooropen()+" "+b.getStation_event_type_tempup()+" "+b.getStation_event_type_templow()+" "+b.getStation_event_type_dampup()+" "+b.getStation_event_type_damplow()+" "+b.getStationName());
        }
    }
}
gx_tieta/src/com/fgkj/dto/Bts_station_event.java
New file
@@ -0,0 +1,164 @@
package com.fgkj.dto;
import java.io.Serializable;
import java.util.Date;
import com.fgkj.dao.BaseDAO;
import com.fgkj.dao.CallBack;
public class Bts_station_event implements Serializable{
    private int num;
    private int station_id;
    private String stationName;
    private int dev_id;
    private Date record_datetime;
    private int station_event_type;
    private int station_event_trig;
    private String note;
    public Date record_datetime_end;
    public int station_event_type_poff;               //基站停电
    public int station_event_type_xuhang;             //基站续航
    public int station_event_type_fadian;             //基站发电
    public int station_event_type_dooropen;           //基站开门
    public int station_event_type_diaozhan;           //基站掉站
    public int station_event_type_tempup;             //基站温度上限
    public int station_event_type_templow;            //基站温度下限
    public int station_event_type_dampup;             //基站湿度上限
    public int station_event_type_damplow;            //基站湿度下限
    public int getNum() {
        return num;
    }
    public void setNum(int num) {
        this.num = num;
    }
    public int getStation_id() {
        return station_id;
    }
    public void setStation_id(int station_id) {
        this.station_id = station_id;
    }
    public int getDev_id() {
        return dev_id;
    }
    public void setDev_id(int dev_id) {
        this.dev_id = dev_id;
    }
    public Date getRecord_datetime() {
        return record_datetime;
    }
    public void setRecord_datetime(Date record_datetime) {
        this.record_datetime = record_datetime;
    }
    public int getStation_event_type() {
        return station_event_type;
    }
    public void setStation_event_type(int station_event_type) {
        this.station_event_type = station_event_type;
    }
    public int getStation_event_trig() {
        return station_event_trig;
    }
    public void setStation_event_trig(int station_event_trig) {
        this.station_event_trig = station_event_trig;
    }
    public String getNote() {
        return note;
    }
    public void setNote(String note) {
        this.note = note;
    }
    public Date getRecord_datetime_end() {
        return record_datetime_end;
    }
    public void setRecord_datetime_end(Date record_datetime_end) {
        this.record_datetime_end = record_datetime_end;
    }
    public int getStation_event_type_poff() {
        return station_event_type_poff;
    }
    public void setStation_event_type_poff(int station_event_type_poff) {
        this.station_event_type_poff = station_event_type_poff;
    }
    public int getStation_event_type_xuhang() {
        return station_event_type_xuhang;
    }
    public void setStation_event_type_xuhang(int station_event_type_xuhang) {
        this.station_event_type_xuhang = station_event_type_xuhang;
    }
    public int getStation_event_type_fadian() {
        return station_event_type_fadian;
    }
    public void setStation_event_type_fadian(int station_event_type_fadian) {
        this.station_event_type_fadian = station_event_type_fadian;
    }
    public int getStation_event_type_dooropen() {
        return station_event_type_dooropen;
    }
    public void setStation_event_type_dooropen(int station_event_type_dooropen) {
        this.station_event_type_dooropen = station_event_type_dooropen;
    }
    public int getStation_event_type_diaozhan() {
        return station_event_type_diaozhan;
    }
    public void setStation_event_type_diaozhan(int station_event_type_diaozhan) {
        this.station_event_type_diaozhan = station_event_type_diaozhan;
    }
    public int getStation_event_type_tempup() {
        return station_event_type_tempup;
    }
    public void setStation_event_type_tempup(int station_event_type_tempup) {
        this.station_event_type_tempup = station_event_type_tempup;
    }
    public int getStation_event_type_templow() {
        return station_event_type_templow;
    }
    public void setStation_event_type_templow(int station_event_type_templow) {
        this.station_event_type_templow = station_event_type_templow;
    }
    public int getStation_event_type_dampup() {
        return station_event_type_dampup;
    }
    public void setStation_event_type_dampup(int station_event_type_dampup) {
        this.station_event_type_dampup = station_event_type_dampup;
    }
    public int getStation_event_type_damplow() {
        return station_event_type_damplow;
    }
    public void setStation_event_type_damplow(int station_event_type_damplow) {
        this.station_event_type_damplow = station_event_type_damplow;
    }
    public String getStationName() {
        return stationName;
    }
    public void setStationName(String stationName) {
        this.stationName = stationName;
    }
    @Override
    public String toString() {
        return "Bts_station_event [num=" + num + ", station_id=" + station_id
                + ", stationName=" + stationName + ", dev_id=" + dev_id
                + ", record_datetime=" + record_datetime
                + ", station_event_type=" + station_event_type
                + ", station_event_trig=" + station_event_trig + ", note="
                + note + ", record_datetime_end=" + record_datetime_end
                + ", station_event_type_poff=" + station_event_type_poff
                + ", station_event_type_xuhang=" + station_event_type_xuhang
                + ", station_event_type_fadian=" + station_event_type_fadian
                + ", station_event_type_dooropen="
                + station_event_type_dooropen
                + ", station_event_type_diaozhan="
                + station_event_type_diaozhan + ", station_event_type_tempup="
                + station_event_type_tempup + ", station_event_type_templow="
                + station_event_type_templow + ", station_event_type_dampup="
                + station_event_type_dampup + ", station_event_type_damplow="
                + station_event_type_damplow + "]";
    }
}
gx_tieta/src/com/fgkj/services/Bts_station_eventService.java
New file
@@ -0,0 +1,47 @@
package com.fgkj.services;
import java.util.List;
import com.fgkj.dao.BaseDAO;
import com.fgkj.dao.BaseDAOFactory;
import com.fgkj.dao.impl.Batt_devalarm_data_historyImpl;
import com.fgkj.dto.ServiceModel;
public class Bts_station_eventService {
    private ServiceModel model;
    private BaseDAO dao;
    public Bts_station_eventService() {
        super();
        model=new ServiceModel();
        dao=BaseDAOFactory.getBaseDAO(BaseDAO.BTS_STATION_EVENT);
    }
    //机房事件统计
    public ServiceModel serchByCondition(Object obj){
        List list=dao.serchByCondition(obj);
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
    //机房事件统计(详情)
    public ServiceModel serchByInfo(Object obj) {
        List list=dao.serchByInfo(obj);
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
}