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.CrudRepository;
import org.springframework.stereotype.Repository;

import com.jasamedika.medifirst2000.entities.JadwalPraktikDokter;

/**
 * Repository class for JadwalPraktikDokter
 * 
 * @author Generator
 */
@Repository("JadwalPraktikDokterDao")
public interface JadwalPraktikDokterDao extends CrudRepository<JadwalPraktikDokter, Integer> {	
 	
	@Query("select new map(model.quota as quota, model.id as id"
			+ ", jadwalPraktek.id as idjadwalPraktek, jadwalPraktek.jamPraktek as jamPraktek"
			+ ",jadwalPraktek.waktumulai as waktumulai, jadwalPraktek.waktuselesai as waktuselesai" 
			+ ", hari.id as idHari, hari.namaHari as namaHari"
			+ ", ruangan.namaRuangan as namaRuangan, ruangan.id as idRuangan"
			+ ", dokter.id as idPegawai, dokter.namaLengkap as namaLengkap)"
			+ " from JadwalPraktikDokter model "
			+ " left join model.hari hari "
			+ " left join model.jadwalPraktek jadwalPraktek "
			+ " left join model.ruangan ruangan "
			+ " left join model.dokter dokter "
			+ " where model.statusEnabled = true ")
	List<Map<String,Object>> findAllJadwalPraktikDokter();
	
}
