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.ConferenceRoomMapper;
import com.ruoyi.system.domain.ConferenceRoom;
import com.ruoyi.system.service.IConferenceRoomService;

/**
 * 会议室Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-23
 */
@Service
public class ConferenceRoomServiceImpl implements IConferenceRoomService 
{
    @Autowired
    private ConferenceRoomMapper conferenceRoomMapper;

    /**
     * 查询会议室
     * 
     * @param conferenceRoomId 会议室主键
     * @return 会议室
     */
    @Override
    public ConferenceRoom selectConferenceRoomByConferenceRoomId(Long conferenceRoomId)
    {
        return conferenceRoomMapper.selectConferenceRoomByConferenceRoomId(conferenceRoomId);
    }

    /**
     * 查询会议室列表
     * 
     * @param conferenceRoom 会议室
     * @return 会议室
     */
    @Override
    public List<ConferenceRoom> selectConferenceRoomList(ConferenceRoom conferenceRoom)
    {
        return conferenceRoomMapper.selectConferenceRoomList(conferenceRoom);
    }

    /**
     * 新增会议室
     * 
     * @param conferenceRoom 会议室
     * @return 结果
     */
    @Override
    public int insertConferenceRoom(ConferenceRoom conferenceRoom)
    {
        conferenceRoom.setCreateTime(DateUtils.getNowDate());
        return conferenceRoomMapper.insertConferenceRoom(conferenceRoom);
    }

    /**
     * 修改会议室
     * 
     * @param conferenceRoom 会议室
     * @return 结果
     */
    @Override
    public int updateConferenceRoom(ConferenceRoom conferenceRoom)
    {
        conferenceRoom.setUpdateTime(DateUtils.getNowDate());
        return conferenceRoomMapper.updateConferenceRoom(conferenceRoom);
    }

    /**
     * 批量删除会议室
     * 
     * @param conferenceRoomIds 需要删除的会议室主键
     * @return 结果
     */
    @Override
    public int deleteConferenceRoomByConferenceRoomIds(Long[] conferenceRoomIds)
    {
        return conferenceRoomMapper.deleteConferenceRoomByConferenceRoomIds(conferenceRoomIds);
    }

    /**
     * 删除会议室信息
     * 
     * @param conferenceRoomId 会议室主键
     * @return 结果
     */
    @Override
    public int deleteConferenceRoomByConferenceRoomId(Long conferenceRoomId)
    {
        return conferenceRoomMapper.deleteConferenceRoomByConferenceRoomId(conferenceRoomId);
    }
}
