Package com.narirelays.ems.exchange.sophic

Examples of com.narirelays.ems.exchange.sophic.SophicHistoryDAO


      //获取模拟量5分钟表中最近的值,想当与实时值,此时开始时间、结束时间等均无用
      value = getRealTimeValueFromHisAI(jdbcTemplate,table_meta_name,key);
    }
    else//sum,max,min,count,avg等函数
    {
      SophicHistoryDAO sophicHistoryDAO = (SophicHistoryDAO)StorageService.ctx.getBean("sophicHistoryDAO");
      if(sophicHistoryDAO!=null)
      {
        List<Double> values = sophicHistoryDAO.queryHistoryValue(table_meta_name, table_unit, id_col_name, value_col_name, time_col_name, key, startTime, endTime, interval, target, 0);
        if(values!=null&&values.size()>0)
          value = values.get(0);         
      }     
    }
    return value;
View Full Code Here


    List<Double> values = null;
    int table_unit = TABLE_UNIT_PERIOD_MONTH;
    String id_col_name = "attr_oid";
    String value_col_name = "value";
    String time_col_name = "attr_time";
    SophicHistoryDAO sophicHistoryDAO = (SophicHistoryDAO)StorageService.ctx.getBean("sophicHistoryDAO");
    if(sophicHistoryDAO!=null)
    {
      values = sophicHistoryDAO.queryHistoryValue(table_meta_name, table_unit, id_col_name, value_col_name, time_col_name, key, startTime, endTime, interval, null, 1);
    }
    return values;
  }
View Full Code Here

import static com.narirelays.ems.exchange.sophic.SophicVars.*;

public class TestSophicHisDAO {

  public static void main(String[] argv) throws ParseException{
    SophicHistoryDAO sophicHistoryDAO = (SophicHistoryDAO)StorageService.ctx.getBean("sophicHistoryDAO");
    String table_name = "ALARM_ALLEVENTLOG";
    int table_unit = TABLE_UNIT_PERIOD_MONTH;
    String id_col_name = "attr_oid";
    String time_col_name = "acting_time";
    List<String> keys = new ArrayList<String>();
    keys.add("1");
    Date startTime = sdf.parse("2011-06-21 04:30:00");
    Date endTime = sdf.parse("2011-06-22 00:00:00");
    int interval = 0;
   
//    如果输入的列名有错,查询肯定会报异常;处理
    OperResult result = sophicHistoryDAO.queryHistory(table_name, table_unit,id_col_name,time_col_name,keys, startTime, endTime, interval);
    if(result.isSUCCEED()){
      System.out.println(JavaDataPrettyPrint.print_object(result.getData()));
    }
  }
View Full Code Here

TOP

Related Classes of com.narirelays.ems.exchange.sophic.SophicHistoryDAO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.