history
This commit is contained in:
parent
a0ee8e6d95
commit
28b75b1568
|
@ -24,4 +24,7 @@ public interface HistoryDAO extends JpaRepository<History, Long> {
|
|||
Page<History> findAllByProbeAndType(@Param("probe") Probe probe, @Param("type") MetaHistoryType type, Pageable pageable);
|
||||
|
||||
Page<History> findAllByDomain(@Param("domain") Domain domain, Pageable pageRequest);
|
||||
|
||||
@Query("SELECT h FROM History h WHERE h.domain.id = :#{#domain.id} and h.type.id = :#{#type.id}")
|
||||
Page<History> findAllByDomainAndType(@Param("domain") Domain domain, @Param("type") MetaHistoryType type, Pageable pageRequest);
|
||||
}
|
||||
|
|
|
@ -44,4 +44,10 @@ public class HistoryService {
|
|||
new PageRequest(pageNo, countPerPage, new Sort(Sort.Direction.DESC, "id"));
|
||||
return this.historyDAO.findAllByDomain(domain, pageRequest);
|
||||
}
|
||||
|
||||
public Page<History> readAllByDomainAndType(Domain domain, MetaHistoryType type, int pageNo, int countPerPage) {
|
||||
Pageable pageRequest =
|
||||
new PageRequest(pageNo, countPerPage, new Sort(Sort.Direction.DESC, "id"));
|
||||
return this.historyDAO.findAllByDomainAndType(domain, type, pageRequest);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user