package com.yonge.cooleshow.biz.dal.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yonge.cooleshow.biz.dal.dto.BasicUserInfo;
import com.yonge.cooleshow.biz.dal.entity.CourseScheduleStudentPayment;
import com.yonge.cooleshow.biz.dal.vo.CourseScheduleStudentPaymentVo;
import com.yonge.cooleshow.biz.dal.vo.CourseScheduleStudentVo;
import com.yonge.cooleshow.biz.dal.vo.LiveCourseInfoVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 课程学生缴费表(CourseScheduleStudentPayment)表数据库访问层
 *
 * @author hgw
 * @since 2022-03-18 15:29:12
 */
public interface CourseScheduleStudentPaymentDao extends BaseMapper<CourseScheduleStudentPayment> {

    int insertBatch(@Param("entities") List<CourseScheduleStudentPayment> entities);

    /**
     * @param courseGroupId
     * @param courseGroupType
     * @return java.util.List<java.lang.Long>
     * @description: 获取学员列表
     * @author zx
     * @date 2022/3/23 16:18
     */
    Set<Long> queryStudentIds(@Param("courseGroupId") Long courseGroupId,
                              @Param("courseGroupType") String courseGroupType);

    /**
     * 根据课程组id查询学员信息
     *
     * @param param 参数
     *              <p> groupId    课程组id
     *              <p> orderState 订单状态
     *              <p> userId     学员id
     */
    List<LiveCourseInfoVo.CourseBuyStudentVo> queryStudentInfoByGroupId(@Param("param") Map<String, Object> param);

    //查询所有购买陪练课用户id
    List<Long> selectAll();

    //根据查询锁定中的课程
    List<CourseScheduleStudentPaymentVo> selectPaymentList(String orderNo);

    /**
     * 查询购买直播课的订单
     *
     * @param courseGroupId 课程组id
     * @return
     */
    List<String> selectOrderNoByGroupId(Long courseGroupId);

    //重置节拍器设置
    void cleanPlayMidi(@Param("courseScheduleId") Long courseScheduleId);

    //获取节拍器数据
    String getMidiByCourseIdAndUserId(@Param("courseScheduleId") Long courseScheduleId, @Param("userId") Long userId);

    //获取伴奏数据
    String getMusicSheetByCourseIdAndUserId(@Param("courseScheduleId") Long courseScheduleId, @Param("userId") Long userId);

    //调整节拍器
    void adjustPlayMidi(@Param("courseScheduleId") long courseScheduleId, @Param("userId") String userId, @Param("content") String content);

    //调整伴奏
    void adjustExamSong(@Param("courseScheduleId") long courseScheduleId,
                        @Param("userId") Long userId,
                        @Param("musicSheetJson") String musicSheetJson);

    //获取课程学员关联
    List<CourseScheduleStudentPayment> queryByCourseId(@Param("courseScheduleId") Long courseScheduleId);

    /**
     * @description:
     * @param scheduleId    课程编号
     * @param userId    学员编号
     * @param content   节拍器参数
     * @param musicSheetJson    伴奏参数
     * @return void
     * @author zx
     * @date 2022/5/7 16:44
     */
    void adjustPlayMidiAndMusicSheet(@Param("scheduleId") Long scheduleId,
                                     @Param("userId") Long userId,
                                     @Param("content") String content,
                                     @Param("musicSheetJson") String musicSheetJson);

    //查询报课学员
    List<CourseScheduleStudentVo> selectUser();

    List<BasicUserInfo> queryNoJoinStu(@Param("scheduleId") Long scheduleId);
}

