Change sorted order of alarm state and severity

From lowest to highest
State - "OK", "Undetermined", "Alarm"
Severity - "Low", "Medium", "High", "Critical"

Change-Id: I6b2b4a6d34064b8fda49ba1e0854353dde56378d
This commit is contained in:
Ryan Brandt 2016-03-21 16:11:50 -06:00
parent 078b6cdb52
commit fd37a7a270
1 changed files with 2 additions and 0 deletions

View File

@ -210,6 +210,8 @@ public class AlarmMySqlRepoImpl implements AlarmRepo {
replaceFieldName(sortBy, "created_timestamp", "a.created_at");
replaceFieldName(sortBy, "updated_timestamp", "a.updated_at");
replaceFieldName(sortBy, "state_updated_timestamp", "a.state_updated_at");
replaceFieldName(sortBy, "state", "FIELD(state, \"OK\", \"UNDETERMINED\", \"ALARM\")");
replaceFieldName(sortBy, "severity", "FIELD(severity, \"LOW\", \"MEDIUM\", \"HIGH\", \"CRITICAL\")");
orderClause.append(" order by ");
orderClause.append(COMMA_JOINER.join(sortBy));