mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-29 16:14:16 +08:00
wechat query command
This commit is contained in:
@@ -4,6 +4,7 @@ import love.sola.netsupport.enums.Status;
|
||||
import love.sola.netsupport.pojo.Ticket;
|
||||
import love.sola.netsupport.pojo.User;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.criterion.Order;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
|
||||
import java.util.List;
|
||||
@@ -35,6 +36,15 @@ public class TableTicket extends SQLCore {
|
||||
}
|
||||
}
|
||||
|
||||
public static Ticket queryLast(User u) {
|
||||
try (Session s = SQLCore.sf.openSession()) {
|
||||
return (Ticket) s.createCriteria(Ticket.class)
|
||||
.addOrder(Order.desc(Ticket.PROPERTY_SUBMIT_TIME))
|
||||
.add(Restrictions.eq(Ticket.PROPERTY_USER, u))
|
||||
.uniqueResult();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static List<Ticket> queryUnsolvedByBlock(int b) {
|
||||
try (Session s = SQLCore.sf.openSession()) {
|
||||
|
||||
Reference in New Issue
Block a user