package com.jasamedika.medifirst2000.dao;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
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.DetailSWOT;

@Repository("DetailSWOTDao")
public interface DetailSWOTDao extends PagingAndSortingRepository<DetailSWOT,Integer>,JpaSpecificationExecutor{

	@Query("Select SUM(model.skor) from DetailSWOT model where model.swot.id = :faktorId and awalPeriode =:awalPeriode")
	public Double getTotalSkor(@Param("faktorId")Integer faktorId, @Param("awalPeriode") Integer awalPeriode);
}
