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

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

import java.util.List;

public interface CourseScheduleStudentMusicScoreDao extends BaseDAO<Integer, CourseScheduleStudentMusicScore> {

    List<CourseScheduleStudentMusicScore> queryByScoreIdAndCourseId(@Param("musicScoreAccompanimentId") Integer musicScoreAccompanimentId,
                                                                    @Param("courseId") Long courseId,
                                                                    @Param("userId") Integer userId,
                                                                    @Param("downStatus") Integer downStatus,
                                                                    @Param("userType") Integer userType);

    int batchInsert(@Param("scheduleStudentMusicScores") List<CourseScheduleStudentMusicScore> scheduleStudentMusicScores);

    /**
     * 关闭所有伴奏的播放
     * @param scheduleId
     * @param userId
     */
    void closePlayStatus(@Param("scheduleId") long scheduleId, @Param("userId") Integer userId, @Param("musicScoreAccompanimentId") Integer musicScoreAccompanimentId);

    /**
     * 开启原音播放
     * @param scheduleId
     * @param musicScoreAccompanimentId
     * @return
     */
    int openPlayStatus(@Param("scheduleId") long scheduleId,
                       @Param("musicScoreAccompanimentId") Integer musicScoreAccompanimentId,
                       @Param("userId") Integer userId);

    /**
     * 开启伴奏播放
     * @param scheduleId
     * @param musicScoreAccompanimentId
     * @return
     */
    int openAccompanimentPlayStatus(@Param("scheduleId") long scheduleId,
                                    @Param("musicScoreAccompanimentId") Integer musicScoreAccompanimentId,
                                    @Param("userId") Integer userId);
}