
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.DetailJenisLimbah;

/**
 * Repository class for Departemen
 * 
 * @author Roberto
 */
@Repository("DetailJenisLimbahDao")
public interface DetailJenisLimbahDao extends PagingAndSortingRepository<DetailJenisLimbah, String> {

	@Query("select new map("
			+ "coalesce(p.noRec,'-') as noRec,"
			+ "coalesce(jenisLibahB3Masuk.jenisLimbahB3masuk,'-') as jenisLimbahB3Masuk,"
			+ "coalesce(p.jumlah,0.0) as jumlah"
			+ ")"
			+ "from DetailJenisLimbah p "
			+ "left join p.jenisLimbahB3Masuk jenisLibahB3Masuk "
			+ "where p.neracaLimbah.noRec=:noRec")
	List<Map<String, Object>> findNeracaById(@Param("noRec") String noRec);

}
