package com.yc.ship.module.resource.dal.mysql.roommodelservice;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.module.resource.dal.dataobject.roommodelservice.ResourceRoomModelServiceDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 房型服务设施 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface ResourceRoomModelServiceMapper extends BaseMapperX<ResourceRoomModelServiceDO> {


    default void deleteServiceByRoomModelId(Long modelId) {
        delete(new LambdaQueryWrapper<ResourceRoomModelServiceDO>()
                .eq(ResourceRoomModelServiceDO::getRoomModelId, modelId));
    }

    default List<ResourceRoomModelServiceDO> selectListByRoomModelId(Long roomModelId) {
        return selectList(new LambdaQueryWrapper<ResourceRoomModelServiceDO>()
                .eq(ResourceRoomModelServiceDO::getRoomModelId, roomModelId));
    }

    default List<ResourceRoomModelServiceDO> selectListByRoomModelIds(List<Long> roomModelIds) {
        return selectList(new LambdaQueryWrapper<ResourceRoomModelServiceDO>()
                .in(ResourceRoomModelServiceDO::getRoomModelId, roomModelIds));
    }
}