package com.jasamedika.medifirst2000.dao;

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.PostingJurnalTransaksi;

@Repository("PostingJurnalTransaksiDao")
public interface PostingJurnalTransaksiDao extends PagingAndSortingRepository<PostingJurnalTransaksi, String> {

	@Query("select max(jurnal.noJurnal) from PostingJurnalTransaksi jurnal ")
	Integer getNoJurnal();

	@Query("select count(p.noPosting) "
			+ "from PostingJurnalTransaksi p where extract(month from p.tglBuktiTransaksi)=:month group by extract(month from p.tglBuktiTransaksi) ")
	Long countGenerateNoPosting(@Param("month") Integer month);

}
