package com.jasamedika.medifirst2000.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.jasamedika.medifirst2000.entities.ModulAplikasiS;

/**
* 
* @author Syamsu
*/

//@Repository("ModulAplikasiSDao")
public interface ModulAplikasiSDao extends JpaRepository<ModulAplikasiS, Integer> {

	
	ModulAplikasiS findById(@Param("id") Integer id);
	
	@Query("select model from ModulAplikasiS model where model.kdModulAplikasiHead is null order by model.modulNoUrut asc")
	List<ModulAplikasiS> findAllSubSytemOrderByModulNoUrutAsc();
	
	@Query("select model from ModulAplikasiS model where model.kdModulAplikasiHead = :kdModulAplikasi order by model.modulNoUrut asc")
	List<ModulAplikasiS> findAllSubModulOrderByModulNoUrutAsc(@Param("kdModulAplikasi") String kdModulAplikasi);
	

//	@Query("select new model from ModulAplikasiS model where model.kdModulAplikasiHead is null order by model.modulNoUrut asc")
//	List<ModulAplikasiS> findAllSubSytemOrderByModulNoUrutAsc();
}
