Package org.qubership.atp.tdm.repo
Interface OccupyStatisticRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<TestDataOccupyStatistic,,UUID> org.springframework.data.jpa.repository.JpaRepository<TestDataOccupyStatistic,,UUID> org.springframework.data.repository.PagingAndSortingRepository<TestDataOccupyStatistic,,UUID> org.springframework.data.repository.query.QueryByExampleExecutor<TestDataOccupyStatistic>,org.springframework.data.repository.Repository<TestDataOccupyStatistic,UUID>
@Repository
public interface OccupyStatisticRepository
extends org.springframework.data.jpa.repository.JpaRepository<TestDataOccupyStatistic,UUID>
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteAllByRowId(List<UUID> rowIds) findAllByProjectId(UUID projectId) findAllByProjectIdAndOccupiedDateAndCountGroupBy(UUID projectId, LocalDateTime date) findAllByProjectIdAndSystemId(UUID projectId, UUID systemId) 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, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlushMethods 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
-
findAllByProjectId
@Query(value="SELECT DISTINCT ON(table_name) row_id, table_name, occupied_by, occupied_date, project_id, system_id, table_title, created_when FROM test_data_occupy_statistic WHERE project_id = :projectId ORDER BY table_name", nativeQuery=true) List<TestDataOccupyStatistic> findAllByProjectId(@Param("projectId") UUID projectId) -
findAllByProjectIdAndSystemId
@Query(value="SELECT DISTINCT ON(table_name) row_id, table_name, occupied_by, occupied_date, project_id, system_id, table_title, created_when FROM test_data_occupy_statistic WHERE project_id = :projectId AND system_id = :systemId ORDER BY table_name", nativeQuery=true) List<TestDataOccupyStatistic> findAllByProjectIdAndSystemId(@Param("projectId") UUID projectId, @Param("systemId") UUID systemId) -
deleteAllByRowId
-
findAllByProjectIdAndOccupiedDateAndCountGroupBy
@Query("SELECT NEW org.qubership.atp.tdm.model.table.TestDataOccupyReportGroupBy(c.occupiedBy, c.occupiedDate, c.tableName, COUNT(*)) FROM TestDataOccupyStatistic as c WHERE c.projectId = :projectId AND c.occupiedDate >= :date GROUP BY c.occupiedBy, c.occupiedDate, c.tableName ORDER BY c.tableName") List<TestDataOccupyReportGroupBy> findAllByProjectIdAndOccupiedDateAndCountGroupBy(@Param("projectId") UUID projectId, @Param("date") LocalDateTime date)
-