package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BomanReservatMapper;
import com.ruoyi.system.domain.BomanReservat;
import com.ruoyi.system.service.IBomanReservatService;

/**
 * 预约Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-27
 */
@Service
public class BomanReservatServiceImpl implements IBomanReservatService 
{
    @Autowired
    private BomanReservatMapper bomanReservatMapper;

    /**
     * 查询预约
     * 
     * @param reservatId 预约主键
     * @return 预约
     */
    @Override
    public BomanReservat selectBomanReservatByReservatId(Long reservatId)
    {
        return bomanReservatMapper.selectBomanReservatByReservatId(reservatId);
    }

    /**
     * 查询预约列表
     * 
     * @param bomanReservat 预约
     * @return 预约
     */
    @Override
    public List<BomanReservat> selectBomanReservatList(BomanReservat bomanReservat)
    {
        return bomanReservatMapper.selectBomanReservatList(bomanReservat);
    }

    /**
     * 新增预约
     * 
     * @param bomanReservat 预约
     * @return 结果
     */
    @Override
    public int insertBomanReservat(BomanReservat bomanReservat)
    {
        bomanReservat.setCreateTime(DateUtils.getNowDate());
        return bomanReservatMapper.insertBomanReservat(bomanReservat);
    }

    /**
     * 修改预约
     * 
     * @param bomanReservat 预约
     * @return 结果
     */
    @Override
    public int updateBomanReservat(BomanReservat bomanReservat)
    {
        bomanReservat.setUpdateTime(DateUtils.getNowDate());
        return bomanReservatMapper.updateBomanReservat(bomanReservat);
    }

    /**
     * 批量删除预约
     * 
     * @param reservatIds 需要删除的预约主键
     * @return 结果
     */
    @Override
    public int deleteBomanReservatByReservatIds(Long[] reservatIds)
    {
        return bomanReservatMapper.deleteBomanReservatByReservatIds(reservatIds);
    }

    /**
     * 删除预约信息
     * 
     * @param reservatId 预约主键
     * @return 结果
     */
    @Override
    public int deleteBomanReservatByReservatId(Long reservatId)
    {
        return bomanReservatMapper.deleteBomanReservatByReservatId(reservatId);
    }
}
