Stringcql="select * from ctid_prof.alarm_log where state in ("+Constant.ALARM_CHANGE+","+Constant.ALARM_RECOVERY+")";
Stringcql="select * from ctid_prof.alarm_log where token(serialnum) > token( '"+flag+"' ) and state < '"+Constant.ALARM_ING+"' limit "+size+" allow filtering;";
System.out.println(cql);
returntemplate.select(cql,AlarmLog.class);
returntemplate.select(cql,AlarmLog.class);
}
}
publicList<AlarmLog>getAlarmList(){
publicList<AlarmLog>getAlarmList(){
Stringcql="select * from ctid_prof.alarm_log where state = "+Constant.ALARM_ING;
Stringcql="select * from ctid_prof.alarm_log where state = '"+Constant.ALARM_ING+"' allow filtering";
returntemplate.select(cql,AlarmLog.class);
returntemplate.select(cql,AlarmLog.class);
}
}
publicAlarmLogcheckAlarm(Stringip,Stringport){
publicAlarmLogcheckAlarm(Stringip,Stringport){
Stringcql="select * from ctid_prof.alarm_log where ip = "+ip+" and port ="+port+" and state = "+Constant.ALARM_ING;
Stringcql="select * from ctid_prof.alarm_log where ip = "+ip+" and port = "+port+" and state = '"+Constant.ALARM_ING+"' allow filtering";
returntemplate.selectOne(cql,AlarmLog.class);
returntemplate.selectOne(cql,AlarmLog.class);
}
}
publicbooleanupdateAlarm(Stringserialnum){
publicbooleanupdateAlarm(Stringserialnum){
Stringcql="update from ctid_prof.alarm_log set state = "+Constant.ALARM_RECOVERY+"and alarm_level = "+Constant.ALARM_OK+"where serialnum = "+serialnum;
Stringcql="update from ctid_prof.alarm_log set state = '"+Constant.ALARM_RECOVERY+"' and alarm_level = "+Constant.ALARM_OK+" where serialnum = "+serialnum;
returntemplate.getCqlOperations().execute(cql);
returntemplate.getCqlOperations().execute(cql);
}
}
publicMapgetAlarmLogSize(){
Stringcql="select count(*) from ctid_prof.alarm_log where state < '"+Constant.ALARM_ING+"' allow filtering";