package com.ruoyi.mall.mapper;

import com.ruoyi.mall.domain.Bo.CheckingOutParamBo;
import com.ruoyi.mall.domain.MallAcceptPlan;
import com.ruoyi.mall.domain.MallSchoolAccept;
import com.ruoyi.mall.domain.Vo.MajorItemVo;
import com.ruoyi.mall.domain.Vo.ReportIntelligenceVo;
import com.ruoyi.mall.domain.Vo.SchoolMajorAcceptRecordVO;
import com.ruoyi.mall.domain.Vo.SchoolVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 学校专业录取数据Mapper接口
 *
 * @author lsm
 * @date 2023-10-18
 */
public interface MallSchoolAcceptMapper
{
    /**
     * 查询学校专业录取数据
     *
     * @param schoolAcceptId 学校专业录取数据主键
     * @return 学校专业录取数据
     */
    public MallSchoolAccept selectMallSchoolAcceptBySchoolAcceptId(Long schoolAcceptId);

    /**
     * 学校专业数据

     * @return
     */
    public MallSchoolAccept selectBySchoolIdAndLinkId(@Param("schoolId")Long schoolId,
                                                      @Param("batchId")Long batchId,
                                                      @Param("linkId")Long linkId,
                                                      @Param("acceptYear")String acceptYear,
                                                      @Param("subjectType")String subjectType);

    /**
     * 查询学校专业录取数据列表
     *
     * @param mallSchoolAccept 学校专业录取数据
     * @return 学校专业录取数据集合
     */
    public List<MallSchoolAccept> selectMallSchoolAcceptList(MallSchoolAccept mallSchoolAccept);

    /**
     * 新增学校专业录取数据
     *
     * @param mallSchoolAccept 学校专业录取数据
     * @return 结果
     */
    public int insertMallSchoolAccept(MallSchoolAccept mallSchoolAccept);

    /**
     * 修改学校专业录取数据
     *
     * @param mallSchoolAccept 学校专业录取数据
     * @return 结果
     */
    public int updateMallSchoolAccept(MallSchoolAccept mallSchoolAccept);

    /**
     * 删除学校专业录取数据
     *
     * @param schoolAcceptId 学校专业录取数据主键
     * @return 结果
     */
    public int deleteMallSchoolAcceptBySchoolAcceptId(Long schoolAcceptId);

    /**
     * 批量删除学校专业录取数据
     *
     * @param schoolAcceptIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteMallSchoolAcceptBySchoolAcceptIds(Long[] schoolAcceptIds);

    /**
     * 专业查询近三年录取记录
     * @param schoolId 学校id
     * @param batchId 批次id
     * @param majorId 专业id
     * @return 结果
     */
    public List<MallSchoolAccept> selectAcceptListByMajorId(@Param("schoolId")Long schoolId,
                                                            @Param("batchId")Long batchId,
                                                            @Param("majorId")Long majorId);

    /**
     * 专业录取数据
     * @return
     */
    public List<MallSchoolAccept> selectAllAcceptList();

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

    /**
     * 学校最新数据录取原则
     * @param schoolId
     * @param batchId
     * @param subjectType
     * @return
     */
    public Long selectNewAccept(@Param("schoolId")Long schoolId,
                                  @Param("batchId")Long batchId,
                                  @Param("subjectType")String subjectType);

    /**
     * 根据批次 查询最新一年的 文科/理科 学校专业录取数据
     * 用于 一键生成志愿填报基础数据
     */
    List<ReportIntelligenceVo> getListForIntelligence(@Param("subjectType")String subjectType,@Param("batchId")Long batchId);

    /**
     *
     * @param batchId
     * @return
     */
    public String selectAcceptYearList(@Param("batchId")Long batchId);

    /**
     * 去年招生的专业记录
     * @return 结果
     */
    public MallSchoolAccept selectAfterAccept(@Param("batchId")Long batchId,
                                                    @Param("schoolId")Long schoolId,
                                                    @Param("linkId")Long linkId,
                                                    @Param("subjectType")String subjectType,
                                                    @Param("afterYear")Integer afterYear);

    /**
     * 三年平均分
     * @param batchId
     * @param schoolId
     * @param linkId
     * @param subjectType
     * @return
     */
    public List<MallSchoolAccept> selectAfterAcceptThree(@Param("batchId")Long batchId,
                                                    @Param("schoolId")Long schoolId,
                                                    @Param("linkId")Long linkId,
                                                    @Param("subjectType")String subjectType);

    /**
     * 去年年份

     * @return
     */
    public int selectAfterYear();

    /**
     * 我的分数小于去年
     * @param myScore 分数
     * @return 结果
     */
    public List<String> selectAfterAcceptSchoolCountByGreater(@Param("myScore")Integer myScore, @Param("schoolIds")Long schoolIds);

    /**
     * 我的分数大于去年
     * @param myScore 分数
      * @return 结果
     */
    public List<String> selectAfterAcceptSchoolCountByLess(@Param("myScore")Integer myScore,@Param("schoolIds")Long schoolIds);

    /**
     * 今年招生计划
     * @return 结果
     */
    public List<MajorItemVo> selectNewAcceptPlanList(@Param("checkingOutParamBo") CheckingOutParamBo checkingOutParamBo,
                                                     @Param("subjectType")String subjectType);

    /**
     * 未公布学校
     * @param checkingOutParamBo
     * @param subjectType
     * @return
     */
    public List<MajorItemVo> selectOldAcceptList(@Param("checkingOutParamBo") CheckingOutParamBo checkingOutParamBo,
                                                 @Param("subjectType") String subjectType,
                                                 @Param("ids")Long[] ids);


    /**
     * 专业列表
     * @param checkingOutParamBo 参数
     * @return 结果
     */
    public List<MajorItemVo> selectMajorList(CheckingOutParamBo checkingOutParamBo);

    /**
     * 专业三年数据
     * @param schoolId 学校id
     * @param batchId 批次id
     * @param majorId 专业id
     * @param subjectType 学科类型
     * @return 结果
     */
    public List<MallSchoolAccept> selectThreeAcceptList(@Param("schoolId")Long schoolId,
                                                        @Param("batchId")Long batchId,
                                                        @Param("majorId")Long majorId,
                                                        @Param("subjectType")String subjectType);

    /**
     * 批量修改关联
     * @param list
     * @return
     */
    public int batchUpdate( @Param("list") List<MallSchoolAccept> list);

    /**
     * 预估分最低专业数据
     * @param schoolId
     * @param batchId
     * @param subjectType
     * @return
     */
    public MallSchoolAccept selectMinReferenceBySchoolId(@Param("schoolId")Long schoolId,
                                                         @Param("batchId")Long batchId,
                                                         @Param("subjectType")String subjectType);

    /**
     * 查询专科最新年成绩数据
     * @param schoolId
     * @param batchId
     * @param subjectType
     * @return
     */
    public MallSchoolAccept selectZhuankeAcceptBySchoolId(@Param("schoolId")Long schoolId,
                                                          @Param("batchId")Long batchId,
                                                          @Param("subjectType")String subjectType);

    /**
     * 重置去年旧数据
     * @param afterYear
     * @return
     */
    public int resetAfterData(@Param("afterYear")String afterYear);

    /**
     * 重置去年记录旧数据
     * @param afterYear
     * @return
     */
    public int resetAfterRecordData(@Param("afterYear")String afterYear);
}
