package com.bonus.system.holiday.dao;

import cn.hutool.core.date.DateTime;
import com.bonus.system.dept.entity.EightRoleBean;
import com.bonus.system.dept.entity.OrgUserVo;
import com.bonus.system.dept.entity.ProDeptRoleBean;
import com.bonus.system.dept.entity.ProDeptRoleDo;
import com.bonus.system.holiday.entity.HolidayBean;
import com.bonus.system.holiday.entity.HolidayImportBean;
import com.bonus.system.holiday.entity.HolidayKeyBean;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

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

/**
 * 项目部角色-数据访问层
 * @author fly
 */
@Repository("HolidayDao")
public interface HolidayDao {

    /**
     * 获取请假列表
     * @param bean 参数
     * @return list bean
     */
    List<HolidayBean> getHolidayList(@Param("bean") HolidayBean bean);

    /**
     * 新增请假记录
     * @param o
     * @return
     */
    int insertHoliday(HolidayBean o);

    /**
     * 根据主键查询请假记录
     * @param id
     * @return
     */
    HolidayBean selectHolidayById(Long id);

    /**
     * 修改请假记录
     * @param o
     * @return
     */
    int updateHoliday(HolidayBean o);

    /**
     * 根据主键删除请假记录
     * @param id
     * @return
     */
    int deleteHolidayById(Long id);

    /**
     * 修改请假状态
     * @param o
     * @return
     */
    int changeHolidayStatus(HolidayBean o);

    List<Map<String, String>> getLeaveType();

    List<HolidayKeyBean> getOrgList();

    List<HolidayKeyBean> getPersonList();

    List<HolidayKeyBean> getLeaveTypeList();

    /**
     * 根据主键查询请假人
     * @param id
     * @return
     */
    List<Long> getUserIdById(long id);

    /**
     * 获取请假数据
     * @param previousMonthDate
     * @return
     */
    List<HolidayImportBean> getHolidayData(LocalDate previousMonthDate);

    List<String> getHolidayDataByType(@Param("startDate") String leaveStartDate,@Param("endDate") String leaveEndDate);

    /**
     * 流程相关->轮休审批->一键审批
     * @param o
     * @return void
     * @author cwchen
     * @date 2025/2/11 14:34
     */
    void batchCheckStatus(HolidayBean o);
}
