Skip to content

Commit

Permalink
Merge pull request #48 from Indicia-Team/hotfix-nbn_downloads
Browse files Browse the repository at this point in the history
Hotfix nbn downloads
  • Loading branch information
johnvanbreda committed Nov 25, 2015
2 parents a36933c + 1a0cf5b commit baa0ed5
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions reports/library/occurrences/filterable_nbn_exchange.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ select #columns#
from cache_occurrences o
join samples s on s.id=o.sample_id
left join (index_locations_samples ils
join locations vc on vc.id=ils.location_id
join locations vc on vc.id=ils.location_id and coalesce(vc.code, '') not like '%+%'
join cache_termlists_terms ctt on ctt.id=vc.location_type_id and ctt.term='Vice County'
) on ils.sample_id=o.sample_id and ils.contains=true
left join groups g1 on g1.id=o.group_id and g1.deleted=false
Expand All @@ -20,7 +20,7 @@ and o.date_type in ('D','DD','O','OO','Y','YY','-Y','U')
and (s.entered_sref_system ilike 'osgb' or s.entered_sref_system ilike 'osie' or s.entered_sref_system = '4326' or s.entered_sref_system = '27700')
and o.taxa_taxon_list_external_key is not null
and st_x(st_transform(st_centroid(public_geom), 4326)) between -14 and 13
and st_y(st_transform(st_centroid(public_geom), 4326)) between -48 and 62
and st_y(st_transform(st_centroid(public_geom), 4326)) between 48 and 62
#idlist#
</query>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
JOIN cache_taxa_taxon_lists cttl on cttl.id=o.taxa_taxon_list_id
JOIN samples s on s.id=o.sample_id AND s.deleted=false
LEFT JOIN (index_locations_samples ils
JOIN locations vc on vc.id=ils.location_id
JOIN locations vc on vc.id=ils.location_id and coalesce(vc.code, '') not like '%+%'
JOIN cache_termlists_terms ctt on ctt.id=vc.location_type_id AND ctt.term='Vice County'
) on ils.sample_id=o.sample_id and ils.contains=true
LEFT JOIN (occurrence_attribute_values det_full_val
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
JOIN occurrences occ on occ.id=o.id and occ.deleted=false -- to get comments
JOIN samples s on s.id=o.sample_id AND s.deleted=false
LEFT JOIN (index_locations_samples ils
JOIN locations vc on vc.id=ils.location_id
JOIN locations vc on vc.id=ils.location_id and coalesce(vc.code, '') not like '%+%'
JOIN cache_termlists_terms ctt on ctt.id=vc.location_type_id AND ctt.term='Vice County'
) on ils.sample_id=o.sample_id and ils.contains=true
LEFT JOIN (occurrence_attribute_values det_full_val
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
JOIN cache_taxa_taxon_lists cttl on cttl.id=o.taxa_taxon_list_id
JOIN samples s on s.id=o.sample_id AND s.deleted=false
LEFT JOIN (index_locations_samples ils
JOIN locations vc on vc.id=ils.location_id
JOIN locations vc on vc.id=ils.location_id and coalesce(vc.code, '') not like '%+%'
JOIN cache_termlists_terms ctt on ctt.id=vc.location_type_id AND ctt.term='Vice County'
) on ils.sample_id=o.sample_id and ils.contains=true
LEFT JOIN (occurrence_attribute_values det_full_val
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
JOIN cache_taxa_taxon_lists cttl on cttl.id=o.taxa_taxon_list_id
JOIN samples s on s.id=o.sample_id AND s.deleted=false
LEFT JOIN (index_locations_samples ils
JOIN locations vc on vc.id=ils.location_id
JOIN locations vc on vc.id=ils.location_id and coalesce(vc.code, '') not like '%+%'
JOIN cache_termlists_terms ctt on ctt.id=vc.location_type_id AND ctt.term='Vice County'
) on ils.sample_id=o.sample_id and ils.contains=true
LEFT JOIN (occurrence_attribute_values det_full_val
Expand Down
4 changes: 2 additions & 2 deletions reports/library/occurrences/nbn_exchange.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ from cache_occurrences co
join occurrences o on o.id=co.id -- ensure we have the latest status. Would not be needed if cache_occurrences reflects updated immediately
join samples s on s.id=o.sample_id
left join (index_locations_samples ils
join locations l on l.id=ils.location_id
join locations l on l.id=ils.location_id and coalesce(l.code, '') not like '%+%'
join cache_termlists_terms ctt on ctt.id=l.location_type_id and ctt.term='Vice County'
) on ils.sample_id=co.sample_id
#agreements_join#
Expand All @@ -22,7 +22,7 @@ and (trim('#date_to#')='' or '#date_to#'='Click here' or co.date_start &lt;= CAS
and quality_check('#quality#', co.record_status, co.certainty)=true
and co.taxa_taxon_list_external_key is not null
and st_x(st_transform(st_centroid(public_geom), 4326)) between -14 and 13
and st_y(st_transform(st_centroid(public_geom), 4326)) between -48 and 62
and st_y(st_transform(st_centroid(public_geom), 4326)) between 48 and 62

</query>

Expand Down
4 changes: 2 additions & 2 deletions reports/library/occurrences/nbn_exchange_by_input_date.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ from cache_occurrences co
join occurrences o on o.id=co.id -- ensure we have the latest status. Would not be needed if cache_occurrences reflects updated immediately
join samples s on s.id=o.sample_id
left join (index_locations_samples ils
join locations l on l.id=ils.location_id
join locations l on l.id=ils.location_id and coalesce(l.code, '') not like '%+%'
join cache_termlists_terms ctt on ctt.id=l.location_type_id and ctt.term='Vice County'
) on ils.sample_id=co.sample_id
#agreements_join#
Expand All @@ -24,7 +24,7 @@ and (trim('#date_to#')='' or '#date_to#'='Click here'
and quality_check('#quality#', co.record_status, co.certainty)=true
and co.taxa_taxon_list_external_key is not null
and st_x(st_transform(st_centroid(public_geom), 4326)) between -14 and 13
and st_y(st_transform(st_centroid(public_geom), 4326)) between -48 and 62
and st_y(st_transform(st_centroid(public_geom), 4326)) between 48 and 62

</query>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ from cache_occurrences co
join occurrences o on o.id=co.id -- ensure we have the latest status. Would not be needed if cache_occurrences reflects updated immediately
join samples s on s.id=o.sample_id
left join (index_locations_samples ils
join locations l on l.id=ils.location_id
join locations l on l.id=ils.location_id and coalesce(l.code, '') not like '%+%'
join cache_termlists_terms ctt on ctt.id=l.location_type_id and ctt.term='Vice County'
) on ils.sample_id=co.sample_id
#agreements_join#
Expand All @@ -25,7 +25,7 @@ and (trim('#date_to#')='' or '#date_to#'='Click here'
and quality_check('#quality#', co.record_status, co.certainty)=true
and co.taxa_taxon_list_external_key is not null
and st_x(st_transform(st_centroid(public_geom), 4326)) between -14 and 13
and st_y(st_transform(st_centroid(public_geom), 4326)) between -48 and 62
and st_y(st_transform(st_centroid(public_geom), 4326)) between 48 and 62

</query>

Expand Down

0 comments on commit baa0ed5

Please sign in to comment.