package com.jasamedika.medifirst2000.dao;

import com.jasamedika.medifirst2000.entities.KomponenGaji;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

/**
 * @author salmanoe
 * @since Jan 30, 2023
 * 
 */
public interface KomponenGajiDao extends JpaRepository<KomponenGaji, Integer> {
	@Query("select new Map(kg.id as id,kg.namaKomponen as namaKomponen) " + "from KomponenGaji kg "
			+ "where kg.urutan is not null " + "order by kg.urutan")
	List<Map<String, Object>> findLabelByUrutan();

	@Query("select kg from KomponenGaji kg " + "where kg.urutan is not null " + "order by kg.urutan")
	List<KomponenGaji> findByUrutan();
}
