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

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yuchen.saas.park.api.entity.park.PmgLogPeopleCount;
import com.yuchen.saas.park.api.vo.park.*;
import com.yuchen.saas.park.api.vo.requestvo.requestparam.RequestParamBase;
import org.nest.springwrap.core.mp.base.BaseService;
import org.nest.springwrap.core.mp.support.Query;

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

/**
 * @author 吕海泉
 * @create 2020/12/23 17:50
 */
public interface IPeopleCountService extends BaseService<PmgLogPeopleCount> {
    Map<String, Object> getCountTime24();
    Map<String, Object> getCountTime24(Long parkId, Long buildingId, Long floorId, Long roomId);
    // 24小时访客(包含陌生人)趋势
    Map<String, Object> getVisitorCountTime24(String parkId);
    Map<String,Long> getPersonResult();
    Map<String,Long> getPersonResult(String parkId);
    AbnormalPeopleVo getAbnormalPeople();
    AbnormalPeopleVo getAbnormalPeopleByParkId(String parkId);
    // 访客分布
    List<Map<String, Object>> visitorBuildingSpread(String code);
    // 访客分布
    List<Map<String, Object>> visitorBuildingSpread(String code, String parkId);
    Long getToDayCountByCode(String code);
    // 正常体温（今日入园）
    Long getNormalPeopleCount(String temperature);

    List<PmgLogPeopleCount> getListAbnormalAndStranger();
    // 体温异常(今日入园(面板机))
    Long getAbnormalPeopleCount(String temperature);
    // 累计人数：历史所有访问/vip/内部人数，根据人员类型(访客/vip/内部)和ID(去重)
    Long getCountBycode(String code);
    // 今日访客/vip/内部，更加人员id去重
    Long getTodayCount(String code);

    /**
     * 首页-人员图像接口返回数据
     * @return
     */
    Map<String,Long> getPersonImage();

    /**
     * 首页-人员图像接口返回数据,新增路径参数 parkId
     * @return
     */
    Map<String,Long> getPersonImage(String parkId);
    // 获取指定园区本月入园人次、本月可疑人员人次、本月外部访客人次
    MonthPeopleCountVo getMonthPeopleCount(String parkId);
    // 近七天入园人次统计
    PieChartVo getSevenDayPeopleCount(String parkId);
    // 近七天访客人次(包含陌生人)
    PieChartVo getSevenDayVisitorCount(String parkId);
    // 近七天园内人员人次
    PieChartVo getSevenDayInsiderCount(String parkId);
    // 近七天VIP人员人次
    PieChartVo getSevenDayVipCount(String parkId);
    // 获取今日各类型的数量
    PeopleTodayCountVo getTodayPeopleCount(String parkId);


    /******************* 3d/bi start ****************/

    /**
     * 根据不同场景查询今日(24小时)内入园人次、访客人次、可疑人次
     * @param paramBase parkId 园区id、buildingId 楼栋id、floorId　楼层ｉｄ、
     * @param paramBase buildingId
     * @param paramBase floorId
     * @return
     */
    GetCountTime24InfoRespVo GetCountTime24InfoRespVo(RequestParamBase paramBase);


    /**
     * 根据不同场景查询今日(当前月)内入园人次、访客人次、可疑人次
     * @param paramBase
     * @return
     */
    GetCountTimeMonthInfoRespVo getCountTimeMonthInfo(RequestParamBase paramBase);



    /**
     * 人员入园分类(可疑人员、内部人员、访客、vip)分园区、楼栋、楼层场景 24小时
     * @param requestParamBase
     * @return
     */
    HashMap<String,Long> getPeopleTypeTime24(RequestParamBase requestParamBase);

    /**
     * 人员入园分类(可疑人员、内部人员、访客、vip)分园区、楼栋、楼层场景 本月
     * @param requestParamBase
     * @return
     */
    HashMap<String,Long> getPeopleTypeTimeMonth(RequestParamBase requestParamBase);

    /**
     *人员去向-园区场景时、显示栋
     * 本月
     * @param parkId
     * @return
     */
    List<Map<String,String>> getPeopleMakeForParkMonth(String parkId);

