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

import com.ym.mec.biz.dal.entity.CourseSchedule;

import java.util.List;

import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
import com.ym.mec.common.dal.BaseDAO;
import org.apache.ibatis.annotations.Param;

public interface MusicGroupPaymentStudentCourseDetailDao extends BaseDAO<Long, MusicGroupPaymentStudentCourseDetail> {

    /**
     * @param studentId:
     * @param courseType:
     * @param courseMinutes:
     * @return com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail
     * @describe 获取指定学员，指定课程，指定课程时长下的可用缴费记录
     * @author Joburgess
     * @date 2020.11.04
     */
    MusicGroupPaymentStudentCourseDetail getUnUseWithStudentAndCourseTypeAndCourseMinutes(@Param("musicGroupId") String musicGroupId,
                                                                                          @Param("studentId") Integer studentId,
                                                                                          @Param("courseType") CourseSchedule.CourseScheduleType courseType,
                                                                                          @Param("courseMinutes") Integer courseMinutes);

    /**
     * @param studentIds:
     * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail>
     * @describe
     * @author Joburgess
     * @date 2020.11.04
     */
    List<MusicGroupPaymentStudentCourseDetail> getUnUseWithStudents(@Param("musicGroupId") String musicGroupId, @Param("studentIds") List<Integer> studentIds);

    int batchInsert(List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList);

    /**
     * 删除用户购买乐团课程记录
     * @param userId
     * @param musicGroupId
     * @return
     */
    int deleteByUserIdAndMusicGroupId(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
}
