# spatial_ref_sys

auth_name: mj10777.de
ref_sys_name: DHDN / Soldner Bayern
proj4text:
+proj=cass +lat_0=48.13959111 +lon_0=11.57437083 +x_0=0 +y_0=0 +ellps=bessel +datum=potsdam +units=m +no_defs

srtext:
PROJCS["DHDN / Soldner Bayern",GEOGCS["DHDN",DATUM["Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel 1841",6377397.155,299.1528128,AUTHORITY["EPSG","7004"]],AUTHORITY["EPSG","6314"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4314"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Cassini_Soldner"],PARAMETER["latitude_of_origin",48.13959111],PARAMETER["central_meridian",11.57437083],PARAMETER["false_easting",0],PARAMETER["false_northing",0],AUTHORITY["mj10777.de","187941"],AXIS["x",NORTH],AXIS["y",EAST]]


auth_name: mj10777.de
ref_sys_name: DHDN / Ferro / Deutsches_Hauptdreiecksnetz
proj4text: +proj=longlat +ellps=bessel +datum=potsdam +pm=ferro +no_defs
srtext:
PROJCS["DHDN / Ferro / Deutsches_Hauptdreiecksnetz",GEOGCS["DHDN",DATUM["Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel 1841",6377397.155,299.1528128,AUTHORITY["EPSG","7004"]], AUTHORITY["EPSG","6314"]],PRIMEM["ferro",-17.66666666666667],UNIT["Degree",0.017453292519943295,AUTHORITY["mj10777.de","187998"]],AUTHORITY["EPSG","4314"]]]


auth_name: mj10777.de
ref_sys_name: DHDN / Brandenburger Tor
proj4text:
+proj=cass +lat_0=52.41864827777778 +lon_0=13.62720366666667 +x_0=16816.615499858 +y_0=-11047.322499366 +ellps=bessel +datum=potsdam +units=m +no_defs

