Penambahan service tabel acuan iki untuk kelompok jabatan medis karena batas iki maksimal 2
39 lines
1.5 KiB
Java
39 lines
1.5 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.TabelAcuanIndeksIKI;
|
|
|
|
@Repository("AcuanIndeksIKIDao")
|
|
public interface TabelAcuanIndeksIKIDao extends PagingAndSortingRepository<TabelAcuanIndeksIKI, String> {
|
|
|
|
@Query("select tabelAcuanIndeksIKI " + "from TabelAcuanIndeksIKI tabelAcuanIndeksIKI ")
|
|
public List<TabelAcuanIndeksIKI> findAllAcuan();
|
|
|
|
@Query("select new Map(aiki.indeks as indeks,aiki.kriteria as kriteria) " + "from TabelAcuanIndeksIKI aiki "
|
|
+ "where aiki.statusEnabled is true " + "and ((:hasil between aiki.nilaiBawah and aiki.nilaiAtas) "
|
|
+ "or (:hasil > 1000 and aiki.nilaiAtas = 1000))")
|
|
public Map<String, Object> findIKI(@Param("hasil") Double hasil);
|
|
|
|
String strAcuanIki = "select new Map(aiki.nilaiBawah as nilaiBawah,aiki.nilaiAtas as nilaiAtas,"
|
|
+ "aiki.indeks as iki,aiki.kriteria as kriteria) " + "from TabelAcuanIndeksIKI aiki "
|
|
+ "where aiki.statusEnabled is true";
|
|
|
|
String whrIki = " and aiki.indeks <= :batasAtasIndeks";
|
|
|
|
String ordIki = " order by aiki.indeks";
|
|
|
|
@Query(strAcuanIki + ordIki)
|
|
public List<Map<String, Object>> findAllAcuanIndeks();
|
|
|
|
@Query(strAcuanIki + whrIki + ordIki)
|
|
public List<Map<String, Object>> findAllAcuanIndeks(@Param("batasAtasIndeks") Double indeksBatasAtas);
|
|
|
|
}
|