Allocation Problem without "OR" Operator
There is a system which solves allocation problem in a ticketing platform. The ticket with highest priority should get allocated first.
All the tickets are stored in a tabular format as below. (Only the sample set, as the number of rows can be much more )
ticketid priority escalationlevel queueid status centerpreference assignee allocationstarttime allocationendtime
4001 100 0 Q1 OPEN 0 NULL 5:00 AM 6:00 AM
4002 90 2 Q1 OPEN 0 5:00 AM 7:00 AM
4003 80 1 Q2 OPEN 1 NULL 6:00 AM 9:00 AM
4004 170 0 Q1 REOPEN 0 NULL NULL
4005 60 0 Q1 CLOSED 0 mmt9568 7:00 AM 8:00 AM
The algorithm should pick the ticket with highest priority having below conditions :-
To write above algorithm , only one condition to be kept in mind, i.e. there is no OR operator that exists in the system.
I tried using nested IFs both in the SQL statements and in code, but didn't work out as a plausible solution