日期:2014-05-18 浏览次数:20747 次
private String timeid;
private double change_count;
private double wlan_count;
private double data_count;
private double send_count;
private double electricy_count;
private double platform_count;
private double totle_count;
public NetWorkFaultType(){}
public NetWorkFaultType(double change_count,double wlan_count,double data_count,double send_count,double electricy_count,double platform_count,double totle_count)
{
this.change_count=change_count;
this.wlan_count=wlan_count;
this.data_count=data_count;
this.send_count=send_count;
this.electricy_count=electricy_count;
this.platform_count=platform_count;
this.totle_count=totle_count;
}
String hql="select new cn.com.starit.local.persistence.po.NetWorkFaultType(sum(t.change_count),sum(t.wlan_count)," +
"sum(t.data_count),sum(t.send_count),sum(t.electricy_count),sum(t.platform_count),sum(t.totle_count)) from NetWorkFaultType t" +
" where timeid between '"+timeList.get(0)+"' and '"+timeList.get(1)+"'";
public ArrayList<NetWorkFaultType> getNetFaultType(String hql)
{
ArrayList<NetWorkFaultType> list=new ArrayList<NetWorkFaultType>();
//获取session
session=getSession();
//开启事物
beginTrans(session);
//创建query对象
query=session.createQuery(hql);
//使用query进行查询
list=(ArrayList)query.list();
return list;
}