package cn.palmte.work.model;

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

/**
 * @author Yuanping Zhang
 * @date 2022/08/08
 */
public interface MonthlySettleRepository extends JpaRepository<MonthlySettle, Integer> {

    @Query(value = "select * from monthly_settle where month = ?1 and project_name = ?2 limit 1", nativeQuery = true)
    MonthlySettle findByMonthAndProjectName(String time, String projectName);

//    @Query(value = "select * from monthly_settle where id = ?1 order by month desc limit 1", nativeQuery = true)
//    MonthlySettle findLatest(int id);
}
