35 lines
1.2 KiB
Java
35 lines
1.2 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.JenisBahan;
|
|
|
|
@Repository("JenisBahanDao")
|
|
public interface JenisBahanDao extends PagingAndSortingRepository<JenisBahan, Integer>{
|
|
@Query("select count(a.id) from JenisBahan a")
|
|
public Integer getCount();
|
|
|
|
@Query("select new map(a.id as id, " +
|
|
" a.namaExternal as namaExternal, " +
|
|
" a.jenisBahan as jenisBahan, " +
|
|
" a.kdJenisBahan as kdJenisBahan, " +
|
|
" a.kodeExternal as kodeExternal) " +
|
|
" from JenisBahan a where a.statusEnabled in('true')")
|
|
public List<Map<String, Object>> getAll();
|
|
|
|
@Query("select new map(a.id as id, " +
|
|
" a.namaExternal as namaExternal, " +
|
|
" a.jenisBahan as jenisBahan, " +
|
|
" a.kdJenisBahan as kdJenisBahan, " +
|
|
" a.kodeExternal as kodeExternal) " +
|
|
" from JenisBahan a where a.id=:id and a.statusEnabled in('true')")
|
|
public Map<String, Object> getJenisBahanById(@Param("id")Integer id);
|
|
|
|
}
|