package de.avatic.taric.repository;

import de.avatic.taric.model.AppliedMeasure;
import org.springframework.data.jdbc.core.mapping.AggregateReference;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository;

import de.avatic.taric.model.MeasureExclusion;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface MeasureExclusionRepository extends CrudRepository<MeasureExclusion, Integer>
{

    @Query("SELECT * FROM measure_exclusion WHERE applied_measure_id = :appliedMeasureId")
    List<MeasureExclusion> findByAppliedMeasure(@Param("appliedMeasureId") AggregateReference<AppliedMeasure, Integer> appliedMeasureRef);


}
