package com.template.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.template.model.dto.WarningUserDto;
import com.template.model.pojo.SmartUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.template.model.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

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

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ceshi
 * @since 2023-12-04
 */
@Repository
public interface SmartUserMapper extends BaseMapper<SmartUser> {
    List<AffiliateUserVo> queryAffiliateUserById(@Param("id") Integer id);

    IPage<UserVo> querySmartUserPages(IPage<UserVo> page, @Param("departmentIds") List<Integer> departmentIds, @Param("name") String name);

    List<SmartUser> querySmartUsers(@Param("departmentIds") List<Integer> departmentIds, @Param("name") String name);

    IPage<GradeVo> querySmartSecordPage(IPage<GradeVo> page, @Param("name") String name, @Param("userId") Integer userId);

    IPage<UserDeleteVo> queryUserDeletePage(IPage<UserDeleteVo> page);

    IPage<WarningUserDto> warningUserList(Page<UserVo> page, @Param("name") String name);

    List<WarningUserDto> warningPushList();

    List<AffiliateParentVo> queryAffiliateParents(@Param("userId") Integer userId);

    List<SmartUser> getAffiliateList(@Param("id") Integer id);

    SmartUserVo querySmartUserById(@Param("userId") Integer userId);

    int deleteUserBatch(@Param("list") List<deleteUserVo> list);

    SmartStudentVo querySmartStudentById(@Param("userId") Integer userId);

    List<SmartUserAffiliateVo> getAffiliateUser(@Param("affiliate") String affiliate);

    List<StudentSelectVo> studentSelect(@Param("keyWord") String keyWord);

    List<SmartUser> querySmartParentByIds(@Param("studentIds") List<Integer> studentIds);

    List<StatisticsCampusVo> getAccessStatisticsCampus(@Param("classId") Integer classId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    List<StatisticsCampusVo> getAttendanceStatisticsCampus(@Param("classId") Integer classId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    List<StatisticsCampusVo> getFaceDiscernStatisticsCampus(@Param("classId") Integer classId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    List<StatisticsCampusVo> getAckStatisticsCampus(@Param("classId") Integer classId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    List<StatisticsCampusVo> getClassStudent(@Param("classId") Integer classId);

    List<StatisticsCampusManageVo> getAccessStatisticsCampusManage(@Param("gradeId") Integer gradeId,@Param("classId") Integer classId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime,@Param("keyWord")String keyWord);

    List<StatisticsCampusManageVo> getAttendanceStatisticsCampusManage(@Param("gradeId") Integer gradeId, @Param("classId") Integer classId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime,@Param("keyWord")String keyWord);

    List<StatisticsCampusManageVo> getFaceDiscernStatisticsCampusManage(@Param("gradeId") Integer gradeId, @Param("classId") Integer classId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime,@Param("keyWord")String keyWord);

    List<StatisticsCampusManageVo> getAckStatisticsCampusManage(@Param("gradeId") Integer gradeId, @Param("classId") Integer classId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime,@Param("keyWord")String keyWord);

    List<StatisticsCampusManageVo> getClassStudentManage(@Param("gradeId") Integer gradeId, @Param("classId")Integer classId,@Param("keyWord")String keyWord);

    IPage<SmartUserPageVo> getPage(Page<SmartUserPageVo> page,@Param("keyWord") String keyWord,@Param("schoolClass") String schoolClass);

    List<StatisticsStatement> getUserClassTotal();

    List<StatisticsStatement> getUserAckTotal(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    List<StatisticsStatement> getUserNormalTotal(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
}
