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

import com.ningdatech.carapi.car.vehicle.model.NdVehicleBaseInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ningdatech.carapi.car.vehicle.model.po.VehicleCompanyPO;
import com.ningdatech.carapi.car.datascreen.model.dto.DataScreenParam;
import com.ningdatech.carapi.car.datascreen.model.po.OverspeedStatisticsPO;
import com.ningdatech.carapi.homepage.entity.po.VehicleNumPO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author PoffyZhang
 * @since 2022-10-09
 */
public interface VehicleBaseInfoMapper extends BaseMapper<NdVehicleBaseInfo> {

    /**
     * 获取车牌号 通过企业ID
     * @param companyIds
     * @return
     */
    List<VehicleCompanyPO> getCarPlatesByCompanyIds(@Param("companyIds") List<String> companyIds);

    List<OverspeedStatisticsPO> getZj(@Param("param") DataScreenParam param);

    List<OverspeedStatisticsPO> getCity(@Param("param") DataScreenParam param);

    List<OverspeedStatisticsPO> getDistrict(@Param("param") DataScreenParam param);

    VehicleNumPO searchVehicleNum(@Param("param") DataScreenParam param);

    Boolean updateOfflineNotInCarPlates(@Param("cars") List<String> carsOnline);

    boolean batchUpdate(@Param("cars") List<NdVehicleBaseInfo> batchSaveCars);

    List<VehicleCompanyPO> getCarPlatesByUseCompanyId(Long companyId);
}
