package com.qmth.distributed.print.business.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.distributed.print.business.bean.result.TeachCourseResult;
import com.qmth.distributed.print.business.entity.TeachCourse;
import com.qmth.teachcloud.common.bean.result.TeacherSelectResult;
import com.qmth.teachcloud.common.bean.result.TeacherTeamResult;
import com.qmth.teachcloud.common.entity.BasicCourse;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description: 教学课程mapper
 * @Author: CaoZixuan
 * @Date: 2022-02-07
 */
public interface TeachCourseMapper extends BaseMapper<TeachCourse> {

    /**
     * 分页查询教学课程
     *
     * @param iPage      分页参数
     * @param courseName 课程名称
     * @param userId     用户id
     * @param schoolId   学校id
     * @return 结果
     */
    IPage<TeachCourseResult> findTeachCoursePage(@Param("iPage") Page<TeachCourseResult> iPage,
                                                 @Param("courseName") String courseName,
                                                 @Param("userId") Long userId,
                                                 @Param("schoolId") Long schoolId);

    /**
     * 教师团队分页查询
     *
     * @param iPage         分页参数
     * @param userInfo      用户信息（姓名||工号）
     * @param basicCourseId 基础课程id
     * @return 分页结果
     */
    IPage<TeacherTeamResult> findTeacherTeamPage(@Param("iPage") Page<TeacherTeamResult> iPage,
                                                 @Param("userInfo") String userInfo,
                                                 @Param("basicCourseId") Long basicCourseId,
                                                 @Param("schoolId") Long schoolId);

    /**
     * 根据机构id查询教师集合
     * @param orgIdList orgIdList
     * @return 教师查询集合
     */
    List<TeacherSelectResult> findTeacherByOrgIds(@Param("orgIdList") List<Long> orgIdList);

    List<BasicCourse> findTeachCourseByUserId(Long userId);
}
