package com.srs.survey.mapper;

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

import com.github.yulichang.base.MPJBaseMapper;
import com.srs.survey.domain.SurItinerary;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.srs.survey.domain.dto.LeaveRes;
import com.srs.survey.domain.dto.ReturnRes;
import com.srs.survey.domain.dto.SubmitRes;
import com.srs.survey.domain.dto.XwReturnRes;
import com.srs.survey.domain.vo.SurItineraryStatisticsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 学生假期返校Mapper接口
 *
 * @author srs
 * @date 2025-03-14
 */
@Mapper
public interface SurItineraryMapper extends MPJBaseMapper<SurItinerary> {

    public List<Map<String, Object>> countWillLeave(Long surveyId);

    public List<Map<String, Object>> countFdyClassWillLeave(@Param("surveyId") Long surveyId,@Param("fdyNo") String fdyNo);


    public List<Map<String, Object>> countXwWillLeave(@Param("surveyId") Long surveyId,@Param("deptId") Long deptId);

    public List<Map<String, Object>> listSubmitRes(Long surveyId);


    public List<Map<String, Object>> listXwSubmitRes(@Param("surveyId") Long surveyId ,@Param("deptId") Long deptId);

    public List<LeaveRes> listLeaveRes(Long surveyId);

    public List<ReturnRes> listReturnRes(Long surveyId);

    public List<XwReturnRes> listXwReturnRes(SurItinerary param);


    public List<SurItinerary> listView(SurItinerary param);


    public List<Map<String, Object>> listReturnRes1(Long surveyId);


    public List<Map<String, Object>> listXwReturnRes1(@Param("surveyId") Long surveyId ,@Param("deptId") Long deptId);

    /**
     * 查询学生假期返校
     *
     * @param returnSchoolId 学生假期返校主键
     * @return 学生假期返校
     */
    public SurItinerary selectSurItineraryByReturnSchoolId(Long returnSchoolId);

    /**
     * 查询学生假期返校列表
     *
     * @param surItinerary 学生假期返校
     * @return 学生假期返校集合
     */
    List<SurItinerary> selectSurItineraryList(SurItinerary surItinerary);

    /**
     * 新增学生假期返校
     *
     * @param surItinerary 学生假期返校
     * @return 结果
     */
    int insertSurItinerary(SurItinerary surItinerary);

    /**
     * 修改学生假期返校
     *
     * @param surItinerary 学生假期返校
     * @return 结果
     */
    int updateSurItinerary(SurItinerary surItinerary);

    /**
     * 删除学生假期返校
     *
     * @param returnSchoolId 学生假期返校主键
     * @return 结果
     */
    int deleteSurItineraryByReturnSchoolId(Long returnSchoolId);

    /**
     * 批量删除学生假期返校
     *
     * @param returnSchoolIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteSurItineraryByReturnSchoolIds(Long[] returnSchoolIds);
    /**
     * 审核学生假期返校
     */
    int auditItinerary(Long returnSchoolId);
    /**
     * 批量审核学生
     */
    int batchAuditItinerary(Long[] returnSchoolId);

    List<SurItineraryStatisticsVo> getItineraryStatistics(@Param("surveyId") Long surveyId);

}
