package com.yonge.cooleshow.biz.dal.dao;

import java.util.List;
import java.util.Set;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yonge.cooleshow.biz.dal.dto.BasicUserInfo;
import com.yonge.cooleshow.biz.dal.dto.search.TeacherSearch;
import com.yonge.cooleshow.biz.dal.entity.Subject;
import com.yonge.cooleshow.biz.dal.entity.Teacher;
import com.yonge.cooleshow.biz.dal.queryInfo.TeacherQueryInfo;
import com.yonge.cooleshow.biz.dal.vo.HotTeacherVo;
import com.yonge.cooleshow.biz.dal.vo.MyFens;
import com.yonge.cooleshow.biz.dal.vo.TeacherVo;

import com.yonge.cooleshow.biz.dal.wrapper.StatGroupWrapper;
import org.apache.ibatis.annotations.Param;

public interface TeacherDao extends BaseMapper<Teacher> {
    /***
     * 查询老师详情
     * @author liweifan
     * @param: id
     * @updateTime 2022/3/23 17:50
     * @return: com.yonge.cooleshow.biz.dal.vo.TeacherVo
     */
    TeacherVo detail(@Param("userId") Long userId);

    /**
     * 自定义分页
     */
    List<TeacherVo> selectPage(@Param("page") IPage page, @Param("param") TeacherSearch teacher);

    /**
     * @description: 获取用户基本信息
     * @param userId
     * @return com.yonge.cooleshow.biz.dal.dto.BasicUserInfo
     * @author zx
     * @date 2022/3/22 13:52
     */
    BasicUserInfo getBasicUserInfo(@Param("userId") Long userId);

    /**
     * @description: 获取用户基本信息
     * @param studentIds
     * @return com.yonge.cooleshow.biz.dal.dto.BasicUserInfo
     * @author zx
     * @date 2022/3/22 13:52
     */
    List<BasicUserInfo> findBasicUserInfo(@Param("studentIds") Set<Long> studentIds);

    /**
     * @param
     * @return java.util.List<com.yonge.cooleshow.biz.dal.entity.Subject>
     * @description: 获取老师可授课声部列表
     * @author zx
     * @date 2022/3/25 09:38
     */
    List<Subject> querySubject(@Param("userId") Long userId);

    /***
     * 设置学员声部
     * @author liweifan
     * @param: id
     * @param: subjectIds
     * @updateTime 2022/4/7 10:12
     * @return: java.lang.Integer
     */
    Integer setSubject(@Param("id") Long id, @Param("subjectIds") String subjectIds);

    /***
     * 增加主页浏览量
     * @author liweifan
     * @param: userId
     * @updateTime 2022/4/24 17:46
     * @return: java.lang.Integer
     */
    Integer addHomeBrowse(@Param("userId") Long userId);

    /***
     * 获取声部下拉框
     * @author liweifan
     * @param: id
     * @updateTime 2022/5/9 10:17
     * @return: java.util.List<com.yonge.cooleshow.biz.dal.entity.Subject>
     */
    List<Subject> querySubjectItem(@Param("userId") Long userId, @Param("type")String type);

    /**
     * 查询我的粉丝
     * @param page IPage<MyFens>
     * @param query TeacherQueryInfo.FansQuery
     * @return List<MyFens>
     */
    List<MyFens> queryMyFans(@Param("page") IPage<MyFens> page, @Param("record") TeacherQueryInfo.FansQuery query);
    
    /**
     * 查询热门老师
     * @return
     */
    List<HotTeacherVo> queryHotTeacherList(Long subjectId);

    /**
     * 老师学生人数统计
     * @param teacherIds 老师ID
     * @return List<StatGroupWrapper>
     */
    List<StatGroupWrapper> selectTeacherStudentNumberStatInfo(@Param("teacherIds") List<Long> teacherIds);
}