package com.qmth.teachcloud.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qmth.teachcloud.common.bean.dto.TaskPrintClassDto;
import com.qmth.teachcloud.common.bean.result.BasicStudentResult;
import com.qmth.teachcloud.common.entity.BasicStudent;
import org.apache.ibatis.annotations.Param;

import java.util.List;

import java.util.Set;

/**
 * <p>
 * 学校id Mapper 接口
 * </p>
 *
 * @author wangliang
 * @since 2021-08-02
 */
public interface BasicStudentMapper extends BaseMapper<BasicStudent> {

    List<TaskPrintClassDto> listByClass(@Param("schoolId") Long schoolId, @Param("stringList") Set<String> stringList);

    IPage<BasicStudentResult> findBasicStudentPage(@Param("iPage") Page<BasicStudentResult> iPage,
                                                   @Param("queryParams") String queryParams,
                                                   @Param("schoolId") Long schoolId,
                                                   @Param("collegeId") Long collegeId,
                                                   @Param("majorId") Long majorId,
                                                   @Param("clazzIdList") Set<Long> clazzIdList,
                                                   @Param("orgIds") Set<Long> orgIds);

    /**
     * 根据基础学生主键同步删除教学学生信息
     *
     * @param idSet 基础学生id集合
     * @return 删除的行数
     */
    int deleteTeachStudentByBasicStudentIdSet(@Param("idSet") Set<Long> idSet);

    /**
     * 根据id查找学生信息
     *
     * @param id id
     * @return 结果
     */
    BasicStudentResult findById(@Param("id") Long id);

    /**
     * 根据第三方字典id查找学生集合
     *
     * @param schoolId        学校id
     * @param collegeId       学生学院id
     * @param majorId         专业id
     * @param clazzId         班级id
     * @param studentCodeList 学号集合
     * @return 学生查询结果
     */
    List<BasicStudentResult> findBasicStudentList(@Param("schoolId") Long schoolId,
                                                  @Param("collegeId") Long collegeId,
                                                  @Param("majorId") Long majorId,
                                                  @Param("clazzId") Long clazzId,
                                                  @Param("studentCodeList") List<String> studentCodeList);
}
