package cn.palmte.work.model;

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

import java.math.BigDecimal;
import java.util.List;

public interface ProjectBudgetIncomePlanDetailRepository extends JpaRepository<ProjectBudgetIncomePlanDetail,Integer> {
    List<ProjectBudgetIncomePlanDetail> findAllByProjectIdEquals(int id);

    @Query(value = "select sum(receive_amount) from project_budget_income_plan_detail where project_id = ?1", nativeQuery = true)
    BigDecimal findReceiveAmountByProject(int projectId);
}
