package com.xhkjedu.sstudy.mapper.subjectbook;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.sstudy.model.subjectbook.TDirector;
import com.xhkjedu.sstudy.vo.subjectbook.DirectorVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ClassName DirectorMapper
 * Description TODO
 * Author WN
 * Date 2020/6/3 15:44
 **/
@Repository
public interface DirectorMapper extends TkMapper<TDirector> {

    /**
     *功能描述  教材下章节集合
     * @author WN
     * @date 2020/6/3
     * @param director
     * @return java.util.List<com.xhkjedu.model.subjectbook.TDirector>
     */
    List<TDirector> listDirectors(@Param("director") TDirector director);

    /**
     * 教师收藏教材下的章节数量
     * @Param [teacherid, lsbid]
     * @Author ywx
     * @Date 2020/7/8 14:48
     * @return java.lang.Integer
     **/
    Integer countByTeacherIdLsbId(@Param("teacherid") Integer teacherid, @Param("lsbid") String lsbid);

    //查找使用章节的模块
    String findUseModule(String directorid);

    //获取章节层级名称和章节层级
    DirectorVo getNameAndLevelById(String directorid);

    //修改层级章节
    void updateDirectorAll(String directorid, String directorname, Integer level);

    //删除
    Integer deleteById(@Param("directorid") String directorid);
}
