package jnpf.personnels.mapper;

import org.apache.ibatis.annotations.Param;

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

/**
 * @Author: peng.hao
 * @create: 2024/10/14
 */
public interface FtbPersonnelsTurnoverAnalysisMapper {
    /**
     * 离职人数
     * @return
     */
    Integer getLeavePeopleMonth(@Param("startTime") Date startTime ,@Param("endTime") Date endTime,@Param("userIdListByOrganizeIds") List<String> userIdListByOrganizeIds);

    /**
     * 计算性别
     * @param startTime
     * @param endTime
     * @param userIdListByOrganizeIds
     * @return
     */
    Integer getLeavePeopleSexMonth(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("userIdListByOrganizeIds") List<String> userIdListByOrganizeIds);

    /**
     * 首月/首月/首年离职人数
     *
     * @param startTime
     * @param endTime
     * @param userIdListByOrganizeIds
     * @param firstMonth
     * @return
     */
    Integer getFirstMonthLeaveRate(@Param("startTime") Date startTime , @Param("endTime") Date endTime, @Param("userIdListByOrganizeIds") List<String> userIdListByOrganizeIds,@Param("firstMonth") Integer firstMonth);

    /**
     * 获取离职原因分布
     * @param startTime
     * @param endTime
     * @param userIdListByOrganizeIds
     * @return
     */
    List<Map<String, String>> getLeaveReasonDistribution(@Param("startTime") Date startTime ,@Param("endTime") Date endTime,@Param("userIdListByOrganizeIds") List<String> userIdListByOrganizeIds);

    /**
     * 离职年龄分布查询
     * @param startTime
     * @param endTime
     * @param userIdListByOrganizeIds
     * @return
     */
    List<Map<String, Object>> getLeavePeopleAgeDistribution(@Param("startTime") Date startTime ,@Param("endTime") Date endTime,@Param("userIdListByOrganizeIds") List<String> userIdListByOrganizeIds);


    /**
     * 离职岗位组织
     * @param startTime
     * @param endTime
     * @param userIdListByOrganizeIds
     * @return
     */
    List<Map<String, String>> getLeavePeoplePostRatio(@Param("startTime") Date startTime ,@Param("endTime") Date endTime,@Param("userIdListByOrganizeIds") List<String> userIdListByOrganizeIds);

    /**
     * 离职人员信息
     *
     * @param startTime
     * @param endTime
     * @param userIdListByOrganizeIds
     * @param workerSex
     * @return
     */
    List<Map<String, Object>> getLeavePeopleAgeLogRatio(@Param("startTime") Date startTime , @Param("endTime") Date endTime, @Param("userIdListByOrganizeIds") List<String> userIdListByOrganizeIds,
                                                        @Param("formId") String formId);

    Integer numberOfOnboardedEmployees(@Param("ringStartTime") Date ringStartTime,@Param("ringEndTime")  Date ringEndTime,@Param("userIdListByOrganizeIds")  List<String> userIdListByOrganizeIds);

    /**
     * 获取离职人员明细
     * @param startTime
     * @param endTime
     * @param userIdListByOrganizeIds
     * @return
     */
    List<Map<String, Object>> getLeaveRateDetail(@Param("startTime") Date startTime ,
                                                 @Param("endTime") Date endTime,
                                                 @Param("userIdListByOrganizeIds") List<String> userIdListByOrganizeIds);

}
