package org.dromara.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.dromara.domain.SenAlgorithmConfig;
import org.dromara.domain.SenEvents;
import org.dromara.domain.SenEventsObject;
import org.dromara.domain.vo.SenAlgorithmConfigVo;
import org.dromara.domain.vo.SenEventsVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;

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

/**
 * 事件信息Mapper接口
 *
 * @author luogang
 * @date 2024-09-19
 */
@Mapper
public interface SenEventsMapper extends BaseMapperPlus<SenEvents, SenEventsVo> {

    HashMap<String, Object> selectEventsCount();

    List<HashMap<String,Object>> importantEventsStat(@Param(Constants.WRAPPER) Wrapper<SenEvents> queryWrapper);

    List<HashMap<String, Object>> motorInLanesTop10(@Param(Constants.WRAPPER) LambdaQueryWrapper<SenEvents> queryWrapper);

    HashMap<String, Object> motorInLanesCount(@Param(Constants.WRAPPER) LambdaQueryWrapper<SenEvents> queryWrapper);

    List<Map<String,Object>> eventPercentTop10();

    List<Map<String, Object>> eventMonthCount();

    List<Map<String, Object>> eventDayCount();

    List<HashMap<String, Object>> pointEventsStat(@Param(Constants.WRAPPER) LambdaQueryWrapper<SenEvents> queryWrapper);

    List<HashMap<String, Object>> regionEventsStat(@Param("dateType") String dateType);

    List<HashMap<String, Object>> minuteEventsStat(@Param(Constants.WRAPPER) LambdaQueryWrapper<SenEvents> queryWrapper);

    List<HashMap<String, Object>> eventsDatasourceStat(@Param(Constants.WRAPPER) LambdaQueryWrapper<SenEvents> queryWrapper);

    List<HashMap<String, Object>> eventsHourStat( @Param(Constants.WRAPPER) LambdaQueryWrapper<SenEvents> queryWrapper);

    List<HashMap<String, Object>> eventsDealRateStat(@Param(Constants.WRAPPER) LambdaQueryWrapper<SenEvents> queryWrapper);

    Page<Map<String, Object>> cycleEventStat(Page<SenEvents>  page, @Param("ew") Wrapper<SenEvents> queryWrapper);

    Page<Map<String, Object>> keyVehicleEventStat(Page<SenEventsObject> page, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("ew")LambdaQueryWrapper<SenEventsObject> queryWrapper);
}
