/**
 * Copyright (c) 2018-2099, Chill Zhuang 庄骞 (bladejava@qq.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.xiaoniu.subsystem.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xiaoniu.common.core.vo.LabelAndValueVO;
import com.xiaoniu.subsystem.business.domain.ProjectPersonnelInfo;
import com.xiaoniu.subsystem.business.domain.vo.ComparisonGradesVO;
import com.xiaoniu.subsystem.business.domain.vo.ParticipantsVO;
import com.xiaoniu.subsystem.business.domain.vo.ProjectPersonnelInfoVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 计划人员信息表 Mapper 接口
 *
 * @author sst
 * @since 2024-11-26
 */
public interface ProjectPersonnelInfoMapper extends BaseMapper<ProjectPersonnelInfo> {

    /**
     * 自定义分页
     *
     * @param page
     * @param projectPersonnelInfo
     * @return
     */
    List<ProjectPersonnelInfoVO> selectProjectPersonnelInfoPage(IPage page, ProjectPersonnelInfoVO projectPersonnelInfo);

    /**
     * 计算历年优秀学院数量
     *
     * @param yearList 年份集合·
     * @return List<LabelAndValueVO>
     */
    List<LabelAndValueVO> getExcellentStudent(@Param("yearList") List<String> yearList, @Param("unitIdList") List<Long> unitIdList);

    /**
     * 获取实际参训人数
     *
     * @param unitIdList 部门id
     * @return 数量
     */
    Integer getActualParticipateNum(@Param("unitIdList") List<Long> unitIdList, @Param("yearList") List<String> yearList,@Param("flightId") Long flightId);

    /**
     * 计划、实际参训人数统计
     *
     * @param yearList   年份id
     * @param unitIdList 部门id
     * @return List<ParticipantsVO>
     */
    List<ParticipantsVO> getNumberParticipants(@Param("yearList") List<String> yearList, @Param("unitIdList") List<Long> unitIdList);

    /**
     * 获取实际参训人员
     *
     * @param unitIdList 部门id
     * @return List<LabelAndValueVO>
     */
    List<LabelAndValueVO> overYearsParticipants(@Param("unitIdList") List<Long> unitIdList, @Param("yearList") List<String> yearList);

    /**
     * 参训人员培训类型占比图
     *
     * @param unitIdList 单位id
     * @return List<LabelAndValueVO>
     */
    List<LabelAndValueVO> trainingType(@Param("unitIdList") List<Long> unitIdList);

    /**
     * 参训人员入学摸底考试与结业考核成绩对比图
     *
     * @param unitIdList 单位id
     * @return List<ComparisonGradesVO>
     */
    List<ComparisonGradesVO> comparisonGrades(@Param("unitIdList") List<Long> unitIdList);

    /**
     * 参训人员成绩占比图
     *
     * @param unitIdList 单位id
     * @return List<LabelAndValueVO>
     */
    List<LabelAndValueVO> scoreProportion(List<Long> unitIdList);

    /**
     * 班次统计-培训状态
     *
     * @param unitIdList 单位id
     * @param yearList   年份
     * @return List<LabelAndValueVO>
     */
    List<LabelAndValueVO> FlightTrainingStatusVO(@Param("yearList") List<String> yearList, @Param("unitIdList") List<Long> unitIdList);

    /**
     * 班次统计-参训人员占比
     *
     * @param flightId 班次id
     * @param year     年份
     * @return List<LabelAndValueVO>
     */
    List<LabelAndValueVO> flightDistributionProportion(@Param("flightId") Long flightId, @Param("year") String year);

    /**
     * 班次统计-历年优秀率
     *
     * @param yearList  年份
     * @param majorType 类型
     * @return List<LabelAndValueVO>
     */
    List<LabelAndValueVO> flightAnnualExcellenceRate(@Param("yearList") List<String> yearList, @Param("majorType") String majorType);

    /**
     * 班次统计-成绩占比图
     *
     * @param yearList 年份
     * @param flightId 班次id
     * @return List<LabelAndValueVO>
     */
    List<LabelAndValueVO> flightProportionGrades(@Param("yearList") List<String> yearList, @Param("flightId") Long flightId);
}