    /**
     *人员去向-园区场景时、显示栋
     * 今日
     * @param parkId
     * @return
     */
    List<Map<String,String>> getPeopleMakeForParkDay(String parkId);

    /**
     *人员去向-楼栋场景时、显示层
     * 本月
     * @param buildingId
     * @return
     */
    List<Map<String,String>> getPeopleMakeForBuildingMonth(String parkId,String buildingId);

    /**
     *人员去向-楼栋场景时、显示层
     * 今日
     * @param buildingId
     * @return
     */
    List<Map<String,String>> getPeopleMakeForBuildingDay(String parkId,String buildingId);

    /**
     *人员去向-楼层场景时、显示房间
     * 本月
     * @param floorId
     * @return
     */
    List<Map<String,String>> getPeopleMakeForRoomMonth(String parkId,String buildingId,String floorId);

    /**
     *人员去向-楼层场景时、显示房间
     * 今日
     * @param floorId
     * @return
     */
    List<Map<String,String>> getPeopleMakeForRoomDay(String parkId,String buildingId,String floorId);

    /**
     * 人员信息卡片 (访客人数、今日入园人次、今日可疑人次、昨日入园人次)
     * @param parkId
     * @return
     */
    Map<String,String> getPeopleInfo(Long parkId, Long buildingId, Long floorId);

    /**
     * 分页查询人员[code: 10000-VIP人员, 100001-内部人员, 10002-访客人员]
     * @param pmgLogPeopleCount
     * @param query
     * @return
     */
    IPage<PmgLogPeopleCount> pagePeople(PmgLogPeopleCount pmgLogPeopleCount, Query query);

    /**
     * 分页查询温度异常人员
     * @param pmgLogPeopleCount
     * @param query
     * @return
     */
    IPage<PmgLogPeopleCount> pagePeopleAbnormal(PmgLogPeopleCount pmgLogPeopleCount, Query query);

    /**
     * 查询陌生人和高频人员列表
     * @param pmgLogPeopleCount
     * @param query
     * @return
     */
    IPage<PmgLogPeopleCount> getHighFrequencyAndStranger(PmgLogPeopleCount pmgLogPeopleCount, Query query);

    /**
     * 今日体温正常人员分页查询
     * @param pmgLogPeopleCount
     * @param query
     * @return
     */
    IPage<PmgLogPeopleCount> getNormalDayPage(PmgLogPeopleCount pmgLogPeopleCount, Query query);

    /**
     * 今日体温异常人员分页查询
     * @param pmgLogPeopleCount
     * @param query
     * @return
     */
    IPage<PmgLogPeopleCount> getAbnormalDayPage(String parkId, PmgLogPeopleCount pmgLogPeopleCount, Query query);

    /**
     * 今日陌生人分页查询
     * @param pmgLogPeopleCount
     * @param query
     * @return
     */
    IPage<PmgLogPeopleCount> getStrangerDayPage(PmgLogPeopleCount pmgLogPeopleCount, Query query);

    /**
     * 获取今日安防异常行为趋势(小时-例)
     * @param parkId
     * @param buildingId
     * @param floorId
     * @return
     */
    List<GetEnvironmentInfo> getHourSecurityAbnormalToday(Long parkId, Long buildingId, Long floorId);

    /**
     * 获取本月安防异常行为趋势(天-例)
     * @param parkId
     * @param buildingId
     * @param floorId
     * @return 本月安防异常行为趋势
     */
    List<GetEnvironmentInfo> getDaySecurityAbnormalMonth(Long parkId, Long buildingId, Long floorId);

    /**
     * 获取安防异常行为数分布
     * @param parkId
     * @param buildingId
     * @param floorId
     * @return 安防异常行为数分布
     */
    Map<String, List<GetEnvironmentInfo>> getSecurityAbnormalDistribution(Long parkId, Long buildingId, Long floorId);

    /**
     * 获取异常行为列表
     * @param categoryCode
     * @param parkId
     * @param buildingId
     * @param floorId
     * @return 异常行为列表
     */
    List<AbnormalListVO> getAbnormalList(String categoryCode, Long parkId, Long buildingId, Long floorId);
}
