package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.visitor.VisitorRecords;
import com.ruoyi.system.mapper.VisitorRecordsMapper;
import com.ruoyi.system.service.IVisitorRecordsService;
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 VisitorRecordsServiceImpl implements IVisitorRecordsService 
{
    @Autowired
    private VisitorRecordsMapper visitorRecordsMapper;

    /**
     * 查询访客车辆登记
     * 
     * @param visitorRecordsId 访客车辆登记主键
     * @return 访客车辆登记
     */
    @Override
    public VisitorRecords selectVisitorRecordsByVisitorRecordsId(Long visitorRecordsId)
    {
        return visitorRecordsMapper.selectVisitorRecordsByVisitorRecordsId(visitorRecordsId);
    }

    /**
     * 查询访客车辆登记列表
     * 
     * @param visitorRecords 访客车辆登记
     * @return 访客车辆登记
     */
    @Override
    public List<VisitorRecords> selectVisitorRecordsList(VisitorRecords visitorRecords)
    {
        return visitorRecordsMapper.selectVisitorRecordsList(visitorRecords);
    }

    /**
     * 新增访客车辆登记
     * 
     * @param visitorRecords 访客车辆登记
     * @return 结果
     */
    @Override
    public int insertVisitorRecords(VisitorRecords visitorRecords)
    {
        visitorRecords.setCreateTime(DateUtils.getNowDate());
        return visitorRecordsMapper.insertVisitorRecords(visitorRecords);
    }

    /**
     * 修改访客车辆登记
     * 
     * @param visitorRecords 访客车辆登记
     * @return 结果
     */
    @Override
    public int updateVisitorRecords(VisitorRecords visitorRecords)
    {
        visitorRecords.setUpdateTime(DateUtils.getNowDate());
        return visitorRecordsMapper.updateVisitorRecords(visitorRecords);
    }

    /**
     * 批量删除访客车辆登记
     * 
     * @param visitorRecordsIds 需要删除的访客车辆登记主键
     * @return 结果
     */
    @Override
    public int deleteVisitorRecordsByVisitorRecordsIds(Long[] visitorRecordsIds)
    {
        return visitorRecordsMapper.deleteVisitorRecordsByVisitorRecordsIds(visitorRecordsIds);
    }

    /**
     * 删除访客车辆登记信息
     * 
     * @param visitorRecordsId 访客车辆登记主键
     * @return 结果
     */
    @Override
    public int deleteVisitorRecordsByVisitorRecordsId(Long visitorRecordsId)
    {
        return visitorRecordsMapper.deleteVisitorRecordsByVisitorRecordsId(visitorRecordsId);
    }
}
