package com.yc.ship.module.product.service.priceroommodel;

import com.yc.ship.module.product.dal.dataobject.priceroommodel.PriceRoomModelDO;
import com.yc.ship.module.product.dal.mysql.priceroommodel.PriceRoomModelMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;
import java.util.List;

/**
 * 价格模板中房型加价设置 Service 实现类
 *
 * @author 管理员
 */
@Service
@Validated
public class PriceRoomModelServiceImpl implements PriceRoomModelService {

    @Resource
    private PriceRoomModelMapper priceRoomModelMapper;


    @Override
    public void deletePriceRoomModel(Long id) {
        // 删除
        priceRoomModelMapper.deleteById(id);
    }

    @Override
    public PriceRoomModelDO getPriceRoomModel(Long id) {
        return priceRoomModelMapper.selectById(id);
    }

    @Override
    public List<PriceRoomModelDO> getListByObjectId(Long objectId) {
        return priceRoomModelMapper.selectListByObjectId(objectId);
    }

    @Override
    public PriceRoomModelDO getListByObjectIdAndRoomModelId(Long id, Long roomModelId) {
        return priceRoomModelMapper.selectListByObjectIdAndRoomModelId(id, roomModelId);
    }


}