package com.ym.mec.biz.service;

import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
import com.ym.mec.biz.dal.entity.StudentRegistration;
import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
import com.ym.mec.biz.dal.enums.GroupType;
import com.ym.mec.common.service.BaseService;

import java.io.IOException;
import java.util.List;

public interface ClassGroupStudentMapperService extends BaseService<Long, ClassGroupStudentMapper> {

    /**
     * 查找班级学生对应关系
     * @param userId
     * @param classGroupId
     * @return
     */
    ClassGroupStudentMapper findClassStudentMapperByUserIdAndClassGroupId(Integer userId, Integer classGroupId,String status);

    /**
     * 删除班级学生
     * @param userId
     * @param classGroupId
     * @return
     */
    boolean delClassGroupStudent(Integer userId, Integer classGroupId) throws Exception;


    /**
     * 查询班级某状态下所有的学生
     * @param classGroupId
     * @param status
     * @return
     */
    List<StudentRegistration> findClassStudentList(Integer classGroupId, ClassGroupStudentStatusEnum status);

    /**
     * 调整班级
     * @param userId
     * @param oldClassGroupId
     * @param classGroupId
     * @return
     */
    boolean adjustClassGroup(Integer userId,Integer oldClassGroupId,Integer classGroupId) throws Exception;

    /**
     * 添加学员
     * @param classGroupId
     * @param userIdsStr
     * @return
     * @throws Exception
     */
    boolean addStudents(Integer classGroupId, String userIdsStr, GroupType groupType) throws Exception;

    /**
     * 获取节假日
     * @param year
     * @return
     */
    Object queryHoliday(String year) throws IOException;

    List<ClassGroupStudentMapper> findMusicGroupClassGroupByType(String musicGroupId, ClassGroupTypeEnum type);

    void classGroupStudentsInsert(List<ClassGroupStudentMapper> classGroupStudentMappers);
}
