package com.ym.mec.biz.dal.dao;

import java.util.List;

import com.ym.mec.biz.dal.dto.UserGoodsDto;
import org.apache.ibatis.annotations.Param;

import com.ym.mec.biz.dal.entity.Goods;
import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
import com.ym.mec.biz.dal.enums.DealStatusEnum;
import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
import com.ym.mec.biz.dal.enums.OrderTypeEnum;
import com.ym.mec.common.dal.BaseDAO;

public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrder> {

    /**
     * 查询商品列表
     *
     * @param musicGroupId
     * @param type
     * @return
     */
    List<Goods> queryApplyGoodsList(@Param("musicGroupId") String musicGroupId, @Param("type") OrderDetailTypeEnum type);

    /**
     * @Author: Joburgess
     * @Date: 2019/10/3
     * 根据学生vip课获取缴费订单
     */
    StudentPaymentOrder findByStudentVipGroup(@Param("vipGroupId") Long vipGroupId, @Param("userId") Long userId);

    /**
     * 查询乐团报名的订单
     *
     * @param userId
     * @param musicGroupId
     * @param status
     * @return
     */
    StudentPaymentOrder findMusicGroupApplyOrderByStatus(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId,
                                                         @Param("status") DealStatusEnum status);

    /**
     * 根据订单号查询订单
     *
     * @param orderNo
     * @return
     */
    StudentPaymentOrder findOrderByOrderNo(@Param("orderNo") String orderNo);

    /**
     * 查询指定交易状态的乐团报名的订单信息
     *
     * @param musicGroupId 乐团编号
     * @param type         订单类型
     * @param status       订单状态
     * @return
     */
    List<StudentPaymentOrder> queryByDealStatus(@Param("musicGroupId") String musicGroupId, @Param("type") OrderTypeEnum type,
                                                @Param("status") DealStatusEnum status);

    /**
     * 查找支付成功和支付中订单
     * @return
     */
    int findPayOrderNum();

    /**
     * 获取学员报名时所购买的商品
     * @param musicGroupId
     * @param userId
     * @return
     */
    List<UserGoodsDto> findGoodsIds(@Param("musicGroupId") String musicGroupId, @Param("userId") Integer userId);
}