ticket lookup api

This commit is contained in:
Sola
2015-12-16 16:54:45 +08:00
parent d518492caa
commit 45f08b9b36
2 changed files with 60 additions and 1 deletions

View File

@@ -63,6 +63,7 @@ public class TableTicket extends SQLCore {
public static List<Ticket> unsolvedByBlock(int b) {
try (Session s = SQLCore.sf.openSession()) {
return s.createCriteria(Ticket.class)
.add(Restrictions.ne(Ticket.PROPERTY_STATUS, Status.SOLVED))
.createCriteria(Ticket.PROPERTY_USER)
.add(Restrictions.between(User.PROPERTY_BLOCK, b * 10, (b + 1) * 10 - 1))
.list();