Skip to content

Commit

Permalink
fix(check_data): fix references to column "active"
Browse files Browse the repository at this point in the history
  • Loading branch information
mguzman14 committed Jan 15, 2025
1 parent b41bcf0 commit a738bae
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ws/fct/ws_gw_fct_graphanalytics_check_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ BEGIN
-- dma : check coherence against nodetype.graphdelimiter and nodeparent defined on dma.graphconfig (fid: 180)
v_querytext ='SELECT node_id, nodecat_id, the_geom, a.active, '||v_edit||'node.expl_id FROM '||v_edit||'node JOIN cat_node c ON id=nodecat_id JOIN cat_feature_node n ON n.id=c.nodetype_id
LEFT JOIN (SELECT node_id, active FROM '||v_edit||'node JOIN (SELECT (json_array_elements_text((graphconfig::json->>''use'')::json))::json->>''nodeParent'' as node_id,
active FROM '||v_edit||'dma WHERE graphconfig IS NOT NULL )a USING (node_id)) a USING (node_id) WHERE graph_delimiter=''DMA'' AND (a.node_id IS NULL
OR node_id NOT IN (SELECT (json_array_elements_text((graphconfig::json->>''ignore'')::json))::text FROM '||v_edit||'dma WHERE active IS TRUE))
active FROM dma WHERE graphconfig IS NOT NULL )a USING (node_id)) a USING (node_id) WHERE graph_delimiter=''DMA'' AND (a.node_id IS NULL
OR node_id NOT IN (SELECT (json_array_elements_text((graphconfig::json->>''ignore'')::json))::text FROM dma WHERE active IS TRUE))
AND '||v_edit||'node.state > 0 and verified<>''2'' and (a.active is null or a.active is false)';

EXECUTE concat('SELECT count(*) FROM (',v_querytext,')a') INTO v_count;
Expand Down Expand Up @@ -267,8 +267,8 @@ BEGIN
-- dqa : check coherence against nodetype.graphdelimiter and nodeparent defined on dqa.graphconfig (fid: 181)
v_querytext = 'SELECT node_id, nodecat_id, the_geom, a.active, '||v_edit||'node.expl_id FROM '||v_edit||'node JOIN cat_node c ON id=nodecat_id JOIN cat_feature_node n ON n.id=c.nodetype_id
LEFT JOIN (SELECT node_id, active FROM '||v_edit||'node JOIN (SELECT (json_array_elements_text((graphconfig::json->>''use'')::json))::json->>''nodeParent'' as node_id,
active FROM '||v_edit||'dqa WHERE graphconfig IS NOT NULL )a USING (node_id)) a USING (node_id) WHERE graph_delimiter=''DQA'' AND (a.node_id IS NULL
OR node_id NOT IN (SELECT (json_array_elements_text((graphconfig::json->>''ignore'')::json))::text FROM '||v_edit||'dqa WHERE active IS TRUE))
active FROM dqa WHERE graphconfig IS NOT NULL )a USING (node_id)) a USING (node_id) WHERE graph_delimiter=''DQA'' AND (a.node_id IS NULL
OR node_id NOT IN (SELECT (json_array_elements_text((graphconfig::json->>''ignore'')::json))::text FROM dqa WHERE active IS TRUE))
AND '||v_edit||'node.state > 0 and verified<>''2'' and (a.active is null or a.active is false)';

EXECUTE concat('SELECT count(*) FROM (',v_querytext,')a') INTO v_count;
Expand Down Expand Up @@ -320,8 +320,8 @@ BEGIN
-- presszone : check coherence between nodetype.graphdelimiter and nodeparent defined on presszone.graphconfig (fid: 182)
v_querytext = 'SELECT node_id, nodecat_id, the_geom, a.active,'||v_edit||'node.expl_id FROM '||v_edit||'node JOIN cat_node c ON id=nodecat_id JOIN cat_feature_node n ON n.id=c.nodetype_id
LEFT JOIN (SELECT node_id, active FROM '||v_edit||'node JOIN (SELECT (json_array_elements_text((graphconfig::json->>''use'')::json))::json->>''nodeParent'' as node_id,
active FROM '||v_edit||'presszone WHERE graphconfig IS NOT NULL )a USING (node_id)) a USING (node_id) WHERE graph_delimiter=''PRESSZONE'' AND (a.node_id IS NULL
OR node_id NOT IN (SELECT (json_array_elements_text((graphconfig::json->>''ignore'')::json))::text FROM '||v_edit||'presszone WHERE active IS TRUE))
active FROM presszone WHERE graphconfig IS NOT NULL )a USING (node_id)) a USING (node_id) WHERE graph_delimiter=''PRESSZONE'' AND (a.node_id IS NULL
OR node_id NOT IN (SELECT (json_array_elements_text((graphconfig::json->>''ignore'')::json))::text FROM presszone WHERE active IS TRUE))
AND '||v_edit||'node.state > 0 and verified<>''2'' and (a.active is null or a.active is false)';

EXECUTE concat('SELECT count(*) FROM (',v_querytext,')a') INTO v_count;
Expand Down

0 comments on commit a738bae

Please sign in to comment.