Interface WebsiteCrawlTaskRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<WebsiteCrawlTask,Long>, org.springframework.data.jpa.repository.JpaRepository<WebsiteCrawlTask,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<WebsiteCrawlTask>, org.springframework.data.repository.ListCrudRepository<WebsiteCrawlTask,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<WebsiteCrawlTask,Long>, org.springframework.data.repository.PagingAndSortingRepository<WebsiteCrawlTask,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<WebsiteCrawlTask>, org.springframework.data.repository.Repository<WebsiteCrawlTask,Long>

public interface WebsiteCrawlTaskRepository extends org.springframework.data.jpa.repository.JpaRepository<WebsiteCrawlTask,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<WebsiteCrawlTask>
抓取任务数据访问层
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor

    org.springframework.data.jpa.repository.JpaSpecificationExecutor.SpecificationFluentQuery<T extends Object>
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    统计指定状态的任务数量
    long
    统计指定网站的任务数量
    void
    删除指定网站的所有任务
    查找正在运行的任务
    根据状态查找任务
    根据任务ID查找任务
    根据网站UID和状态查找任务
    根据网站UID查找任务
    查找指定网站的最新任务

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor

    count, delete, exists, findAll, findAll, findAll, findAll, findBy, findOne

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByTaskId

      Optional<WebsiteCrawlTask> findByTaskId(String taskId)
      根据任务ID查找任务
    • findByWebsiteUidOrderByCreatedAtDesc

      List<WebsiteCrawlTask> findByWebsiteUidOrderByCreatedAtDesc(String websiteUid)
      根据网站UID查找任务
    • findByStatusOrderByCreatedAtDesc

      List<WebsiteCrawlTask> findByStatusOrderByCreatedAtDesc(WebsiteCrawlStatus status)
      根据状态查找任务
    • findActiveTasks

      @Query("SELECT t FROM WebsiteCrawlTask t WHERE t.status IN (\'RUNNING\', \'PENDING\') ORDER BY t.createdAt DESC") List<WebsiteCrawlTask> findActiveTasks()
      查找正在运行的任务
    • findByWebsiteUidAndStatusOrderByCreatedAtDesc

      List<WebsiteCrawlTask> findByWebsiteUidAndStatusOrderByCreatedAtDesc(String websiteUid, WebsiteCrawlStatus status)
      根据网站UID和状态查找任务
    • findLatestByWebsiteUid

      @Query("SELECT t FROM WebsiteCrawlTask t WHERE t.websiteUid = :websiteUid ORDER BY t.createdAt DESC LIMIT 1") Optional<WebsiteCrawlTask> findLatestByWebsiteUid(@Param("websiteUid") String websiteUid)
      查找指定网站的最新任务
    • countByWebsiteUid

      long countByWebsiteUid(String websiteUid)
      统计指定网站的任务数量
    • countByStatus

      long countByStatus(WebsiteCrawlStatus status)
      统计指定状态的任务数量
    • deleteByWebsiteUid

      void deleteByWebsiteUid(String websiteUid)
      删除指定网站的所有任务