package com.yc.ship.module.product.dal.mysql.priceroommodeltype;

import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yc.ship.module.product.dal.dataobject.priceroommodeltype.PriceRoomModelTypeDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 价格模板中房型入住模式 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface PriceRoomModelTypeMapper extends BaseMapperX<PriceRoomModelTypeDO> {



    default void deleteByObjectId(Long objectId) {
        delete(new LambdaQueryWrapperX<PriceRoomModelTypeDO>().eq(PriceRoomModelTypeDO::getObjectId, objectId));
    }

    default List<PriceRoomModelTypeDO> selectByObjectId(Long objectId) {
        return selectList(new LambdaQueryWrapperX<PriceRoomModelTypeDO>().eq(PriceRoomModelTypeDO::getObjectId, objectId));
    }

    default List<PriceRoomModelTypeDO> selectByObjectIdAndRoomModelId(Long objectId, Long roomModelId) {
        return selectList(new LambdaQueryWrapperX<PriceRoomModelTypeDO>().eq(PriceRoomModelTypeDO::getObjectId, objectId).eq(PriceRoomModelTypeDO::getRoomModelId, roomModelId));
    }
}