srtext:
PROJCS["DHDN / Soldner Brandenburger Tor",GEOGCS["DHDN",DATUM["Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel 1841",6377397.155,299.1528128,AUTHORITY["EPSG","7004"]],AUTHORITY["EPSG","6314"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4314"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Cassini_Soldner"],PARAMETER["latitude_of_origin",52.41864827777778],PARAMETER["central_meridian",13.62720366666667],PARAMETER["false_easting",16816.615499858],PARAMETER["false_northing",-11047.322499366],AUTHORITY["mj10777.de","187999"],AXIS["x",NORTH],AXIS["y",EAST]]


auth_name: mj10777.de
ref_sys_name: ETRS89 / UTM zone 33N (Brandenburg)
proj4text: +proj=utm +zone=33 +ellps=GRS80 +units=m +no_defs
srtext:
PROJCS["ETRS89 / UTM zone 33N (Brandenburg)",GEOGCS["ETRS89",DATUM["European_Terrestrial_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6258"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4258"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",3500000],PARAMETER["false_northing",0],AUTHORITY["EPSG","325833"],AXIS["Easting",EAST],AXIS["Northing",NORTH]]


# sql_statements_log

time_start: 2021-02-24T08:16:53.490Z
time_end: 2021-02-24T08:16:53.628Z
user_agent: spatialite_gui
error_cause: success
sql_statement:
CREATE TABLE "controle"( 
    uuid TEXT NOT NULL UNIQUE,
    'date' datetime,
    projet TEXT,
    utilisateur TEXT,
    phase TEXT,
    code_ctrl_1 text,
    commentaire_1 text,
    criticite_1 text,
    pj_1_ctrl_1 text,
    pj_2_ctrl_1 text,
    pj_3_ctrl_1 text,
    pj_4_ctrl_1 text,
    pj_5_ctrl_1 text,
    pj_6_ctrl_1 text,
    code_ctrl_2 text,
    commentaire_2 text,
    criticite_2 text,
    pj_1_ctrl_2 text,
    pj_2_ctrl_2 text,
    pj_3_ctrl_2 text,
    pj_4_ctrl_2 text,
    pj_5_ctrl_2 text,
    pj_6_ctrl_2 text,
    code_ctrl_3 text,
    commentaire_3 text,
    criticite_3 text,
    pj_1_ctrl_3 text,
    pj_2_ctrl_3 text,
    pj_3_ctrl_3 text,
    pj_4_ctrl_3 text,
    pj_5_ctrl_3 text,
    pj_6_ctrl_3 text,
    code_ctrl_4 text,
    commentaire_4 text,
    criticite_4 text,
    pj_1_ctrl_4 text,
    pj_2_ctrl_4 text,
    pj_3_ctrl_4 text,
    pj_4_ctrl_4 text,
    pj_5_ctrl_4 text,
    pj_6_ctrl_4 text,
    code_ctrl_5 text,
    commentaire_5 text,
    criticite_5 text,
    pj_1_ctrl_5 text,
    pj_2_ctrl_5 text,
    pj_3_ctrl_5 text,
    pj_4_ctrl_5 text,
    pj_5_ctrl_5 text,
    pj_6_ctrl_5 text,
    code_ctrl_6 text,
    commentaire_6 text,
    criticite_6 text,
    pj_1_ctrl_6 text,
    pj_2_ctrl_6 text,
    pj_3_ctrl_6 text,
    pj_4_ctrl_6 text,
    pj_5_ctrl_6 text,
    pj_6_ctrl_6 text,
    code_ctrl_7 text,
    commentaire_7 text,
    criticite_7 text,
    pj_1_ctrl_7 text,
    pj_2_ctrl_7 text,
    pj_3_ctrl_7 text,
    pj_4_ctrl_7 text,
    pj_5_ctrl_7 text,
    pj_6_ctrl_7 text,
    code_ctrl_8 text,
    commentaire_8 text,
    criticite_8 text,
    pj_1_ctrl_8 text,
    pj_2_ctrl_8 text,
    pj_3_ctrl_8 text,
    pj_4_ctrl_8 text,
    pj_5_ctrl_8 text,
    pj_6_ctrl_8 text, 
    code_ctrl_9 text,
    commentaire_9 text,
    criticite_9 text,
    pj_1_ctrl_9 text,
    pj_2_ctrl_9 text,
    pj_3_ctrl_9 text,
    pj_4_ctrl_9 text,
    pj_5_ctrl_9 text,
    pj_6_ctrl_9 text,
    code_ctrl_10 text,
    commentaire_10 text,
    criticite_10 text,
    pj_1_ctrl_10 text,
    pj_2_ctrl_10 text,
    pj_3_ctrl_10 text,
    pj_4_ctrl_10 text,
    pj_5_ctrl_10 text,
    pj_6_ctrl_10 text,
    code_ctrl_11 text,
    commentaire_11 text,
    criticite_11 text,
    pj_1_ctrl_11 text,
    pj_2_ctrl_11 text,
    pj_3_ctrl_11 text,
    pj_4_ctrl_11 text,
    pj_5_ctrl_11 text,
    pj_6_ctrl_11 text,
    code_ctrl_12 text,
    commentaire_12 text,
    criticite_12 text,
    pj_1_ctrl_12 text,
    pj_2_ctrl_12 text,
    pj_3_ctrl_12 text,
    pj_4_ctrl_12 text,
    pj_5_ctrl_12 text,
    pj_6_ctrl_12 text,
    code_ctrl_13 text,
    commentaire_13 text,
    criticite_13 text,
    pj_1_ctrl_13 text,
    pj_2_ctrl_13 text,
    pj_3_ctrl_13 text,
    pj_4_ctrl_13 text,
    pj_5_ctrl_13 text,
    pj_6_ctrl_13 text,
    code_ctrl_14 text,
    commentaire_14 text,
    criticite_14 text,
    pj_1_ctrl_14 text,
    pj_2_ctrl_14 text,
    pj_3_ctrl_14 text,
    pj_4_ctrl_14 text,
    pj_5_ctrl_14 text,
    pj_6_ctrl_14 text,
    code_ctrl_15 text,
    commentaire_15 text,
    criticite_15 text,
    pj_1_ctrl_15 text,
    pj_2_ctrl_15 text,
    pj_3_ctrl_15 text,
    pj_4_ctrl_15 text,
    pj_5_ctrl_15 text,
    pj_6_ctrl_15 text);
    
SELECT AddGeometryColumn('controle','geom',2154,'POINT','XY');
SELECT CreateSpatialIndex('controle','geom');


CREATE TABLE "controle_detail" (
"uuid_detail" text,
"uuid_controle" text,
"criticite" text,
"code_controle" text, 
commentaire text);


time_start: 2021-02-24T08:17:11.140Z
time_end: 2021-02-24T08:17:11.178Z
user_agent: spatialite_gui
error_cause: success
sql_statement:
DROP VIEW IF EXISTS v_controle_unstack;
CREATE VIEW v_controle_unstack AS 

SELECT 
	uuid,
    ROWID AS controle_rowid,
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_1 AS code_ctrl, 
	commentaire_1 AS commentaire,
	criticite_1 AS criticite,
	pj_1_ctrl_1 AS pj_1,
	pj_2_ctrl_1 AS pj_2,
	pj_3_ctrl_1 AS pj_3,
	pj_4_ctrl_1 AS pj_4,
	pj_5_ctrl_1 AS pj_5,
	pj_6_ctrl_1 AS pj_6,
    geom
FROM
	controle

UNION

SELECT 
	uuid,
    ROWID AS controle_rowid,    
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_2 AS code_ctrl, 
	commentaire_2 AS commentaire,
	criticite_2 AS criticite,
	pj_1_ctrl_2 AS pj_1,
	pj_2_ctrl_2 AS pj_2,
	pj_3_ctrl_2 AS pj_3,
	pj_4_ctrl_2 AS pj_4,
	pj_5_ctrl_2 AS pj_5,
	pj_6_ctrl_2 AS pj_6,
    geom
FROM
	controle
    
UNION

SELECT 
	uuid,
    ROWID AS controle_rowid,
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_3 AS code_ctrl, 
	commentaire_3 AS commentaire,
	criticite_3 AS criticite,
	pj_1_ctrl_3 AS pj_1,
	pj_2_ctrl_3 AS pj_2,
	pj_3_ctrl_3 AS pj_3,
	pj_4_ctrl_3 AS pj_4,
	pj_5_ctrl_3 AS pj_5,
	pj_6_ctrl_3 AS pj_6,
    geom
FROM
	controle

UNION

SELECT 
	uuid, 
    ROWID AS controle_rowid,
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_4 AS code_ctrl, 
	commentaire_4 AS commentaire,
	criticite_4 AS criticite,
	pj_1_ctrl_4 AS pj_1,
	pj_2_ctrl_4 AS pj_2,
	pj_3_ctrl_4 AS pj_3,
	pj_4_ctrl_4 AS pj_4,
	pj_5_ctrl_4 AS pj_5,
	pj_6_ctrl_4 AS pj_6,
    geom
FROM
	controle

UNION

SELECT 
	uuid,
    ROWID AS controle_rowid,    
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_5 AS code_ctrl, 
	commentaire_5 AS commentaire,
	criticite_5 AS criticite,
	pj_1_ctrl_5 AS pj_1,
	pj_2_ctrl_5 AS pj_2,
	pj_3_ctrl_5 AS pj_3,
	pj_4_ctrl_5 AS pj_4,
	pj_5_ctrl_5 AS pj_5,
	pj_6_ctrl_5 AS pj_6,
    geom
FROM
	controle
    
UNION

SELECT 
	uuid,
    ROWID AS controle_rowid,    
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_6 AS code_ctrl, 
	commentaire_6 AS commentaire,
	criticite_6 AS criticite,
	pj_1_ctrl_6 AS pj_1,
	pj_2_ctrl_6 AS pj_2,
	pj_3_ctrl_6 AS pj_3,
	pj_4_ctrl_6 AS pj_4,
	pj_5_ctrl_6 AS pj_5,
	pj_6_ctrl_6 AS pj_6,
    geom
FROM
	controle
    
UNION

SELECT 
	uuid,
    ROWID AS controle_rowid,    
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_7 AS code_ctrl, 
	commentaire_7 AS commentaire,
	criticite_7 AS criticite,
	pj_1_ctrl_7 AS pj_1,
	pj_2_ctrl_7 AS pj_2,
	pj_3_ctrl_7 AS pj_3,
	pj_4_ctrl_7 AS pj_4,
	pj_5_ctrl_7 AS pj_5,
	pj_6_ctrl_7 AS pj_6,
    geom
FROM
	controle
    
UNION

SELECT 
	uuid, 
    ROWID AS controle_rowid,
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_8 AS code_ctrl, 
	commentaire_8 AS commentaire,
	criticite_8 AS criticite,
	pj_1_ctrl_8 AS pj_1,
	pj_2_ctrl_8 AS pj_2,
	pj_3_ctrl_8 AS pj_3,
	pj_4_ctrl_8 AS pj_4,
	pj_5_ctrl_8 AS pj_5,
	pj_6_ctrl_8 AS pj_6,
    geom
FROM
	controle
    
UNION

SELECT 
	uuid, 
    ROWID AS controle_rowid,
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_9 AS code_ctrl, 
	commentaire_9 AS commentaire,
	criticite_9 AS criticite,
	pj_1_ctrl_9 AS pj_1,
	pj_2_ctrl_9 AS pj_2,
	pj_3_ctrl_9 AS pj_3,
	pj_4_ctrl_9 AS pj_4,
	pj_5_ctrl_9 AS pj_5,
	pj_6_ctrl_9 AS pj_6,
    geom
FROM
	controle
    
UNION

SELECT 
	uuid, 
    ROWID AS controle_rowid,
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_10 AS code_ctrl, 
	commentaire_10 AS commentaire,
	criticite_10 AS criticite,
	pj_1_ctrl_10 AS pj_1,
	pj_2_ctrl_10 AS pj_2,
	pj_3_ctrl_10 AS pj_3,
	pj_4_ctrl_10 AS pj_4,
	pj_5_ctrl_10 AS pj_5,
	pj_6_ctrl_10 AS pj_6,
    geom
FROM
	controle
    
UNION


SELECT 
	uuid, 
    ROWID AS controle_rowid,
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_11 AS code_ctrl, 
	commentaire_11 AS commentaire,
	criticite_11 AS criticite,
	pj_1_ctrl_11 AS pj_1,
	pj_2_ctrl_11 AS pj_2,
	pj_3_ctrl_11 AS pj_3,
	pj_4_ctrl_11 AS pj_4,
	pj_5_ctrl_11 AS pj_5,
	pj_6_ctrl_11 AS pj_6,
    geom
FROM
	controle
    
UNION 


SELECT 
	uuid, 
    ROWID AS controle_rowid,
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_12 AS code_ctrl, 
	commentaire_12 AS commentaire,
	criticite_12 AS criticite,
	pj_1_ctrl_12 AS pj_1,
	pj_2_ctrl_12 AS pj_2,
	pj_3_ctrl_12 AS pj_3,
	pj_4_ctrl_12 AS pj_4,
	pj_5_ctrl_12 AS pj_5,
	pj_6_ctrl_12 AS pj_6,
    geom
FROM
	controle
    
UNION

SELECT 
	uuid, 
    ROWID AS controle_rowid,
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_13 AS code_ctrl, 
	commentaire_13 AS commentaire,
	criticite_13 AS criticite,
	pj_1_ctrl_13 AS pj_1,
	pj_2_ctrl_13 AS pj_2,
	pj_3_ctrl_13 AS pj_3,
	pj_4_ctrl_13 AS pj_4,
	pj_5_ctrl_13 AS pj_5,
	pj_6_ctrl_13 AS pj_6,
    geom
FROM
	controle
    
UNION

SELECT 
	uuid, 
    ROWID AS controle_rowid,
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_14 AS code_ctrl, 
	commentaire_14 AS commentaire,
	criticite_14 AS criticite,
	pj_1_ctrl_14 AS pj_1,
	pj_2_ctrl_14 AS pj_2,
	pj_3_ctrl_14 AS pj_3,
	pj_4_ctrl_14 AS pj_4,
	pj_5_ctrl_14 AS pj_5,
	pj_6_ctrl_14 AS pj_6,
    geom
FROM
	controle
    
UNION

SELECT 
	uuid, 
    ROWID AS controle_rowid,
	date, 
	projet, 
	utilisateur, 
	phase, 
	code_ctrl_15 AS code_ctrl, 
	commentaire_15 AS commentaire,
	criticite_15 AS criticite,
	pj_1_ctrl_15 AS pj_1,
	pj_2_ctrl_15 AS pj_2,
	pj_3_ctrl_15 AS pj_3,
	pj_4_ctrl_15 AS pj_4,
	pj_5_ctrl_15 AS pj_5,
	pj_6_ctrl_15 AS pj_6,
    geom
FROM
	controle


time_start: 2021-02-24T08:17:29.084Z
time_end: 2021-02-24T08:17:29.112Z
user_agent: spatialite_gui
error_cause: success
sql_statement:
DROP VIEW IF EXISTS v_controle_unstacked_detail;
CREATE VIEW v_controle_unstacked_detail AS

SELECT controle.*,
	uuid || "-" || controle.code_ctrl AS 'uuid_new',
	controle_detail.code_controle AS code_controle_detail,
	controle_detail.criticite AS criticite_detail,
    controle_detail.commentaire AS comment_detail,
	controle_detail.uuid_detail AS uuid_detail


FROM v_controle_unstack as controle
LEFT JOIN controle_detail ON (controle.uuid=controle_detail.uuid_controle AND controle_detail.code_controle LIKE controle.code_ctrl || '%')
WHERE code_controle_detail NOT NULL
GROUP BY uuid_detail
ORDER BY controle.ROWID, code_ctrl, controle_detail.code_controle


time_start: 2021-02-24T08:17:44.055Z
time_end: 2021-02-24T08:17:44.100Z
user_agent: spatialite_gui
error_cause: success
sql_statement:
DROP VIEW IF EXISTS vs_controle_ok_nok;
CREATE VIEW vs_controle_ok_nok AS

SELECT uuid, controle_rowid,
	SUM(criticite_detail = 'OK') as oks,
	SUM(criticite_detail = 'NOK') as noks,
	SUM(criticite_detail = 'SUSPENDU') as suspendus,
	geom

FROM v_controle_unstacked_detail

GROUP BY uuid;

INSERT INTO views_geometry_columns VALUES ('vs_controle_ok_nok', 'geom', 'controle_rowid', 'controle', 'geom', 1);


# controle_detail

uuid_detail: {5839e443-a5cb-4b5f-9229-3aa210e86909}
uuid_controle: {16f58de5-5cce-49d8-81a1-1cd41341cb62}
criticite: NOK
code_controle: 4_SRO_4_ARM_3_Intérieur
commentaire:
Propreté de l'armoire avec certaines étiquette en attente puis divers sachets traînant au sein de l'armoire 


uuid_detail: {8477063b-c3b1-41dd-880a-bb14d98ab834}
uuid_controle: {51704f89-70cc-41f1-9e25-722f56b018d8}
criticite: NOK
code_controle: 5.2_CHAM_CR_2_CHB_99_Autre
commentaire:
Un câble fibre optique passe par le fourreau réservé pour le fil de detection et la cablette terre dans chambre C211570


uuid_detail: {928c86cd-1b02-47e5-b11e-f8a4d4636039}
uuid_controle: {633d0e88-2367-4eb3-b1c6-0bde414f9173}
criticite: NOK
code_controle: 5.2_CHAM_CR_1_SECU_99_Autre
commentaire:
Le câble transport de 288 FO ne passe pas dans la chambre CD21 à l'entrée du village dans chambre 260


uuid_detail: {0ca1da70-0dda-4757-b5d4-00443206bbc3}
uuid_controle: {ed1d0b08-888c-45aa-82bc-4b8b6d8f8690}
criticite: NOK
code_controle: 6.2_APP_A_CREER_1_SECU_99_Autre
commentaire:
Les câbles de fibre optique passe au-dessus des câbles d'électricités non-respect de la réglementation


uuid_detail: {b3da3a5b-1d74-432b-85b1-1172bb1f400b}
uuid_controle: {8528e9e2-779b-420e-9bfa-55d2a148c8dc}
criticite: SUSPENDU
code_controle: 5.1_CHAM_FT_1_SECU_99_Autre
commentaire:
Le câble transport et probablement en attente dans cette chambre installé sous une route départementale


