package com.yuchen.saas.park.service.mapper.pldoor;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuchen.saas.park.api.entity.pldoor.PlDoorInoutRecode;
import com.yuchen.saas.park.api.vo.pldoor.PlDoorPassedTimeFrameCountVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 门禁出入记录 Mapper 接口
 * </p>
 *
 * @author miaoqs
 * @since 2024-04-12
 */
public interface PlDoorInoutRecodeMapper extends BaseMapper<PlDoorInoutRecode> {

    /**
     * 统计今日通行次数
     * @param parkId
     * @param userType
     * @return
     */
    Integer todayPassCount(@Param("parkId") Long parkId, @Param("userType") String userType);

    /**
     * 通行时间段统计-七天
     * @param parkId
     * @param userType
     * @return
     */
    List<PlDoorPassedTimeFrameCountVO> passedTimeFrameCount(@Param("parkId") Long parkId, @Param("userType")String userType);

    /**
     * 按天统计-本月
     * @param parkId
     * @return
     */
    List<PlDoorPassedTimeFrameCountVO> getDaysOfCurrentMonth(@Param("parkId") Long parkId);
    /**
     * 按月统计-访客
     * @param parkId
     * @return
     */
    List<PlDoorPassedTimeFrameCountVO> getMonthsOfCurrentYear(@Param("parkId") Long parkId);

    /**
     * 按小时统计-访客
     * @param parkId
     * @return
     */
    List<PlDoorPassedTimeFrameCountVO> getHourOfDay(@Param("parkId") Long parkId);

}
