package com.xhkjedu.sstudy.mapper.paper;

import com.xhkjedu.sstudy.base.TkMapper;
import com.xhkjedu.sstudy.model.paper.TPaper;
import com.xhkjedu.sstudy.model.paper.TPaperFile;
import com.xhkjedu.sstudy.vo.paper.AnalyzeSearchVo;
import com.xhkjedu.sstudy.vo.paper.CheckClassVo;
import com.xhkjedu.sstudy.vo.paper.PaperListVo;
import com.xhkjedu.sstudy.vo.paper.PaperQtypeVo;
import com.xhkjedu.sstudy.vo.paper.PaperVo;
import com.xhkjedu.sstudy.vo.paperstudent.PaperSearchVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @ClassName PaperMapper
 * Description 作业
 * Author WN
 * Date 2020/6/8 16:10
 **/
@Repository
public interface PaperMapper extends TkMapper<TPaper> {

    /**
     *功能描述 修改作业状态
     * @author WN
     * @date 2020/6/11
     * @param  * @param paperstate
     * @param paperid
     * @return void
     */
    void updatePaperState(@Param("paperstate") Integer paperstate, @Param("paperid") Integer paperid, @Param("ctypecount") Integer ctypecount);

    /**
     *功能描述 修改
     * @author WN
     * @date 2020/6/11
     * @param  * @param paper
     * @return void
     */
    void updatePaper(@Param("paper") TPaper paper);

    /**
     * 获取作业题型列表
     * @Param [paperid]
     * @Author ywx
     * @Date 2020/6/10 14:31
     * @return java.util.List<com.xhkjedu.vo.paper.PaperQtypeVo>
     **/
    List<PaperQtypeVo> listPaperType(@Param("paperid") Integer paperid);

    /**
     * 详情
     * @Param [paperid]
     * @Author ywx
     * @Date 2020/6/10 16:50
     * @return com.xhkjedu.vo.paper.PaperVo
     **/
    PaperVo findById(@Param("paperid") Integer paperid);

    /**
     * 作业列表
     * @Param [paper]
     * @Author ywx
     * @Date 2020/6/11 16:06
     * @return java.util.List<com.xhkjedu.vo.paper.PaperListVo>
     **/
    List<PaperListVo> listAll(@Param("paper") PaperSearchVo paper);

    //作业列表--未发布
    List<PaperListVo> listWfbPapers(@Param("paper") PaperSearchVo paper);

    /**
     * 设置批改方式
     * @Param [paperid, checktype]
     * @Author ywx
     * @Date 2020/6/12 9:15
     * @return java.lang.Integer
     **/
    Integer updateCheckType(@Param("paperid") Integer paperid, @Param("checktype") Integer checktype);

    /**
     * 获取批改学生列表
     * @Param [paperid, checkid, classid]
     * @Author ywx
     * @Date 2020/6/12 11:02
     * @return com.xhkjedu.vo.paper.CheckClassVo
     **/
    CheckClassVo listStudentsByPaperIdCheckId(@Param("paperid") Integer paperid, @Param("checkid") Integer checkid, @Param("classid") Integer classid);

    /**
     * 教师批阅列表
     * @Param [checkid]
     * @Author ywx
     * @Date 2020/6/18 14:54
     * @return java.util.List<com.xhkjedu.vo.paper.PaperListVo>
     **/
    List<PaperListVo> correctList(@Param("checkid") Integer checkid);

    /**
     * 作业附件列表
     * @Param [paperid, fileclass]
     * @Author ywx
     * @Date 2020/6/29 17:57
     * @return java.util.List<com.xhkjedu.model.paper.TPaperFile>
     **/
    List<TPaperFile> listPaperFile(@Param("paperid") Integer paperid, @Param("fileclass") Integer fileclass);

    /**
     * 获取年级下教师发布作业列表
     * @Param [paper]
     * @Author ywx
     * @Date 2020/9/28 15:23
     * @return java.util.List<com.xhkjedu.vo.paper.PaperListVo>
     **/
    List<PaperListVo> listPaper(@Param("paper") AnalyzeSearchVo paper);

    /**
     * 删除作业
     * @Param [paperid]
     * @Author ywx
     * @Date 2020/10/30 16:52
     * @return java.lang.Integer
     **/
    Integer delPaper(Integer paperid);

    //获取作业原文件保存地址列表
    List<String> listSourcePath(Integer paperid);

    //获取今天布置作业数量
    Integer getPaperNum(@Param("subjectid") String subjectid, @Param("createid") Integer createid, @Param("createtime") Integer createtime);

    //获取作业状态
    Integer getPaperState(Integer paperid);

    //获取批阅班级
    List<Map> listPaperClass(Integer paperid, Integer checkid);

    //根据作业id获取作业分类
    Integer getPaperTypeById(@Param("paperid") Integer paperid);
}
