| | |
| | | }
|
| | | //实时查询充放电统计
|
| | | public String serchDisOrChargrNew() {
|
| | | ServiceModel model=service.serchDisOrChargrNew();
|
| | | BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class); |
| | | ServiceModel model=service.serchDisOrChargrNew(binf); |
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | |
| | | }
|
| | | //查询实时告警(分页)
|
| | | public String serchByInfo() {
|
| | | Page page=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Page.class);
|
| | | ServiceModel model=service.serchByInfo(page);
|
| | | BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);Page page=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Page.class); |
| | | ServiceModel model=service.serchByInfo(binf); |
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | |
| | | }
|
| | | //查询实时告警的总数
|
| | | public String searchAlarmNum() {
|
| | | ServiceModel model=service.searchAlarmNum();
|
| | | BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class); |
| | | ServiceModel model=service.searchAlarmNum(binf); |
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | |
| | | }
|
| | | //查询所有的历史告警(分页)
|
| | | public String serchByInfo() {
|
| | | Page page=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Page.class);
|
| | | ServiceModel model=service.serchByInfo(page);
|
| | | BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class); |
| | | ServiceModel model=service.serchByInfo(binf); |
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | |
| | | return list;
|
| | | }
|
| | | //测试数据——实时查询充放电统计
|
| | | public List serchDisOrChargrNew(){
|
| | | String sql=" select sum(if(batt_test_type=2,1,0)) as charge,sum(if(batt_test_type=3,1,0)) as discharge from db_ram_db.tb_batt_rtstate where batt_test_type IN(2,3) "
|
| | | public List serchDisOrChargrNew(Object obj){ |
| | | BattInf binf=(BattInf) obj; |
| | | String sql=" select sum(if(batt_test_type=2,1,0)) as charge,sum(if(batt_test_type=3,1,0)) as discharge " |
| | | + " from db_ram_db.tb_batt_rtstate,db_battinf.tb_battinf " |
| | | + " where db_alarm.tb_battalarm_data.battGroupId=db_battinf.tb_battinf.battGroupId " |
| | | + " and batt_test_type IN(2,3) " |
| | | + " and db_battinf.tb_battinf.FBSDeviceId=? " |
| | | + " GROUP BY batt_test_type ";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),null, new CallBack() {
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{binf.getFBSDeviceId()}, new CallBack() { |
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | + " ,batt_state,batt_test_type,batt_test_starttime,batt_test_recordtime,batt_test_tlong,batt_test_cap,batt_real_cap,batt_rest_cap"
|
| | | + " ,FBSDeviceId,BattGroupName "
|
| | | + " from db_ram_db.tb_batt_rtstate,db_battinf.tb_battinf "
|
| | | + " where db_ram_db.tb_batt_rtstate.battGroupId=db_battinf.tb_battinf.battGroupId ";
|
| | | + " where db_ram_db.tb_batt_rtstate.battGroupId=db_battinf.tb_battinf.battGroupId " |
| | | + " and db_battinf.tb_battinf.FBSDeviceId=? "; |
| | | //判断是充电还是放电
|
| | | String chargeSqlT=" and batt_state!=? ";
|
| | | String chargeSqlF=" and batt_state=? ";
|
| | |
| | | String endsql=" order by batt_test_starttime desc";
|
| | | sql+=endsql;
|
| | | //System.out.println(sql);
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum()}, new CallBack() {
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getFBSDeviceId(),binf.getNum()}, new CallBack() { |
| | |
|
| | | @Override
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | Batt_rtstateImpl bimpl=new Batt_rtstateImpl();
|
| | | BattInf binf=new BattInf();
|
| | | binf.setNum(100);
|
| | | List<Integer> list=bimpl.serchDisOrChargrNew();
|
| | | List<Integer> list=bimpl.serchDisOrChargrNew(binf); |
| | | for (Integer num : list) {
|
| | | System.out.println(num);
|
| | | }
|
| | |
| | | //查询实时告警(分页) |
| | | @Override |
| | | public List serchByInfo(Object obj) { |
| | | Page page=(Page) obj; |
| | | BattInf binf=(BattInf) obj; |
| | | Page page=binf.getPage(); |
| | | String sql=" select distinct db_alarm.tb_battalarm_data.battgroupid,alm_start_time,alm_id,db_alarm.tb_battalarm_data.monnum,alm_signal_id,alm_level " |
| | | + " ,FBSDeviceId,BattGroupName " |
| | | + " from db_alarm.tb_battalarm_data,db_battinf.tb_battinf " |
| | | + " where db_alarm.tb_battalarm_data.battGroupId=db_battinf.tb_battinf.battGroupId " |
| | | + " and db_battinf.tb_battinf.FBSDeviceId=? " |
| | | + " order by db_alarm.tb_battalarm_data.battgroupid asc,alm_start_time desc " |
| | | + " limit ?,? "; |
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() { |
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getFBSDeviceId(),(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() { |
| | | |
| | | @Override |
| | | public List getResults(ResultSet rs) { |
| | |
| | | return list; |
| | | } |
| | | //查询实时告警的总数 |
| | | public List searchAlarmNum(){ |
| | | public List searchAlarmNum(Object obj){ |
| | | BattInf binf=(BattInf) obj; |
| | | String sql=" select count(db_alarm.tb_battalarm_data.num) as number " |
| | | + " from db_alarm.tb_battalarm_data,db_battinf.tb_battinf " |
| | | + " where db_alarm.tb_battalarm_data.battGroupId=db_battinf.tb_battinf.battGroupId "; |
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() { |
| | | + " where db_alarm.tb_battalarm_data.battGroupId=db_battinf.tb_battinf.battGroupId " |
| | | + " and db_battinf.tb_battinf.FBSDeviceId=? "; |
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getFBSDeviceId()}, new CallBack() { |
| | | |
| | | @Override |
| | | public List getResults(ResultSet rs) { |
| | |
| | | }
|
| | | //查询所有的历史告警(分页)
|
| | | public List serchByInfo(Object obj) {
|
| | | Page page=(Page) obj;
|
| | | BattInf binf=(BattInf) obj; |
| | | Page page=binf.getPage(); |
| | | String sql="select distinct(db_alarm.tb_battalarm_data_history.BattGroupId),db_alarm.tb_battalarm_data_history.num,alm_signal_id,db_alarm.tb_battalarm_data_history.monnum,alm_value,alm_level,alm_is_confirmed,alm_confirmed_time,alm_start_time,alm_end_time "
|
| | | + " ,FBSDeviceId,BattGroupName "
|
| | | + " from db_alarm.tb_battalarm_data_history,db_battinf.tb_battinf"
|
| | | + " where db_alarm.tb_battalarm_data_history.battGroupId=db_battinf.tb_battinf.battGroupId "
|
| | | + " and db_battinf.tb_battinf.FBSDeviceId=? " |
| | | + " order by db_alarm.tb_battalarm_data_history.BattGroupId asc,alm_start_time desc "
|
| | | + " limit ?,? ";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getFBSDeviceId(),(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() { |
| | |
|
| | | @Override
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | return model;
|
| | | }
|
| | | //实时查询充放电统计
|
| | | public ServiceModel serchDisOrChargrNew() {
|
| | | List list=((Batt_rtstateImpl)dao).serchDisOrChargrNew();
|
| | | public ServiceModel serchDisOrChargrNew(Object obj) { |
| | | List list=((Batt_rtstateImpl)dao).serchDisOrChargrNew(obj); |
| | | if(list!=null&&list.size()>0){
|
| | | model.setCode(1);
|
| | | model.setData(list);
|
| | |
| | | return model;
|
| | | }
|
| | | //查询实时告警的总数
|
| | | public ServiceModel searchAlarmNum() {
|
| | | List list=((Battalarm_dataImpl)dao).searchAlarmNum();
|
| | | public ServiceModel searchAlarmNum(Object obj) { |
| | | List list=((Battalarm_dataImpl)dao).searchAlarmNum(obj); |
| | | if(list!=null&&list.size()>0){
|
| | | model.setCode(1);
|
| | | model.setData(list);
|