package com.evobms.project.VehicleData.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.evobms.project.VehicleData.mapper.VehicleDataMapper;
import com.evobms.project.VehicleData.domain.VehicleData;
import com.evobms.project.VehicleData.service.IVehicleDataService;

/**
 * 整车数据Service业务层处理
 *
 * @author 田志阳
 * @date 2025-11-15
 */
@Service
public class VehicleDataServiceImpl implements IVehicleDataService
{
    @Autowired
    private VehicleDataMapper vehicleDataMapper;

    /**
     * 查询整车数据
     *
     * @param id 整车数据主键
     * @return 整车数据
     */
    @Override
    public VehicleData selectVehicleDataById(Long id)
    {
        return vehicleDataMapper.selectVehicleDataById(id);
    }

    /**
     * 查询整车数据列表
     *
     * @param vehicleData 整车数据
     * @return 整车数据
     */
    @Override
    public List<VehicleData> selectVehicleDataList(VehicleData vehicleData)
    {
        return vehicleDataMapper.selectVehicleDataList(vehicleData);
    }

    /**
     * 新增整车数据
     *
     * @param vehicleData 整车数据
     * @return 结果
     */
    @Override
    public int insertVehicleData(VehicleData vehicleData)
    {
        return vehicleDataMapper.insertVehicleData(vehicleData);
    }

    /**
     * 修改整车数据
     *
     * @param vehicleData 整车数据
     * @return 结果
     */
    @Override
    public int updateVehicleData(VehicleData vehicleData)
    {
        return vehicleDataMapper.updateVehicleData(vehicleData);
    }

    /**
     * 批量删除整车数据
     *
     * @param ids 需要删除的整车数据主键
     * @return 结果
     */
    @Override
    public int deleteVehicleDataByIds(Long[] ids)
    {
        return vehicleDataMapper.deleteVehicleDataByIds(ids);
    }

    /**
     * 删除整车数据信息
     *
     * @param id 整车数据主键
     * @return 结果
     */
    @Override
    public int deleteVehicleDataById(Long id)
    {
        return vehicleDataMapper.deleteVehicleDataById(id);
    }

    @Override
    public List<VehicleData> selectByDeviceAndStartTime(String deviceId, Date startTime) {
        return vehicleDataMapper.selectByDeviceAndStartTime(deviceId, startTime);
    }

    @Override
    public VehicleData selectLatestByDeviceId(String deviceId) {
        return vehicleDataMapper.selectLatestByDeviceId(deviceId);
    }
}
