package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.proprietorCar.ProprietorCar;
import com.ruoyi.system.mapper.ProprietorCarMapper;
import com.ruoyi.system.service.IProprietorCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业主车辆管理Service业务层处理
 * 
 * @author boman
 * @date 2025-02-14
 */
@Service
public class ProprietorCarServiceImpl implements IProprietorCarService 
{
    @Autowired
    private ProprietorCarMapper proprietorCarMapper;

    /**
     * 查询业主车辆管理
     * 
     * @param carId 业主车辆管理主键
     * @return 业主车辆管理
     */
    @Override
    public ProprietorCar selectProprietorCarByCarId(Long carId)
    {
        return proprietorCarMapper.selectProprietorCarByCarId(carId);
    }

    /**
     * 查询业主车辆管理列表
     * 
     * @param proprietorCar 业主车辆管理
     * @return 业主车辆管理
     */
    @Override
    public List<ProprietorCar> selectProprietorCarList(ProprietorCar proprietorCar)
    {
        return proprietorCarMapper.selectProprietorCarList(proprietorCar);
    }

    /**
     * 新增业主车辆管理
     * 
     * @param proprietorCar 业主车辆管理
     * @return 结果
     */
    @Override
    public int insertProprietorCar(ProprietorCar proprietorCar)
    {
        proprietorCar.setCreateTime(DateUtils.getNowDate());
        return proprietorCarMapper.insertProprietorCar(proprietorCar);
    }

    /**
     * 修改业主车辆管理
     * 
     * @param proprietorCar 业主车辆管理
     * @return 结果
     */
    @Override
    public int updateProprietorCar(ProprietorCar proprietorCar)
    {
        proprietorCar.setUpdateTime(DateUtils.getNowDate());
        return proprietorCarMapper.updateProprietorCar(proprietorCar);
    }

    /**
     * 批量删除业主车辆管理
     * 
     * @param carIds 需要删除的业主车辆管理主键
     * @return 结果
     */
    @Override
    public int deleteProprietorCarByCarIds(Long[] carIds)
    {
        return proprietorCarMapper.deleteProprietorCarByCarIds(carIds);
    }

    /**
     * 删除业主车辆管理信息
     * 
     * @param carId 业主车辆管理主键
     * @return 结果
     */
    @Override
    public int deleteProprietorCarByCarId(Long carId)
    {
        return proprietorCarMapper.deleteProprietorCarByCarId(carId);
    }
}
