package com.ningdatech.carapi.driver.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.carapi.car.datascreen.model.dto.DataScreenParam;
import com.ningdatech.carapi.common.model.po.MapDataPO;
import com.ningdatech.carapi.driver.entity.DriverInfo;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author LiuXinXin
 * @since 2022-10-09
 */
public interface IDriverInfoService extends IService<DriverInfo> {

    Map<Long, DriverInfo> listDriverInfoByIds(Collection<Long> ids);

    /**
     * 驾驶员年龄分布计算
     *
     * @param caseSql      年龄区间计算SQL
     * @param undefinedAge 不参与统计的年龄
     * @param param
     * @return key 年龄、value 驾驶员数量
     * @author WendyYang
     **/
    Map<Integer, Integer> driverAgeStatistics(String caseSql, Integer undefinedAge, DataScreenParam param);

    /**
     * 驾驶员驾龄分布计算
     *
     * @param caseSql      驾龄区间计算SQL
     * @param undefinedAge 不参与统计的驾龄
     * @param param
     * @return key 驾龄、value 驾驶员数量
     * @author WendyYang
     **/
    Map<Integer, Integer> drivingExperienceStatistics(String caseSql, Integer undefinedAge,DataScreenParam param);

    Long selectUserIdById(Long driverId);

    Map<String, DriverInfo> listByIdCard(List<String> idCards);

    List<MapDataPO> diverCountByRegion(DataScreenParam param);

    List<Map<String, Object>> nativePlaceStatisticsByRegion(DataScreenParam param);
}
