package com.xhkjedu.sapi.mapper.itemtool;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.sapi.model.itemtool.TRead;
import com.xhkjedu.sapi.vo.itemtool.ReadStudentVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ClassName ReadMapper
 * Description 阅读
 * Author WN
 * Date 2020/6/9 17:23
 **/
@Repository
public interface ReadMapper extends TkMapper<TRead> {

    /**
     *功能描述 所有阅读资源集合
     * @author WN
     * @date 2020/6/9
     * @param  * @param schoolid
     * @return java.util.List<com.xhkjedu.model.itemtool.TRead>
     */
    List<TRead> listReadsForWeb(Integer schoolid, Integer readstate, String readname);


    /**
     *功能描述 阅读分页（android）
     * @author WN
     * @date 2020/6/9
     * @param  * @param read
     * @return java.util.List<com.xhkjedu.model.itemtool.TRead>
     */
    List<TRead> listReadsForAndr(@Param("read") TRead read);

    //获取阅读详情
    TRead getObjByReadId(Integer readid);

    //修改阅读次数
    Integer updateReadcount(Integer readid);

    /**
     *功能描述 获取学生阅读历史
     * @author WN
     * @date 2020/6/17
     * @param  * @param readid
     * @param schoolid
     * @param begintime
     * @return java.util.List<com.xhkjedu.model.itemtool.TReadStudent>
     */
    List<ReadStudentVo> listReadStudents(@Param("schoolid") Integer schoolid, @Param("readid") Integer readid, @Param("begintime") Integer begintime, @Param("endtime") Integer endtime);

    /**
     * 获取学校阅读历史
     * @Param [readid, begintime, endtime]
     * @Author ywx
     * @Date 2021/7/31 17:20
     * @return java.util.List<com.xhkjedu.vo.itemtool.ReadStudentVo>
     **/
    List<ReadStudentVo> listReadSchool(@Param("readid") Integer readid, @Param("begintime") Integer begintime, @Param("endtime") Integer endtime);

    /**
     * 修改上架状态
     * @Param [readid, readstate]
     * @Author ywx
     * @Date 2020/6/26 11:47
     * @return java.lang.Integer
     **/
    Integer updateState(@Param("readid") Integer readid, @Param("readstate") Integer readstate);

    /**
     * 定时任务修改阅读状态
     * @Param [readstate, readstate2]
     * @Author ywx
     * @Date 2020/9/1 9:52
     * @return java.lang.Integer
     **/
    Integer updateTaskState(@Param("readstate") int readstate, @Param("readstate2") int readstate2);

    /**
     * 获取电子书文件
     * @Param [readid]
     * @Author ywx
     * @Date 2021/10/26 16:25
     * @return java.util.List<java.lang.String>
     **/
    TRead getReadPath(Integer readid);

    //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
    /**
     * 电子书列表
     * @Param [read]
     * @Author ywx
     * @Date 2020/9/3 18:05
     * @return java.util.List<com.xhkjedu.model.itemtool.TRead>
     **/
    List<TRead> listReadForStuWeb(@Param("read") TRead read);
}
