package com.jasamedika.medifirst2000.dao;

import java.util.Map;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.jasamedika.medifirst2000.entities.FileDirectory;

@Repository("FileDirectoryDao")
public interface FileDirectoryDao extends CrudRepository<FileDirectory, String>{

	@Query("select NEW Map("
			+ "a.noRec as noRec,"
			+ "a.file as file,"
			+ "a.fileTape as fileTape) "
			+ "from FileDirectory a "
			+ "left join a.noRegistrasi b "
			+ "where b.noRec=:noRec")
	Map<String, Object> getOneByNoRegistrasi(@Param("noRec") String noRec);
}
