Update tabelAcuanIndeksIKIDao

Penambahan service tabel acuan iki untuk kelompok jabatan medis karena batas iki maksimal 2
This commit is contained in:
Salman Manoe 2022-02-01 16:05:31 +07:00
parent 817a508d2f
commit 90fca1aca7
2 changed files with 19 additions and 10 deletions

View File

@ -21,9 +21,18 @@ public interface TabelAcuanIndeksIKIDao extends PagingAndSortingRepository<Tabel
+ "or (:hasil > 1000 and aiki.nilaiAtas = 1000))")
public Map<String, Object> findIKI(@Param("hasil") Double hasil);
@Query("select new Map(aiki.nilaiBawah as nilaiBawah,aiki.nilaiAtas as nilaiAtas,"
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 " + "order by aiki.indeks")
+ "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);
}

View File

@ -5,35 +5,35 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;
@Entity
@Table(name = "tabelAcuanIndeksIKI")
public class TabelAcuanIndeksIKI extends BaseMaster{
public class TabelAcuanIndeksIKI extends BaseMaster {
@Caption(value = "nilaiBawah")
@Column(name = "nilaiBawah", nullable = false)
private Double nilaiBawah;
@Caption(value = "nilaiAtas")
@Column(name = "nilaiAtas", nullable = false)
private Double nilaiAtas;
@Caption(value = "indeks")
@Column(name = "indeks", nullable = false)
private Double indeks;
@Caption(value = "kriteria")
@Column(name = "kriteria", nullable = true)
private String kriteria;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.TabelAcuanIndeksIKI_m_id_seq")
@javax.persistence.SequenceGenerator(name = "public.TabelAcuanIndeksIKI_m_id_seq", sequenceName = "public.TabelAcuanIndeksIKI_m_id_seq", allocationSize = 1)
@SequenceGenerator(name = "public.TabelAcuanIndeksIKI_m_id_seq", sequenceName = "public.TabelAcuanIndeksIKI_m_id_seq", allocationSize = 1)
@Column(name = "id")
protected Integer id;