package com.ym.mec.biz.service;

import com.ym.mec.biz.dal.dto.ClassGroupStudentInfoDto;
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.math.BigDecimal;
import java.util.List;
import java.util.Set;

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,Boolean quitMusicGroup);


    /**
     * 查询班级某状态下所有的学生
     * @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);

    /**
     * @describe 获取团体或者班级下的学员
     * @author Joburgess
     * @date 2020/3/10
     * @param groupId:
     * @param classGroupId:
     * @param groupType:
     * @return java.util.List<com.ym.mec.biz.dal.dto.ClassGroupStudentInfoDto>
     */
    List<ClassGroupStudentInfoDto> findStudentByGroupOrClassGroup(String groupId, Integer classGroupId, GroupType groupType);

    /**
     * @describe 更新班级学员
     * @author Joburgess
     * @date 2020.11.04
     * @param classGroupId:
     * @param studentIds:
     * @return void
     */
    void updateClassGroupStudents(Long classGroupId, Set<Integer> studentIds);

    /**
     * @describe 更新班级学员
     * @date 2020.11.04
     * @param classGroupId:
     * @param studentIds:
     * @return void
     */
    void updateClassGroupStudents1(Long classGroupId, List<Integer> studentIds, List<Long> allLockCourseIds, String batchNo, BigDecimal masterTotalPrice);

}
