赵士淞
2023-01-03 4f034304f5e0ca231d31c4208932af6804a4e5a8
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskUserRepository.java
@@ -52,4 +52,20 @@
     */
    @Query(value = "SELECT user_id FROM task_user WHERE task_id = ?1", nativeQuery = true)
    List<Long> findUserIdByTaskId(Long taskId);
    /**
     * 根据用户ID查询项目ID
     * @param userId
     * @return
     */
    @Query(value = "SELECT project_id FROM task_user WHERE user_id = ?1", nativeQuery = true)
    List<Long> findProjectIdByUserId(Long userId);
    /**
     * 根据用户ID、项目ID查询任务ID
     * @param userId
     * @return
     */
    @Query(value = "SELECT task_id FROM task_user WHERE user_id = ?1 AND project_id = ?2", nativeQuery = true)
    List<Long> findTaskIdByUserIdAndProjectId(Long userId, Long projectId);
}