package com.campus.activity.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.campus.activity.entity.Activity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface ActivityMapper extends BaseMapper<Activity> {

    IPage<Activity> selectActivityPage(Page<Activity> page,
                                        @Param("status") Integer status,
                                        @Param("keyword") String keyword,
                                        @Param("category") String category,
                                        @Param("startDate") LocalDateTime startDate,
                                        @Param("endDate") LocalDateTime endDate);

    List<Activity> selectCalendarActivities(@Param("year") Integer year,
                                             @Param("month") Integer month);

    List<Activity> selectConflictActivities(@Param("startTime") LocalDateTime startTime,
                                             @Param("endTime") LocalDateTime endTime,
                                             @Param("excludeActivityId") Long excludeActivityId);
}