|
|
|
@ -41,7 +41,8 @@ public interface AssetRepository extends JpaRepository<AssetEntity, UUID>, Expor |
|
|
|
AssetInfoEntity findAssetInfoById(@Param("assetId") UUID assetId); |
|
|
|
|
|
|
|
@Query("SELECT a FROM AssetEntity a WHERE a.tenantId = :tenantId " + |
|
|
|
"AND (:textSearch IS NULL OR ilike(a.name, CONCAT('%', :textSearch, '%')) = true)") |
|
|
|
"AND (:textSearch IS NULL OR ilike(a.name, CONCAT('%', :textSearch, '%')) = true " + |
|
|
|
" OR ilike(a.label, CONCAT('%', :textSearch, '%')) = true) ") |
|
|
|
Page<AssetEntity> findByTenantId(@Param("tenantId") UUID tenantId, |
|
|
|
@Param("textSearch") String textSearch, |
|
|
|
Pageable pageable); |
|
|
|
@ -61,7 +62,8 @@ public interface AssetRepository extends JpaRepository<AssetEntity, UUID>, Expor |
|
|
|
|
|
|
|
@Query("SELECT a FROM AssetEntity a WHERE a.tenantId = :tenantId " + |
|
|
|
"AND a.customerId = :customerId " + |
|
|
|
"AND (:textSearch IS NULL OR ilike(a.name, CONCAT('%', :textSearch, '%')) = true)") |
|
|
|
"AND (:textSearch IS NULL OR ilike(a.name, CONCAT('%', :textSearch, '%')) = true " + |
|
|
|
" OR ilike(a.label, CONCAT('%', :textSearch, '%')) = true) ") |
|
|
|
Page<AssetEntity> findByTenantIdAndCustomerId(@Param("tenantId") UUID tenantId, |
|
|
|
@Param("customerId") UUID customerId, |
|
|
|
@Param("textSearch") String textSearch, |
|
|
|
@ -69,7 +71,8 @@ public interface AssetRepository extends JpaRepository<AssetEntity, UUID>, Expor |
|
|
|
|
|
|
|
@Query("SELECT a FROM AssetEntity a WHERE a.tenantId = :tenantId " + |
|
|
|
"AND a.assetProfileId = :profileId " + |
|
|
|
"AND (:searchText IS NULL OR ilike(a.name, CONCAT('%', :searchText, '%')) = true)") |
|
|
|
"AND (:searchText IS NULL OR ilike(a.name, CONCAT('%', :searchText, '%')) = true " + |
|
|
|
" OR ilike(a.label, CONCAT('%', :searchText, '%')) = true) ") |
|
|
|
Page<AssetEntity> findByTenantIdAndProfileId(@Param("tenantId") UUID tenantId, |
|
|
|
@Param("profileId") UUID profileId, |
|
|
|
@Param("searchText") String searchText, |
|
|
|
@ -81,7 +84,9 @@ public interface AssetRepository extends JpaRepository<AssetEntity, UUID>, Expor |
|
|
|
"LEFT JOIN AssetProfileEntity p on p.id = a.assetProfileId " + |
|
|
|
"WHERE a.tenantId = :tenantId " + |
|
|
|
"AND a.customerId = :customerId " + |
|
|
|
"AND (:searchText IS NULL OR ilike(a.name, CONCAT('%', :searchText, '%')) = true)") |
|
|
|
"AND (:searchText IS NULL OR ilike(a.name, CONCAT('%', :searchText, '%')) = true " + |
|
|
|
" OR ilike(a.label, CONCAT('%', :searchText, '%')) = true " + |
|
|
|
" OR ilike(c.title, CONCAT('%', :searchText, '%')) = true) ") |
|
|
|
Page<AssetInfoEntity> findAssetInfosByTenantIdAndCustomerId(@Param("tenantId") UUID tenantId, |
|
|
|
@Param("customerId") UUID customerId, |
|
|
|
@Param("searchText") String searchText, |
|
|
|
@ -95,7 +100,8 @@ public interface AssetRepository extends JpaRepository<AssetEntity, UUID>, Expor |
|
|
|
|
|
|
|
@Query("SELECT a FROM AssetEntity a WHERE a.tenantId = :tenantId " + |
|
|
|
"AND a.type = :type " + |
|
|
|
"AND (:textSearch IS NULL OR ilike(a.name, CONCAT('%', :textSearch, '%')) = true)") |
|
|
|
"AND (:textSearch IS NULL OR ilike(a.name, CONCAT('%', :textSearch, '%')) = true " + |
|
|
|
" OR ilike(a.label, CONCAT('%', :textSearch, '%')) = true) ") |
|
|
|
Page<AssetEntity> findByTenantIdAndType(@Param("tenantId") UUID tenantId, |
|
|
|
@Param("type") String type, |
|
|
|
@Param("textSearch") String textSearch, |
|
|
|
@ -132,7 +138,8 @@ public interface AssetRepository extends JpaRepository<AssetEntity, UUID>, Expor |
|
|
|
|
|
|
|
@Query("SELECT a FROM AssetEntity a WHERE a.tenantId = :tenantId " + |
|
|
|
"AND a.customerId = :customerId AND a.type = :type " + |
|
|
|
"AND (:textSearch IS NULL OR ilike(a.name, CONCAT('%', :textSearch, '%')) = true)") |
|
|
|
"AND (:textSearch IS NULL OR ilike(a.name, CONCAT('%', :textSearch, '%')) = true " + |
|
|
|
" OR ilike(a.label, CONCAT('%', :textSearch, '%')) = true) ") |
|
|
|
Page<AssetEntity> findByTenantIdAndCustomerIdAndType(@Param("tenantId") UUID tenantId, |
|
|
|
@Param("customerId") UUID customerId, |
|
|
|
@Param("type") String type, |
|
|
|
@ -146,7 +153,9 @@ public interface AssetRepository extends JpaRepository<AssetEntity, UUID>, Expor |
|
|
|
"WHERE a.tenantId = :tenantId " + |
|
|
|
"AND a.customerId = :customerId " + |
|
|
|
"AND a.type = :type " + |
|
|
|
"AND (:textSearch IS NULL OR ilike(a.name, CONCAT('%', :textSearch, '%')) = true)") |
|
|
|
"AND (:textSearch IS NULL OR ilike(a.name, CONCAT('%', :textSearch, '%')) = true " + |
|
|
|
" OR ilike(a.label, CONCAT('%', :textSearch, '%')) = true " + |
|
|
|
" OR ilike(c.title, CONCAT('%', :textSearch, '%')) = true) ") |
|
|
|
Page<AssetInfoEntity> findAssetInfosByTenantIdAndCustomerIdAndType(@Param("tenantId") UUID tenantId, |
|
|
|
@Param("customerId") UUID customerId, |
|
|
|
@Param("type") String type, |
|
|
|
@ -160,7 +169,9 @@ public interface AssetRepository extends JpaRepository<AssetEntity, UUID>, Expor |
|
|
|
"WHERE a.tenantId = :tenantId " + |
|
|
|
"AND a.customerId = :customerId " + |
|
|
|
"AND a.assetProfileId = :assetProfileId " + |
|
|
|
"AND (:textSearch IS NULL OR ilike(a.name, CONCAT('%', :textSearch, '%')) = true)") |
|
|
|
"AND (:textSearch IS NULL OR ilike(a.name, CONCAT('%', :textSearch, '%')) = true " + |
|
|
|
" OR ilike(a.label, CONCAT('%', :textSearch, '%')) = true " + |
|
|
|
" OR ilike(c.title, CONCAT('%', :textSearch, '%')) = true) ") |
|
|
|
Page<AssetInfoEntity> findAssetInfosByTenantIdAndCustomerIdAndAssetProfileId(@Param("tenantId") UUID tenantId, |
|
|
|
@Param("customerId") UUID customerId, |
|
|
|
@Param("assetProfileId") UUID assetProfileId, |
|
|
|
@ -172,7 +183,8 @@ public interface AssetRepository extends JpaRepository<AssetEntity, UUID>, Expor |
|
|
|
@Query("SELECT a FROM AssetEntity a, RelationEntity re WHERE a.tenantId = :tenantId " + |
|
|
|
"AND a.id = re.toId AND re.toType = 'ASSET' AND re.relationTypeGroup = 'EDGE' " + |
|
|
|
"AND re.relationType = 'Contains' AND re.fromId = :edgeId AND re.fromType = 'EDGE' " + |
|
|
|
"AND (:searchText IS NULL OR ilike(a.name, CONCAT('%', :searchText, '%')) = true)") |
|
|
|
"AND (:searchText IS NULL OR ilike(a.name, CONCAT('%', :searchText, '%')) = true " + |
|
|
|
" OR ilike(a.label, CONCAT('%', :searchText, '%')) = true) ") |
|
|
|
Page<AssetEntity> findByTenantIdAndEdgeId(@Param("tenantId") UUID tenantId, |
|
|
|
@Param("edgeId") UUID edgeId, |
|
|
|
@Param("searchText") String searchText, |
|
|
|
@ -182,7 +194,8 @@ public interface AssetRepository extends JpaRepository<AssetEntity, UUID>, Expor |
|
|
|
"AND a.id = re.toId AND re.toType = 'ASSET' AND re.relationTypeGroup = 'EDGE' " + |
|
|
|
"AND re.relationType = 'Contains' AND re.fromId = :edgeId AND re.fromType = 'EDGE' " + |
|
|
|
"AND a.type = :type " + |
|
|
|
"AND (:searchText IS NULL OR ilike(a.name, CONCAT('%', :searchText, '%')) = true)") |
|
|
|
"AND (:searchText IS NULL OR ilike(a.name, CONCAT('%', :searchText, '%')) = true " + |
|
|
|
" OR ilike(a.label, CONCAT('%', :searchText, '%')) = true) ") |
|
|
|
Page<AssetEntity> findByTenantIdAndEdgeIdAndType(@Param("tenantId") UUID tenantId, |
|
|
|
@Param("edgeId") UUID edgeId, |
|
|
|
@Param("type") String type, |
|
|
|
|