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.MappingBmhpToSetAlat; @Repository("MappingBmhpToSetAlatDao") public interface MappingBmhpToSetAlatDao extends PagingAndSortingRepository { @Query("select m from MappingBmhpToSetAlat m where m.bundleSetAlat.nama=:nama ") List findByNamaAlat(@Param("nama") Integer nama); @Query("select new map(alat.id as idalat, alat.namaAlat as namaAlat, " + " satuanStandar.id as idSatuan, " + " satuanStandar.satuanStandar as satuanStandar, " + " mappingAlatToBundle.jumlah as jumlah, " + " mappingAlatToBundle.id as id) " + " from MappingBmhpToSetAlat mappingAlatToBundle "+ " left join mappingAlatToBundle.bmhp alat " + " left join mappingAlatToBundle.bundleSetAlat bundleSetAlat "+ " left join alat.satuanStandar satuanStandar " + " where bundleSetAlat.id=:idBundle and mappingAlatToBundle.statusEnabled in('true')") List> getAlatByBundle(@Param("idBundle")Integer idBundle); }