package com.itsol.quantrivanphong.manager.project.project.repository;

import com.itsol.quantrivanphong.model.Project;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ProjectRRepository extends JpaRepository<Project, Integer> {

    @Query(value = "SELECT p.id, p.name, p.descriptions, p.start_date, p.end_date, p.status FROM project p where p.status = 2", nativeQuery = true)
    List<Project> listProjectWorking();

    @Query(value = "SELECT p.name FROM project p where p.id = ?1", nativeQuery = true)
    String ProjectName(int projectId);






}
