package com.jianshui.platform.service.impl;

import java.util.List;
import com.jianshui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jianshui.platform.mapper.VehicleCodeMapper;
import com.jianshui.platform.domain.VehicleCode;
import com.jianshui.platform.service.IVehicleCodeService;

/**
 * 车辆编码Service业务层处理
 * 
 * @author kk
 * @date 2023-06-28
 */
@Service
public class VehicleCodeServiceImpl implements IVehicleCodeService 
{
    @Autowired
    private VehicleCodeMapper vehicleCodeMapper;

    /**
     * 查询车辆编码
     * 
     * @param id 车辆编码主键
     * @return 车辆编码
     */
    @Override
    public VehicleCode selectVehicleCodeById(Long id)
    {
        return vehicleCodeMapper.selectVehicleCodeById(id);
    }

    /**
     * 查询车辆编码列表
     * 
     * @param vehicleCode 车辆编码
     * @return 车辆编码
     */
    @Override
    public List<VehicleCode> selectVehicleCodeList(VehicleCode vehicleCode)
    {
        List<VehicleCode> vehicleCodeList = vehicleCodeMapper.selectVehicleCodeList(vehicleCode);

        return vehicleCodeMapper.selectVehicleCodeList(vehicleCode);
    }

    /**
     * 新增车辆编码
     * 
     * @param vehicleCode 车辆编码
     * @return 结果
     */
    @Override
    public int insertVehicleCode(VehicleCode vehicleCode)
    {
        vehicleCode.setCreateTime(DateUtils.getNowDate());
        return vehicleCodeMapper.insertVehicleCode(vehicleCode);
    }

    /**
     * 修改车辆编码
     * 
     * @param vehicleCode 车辆编码
     * @return 结果
     */
    @Override
    public int updateVehicleCode(VehicleCode vehicleCode)
    {
        vehicleCode.setUpdateTime(DateUtils.getNowDate());
        return vehicleCodeMapper.updateVehicleCode(vehicleCode);
    }

    /**
     * 批量删除车辆编码
     * 
     * @param ids 需要删除的车辆编码主键
     * @return 结果
     */
    @Override
    public int deleteVehicleCodeByIds(Long[] ids)
    {
        return vehicleCodeMapper.deleteVehicleCodeByIds(ids);
    }

    /**
     * 删除车辆编码信息
     * 
     * @param id 车辆编码主键
     * @return 结果
     */
    @Override
    public int deleteVehicleCodeById(Long id)
    {
        return vehicleCodeMapper.deleteVehicleCodeById(id);
    }
}
