package com.yida.data.user.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.yida.data.common.core.entity.user.EduStaff;
import com.yida.data.user.dto.ListStaffDTO;
import com.yida.data.user.dto.PageTeacherDTO;
import com.yida.data.user.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface EduStaffMapper extends BaseMapper<EduStaff> {

    /**
     * 分页查询教师列表数据
     */
    List<TeacherListVO> listTeacher(Page page, @Param("dto") PageTeacherDTO dto);

    TeacherDetailVO getTeacherById(Long teacherId);

    /**
     * 判断该教师手机号是否已经存在
     *
     * @param eduStaff
     * @return
     * @Author: ZYJ
     * @Date: 2020/6/5 9:37
     */
    int checkTeacherTelephone(EduStaff eduStaff);

    List<TeacherClassVO> listClassByTeacher(@Param("teacherId") Long teacherId);

    List<TeacherDeptVO> listDeptByTeacher(@Param("teacherId") Long teacherId, @Param("type") Integer type);

    IPage<StaffPageVO> listStaffPage(@Param("page") Page page,
                                     @Param("schoolId") List<Long> schoolId,
                                     @Param("deptId") Long deptId,
                                     @Param("isLeader") Integer isLeader,
                                     @Param("position") String position,
                                     @Param("name") String name,
                                     @Param("mobile") String mobile,
                                     @Param("sex") Integer sex,
                                     @Param("collectType") Integer collectType);

    EduStaff getStaffById(Long staffId);

    EduStaff getStaff(@Param("id") Long staffId);

    List<EduStaff> listStaff(@Param("dto") ListStaffDTO dto);

    List<Long> listStaffByDeptId(@Param("deptId") Long deptId, @Param("staffIds") List<Long> staffIds);

    List<Long> listStaffByNameOrPhone(@Param("deptId") Long deptId, @Param("nameOrPhone") String nameOrPhone, @Param("schoolId") Long schoolId);

    /**
     * 查询教师可见课程
     *
     * @param teacherId
     * @return
     */
    List<TeacherClassAndGradeVO> listClassAndGradeByTeacher(@Param("teacherId") Long teacherId);

    List<StaffPageVO> listExportStaff(@Param("schoolId") List<Long> schoolId,
                                      @Param("deptId") Long deptId,
                                      @Param("isLeader") Integer isLeader,
                                      @Param("position") String position,
                                      @Param("name") String name,
                                      @Param("mobile") String mobile,
                                      @Param("sex") Integer sex,
                                      @Param("collectType") Integer collectType);
}