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 ProjectVisibleRepository extends JpaRepository<ProjectVisible, Integer> {
    List<ProjectVisible> findAllByProjectIdEqualsAndTypeEquals(int projectId, int type);
    List<ProjectVisible> findAllByProjectIdEquals(int projectId);

    @Query(value = "SELECT project_id FROM project_visible WHERE type = ?1 and tid = ?2", nativeQuery = true)
    List<Integer> findProjectIdByTypeAndTid(int type,int tid);

}
