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 ProjectBudgetCostManageRepository extends JpaRepository<ProjectBudgetCostManage,Integer> {
    List<ProjectBudgetCostManage> findAllByProjectIdEquals(int id);

    @Query(value = "select sum(cost_tax_exclude) from project_budget_cost_manage where type = ?", nativeQuery = true)
    BigDecimal costTaxExcludeSum(int type);


    @Query(value = "select * from project_budget_cost_manage where project_id in ?1", nativeQuery = true)
    List<ProjectBudgetCostManage> findAllByProjectIds(List<Integer> projectInt);
}
