public static final Order getServeringOrderByConId(int consulterId) { Order order = dao.findFirst( "select * from consulter_order where consulter_id=? and server_status=0", consulterId); if (order == null) { order = createOrder(consulterId); } return order; }
private static final Order createOrder(int id) { Order order = null; synchronized (Order.class) { order = dao.findFirst( "select * from consulter_order where consulter_id=? and server_status=0", id); if (order == null) { order = new Order(); order.set("consulter_id", id); order.set("status", 0); order.set("server_status", 0); order.set("create_time", System.currentTimeMillis()); order.save(); HuanxinUtil.noticeNewOrder(order); } } return order; }
public static final List<Order> getServeringOrderByCusId(Integer cusId) { return dao.find( "select * from consulter_order where customer_id=? and server_status=0 and status=1", cusId); }
public static final List<Order> getUnserverOrder() { return dao.find("select * from consulter_order where server_status=0 and status=0"); }