package com.xhkjedu.sstudy.mapper.subjectbook;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.sstudy.model.subjectbook.TTeacherSubjectbook;
import com.xhkjedu.sstudy.vo.subjectbook.TeacherSClassVo;
import com.xhkjedu.sstudy.vo.subjectbook.TeacherSubjectbookVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TeacherSubjectbookMapper extends TkMapper<TTeacherSubjectbook> {
    //列表
    List<TeacherSubjectbookVo> findAll(@Param("book") TTeacherSubjectbook book);

    //更改教师教材关系是选中
    void updateSelected(@Param("tbid") Integer tbid);
    //更改教师教材关系不选中
    void updateNoSelected(@Param("teacherid") Integer teacherid);

    //用户id删除教材
    void deleteByUserid(Integer userid);
    //获取用户教材集合
    List<String> listLsbsByUserid(Integer userid);

    //根据教材id教师id获取教师教材关系信息
    TTeacherSubjectbook getObjByLsbIdTeacherId(String lsbid, Integer teacherid);

    //删除教师收藏教材
    Integer deleteByLsbIdTeacherId(@Param("lsbids") List<String> lsbids, @Param("teacherid") Integer teacherid);

    //学生教材列表
    List<TeacherSubjectbookVo> listStuBook(@Param("subjectid") String subjectid
            , @Param("year") Integer year, @Param("studentid") Integer studentid);

    //获取教师年级下班级列表
    TeacherSClassVo listBookClass(@Param("teacherid") Integer teacherid, @Param("year") Integer year, @Param("classtype") Integer classtype);

    //获取教师权限教材科目下所有教材列表
    List<TeacherSubjectbookVo> listSubjectLsb(@Param("teacherid") Integer teacherid);

    //根据教材id获取科目id
    String getSubjectidByLsbid(@Param("lsbid") String lsbid);

    //根据教师id获取教师权限科目
    String listSubjectidByTeacherid(@Param("teacherid") Integer teacherid);
}
