package com.yida.data.school.health.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yida.data.common.core.entity.health.EduProject;
import com.yida.data.common.core.entity.health.EduStudentProjectTestResult;
import com.yida.data.school.vo.health.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 学生单项成绩记录表 Service接口
 *
 * @author wjm
 * @date 2021-09-14 17:16:24
 */
public interface EduStudentProjectTestResultService extends IService<EduStudentProjectTestResult> {

    /**
     * 保存学生自测成绩
     *
     * @param stuProjectVO
     */
    void saveStudentSelfTest(EduStuProjectVO stuProjectVO);

    /**
     * 查询体育成绩列表
     *
     * @param stuSex
     * @param recordGradeId
     * @return
     */
    List<EduProjectVO> findStuSelfTestProjectList(String stuSex, Long recordGradeId, Long id);


    /**
     * 查询学年国际自测成绩
     *
     * @param id 成绩主键id
     * @return com.yida.data.health.vo.EduNationalProjectVO
     * @author ZYJ
     * @date 2021/10/29 16:41
     */
    EduNationalProjectVO findStuSelfTest(Long id);

    /**
     * 查询学年体测成绩
     *
     * @param id 成绩id
     * @return com.yida.data.health.vo.EduNationalProjectVO
     * @author ZYJ
     * @date 2021/10/29 15:11
     */
    EduNationalProjectVO findStuNationalTest(Long id);

    /**
     * 查询学生国标测试历史列表
     *
     * @param stuId
     * @param recordGradeId
     * @param stuSex
     * @return list
     */
    List<EduProjectVO> findStuHistoryResultsList(@Param("stuId") Long stuId, @Param("recordGradeId") Long recordGradeId,
                                                 @Param("stuSex") String stuSex);

    /**
     * 查询学生对应国标体测和自测成绩
     *
     * @param studentId
     * @return
     */
    List findStuNationalAndSelfTest(Long studentId);


    List<EduNationalProjectVO> findPageStuSelfTestProjectList(Long schoolId);

    IPage<StudentHealthListVO> findPageStudent(Long schoolId, Long groupId,
                                               Long gradeId, Long classId, String studentName,
                                               Page<EduNationalProjectVO> page,
                                               Integer type);

    void saveOrUpTestProject(EduProject eduProject) throws Exception;

    /**
     * 查询学生体测历史
     * @param studentId
     */
    List<SelfHealthVO> findStuHistoryResults(Long studentId, Integer num);

    /**
     * 查询最近一次体测数据
     * @param studentId
     */
    NationalHealthVO findLastResults(Long studentId);

    List<AppHistoryHealthVO> findStudentHistoryResults(Long studentId);

    /**
     * 查询最新一次视力测试
     * @param studentId
     * @param num
     * @return
     */
    EyesTestVO findLastEyesTest(Long studentId, Integer num);

    /**
     * 删除学生成绩
     * @param gradeResultId
     */
    void removeTestProject(Long gradeResultId);

    /**
     * 查询
     * @param gradeResultId
     * @return
     */
    EduNationalProjectVO findOneStuSelfTestProject(Long gradeResultId);
}
