package com.yida.data.school.leave.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yida.data.common.core.entity.leave.EduLeaveRequest;
import com.yida.data.school.dto.leave.ListStudentRequestDetailDTO;
import com.yida.data.school.vo.leave.CountRequestVO;
import com.yida.data.school.vo.leave.FindPageLeaveListVO;
import com.yida.data.school.vo.leave.LeaveRequestDetailVO;
import java.util.List;


/**
 * 请假表 Service接口
 *
 * @author ccl
 * @date 2021-11-22 16:27:42
 */
public interface EduLeaveRequestService extends IService<EduLeaveRequest> {

    /**
     * 新增请假条
     *
     * @param leaveRequest
     */
    void saveOrUpLeave(EduLeaveRequest leaveRequest);


    /**
     * 查询对应学生请假条列表
     *
     * @param studentId
     * @param page
     * @param status
     * @return
     */
    Page<EduLeaveRequest> findLeaveList(Long parentId, Long studentId, Page<EduLeaveRequest> page, Integer status);

    /**
     * 教师查询对应学生请假条列表
     *
     * @param deptId
     * @param teacherId
     * @param status
     * @return
     */
    Page<EduLeaveRequest> findDeptLeaveList(Long deptId, Long teacherId, Integer status, Page<EduLeaveRequest> page,
        String studentName);


    /**
     * 请假条审批接口
     *
     * @param requestId
     * @param status
     */
    void updateLeave(Long requestId, Integer status, Long schoolId);

    /**
     * 后台查询请假条列表
     *
     * @param page
     * @param status
     * @param sectionId
     * @param gradeId
     * @param teacherId
     * @param studentName
     * @return
     */
    Page<FindPageLeaveListVO> findPageLeaveList(Page<FindPageLeaveListVO> page, Integer status, Long sectionId, Long gradeId,
                                                 String studentName, Integer reviewStatus, String teacherName, Long campsId, Long schoolId);

    /**
     * 查询请假详情
     *
     * @return
     */
    FindPageLeaveListVO findLeaveRequest(Long id);

    /**
     * 修改请假条状态为已失效
     */
    void updateLeaveRequest();

    /**
     * 根据学生与日期查询请假条
     */
    List<LeaveRequestDetailVO> listStudentLeave(ListStudentRequestDetailDTO dto);

    /**
     * 查询学生请假数
     */
    CountRequestVO countStudentRequest(ListStudentRequestDetailDTO dto);

    /**
     * 学生是否存在已通过的请假条
     */
    Boolean existRequest(ListStudentRequestDetailDTO dto);

}
