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 TypeMethodDescriptionlongcountByStatus(WebsiteCrawlStatus status) 统计指定状态的任务数量longcountByWebsiteUid(String websiteUid) 统计指定网站的任务数量voiddeleteByWebsiteUid(String websiteUid) 删除指定网站的所有任务查找正在运行的任务根据状态查找任务findByTaskId(String taskId) 根据任务ID查找任务findByWebsiteUidAndStatusOrderByCreatedAtDesc(String websiteUid, WebsiteCrawlStatus status) 根据网站UID和状态查找任务findByWebsiteUidOrderByCreatedAtDesc(String websiteUid) 根据网站UID查找任务findLatestByWebsiteUid(String websiteUid) 查找指定网站的最新任务Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
count, delete, exists, findAll, findAll, findAll, findAll, findBy, findOneMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByTaskId
根据任务ID查找任务 -
findByWebsiteUidOrderByCreatedAtDesc
根据网站UID查找任务 -
findByStatusOrderByCreatedAtDesc
根据状态查找任务 -
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
统计指定网站的任务数量 -
countByStatus
统计指定状态的任务数量 -
deleteByWebsiteUid
删除指定网站的所有任务
-