package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.reservRecord.ReservRecord;
import com.ruoyi.system.mapper.ReservRecordMapper;
import com.ruoyi.system.service.IReservRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 预约记录Service业务层处理
 * 
 * @author boman
 * @date 2025-02-19
 */
@Service
public class ReservRecordServiceImpl implements IReservRecordService 
{
    @Autowired
    private ReservRecordMapper reservRecordMapper;

    /**
     * 查询预约记录
     * 
     * @param reservRecordId 预约记录主键
     * @return 预约记录
     */
    @Override
    public ReservRecord selectReservRecordByReservRecordId(Long reservRecordId)
    {
        return reservRecordMapper.selectReservRecordByReservRecordId(reservRecordId);
    }

    /**
     * 查询预约记录列表
     * 
     * @param reservRecord 预约记录
     * @return 预约记录
     */
    @Override
    public List<ReservRecord> selectReservRecordList(ReservRecord reservRecord)
    {
        return reservRecordMapper.selectReservRecordList(reservRecord);
    }

    /**
     * 新增预约记录
     * 
     * @param reservRecord 预约记录
     * @return 结果
     */
    @Override
    public int insertReservRecord(ReservRecord reservRecord)
    {
        reservRecord.setCreateTime(DateUtils.getNowDate());
        return reservRecordMapper.insertReservRecord(reservRecord);
    }

    /**
     * 修改预约记录
     * 
     * @param reservRecord 预约记录
     * @return 结果
     */
    @Override
    public int updateReservRecord(ReservRecord reservRecord)
    {
        reservRecord.setUpdateTime(DateUtils.getNowDate());
        return reservRecordMapper.updateReservRecord(reservRecord);
    }

    /**
     * 批量删除预约记录
     * 
     * @param reservRecordIds 需要删除的预约记录主键
     * @return 结果
     */
    @Override
    public int deleteReservRecordByReservRecordIds(Long[] reservRecordIds)
    {
        return reservRecordMapper.deleteReservRecordByReservRecordIds(reservRecordIds);
    }

    /**
     * 删除预约记录信息
     * 
     * @param reservRecordId 预约记录主键
     * @return 结果
     */
    @Override
    public int deleteReservRecordByReservRecordId(Long reservRecordId)
    {
        return reservRecordMapper.deleteReservRecordByReservRecordId(reservRecordId);
    }
}
