package com.yc.ship.module.resource.service.roommodelservice;

import com.yc.ship.framework.common.util.collection.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;

import java.util.*;
import com.yc.ship.module.resource.controller.admin.roommodelservice.vo.*;
import com.yc.ship.module.resource.dal.dataobject.roommodelservice.ResourceRoomModelServiceDO;
import com.yc.ship.framework.common.pojo.PageResult;
import com.yc.ship.framework.common.pojo.PageParam;
import com.yc.ship.framework.common.util.object.BeanUtils;

import com.yc.ship.module.resource.dal.mysql.roommodelservice.ResourceRoomModelServiceMapper;

import static com.yc.ship.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.yc.ship.module.resource.enums.ErrorCodeConstants.*;

/**
 * 房型服务设施 Service 实现类
 *
 * @author 管理员
 */
@Service
@Validated
public class ResourceRoomModelServiceServiceImpl implements ResourceRoomModelServiceService {

    @Resource
    private ResourceRoomModelServiceMapper roomModelServiceMapper;

    @Override
    public List<ResourceRoomModelServiceDO> getByRoomModelId(Long id) {
        return roomModelServiceMapper.selectListByRoomModelId(id);
    }

    @Override
    public List<ResourceRoomModelServiceDO> getByRoomModelIds(List<Long> roomModelIds) {
        if(CollectionUtils.isAnyEmpty(roomModelIds)) {
            return Collections.emptyList();
        }
        return roomModelServiceMapper.selectListByRoomModelIds(roomModelIds);
    }
}