package cn.palmte.work.model;

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

import java.util.List;

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

    @Query(value = "select sum(amount) from project_budget_cost_detail where project_id = ?1", nativeQuery = true)
    Integer findAmountByProject(int projectId);}
