private List<Order_detail> getAllOrderListByOrderType(String userId, String orderType) {

    String hql =
        "from Order_list where providerid='0001' and validflag=1  and userId=? and orderType =1 order by createTime desc";

    List<Order_list> orderLists = commonDao.findByHql(hql, userId);

    List<Order_detail> order_details = new ArrayList<Order_detail>();

    for (Order_list order_list : orderLists) {

      User user = (User) userService.getUserByMethod(11, order_list.getUserId()).get(0);
      order_list.setUser(user);

      if (order_list.getOrderType() == 1 || order_list.getOrderType() == 100) {
        List<Order_detail> detailsList =
            detailService.getOrderdetailByMethod(1, null, order_list.getOrderId());
        // .findByHql("from Order_detail where orderId=?", );
        for (Order_detail order_detail : detailsList) {
          Product_ext_shop product =
              ext_shopService.getShopProductByMethod(5, order_detail.getProductId()).get(0);
          order_detail.setOrder_list(order_list);
          order_detail.setProduct(product.getProduct());
          order_detail.setProductReview(
              productReviewService.getProductReviewByOrderId(
                  order_list.getOrderId(), product.getProductId()));
          order_details.add(order_detail);
        }
        // order_list.setOrder_detail(detailsList);
        order_list.setUserAddress(
            userAddressService
                .getUserAddressByMethod(3, order_list.getUserAddressId(), order_list.getUserId())
                .get(0));
        order_list.setPayment_Method(
            payment_MethodService.getPayMentByMethod(2, order_list.getPaymentway()).get(0));
      }
      // order_list.setExpress(expressService.getExpressByMethod(2,
      // order_list.getExpressvendor()).get(0));
    }
    return order_details;
  }
  @Override
  public OrderListResult getAllOrderList(String userId, PagePojo pagePojo) {

    String hql =
        "from Order_list where providerid='0001' and validflag=1  and userId=? order by createTime desc";

    List<Order_list> orderLists =
        commonDao.findPagingByHql(hql, pagePojo.getPageno(), pagePojo.getPagesize(), userId);
    List listCount = commonDao.findByHql("select count(*) " + hql, userId);
    Integer totalcount = Integer.parseInt(listCount.get(0) + "");
    pagePojo.setTotalcount(totalcount);

    for (Order_list order_list : orderLists) {

      User user = (User) userService.getUserByMethod(11, order_list.getUserId()).get(0);
      order_list.setUser(user);

      if (order_list.getOrderType() == 3) {
        List<Order_detail> detailsList =
            detailService.getOrderdetailByMethod(1, null, order_list.getOrderId());
        // .findByHql("from Order_detail where orderId=?", );
        for (Order_detail order_detail : detailsList) {
          Product_ext_bigDeal bigDeal =
              bigDealService.getbigDealProductByMethod(5, order_detail.getProductId(), "1").get(0);
          order_detail.setProduct(bigDeal.getProduct());
        }
        order_list.setOrder_detail(detailsList);
      } else if (order_list.getOrderType() == 2) {
        List<Order_detail> detailsList =
            detailService.getOrderdetailByMethod(1, null, order_list.getOrderId());
        // .findByHql("from Order_detail where orderId=?", );
        for (Order_detail order_detail : detailsList) {
          Product_ext_groupBuy bigDeal =
              groupBuyService.getgroupBuyProductByMethod(5, order_detail.getProductId()).get(0);
          order_detail.setProduct(bigDeal.getProduct());
        }
        order_list.setOrder_detail(detailsList);
      } else if (order_list.getOrderType() == 1 || order_list.getOrderType() == 100) {
        List<Order_detail> detailsList =
            detailService.getOrderdetailByMethod(1, null, order_list.getOrderId());
        // .findByHql("from Order_detail where orderId=?", );
        for (Order_detail order_detail : detailsList) {
          Product_ext_shop product =
              ext_shopService.getShopProductByMethod(5, order_detail.getProductId()).get(0);
          order_detail.setProduct(product.getProduct());
          order_detail.setProductReview(
              productReviewService.getProductReviewByOrderId(
                  order_list.getOrderId(), product.getProductId()));
        }
        order_list.setOrder_detail(detailsList);
        order_list.setUserAddress(
            userAddressService
                .getUserAddressByMethod(3, order_list.getUserAddressId(), order_list.getUserId())
                .get(0));
        order_list.setPayment_Method(
            payment_MethodService.getPayMentByMethod(2, order_list.getPaymentway()).get(0));
      }
      // order_list.setExpress(expressService.getExpressByMethod(2,
      // order_list.getExpressvendor()).get(0));
    }
    OrderListResult orderListResult = new OrderListResult(totalcount, orderLists);
    return orderListResult;
  }