package com.ruoyi.mall.mapper;

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

import com.ruoyi.mall.domain.MallAcceptPlan;
import com.ruoyi.mall.domain.Vo.AcceptChangeItemVo;
import com.ruoyi.mall.domain.Vo.MajorItemVo;
import com.ruoyi.mall.domain.Vo.SchoolAcceptPlanVO;
import com.ruoyi.mall.domain.Vo.SchoolVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

/**
 * 招生计划Mapper接口
 *
 * @author Lsm
 * @date 2023-10-19
 */
public interface MallAcceptPlanMapper
{
    /**
     * 查询招生计划
     *
     * @param acceptPlanId 招生计划主键
     * @return 招生计划
     */
    public MallAcceptPlan selectMallAcceptPlanByAcceptPlanId(Long acceptPlanId);

    /**
     * 查询学校招生计划
     * @param mallAcceptPlan
     * @return
     */
    public List<MallAcceptPlan> selectAcceptPlanBySchoolId(MallAcceptPlan mallAcceptPlan);

    /**
     * 最近2年招生计划
     * @param
     * @return
     */
    public List<MallAcceptPlan> selectTwoPlan(@Param("majorId")Long majorId, @Param("batchId")Long batchId, @Param("subjectType")String subjectType);

    /**
     * 最新年份
     * @return
     */
    public String selectMaxYear();


    public List<MallAcceptPlan> selectPlan(@Param("schoolId")Long schoolId,
                                     @Param("batchId")Long batchId,
                                     @Param("planYear")String planYear,
                                     @Param("subjectType")Integer subjectType,
                                     @Param("linkId")Long linkId);

    /**
     * 查询学费
     * @param schoolId 学校id
     * @param majorId 专业id
     * @param batchId 批次id
     * @param planYear 年份
     * @return 结果
     */
    public MallAcceptPlan selectSchoolPrice(@Param("schoolId")Long schoolId,
                                            @Param("majorId")Long majorId,
                                            @Param("batchId")Long batchId,
                                            @Param("planYear")String planYear,
                                            @Param("subjectType")String subjectType);

    /**
     * 根据学校专业查计划
     * @param schoolId 学校id
     * @param batchId 批次id
     * @param majorId 专业id
     * @return 结果
     */
    public List<MallAcceptPlan> selectMallAcceptPlanByMajorIdAndSchoolId(@Param("schoolId") Long schoolId,
                                                                   @Param("batchId")Long batchId,
                                                                   @Param("majorId")Long majorId);

    /**
     * 查询招生计划列表
     *
     * @param mallAcceptPlan 招生计划
     * @return 招生计划集合
     */
    public List<MallAcceptPlan> selectMallAcceptPlanList(MallAcceptPlan mallAcceptPlan);

    /**
     * 新增招生计划
     *
     * @param mallAcceptPlan 招生计划
     * @return 结果
     */
    public int insertMallAcceptPlan(MallAcceptPlan mallAcceptPlan);

    /**
     * 修改招生计划
     *
     * @param mallAcceptPlan 招生计划
     * @return 结果
     */
    public int updateMallAcceptPlan(MallAcceptPlan mallAcceptPlan);

    /**
     * 删除招生计划
     *
     * @param acceptPlanId 招生计划主键
     * @return 结果
     */
    public int deleteMallAcceptPlanByAcceptPlanId(Long acceptPlanId);

    /**
     * 批量删除招生计划
     *
     * @param acceptPlanIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteMallAcceptPlanByAcceptPlanIds(Long[] acceptPlanIds);

    /**
     * 招生计划
     * @param schoolId 学校id
     * @param batchId 批次
     * @return 结果
     */
    public List<SchoolAcceptPlanVO> selectAcceptPlanList(@Param("schoolId")Long schoolId,
                                                         @Param("batchId")Long batchId,
                                                         @Param("subjectType")String subjectType);

    /**
     * 查询更新时间范围
     * @param schoolId 学校id
     * @param batchId 批次id
     * @return 结果
     */
    public Map<String, String> selectUpdateTime(@Param("schoolId")Long schoolId,
                                                @Param("batchId")Long batchId);

    /** 查询新招专业或所有新招  用于志愿填报自主选择*/
    List<MajorItemVo> newAcceptList(@Param("subjectType")String subjectType,@Param("newAcceptType") String newAcceptType, @Param("batchId") Long batchId);

    /** 志愿添加 查询专业 人数 学费*/
    List<MajorItemVo> majorList(MajorItemVo vo);

    /** 招生变化 列表查询*/
    AcceptChangeItemVo getSumNumByBatchId(@Param("y") String y,@Param("batchId")Long batchId,@Param("subjectType")String subjectType);

    /** 新招院校 用于招生变化*/
    List<Long> getNewAcceptSchools(@Param("batchId")Long batchId,@Param("subjectType")String subjectType);

    /** 查询所有计划 */
    List<MallAcceptPlan> selectAllPlan();

    /**
     * 批量修改
     * @param list
     * @return
     */
    public int batchUpdate(@Param("list")List<MallAcceptPlan> list);
    public int insertByList(@Param("list")List<MallAcceptPlan> list);
}
