package com.sqx.modules.orders.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.common.utils.Result;
import com.sqx.modules.orders.entity.Orders;

public interface OrdersService extends IService<Orders> {
    /**
     * 处理所有订单
     *
     * @param orders
     * @return
     */
    Result insertOrders(Orders orders);

    Result payMoney(Long orderId);

    Result insertCourseOrders(Long courseId, Long courseDetailsId, Long userId);

    Result insertCourseOrdersLimit10(Long courseId, Long userId);

    Result insertVipOrders(Long vipDetailsId, Long userId);

    Result refundOrder(Long ordersId, String refundContent);

    Result selectOrders(Integer page, Integer limit, String ordersNo, Integer status, Long userId, Long courseId,
                        Integer flag, String time, String userName, Integer ordersType, String startTime, String endTime,
                        Long sysUserId, String qdCode, String sysUserName);

    Result selectOrderByUserId(Integer page, Integer limit, Long userId);

    Result deleteOrders(String ids);

    Orders selectOrderById(Long orderId);

    Orders selectOrderByOrdersNo(String ordersNo);

    Orders selectOrderByTradeNo(String tradeNo);

    Double statisticsIncomeMoney(String time, Integer flag, Integer ordersType);

    Orders selectOrdersByCourseIdAndUserId(Long userId, Long courseId);

    Result selectOrdersMoneyList(Integer page, Integer limit, Integer flag, String time);

    Integer selectOrdersCount(Integer status, Integer ordersType, Integer flag, String time, Long sysUserId);

    Double selectOrdersMoney(Integer status, Integer ordersType, Integer flag, String time, Long courseId, Long sysUserId);

    Double selectFenXiaoMoney(Integer type, Long sysUserId, Integer flag, String time);

    Integer selectOrdersCountStatisticsByYear(Integer flag, String time, Integer status);

    Integer selectOrdersCountStatisticsByDay(Long userId, Integer limit);

    Orders selectOrdersByDay(Long userId);

    /**
     * 统计 用户成功订单笔数
     *
     * @param userId
     * @param time   时间条件 不传为全部订单 格式 yyyy-MM-dd HH:mm:ss
     * @return
     */
    Integer countOrderNum(Long userId, String time);


}
