package com.ningdatech.carapi.car.datascreen.mapper;

import com.ningdatech.carapi.car.datascreen.model.dto.DataScreenParam;
import com.ningdatech.carapi.car.datascreen.model.po.*;
import com.ningdatech.carapi.common.model.KeyValueDTO;
import com.ningdatech.carapi.common.model.po.MapDataPO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Classname VehicleStatisticsMapper
 * @Description
 * @Date 2022/10/22 15:57
 * @Created by PoffyZhang
 */
public interface VehicleStatisticsMapper {

    List<VehicleTypeStatisticsPO> getTypesStatistics(@Param("param") DataScreenParam param);

    /**
     * 查浙江省 各个市的区域车辆数
     *
     * @return
     */
    List<RegionDistributionStatisticsPO> getZjRegionsStatistics(@Param("param") DataScreenParam param);

    /**
     * 保险公司分布
     *
     * @param param
     * @return
     */
    List<InsureDistributionStatisticsPO> getInsureDistribution(@Param("param") DataScreenParam param);

    /**
     * 运营商分布
     *
     * @param param
     * @return
     */
    List<OperatorDistributionStatisticsPO> getOperatorDistribution(@Param("param") DataScreenParam param);

    /**
     * 年度车辆新增分布
     *
     * @param param
     * @return
     */
    List<YearVehicleStatisticsPO> getNewVehicleDistribution(@Param("param") DataScreenParam param);

    /**
     * 根据公司ids 查询车辆总数
     *
     * @param param
     * @return
     */
    Long getVehicleNums(@Param("param") DataScreenParam param);

    List<KeyValueDTO<Long, Long>>  getVehicleNumsGroupByRegion(@Param("param") DataScreenParam param);


    List<MapDataPO> getOverspeedRegions(@Param("param") DataScreenParam param);

    List<MapDataPO> getViolationRegions(@Param("param") DataScreenParam param);

    List<MapDataPO> getOutDangerRegions(@Param("param") DataScreenParam param);

    List<MapDataPO> getInjuriesRegion(@Param("param") DataScreenParam param);

    List<MapDataPO> getDeathRegion(@Param("param") DataScreenParam param);

    List<OnlineVehicleTimesPO> getOnlineRateToday(@Param("param") DataScreenParam param, @Param("tableName") String tableName);

    List<OnlineVehicleRegionsPO> getVehicleOnlineRegions(@Param("param") DataScreenParam param);

    List<VehicleUsefulLifeStatisticsPO> getVehicleUsefulLife(@Param("param") DataScreenParam param);
}
