package com.amms.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.amms.mapper.ReservationVisitorMapper;
import com.amms.domain.ReservationVisitor;
import com.amms.service.IReservationVisitorService;

/**
 * 游客预约明细Service业务层处理
 */
@Service
public class ReservationVisitorServiceImpl implements IReservationVisitorService {

    @Autowired
    private ReservationVisitorMapper reservationVisitorMapper;

    /**
     * 查询游客预约明细列表
     *
     * @param reservationVisitor 游客预约明细
     * @return 游客预约明细
     */
    @Override
    public List<ReservationVisitor> selectReservationVisitorList(ReservationVisitor reservationVisitor) {
        return reservationVisitorMapper.selectReservationVisitorList(reservationVisitor);
    }

    /**
     * 查询游客预约明细
     *
     * @param id 游客预约明细主键
     * @return 游客预约明细
     */
    @Override
    public ReservationVisitor selectReservationVisitorById(Long id) {
        return reservationVisitorMapper.selectReservationVisitorById(id);
    }

    /**
     * 新增游客预约明细
     *
     * @param reservationVisitor 游客预约明细
     * @return 结果
     */
    @Override
    public int insertReservationVisitor(ReservationVisitor reservationVisitor) {
        return reservationVisitorMapper.insertReservationVisitor(reservationVisitor);
    }

    /**
     * 修改游客预约明细
     *
     * @param reservationVisitor 游客预约明细
     * @return 结果
     */
    @Override
    public int updateReservationVisitor(ReservationVisitor reservationVisitor) {
        return reservationVisitorMapper.updateReservationVisitor(reservationVisitor);
    }

    /**
     * 删除游客预约明细信息
     *
     * @param id 游客预约明细主键
     * @return 结果
     */
    @Override
    public int deleteReservationVisitorById(Long id) {
        return reservationVisitorMapper.deleteReservationVisitorById(id);
    }

    @Override
    public int deleteReservationVisitorsByReservationId(Long reservationId) {
        // 根据预约ID批量删除其下所有游客明细记录
        return reservationVisitorMapper.deleteReservationVisitorsByReservationId(reservationId);
    }

}
