package de.avatic.taric.repository;

import de.avatic.taric.model.Import;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface ImportRepository extends CrudRepository<Import, Integer> {

    @Query("SELECT * FROM import WHERE nomenclature_id = :nomenclatureId AND geo_id = :geoId")
    List<Import> findByNomenclatureIdAndGeoId(Integer nomenclatureId, Integer geoId);

    @Query("SELECT * FROM import WHERE nomenclature_id = :nomenclatureId AND geo_group_id = :geoGroupId")
    List<Import> findByNomenclatureIdAndGeoGroupId(Integer nomenclatureId, Integer geoGroupId);
}
