package com.srs.stureg.service.impl;

import java.util.List;
import com.srs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.srs.stureg.mapper.CheckRoomMapper;
import com.srs.stureg.domain.CheckRoom;
import com.srs.stureg.service.ICheckRoomService;

/**
 * 入住信息Service业务层处理
 * 
 * @author 邓
 * @date 2023-05-20
 */
@Service
public class CheckRoomServiceImpl implements ICheckRoomService 
{
    @Autowired
    private CheckRoomMapper checkRoomMapper;

    /**
     * 查询入住信息
     * 
     * @param id 入住信息主键
     * @return 入住信息
     */
    @Override
    public CheckRoom selectCheckRoomById(Long id)
    {
        return checkRoomMapper.selectCheckRoomById(id);
    }

    /**
     * 查询入住信息列表
     * 
     * @param checkRoom 入住信息
     * @return 入住信息
     */
    @Override
    public List<CheckRoom> selectCheckRoomList(CheckRoom checkRoom)
    {
        return checkRoomMapper.selectCheckRoomList(checkRoom);
    }

    /**
     * 新增入住信息
     * 
     * @param checkRoom 入住信息
     * @return 结果
     */
    @Override
    public int insertCheckRoom(CheckRoom checkRoom)
    {
        checkRoom.setCreateTime(DateUtils.getNowDate());
        return checkRoomMapper.insertCheckRoom(checkRoom);
    }

    /**
     * 修改入住信息
     * 
     * @param checkRoom 入住信息
     * @return 结果
     */
    @Override
    public int updateCheckRoom(CheckRoom checkRoom)
    {
        checkRoom.setUpdateTime(DateUtils.getNowDate());
        return checkRoomMapper.updateCheckRoom(checkRoom);
    }

    /**
     * 批量删除入住信息
     * 
     * @param ids 需要删除的入住信息主键
     * @return 结果
     */
    @Override
    public int deleteCheckRoomByIds(Long[] ids)
    {
        return checkRoomMapper.deleteCheckRoomByIds(ids);
    }

    /**
     * 删除入住信息信息
     * 
     * @param id 入住信息主键
     * @return 结果
     */
    @Override
    public int deleteCheckRoomById(Long id)
    {
        return checkRoomMapper.deleteCheckRoomById(id);
    }
}
