mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-30 01:23:08 +00:00
parent
c4bac17b83
commit
df704fb566
@ -679,7 +679,8 @@ public interface CollectionDAO {
|
|||||||
@SqlQuery(
|
@SqlQuery(
|
||||||
"SELECT json FROM thread_entity WHERE updatedAt > :before AND resolved = :resolved AND (:type IS NULL OR type = :type) AND "
|
"SELECT json FROM thread_entity WHERE updatedAt > :before AND resolved = :resolved AND (:type IS NULL OR type = :type) AND "
|
||||||
+ "id in (SELECT fromFQN FROM field_relationship WHERE "
|
+ "id in (SELECT fromFQN FROM field_relationship WHERE "
|
||||||
+ "toFQN LIKE CONCAT(:fqnPrefix, '%') AND fromType='THREAD' AND toType LIKE CONCAT(:toType, '%') AND relation= :relation) "
|
+ "(toFQN LIKE CONCAT(:fqnPrefix, '.%') OR toFQN=:fqnPrefix) AND fromType='THREAD' AND "
|
||||||
|
+ "(toType LIKE CONCAT(:toType, '.%') OR toType=:toType) AND relation= :relation) "
|
||||||
+ "ORDER BY updatedAt DESC "
|
+ "ORDER BY updatedAt DESC "
|
||||||
+ "LIMIT :limit")
|
+ "LIMIT :limit")
|
||||||
List<String> listThreadsByEntityLinkBefore(
|
List<String> listThreadsByEntityLinkBefore(
|
||||||
@ -695,7 +696,8 @@ public interface CollectionDAO {
|
|||||||
"SELECT json FROM thread_entity WHERE updatedAt < :after AND resolved = :resolved AND "
|
"SELECT json FROM thread_entity WHERE updatedAt < :after AND resolved = :resolved AND "
|
||||||
+ "(:type IS NULL OR type = :type) AND "
|
+ "(:type IS NULL OR type = :type) AND "
|
||||||
+ "id in (SELECT fromFQN FROM field_relationship WHERE "
|
+ "id in (SELECT fromFQN FROM field_relationship WHERE "
|
||||||
+ "toFQN LIKE CONCAT(:fqnPrefix, '%') AND fromType='THREAD' AND toType LIKE CONCAT(:toType, '%') AND relation= :relation) "
|
+ "(toFQN LIKE CONCAT(:fqnPrefix, '.%') OR toFQN=:fqnPrefix) AND fromType='THREAD' AND "
|
||||||
|
+ "(toType LIKE CONCAT(:toType, '.%') OR toType=:toType) AND relation= :relation) "
|
||||||
+ "ORDER BY updatedAt DESC "
|
+ "ORDER BY updatedAt DESC "
|
||||||
+ "LIMIT :limit")
|
+ "LIMIT :limit")
|
||||||
List<String> listThreadsByEntityLinkAfter(
|
List<String> listThreadsByEntityLinkAfter(
|
||||||
@ -711,7 +713,8 @@ public interface CollectionDAO {
|
|||||||
"SELECT count(id) FROM thread_entity WHERE resolved = :resolved AND "
|
"SELECT count(id) FROM thread_entity WHERE resolved = :resolved AND "
|
||||||
+ "(:type IS NULL OR type = :type) AND "
|
+ "(:type IS NULL OR type = :type) AND "
|
||||||
+ "id in (SELECT fromFQN FROM field_relationship WHERE "
|
+ "id in (SELECT fromFQN FROM field_relationship WHERE "
|
||||||
+ "toFQN LIKE CONCAT(:fqnPrefix, '%') AND fromType='THREAD' AND toType LIKE CONCAT(:toType, '%') AND relation= :relation)")
|
+ "(toFQN LIKE CONCAT(:fqnPrefix, '.%') OR toFQN=:fqnPrefix) AND fromType='THREAD' AND "
|
||||||
|
+ "(toType LIKE CONCAT(:toType, '.%') OR toType=:toType) AND relation= :relation)")
|
||||||
int listCountThreadsByEntityLink(
|
int listCountThreadsByEntityLink(
|
||||||
@Bind("fqnPrefix") String fqnPrefix,
|
@Bind("fqnPrefix") String fqnPrefix,
|
||||||
@Bind("toType") String toType,
|
@Bind("toType") String toType,
|
||||||
@ -727,7 +730,8 @@ public interface CollectionDAO {
|
|||||||
|
|
||||||
@SqlQuery(
|
@SqlQuery(
|
||||||
"SELECT entityLink, COUNT(id) count FROM field_relationship fr INNER JOIN thread_entity te ON fr.fromFQN=te.id "
|
"SELECT entityLink, COUNT(id) count FROM field_relationship fr INNER JOIN thread_entity te ON fr.fromFQN=te.id "
|
||||||
+ "WHERE fr.toFQN LIKE CONCAT(:fqnPrefix, '%') AND fr.toType like concat(:toType, '%') AND fr.fromType = :fromType "
|
+ "WHERE (fr.toFQN LIKE CONCAT(:fqnPrefix, '.%') OR fr.toFQN=:fqnPrefix) AND "
|
||||||
|
+ "(fr.toType like concat(:toType, '.%') OR fr.toType=:toType)AND fr.fromType = :fromType "
|
||||||
+ "AND fr.relation = :relation AND te.resolved= :isResolved AND (:type IS NULL OR te.type = :type) "
|
+ "AND fr.relation = :relation AND te.resolved= :isResolved AND (:type IS NULL OR te.type = :type) "
|
||||||
+ "GROUP BY entityLink")
|
+ "GROUP BY entityLink")
|
||||||
@RegisterRowMapper(CountFieldMapper.class)
|
@RegisterRowMapper(CountFieldMapper.class)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user