hibernate UUID cast removed for AlarmRepository and DeviceRepository
This commit is contained in:
parent
1f5c95a375
commit
c4918d97c9
@ -57,7 +57,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
"AND (:endTime IS NULL OR (a.createdTime <= :endTime AND ea.createdTime <= :endTime)) " +
|
||||
"AND ((:clearFilterEnabled) = FALSE OR a.cleared = :clearFilter) " +
|
||||
"AND ((:ackFilterEnabled) = FALSE OR a.acknowledged = :ackFilter) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = uuid(:assigneeId)) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = :assigneeId) " +
|
||||
"AND (:searchText IS NULL OR (ilike(a.type, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.severity, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.status, CONCAT('%', :searchText, '%')) = true)) "
|
||||
@ -74,7 +74,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
"AND (:endTime IS NULL OR (a.createdTime <= :endTime AND ea.createdTime <= :endTime)) " +
|
||||
"AND ((:clearFilterEnabled) = FALSE OR a.cleared = :clearFilter) " +
|
||||
"AND ((:ackFilterEnabled) = FALSE OR a.acknowledged = :ackFilter) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = uuid(:assigneeId)) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = :assigneeId) " +
|
||||
"AND (:searchText IS NULL OR (ilike(a.type, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.severity, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.status, CONCAT('%', :searchText, '%')) = true))")
|
||||
@ -87,7 +87,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
@Param("clearFilter") boolean clearFilter,
|
||||
@Param("ackFilterEnabled") boolean ackFilterEnabled,
|
||||
@Param("ackFilter") boolean ackFilter,
|
||||
@Param("assigneeId") String assigneeId,
|
||||
@Param("assigneeId") UUID assigneeId,
|
||||
@Param("searchText") String searchText,
|
||||
Pageable pageable);
|
||||
|
||||
@ -106,7 +106,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
// "AND ((:alarmSeverities) IS NULL OR a.severity IN (:alarmSeverities)) " +
|
||||
"AND ((:clearFilterEnabled) = FALSE OR a.cleared = :clearFilter) " +
|
||||
"AND ((:ackFilterEnabled) = FALSE OR a.acknowledged = :ackFilter) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = uuid(:assigneeId)) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = :assigneeId) " +
|
||||
"AND (:searchText IS NULL OR (ilike(a.type, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.severity, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.status, CONCAT('%', :searchText, '%')) = true)) "
|
||||
@ -127,7 +127,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
// "AND ((:alarmSeverities) IS NULL OR a.severity IN (:alarmSeverities)) " +
|
||||
"AND ((:clearFilterEnabled) = FALSE OR a.cleared = :clearFilter) " +
|
||||
"AND ((:ackFilterEnabled) = FALSE OR a.acknowledged = :ackFilter) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = uuid(:assigneeId)) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = :assigneeId) " +
|
||||
"AND (:searchText IS NULL OR (ilike(a.type, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.severity, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.status, CONCAT('%', :searchText, '%')) = true))")
|
||||
@ -142,7 +142,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
@Param("clearFilter") boolean clearFilter,
|
||||
@Param("ackFilterEnabled") boolean ackFilterEnabled,
|
||||
@Param("ackFilter") boolean ackFilter,
|
||||
@Param("assigneeId") String assigneeId,
|
||||
@Param("assigneeId") UUID assigneeId,
|
||||
@Param("searchText") String searchText,
|
||||
Pageable pageable);
|
||||
|
||||
@ -153,7 +153,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
"AND (:endTime IS NULL OR a.createdTime <= :endTime) " +
|
||||
"AND ((:clearFilterEnabled) = FALSE OR a.cleared = :clearFilter) " +
|
||||
"AND ((:ackFilterEnabled) = FALSE OR a.acknowledged = :ackFilter) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = uuid(:assigneeId)) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = :assigneeId) " +
|
||||
"AND (:searchText IS NULL OR (ilike(a.type, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.severity, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.status, CONCAT('%', :searchText, '%')) = true)) ",
|
||||
@ -165,7 +165,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
"AND (:endTime IS NULL OR a.createdTime <= :endTime) " +
|
||||
"AND ((:clearFilterEnabled) = FALSE OR a.cleared = :clearFilter) " +
|
||||
"AND ((:ackFilterEnabled) = FALSE OR a.acknowledged = :ackFilter) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = uuid(:assigneeId)) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = :assigneeId) " +
|
||||
"AND (:searchText IS NULL OR (ilike(a.type, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.severity, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.status, CONCAT('%', :searchText, '%')) = true))")
|
||||
@ -176,7 +176,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
@Param("clearFilter") boolean clearFilter,
|
||||
@Param("ackFilterEnabled") boolean ackFilterEnabled,
|
||||
@Param("ackFilter") boolean ackFilter,
|
||||
@Param("assigneeId") String assigneeId,
|
||||
@Param("assigneeId") UUID assigneeId,
|
||||
@Param("searchText") String searchText,
|
||||
Pageable pageable);
|
||||
|
||||
@ -191,7 +191,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
// "AND ((:alarmSeverities) IS NULL OR a.severity IN (:alarmSeverities)) " +
|
||||
"AND ((:clearFilterEnabled) = FALSE OR a.cleared = :clearFilter) " +
|
||||
"AND ((:ackFilterEnabled) = FALSE OR a.acknowledged = :ackFilter) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = uuid(:assigneeId)) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = :assigneeId) " +
|
||||
"AND (:searchText IS NULL OR (ilike(a.type, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.severity, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.status, CONCAT('%', :searchText, '%')) = true)) ",
|
||||
@ -207,7 +207,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
// "AND ((:alarmSeverities) IS NULL OR a.severity IN (:alarmSeverities)) " +
|
||||
"AND ((:clearFilterEnabled) = FALSE OR a.cleared = :clearFilter) " +
|
||||
"AND ((:ackFilterEnabled) = FALSE OR a.acknowledged = :ackFilter) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = uuid(:assigneeId)) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = :assigneeId) " +
|
||||
"AND (:searchText IS NULL OR (ilike(a.type, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.severity, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.status, CONCAT('%', :searchText, '%')) = true))")
|
||||
@ -220,7 +220,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
@Param("clearFilter") boolean clearFilter,
|
||||
@Param("ackFilterEnabled") boolean ackFilterEnabled,
|
||||
@Param("ackFilter") boolean ackFilter,
|
||||
@Param("assigneeId") String assigneeId,
|
||||
@Param("assigneeId") UUID assigneeId,
|
||||
@Param("searchText") String searchText,
|
||||
Pageable pageable);
|
||||
|
||||
@ -231,7 +231,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
"AND (:endTime IS NULL OR a.createdTime <= :endTime) " +
|
||||
"AND ((:clearFilterEnabled) = FALSE OR a.cleared = :clearFilter) " +
|
||||
"AND ((:ackFilterEnabled) = FALSE OR a.acknowledged = :ackFilter) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = uuid(:assigneeId)) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = :assigneeId) " +
|
||||
"AND (:searchText IS NULL OR (ilike(a.type, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.severity, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.status, CONCAT('%', :searchText, '%')) = true)) "
|
||||
@ -244,7 +244,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
"AND (:endTime IS NULL OR a.createdTime <= :endTime) " +
|
||||
"AND ((:clearFilterEnabled) = FALSE OR a.cleared = :clearFilter) " +
|
||||
"AND ((:ackFilterEnabled) = FALSE OR a.acknowledged = :ackFilter) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = uuid(:assigneeId)) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = :assigneeId) " +
|
||||
"AND (:searchText IS NULL OR (ilike(a.type, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.severity, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.status, CONCAT('%', :searchText, '%')) = true))")
|
||||
@ -256,7 +256,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
@Param("clearFilter") boolean clearFilter,
|
||||
@Param("ackFilterEnabled") boolean ackFilterEnabled,
|
||||
@Param("ackFilter") boolean ackFilter,
|
||||
@Param("assigneeId") String assigneeId,
|
||||
@Param("assigneeId") UUID assigneeId,
|
||||
@Param("searchText") String searchText,
|
||||
Pageable pageable);
|
||||
|
||||
@ -271,7 +271,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
// "AND ((:alarmSeverities) IS NULL OR a.severity IN (:alarmSeverities)) " +
|
||||
"AND ((:clearFilterEnabled) = FALSE OR a.cleared = :clearFilter) " +
|
||||
"AND ((:ackFilterEnabled) = FALSE OR a.acknowledged = :ackFilter) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = uuid(:assigneeId)) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = :assigneeId) " +
|
||||
"AND (:searchText IS NULL OR (ilike(a.type, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.severity, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.status, CONCAT('%', :searchText, '%')) = true)) "
|
||||
@ -288,7 +288,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
// "AND ((:alarmSeverities) IS NULL OR a.severity IN (:alarmSeverities)) " +
|
||||
"AND ((:clearFilterEnabled) = FALSE OR a.cleared = :clearFilter) " +
|
||||
"AND ((:ackFilterEnabled) = FALSE OR a.acknowledged = :ackFilter) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = uuid(:assigneeId)) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = :assigneeId) " +
|
||||
"AND (:searchText IS NULL OR (ilike(a.type, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.severity, CONCAT('%', :searchText, '%')) = true " +
|
||||
" OR ilike(a.status, CONCAT('%', :searchText, '%')) = true))")
|
||||
@ -302,7 +302,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
@Param("clearFilter") boolean clearFilter,
|
||||
@Param("ackFilterEnabled") boolean ackFilterEnabled,
|
||||
@Param("ackFilter") boolean ackFilter,
|
||||
@Param("assigneeId") String assigneeId,
|
||||
@Param("assigneeId") UUID assigneeId,
|
||||
@Param("searchText") String searchText,
|
||||
Pageable pageable);
|
||||
|
||||
@ -314,7 +314,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
"AND ea.entityType = :affectedEntityType " +
|
||||
"AND ((:clearFilterEnabled) = FALSE OR a.cleared = :clearFilter) " +
|
||||
"AND ((:ackFilterEnabled) = FALSE OR a.acknowledged = :ackFilter) " +
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = uuid(:assigneeId))")
|
||||
"AND (:assigneeId IS NULL OR a.assigneeId = :assigneeId)")
|
||||
Set<AlarmSeverity> findAlarmSeverities(@Param("tenantId") UUID tenantId,
|
||||
@Param("affectedEntityId") UUID affectedEntityId,
|
||||
@Param("affectedEntityType") String affectedEntityType,
|
||||
@ -322,7 +322,7 @@ public interface AlarmRepository extends JpaRepository<AlarmEntity, UUID> {
|
||||
@Param("clearFilter") boolean clearFilter,
|
||||
@Param("ackFilterEnabled") boolean ackFilterEnabled,
|
||||
@Param("ackFilter") boolean ackFilter,
|
||||
@Param("assigneeId") String assigneeId);
|
||||
@Param("assigneeId") UUID assigneeId);
|
||||
|
||||
@Query("SELECT a.id FROM AlarmEntity a WHERE a.tenantId = :tenantId AND a.createdTime < :time AND a.endTs < :time")
|
||||
Page<UUID> findAlarmsIdsByEndTsBeforeAndTenantId(@Param("time") Long time, @Param("tenantId") UUID tenantId, Pageable pageable);
|
||||
|
||||
@ -154,7 +154,7 @@ public class JpaAlarmDao extends JpaAbstractDao<AlarmEntity, Alarm> implements A
|
||||
asf.hasClearFilter() && asf.getClearFilter(),
|
||||
asf.hasAckFilter(),
|
||||
asf.hasAckFilter() && asf.getAckFilter(),
|
||||
DaoUtil.getStringId(query.getAssigneeId()),
|
||||
DaoUtil.getId(query.getAssigneeId()),
|
||||
query.getPageLink().getTextSearch(),
|
||||
DaoUtil.toPageable(query.getPageLink())
|
||||
)
|
||||
@ -169,7 +169,7 @@ public class JpaAlarmDao extends JpaAbstractDao<AlarmEntity, Alarm> implements A
|
||||
asf.hasClearFilter() && asf.getClearFilter(),
|
||||
asf.hasAckFilter(),
|
||||
asf.hasAckFilter() && asf.getAckFilter(),
|
||||
DaoUtil.getStringId(query.getAssigneeId()),
|
||||
DaoUtil.getId(query.getAssigneeId()),
|
||||
query.getPageLink().getTextSearch(),
|
||||
DaoUtil.toPageable(query.getPageLink())
|
||||
)
|
||||
@ -191,7 +191,7 @@ public class JpaAlarmDao extends JpaAbstractDao<AlarmEntity, Alarm> implements A
|
||||
asf.hasClearFilter() && asf.getClearFilter(),
|
||||
asf.hasAckFilter(),
|
||||
asf.hasAckFilter() && asf.getAckFilter(),
|
||||
DaoUtil.getStringId(query.getAssigneeId()),
|
||||
DaoUtil.getId(query.getAssigneeId()),
|
||||
query.getPageLink().getTextSearch(),
|
||||
DaoUtil.toPageable(query.getPageLink())
|
||||
)
|
||||
@ -219,7 +219,7 @@ public class JpaAlarmDao extends JpaAbstractDao<AlarmEntity, Alarm> implements A
|
||||
asf.hasClearFilter() && asf.getClearFilter(),
|
||||
asf.hasAckFilter(),
|
||||
asf.hasAckFilter() && asf.getAckFilter(),
|
||||
DaoUtil.getStringId(query.getAssigneeId()),
|
||||
DaoUtil.getId(query.getAssigneeId()),
|
||||
query.getPageLink().getTextSearch(),
|
||||
DaoUtil.toPageable(query.getPageLink())
|
||||
)
|
||||
@ -236,7 +236,7 @@ public class JpaAlarmDao extends JpaAbstractDao<AlarmEntity, Alarm> implements A
|
||||
asf.hasClearFilter() && asf.getClearFilter(),
|
||||
asf.hasAckFilter(),
|
||||
asf.hasAckFilter() && asf.getAckFilter(),
|
||||
DaoUtil.getStringId(query.getAssigneeId()),
|
||||
DaoUtil.getId(query.getAssigneeId()),
|
||||
query.getPageLink().getTextSearch(),
|
||||
DaoUtil.toPageable(query.getPageLink())
|
||||
)
|
||||
@ -262,7 +262,7 @@ public class JpaAlarmDao extends JpaAbstractDao<AlarmEntity, Alarm> implements A
|
||||
asf.hasClearFilter() && asf.getClearFilter(),
|
||||
asf.hasAckFilter(),
|
||||
asf.hasAckFilter() && asf.getAckFilter(),
|
||||
DaoUtil.getStringId(query.getAssigneeId()),
|
||||
DaoUtil.getId(query.getAssigneeId()),
|
||||
query.getPageLink().getTextSearch(),
|
||||
DaoUtil.toPageable(query.getPageLink())
|
||||
)
|
||||
@ -281,7 +281,7 @@ public class JpaAlarmDao extends JpaAbstractDao<AlarmEntity, Alarm> implements A
|
||||
asf.hasClearFilter() && asf.getClearFilter(),
|
||||
asf.hasAckFilter(),
|
||||
asf.hasAckFilter() && asf.getAckFilter(),
|
||||
assigneeId);
|
||||
UUID.fromString(assigneeId));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -126,20 +126,20 @@ public interface DeviceRepository extends JpaRepository<DeviceEntity, UUID>, Exp
|
||||
|
||||
@Query("SELECT d FROM DeviceInfoEntity d " +
|
||||
"WHERE d.tenantId = :tenantId " +
|
||||
"AND (:customerId IS NULL OR d.customerId = uuid(:customerId)) " +
|
||||
"AND (:edgeId IS NULL OR d.id IN (SELECT re.toId FROM RelationEntity re WHERE re.toType = 'DEVICE' AND re.relationTypeGroup = 'EDGE' AND re.relationType = 'Contains' AND re.fromType = 'EDGE' AND re.fromId = uuid(:edgeId))) " +
|
||||
"AND (:customerId IS NULL OR d.customerId = :customerId) " +
|
||||
"AND (:edgeId IS NULL OR d.id IN (SELECT re.toId FROM RelationEntity re WHERE re.toType = 'DEVICE' AND re.relationTypeGroup = 'EDGE' AND re.relationType = 'Contains' AND re.fromType = 'EDGE' AND re.fromId = :edgeId)) " +
|
||||
"AND ((:deviceType) IS NULL OR d.type = :deviceType) " +
|
||||
"AND (:deviceProfileId IS NULL OR d.deviceProfileId = uuid(:deviceProfileId)) " +
|
||||
"AND (:deviceProfileId IS NULL OR d.deviceProfileId = :deviceProfileId) " +
|
||||
"AND ((:filterByActive) = FALSE OR d.active = :deviceActive) " +
|
||||
"AND (:textSearch IS NULL OR ilike(d.name, CONCAT('%', :textSearch, '%')) = true " +
|
||||
"OR ilike(d.label, CONCAT('%', :textSearch, '%')) = true " +
|
||||
"OR ilike(d.type, CONCAT('%', :textSearch, '%')) = true " +
|
||||
"OR ilike(d.customerTitle, CONCAT('%', :textSearch, '%')) = true)")
|
||||
Page<DeviceInfoEntity> findDeviceInfosByFilter(@Param("tenantId") UUID tenantId,
|
||||
@Param("customerId") String customerId,
|
||||
@Param("edgeId") String edgeId,
|
||||
@Param("customerId") UUID customerId,
|
||||
@Param("edgeId") UUID edgeId,
|
||||
@Param("deviceType") String type,
|
||||
@Param("deviceProfileId") String deviceProfileId,
|
||||
@Param("deviceProfileId") UUID deviceProfileId,
|
||||
@Param("filterByActive") boolean filterByActive,
|
||||
@Param("deviceActive") boolean active,
|
||||
@Param("textSearch") String textSearch,
|
||||
|
||||
@ -110,10 +110,10 @@ public class JpaDeviceDao extends JpaAbstractDao<DeviceEntity, Device> implement
|
||||
return DaoUtil.toPageData(
|
||||
deviceRepository.findDeviceInfosByFilter(
|
||||
filter.getTenantId().getId(),
|
||||
DaoUtil.getStringId(filter.getCustomerId()),
|
||||
DaoUtil.getStringId(filter.getEdgeId()),
|
||||
DaoUtil.getId(filter.getCustomerId()),
|
||||
DaoUtil.getId(filter.getEdgeId()),
|
||||
filter.getType(),
|
||||
DaoUtil.getStringId(filter.getDeviceProfileId()),
|
||||
DaoUtil.getId(filter.getDeviceProfileId()),
|
||||
filter.getActive() != null,
|
||||
Boolean.TRUE.equals(filter.getActive()),
|
||||
pageLink.getTextSearch(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user