package com.jasamedika.medifirst2000.dao;

import java.util.List;
import java.util.Map;

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

import com.jasamedika.medifirst2000.entities.RIS_Report;

@Repository("RIS_ReportDao")
public interface RIS_ReportDao extends PagingAndSortingRepository<RIS_Report, Integer>{
	
	@Query("select new Map ( report.CONFIRM_DATE as confirmDate, "+
			"report.CONFIRM_DOC_NAME as confirmDoctor, "+
			"report.REPORT_TEXT as reportText, "+
			"report.CONCLUSION as conclusion, "+
			"report.CREATE_DATE as createDate, "+
			"report.ACCESSION_NUM as accesion_num, "+
			"report.READ_DATE as readDate) "+
			"from RIS_Report report "+
			"where substring(report.CREATE_DATE,1,8) between :startDate and :endDate")
	List<Map<String,Object>> getReportByTglCreate(@Param("startDate") String startDate,@Param("endDate") String endDate);

}
