package com.huijy.management.service.impl;

import java.util.List;

import com.huijy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.huijy.management.mapper.ShopRoomMapper;
import com.huijy.management.domain.ShopRoom;
import com.huijy.management.service.IShopRoomService;

/**
 * 酒店房间Service业务层处理
 *
 * @author lishuwen
 * @date 2021-11-10
 */
@Service
public class ShopRoomServiceImpl implements IShopRoomService {
    @Autowired
    private ShopRoomMapper shopRoomMapper;

    /**
     * 查询酒店房间
     *
     * @param id 酒店房间主键
     * @return 酒店房间
     */
    @Override
    public ShopRoom selectShopRoomById(Long id) {
        return shopRoomMapper.selectShopRoomById(id);
    }

    /**
     * 查询酒店房间列表
     *
     * @param shopRoom 酒店房间
     * @return 酒店房间
     */
    @Override
    public List<ShopRoom> selectShopRoomList(ShopRoom shopRoom) {
        return shopRoomMapper.selectShopRoomList(shopRoom);
    }

    @Override
    public List<ShopRoom> selectShopRoomByShopId(Long shopId) {
        return shopRoomMapper.selectShopRoomByShopId(shopId);
    }

    /**
     * 新增酒店房间
     *
     * @param shopRoom 酒店房间
     * @return 结果
     */
    @Override
    public int insertShopRoom(ShopRoom shopRoom) {
        shopRoom.setCreateTime(DateUtils.getNowDate());
        return shopRoomMapper.insertShopRoom(shopRoom);
    }

    /**
     * 修改酒店房间
     *
     * @param shopRoom 酒店房间
     * @return 结果
     */
    @Override
    public int updateShopRoom(ShopRoom shopRoom) {
        return shopRoomMapper.updateShopRoom(shopRoom);
    }

    /**
     * 批量删除酒店房间
     *
     * @param ids 需要删除的酒店房间主键
     * @return 结果
     */
    @Override
    public int deleteShopRoomByIds(Long[] ids) {
        return shopRoomMapper.deleteShopRoomByIds(ids);
    }

    /**
     * 删除酒店房间信息
     *
     * @param id 酒店房间主键
     * @return 结果
     */
    @Override
    public int deleteShopRoomById(Long id) {
        return shopRoomMapper.deleteShopRoomById(id);
    }
}
