package com.ruoyi.mall.mapper;

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

import com.ruoyi.mall.domain.MallSchoolAcceptRecord;
import com.ruoyi.mall.domain.Vo.SchoolAcceptRecordVO;
import com.ruoyi.mall.domain.Vo.UnionTestAnalysisVO;
import com.ruoyi.mall.domain.Vo.UserScoreAnalysisVO;
import org.apache.ibatis.annotations.Param;

/**
 * 院校录取数据Mapper接口
 *
 * @author lsm
 * @date 2023-10-19
 */
public interface MallSchoolAcceptRecordMapper {
    /**
     * 查询院校录取数据
     *
     * @param schoolAcceptRecordId 院校录取数据主键
     * @return 院校录取数据
     */
    public MallSchoolAcceptRecord selectMallSchoolAcceptRecordBySchoolAcceptRecordId(Long schoolAcceptRecordId);

    /**
     * 学校最新录取记录
     * @param schoolId 学校id
     * @param batchId  批次id
     * @return 结果
     */
    public MallSchoolAcceptRecord selectNewSchoolAcceptRecordBySchoolId(@Param("schoolId") Long schoolId,
                                                                     @Param("batchId")Long batchId,
                                                                     @Param("subjectType")String subjectType);

    /**
     * 查询院校录取数据列表
     *
     * @param mallSchoolAcceptRecord 院校录取数据
     * @return 院校录取数据集合
     */
    public List<MallSchoolAcceptRecord> selectMallSchoolAcceptRecordList(MallSchoolAcceptRecord mallSchoolAcceptRecord);

    /**
     * 后台展示录取列表
     * @param mallSchoolAcceptRecord 录取数据
     * @return 结果
     */
    public List<MallSchoolAcceptRecord> selectCMSMallSchoolAcceptRecordList(MallSchoolAcceptRecord mallSchoolAcceptRecord);

    /**
     * 新增院校录取数据
     *
     * @param mallSchoolAcceptRecord 院校录取数据
     * @return 结果
     */
    public int insertMallSchoolAcceptRecord(MallSchoolAcceptRecord mallSchoolAcceptRecord);

    /**
     * 修改院校录取数据
     *
     * @param mallSchoolAcceptRecord 院校录取数据
     * @return 结果
     */
    public int updateMallSchoolAcceptRecord(MallSchoolAcceptRecord mallSchoolAcceptRecord);

    /**
     * 删除院校录取数据
     *
     * @param schoolAcceptRecordId 院校录取数据主键
     * @return 结果
     */
    public int deleteMallSchoolAcceptRecordBySchoolAcceptRecordId(Long schoolAcceptRecordId);

    /**
     * 删除24年记录
     * @return
     */
    public int deleteRecord();

    /**
     * 批量删除院校录取数据
     *
     * @param schoolAcceptRecordIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteMallSchoolAcceptRecordBySchoolAcceptRecordIds(Long[] schoolAcceptRecordIds);

    /**
     * 院校录取数据列表
     *
     * @param schoolId 学校id
     * @param batchId  批次
     * @return 结果
     */
    public List<SchoolAcceptRecordVO> selectAcceptRecordList(@Param("schoolId") Long schoolId,
                                                             @Param("batchId") Long batchId,
                                                             @Param("subjectType")String subjectType);

    /**
     * 近三年录取数据
     * @param schoolId 学校id
     * @param batchId 批次id
     * @param subjectType 学科
     * @return 结果
     */
    public List<MallSchoolAcceptRecord> selectThreeYearRecordList(@Param("schoolId") Long schoolId,
                                                                  @Param("batchId") Long batchId,
                                                                  @Param("subjectType")String subjectType);

    /**
     * 院校录取数据详情
     *
     * @param schoolAcceptRecordId 录取数据id
     * @return 结果
     */
    public List<SchoolAcceptRecordVO> selectSchoolRecordDetail(@Param("schoolAcceptRecordId") Long schoolAcceptRecordId);

    /**
     * 学校历年某一批次录取成绩列表
     * @param schoolId 学校id
     * @param batchId 批次id
     * @return 结果
     */
    public List<UnionTestAnalysisVO> selectUnionTestAnalysisList(@Param("schoolId")Long schoolId,
                                                                 @Param("batchId")Long batchId,
                                                                 @Param("subjectType")String subjectType);

    /**
     * 专业综合成绩列表
     * @param schoolId 学校id
     * @param batchId 批次id
     * @param subjectType 学科0-文科,1-理科
     * @return 结果
     */
    public List<UserScoreAnalysisVO> selectUserScoreAnalysisList(@Param("schoolId")Long schoolId,
                                                                 @Param("batchId")Long batchId,
                                                                 @Param("subjectType")String subjectType);

    /**
     * 各层次院校录取分析列表
     *
     * @param batchId 批次ID
     * @param years 年份
     * @return 层次院校录取分析集合
     */
    public List<Map<String, Object>> selectAllLevelsMallSchoolAcceptRecordList(@Param("batchId")Long batchId, @Param("years") String years);

    /**
     * 批量插入
     * @param list
     * @return
     */
    public int insertByList(List<MallSchoolAcceptRecord> list);

    public int selectSum(@Param("schoolId")Long schoolId,
                         @Param("acceptYear")String acceptYear,
                         @Param("batchId")Long batchId,
                         @Param("subjectType")String subjectType);
}
