Skip to content

Commit

Permalink
Export CSV : bascule Cadastre/BAN (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdct committed Nov 23, 2020
1 parent 5b761f8 commit 2a295f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bano/sql/export_csv_dept.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ AS
COALESCE(cn.libelle,initcap(ca.nom_com)) AS ville,
CASE
WHEN u.num=o.num THEN 'OSM'
WHEN (u.num=od.num AND od.voie_osm != od.voie_cadastre AND od.voie_osm IS NOT NULL) THEN 'O+O'
WHEN (u.num=od.num AND od.voie_osm != od.voie_autre AND od.voie_osm IS NOT NULL) THEN 'O+O'
WHEN u.num=od.num THEN 'OD'
WHEN c.voie_osm != '' THEN 'C+O'
ELSE 'CAD'
Expand All @@ -63,7 +63,7 @@ LEFT JOIN
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REGEXP_REPLACE(UPPER(numero),'^0*',''),'BIS','B'),'TER','T'),'QUATER','Q'),'QUAT','Q'),' ',''),'à','-'),';',',') AS num
FROM cumul_adresses
WHERE dept = '__dept__' AND
source = 'CADASTRE' AND
source = 'BAN' AND
st_x(geometrie)!=0 AND
st_y(geometrie)!=0) AS c
ON (c.num=u.num AND c.fantoir=u.fantoir)
Expand All @@ -72,7 +72,7 @@ LEFT JOIN
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REGEXP_REPLACE(UPPER(numero),'^0*',''),'BIS','B'),'TER','T'),'QUATER','Q'),'QUAT','Q'),' ',''),'à','-'),';',',') AS num
FROM cumul_adresses
WHERE dept = '__dept__' AND
source LIKE 'OD%' AND
source = 'BAL' AND
st_x(geometrie)!=0 AND
st_y(geometrie)!=0) AS od
ON (od.num = u.num AND od.fantoir = u.fantoir)
Expand Down

0 comments on commit 2a295f5

Please sign in to comment.