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

import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yc.ship.module.resource.dal.dataobject.roommodelrooms.ResourceRoomModelRoomsDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ResourceRoomModelRoomsMapper extends BaseMapperX<ResourceRoomModelRoomsDO> {
    default void deleteByRoomId(Long id) {
        delete(new LambdaQueryWrapperX<ResourceRoomModelRoomsDO>()
                .eq(ResourceRoomModelRoomsDO::getRoomId, id));
    }

    default void deleteByRoomModelId(Long modelId) {
        delete(new LambdaQueryWrapperX<ResourceRoomModelRoomsDO>()
                .eq(ResourceRoomModelRoomsDO::getRoomModelId, modelId));
    }

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