Stringcql="select * from ctid_prof.alarm_log where token(serialnum) > token( '"+flag+"' ) and state < '"+Constant.ALARM_ING+"' limit "+size+" allow filtering;";
Stringcql="select * from ctid_prof.alarm_log where state = '"+Constant.ALARM_RECOVERY+"' and serialnum<'"+flag+"' order by alatime desc limit "+size+" allow filtering;";
returntemplate.select(cql,AlarmLog.class);
}
publicList<AlarmLog>getAlarmList(){
Stringcql="select * from ctid_prof.alarm_log where state = '"+Constant.ALARM_ING+"' allow filtering";
publicList<AlarmLog>getAlarmLogList(){
Stringcql="select * from ctid_prof.alarm_log where state = '"+Constant.ALARM_RECOVERY+"' allow filtering";
Stringcql="select * from ctid_prof.alarm_log where cluster_name = '"+name+"' and ip = '"+ip+"' and port = '"+port+"' and state = '"+Constant.ALARM_ING+"' allow filtering";
returntemplate.selectOne(cql,AlarmLog.class);
publicList<AlarmMsg>getAlarmMsgList(){
Stringcql="select * from ctid_prof.alarm_msg where state = '"+Constant.ALARM_ING+"' allow filtering";
Stringcql="select * from ctid_prof.alarm_msg where cluster_name = '"+name+"' and ip = '"+ip+"' and port = '"+port+"' and state = '"+Constant.ALARM_ING+"' allow filtering";
returntemplate.selectOne(cql,AlarmMsg.class);
}
/*变更告警信息(已启用)*/
/* public boolean updateAlarm(String serialnum,String time) {
String cql="update ctid_prof.alarm_log set rectime = '"+time+"' , state = '" +Constant.ALARM_RECOVERY +"', alarm_level = '"+Constant.ALARM_OK+"' where serialnum = '"+serialnum +"'";
Stringcql="select * from ctid_prof.alarm_log where alatime > '"+start+"' and alatime < '"+end+"'and state = '"+Constant.ALARM_RECOVERY+"' and serialnum<'"+flag+"' order by alatime desc limit "+size+" allow filtering";
Stringcql="select * from ctid_prof.alarm_log where ip like '%"+ip+"%' and state = '"+Constant.ALARM_RECOVERY+"' and serialnum<'"+flag+"' order by alatime desc limit "+size+" allow filtering";
Stringcql="select * from ctid_prof.alarm_log where ip like '%"+ip+"%' and alatime>'"+start+"' and alatime <'"+end+"' and state = '"+Constant.ALARM_RECOVERY+"' and serialnum<'"+flag+"' limit "+size+" allow filtering";
returntemplate.select(cql,AlarmLog.class);
}
publicMapgetAlarmLogSize(Stringstart,Stringend){
Stringcql="select count(*) from ctid_prof.alarm_log where alatime > '"+start+"' and alatime < '"+end+"' and state < '"+Constant.ALARM_ING+"' allow filtering";
returntemplate.selectOne(cql,Map.class);
}
publicMapgetAlarmLogSize(Stringip){
Stringcql="select count(*) from ctid_prof.alarm_log where ip like '%"+ip+"%' and state < '"+Constant.ALARM_ING+"' allow filtering";
Stringcql="select count(*) from ctid_prof.alarm_log where ip like '%"+ip+"%' and alatime > '"+start+"' and alatime <'"+end+"' and state < '"+Constant.ALARM_ING+"' allow filtering";