41 lines
2.0 KiB
Java
41 lines
2.0 KiB
Java
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.PelayananPasienPetugas;
|
|
|
|
/**
|
|
* Repository class for PelayananPasien
|
|
*
|
|
* @author Generator
|
|
*/
|
|
@Repository("PelayananPasienPetugasDao")
|
|
public interface PelayananPasienPetugasDao extends PagingAndSortingRepository<PelayananPasienPetugas, String> {
|
|
|
|
@Query("select new Map(ppp.pelayananPasienId as pelayananId, count(ppp.pelayananPasienId) as sumPelayananId) "
|
|
+ "from PelayananPasienPetugas ppp " + "inner join ppp.pelayananPasien pp "
|
|
+ "where ppp.statusEnabled is true " + "and pp.statusEnabled is true "
|
|
+ "and ppp.ObjectJenisPetugasPeId in (4,6) " + "and ppp.pelayananPasienId in (:listPelayananId) "
|
|
+ "group by ppp.pelayananPasienId " + "having count(ppp.pelayananPasienId) > 1")
|
|
List<Map<String, Object>> countReferensiSkorPelayananAnestesi(
|
|
@Param("listPelayananId") List<String> listPelayananId);
|
|
|
|
@Query("select new Map(ppp.pelayananPasienId as pelayananId," + "ppp.ObjectJenisPetugasPeId as jenisPetugasId,"
|
|
+ "ppp.ObjectPegawaiId as petugasId," + "coalesce(ppp.asaId,1) as asaId,"
|
|
+ "mj.subUnitKerjaPegawaiId as kkId," + "pp.produkId as produkId) " + "from PelayananPasienPetugas ppp, "
|
|
+ "MapPegawaiJabatanToUnitKerja mj " + "inner join ppp.pelayananPasien pp "
|
|
+ "where ppp.ObjectPegawaiId = mj.pegawaiId " + "and ppp.statusEnabled is true "
|
|
+ "and pp.statusEnabled is true " + "and mj.statusEnabled is true "
|
|
+ "and ppp.ObjectJenisPetugasPeId in (4,6) " + "and ppp.pelayananPasienId in (:listPelayananId) "
|
|
+ "and mj.unitKerjaPegawaiId in (:listKsmId) " + "order by ppp.pelayananPasienId")
|
|
List<Map<String, Object>> findReferensiSkorPelayananAnestesi(@Param("listPelayananId") List<String> listPelayananId,
|
|
@Param("listKsmId") List<Integer> listKsmId);
|
|
|
|
}
|