Subversion Repositories eFlore/Applications.del

Rev

Rev 734 | Rev 784 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
714 jpm 1
-- TODO : Voir comment remplacer le test REGEXP par quelque chose de plus simple.
712 jpm 2
 
731 jpm 3
DROP VIEW IF EXISTS del_utilisateur ;
4
DROP TABLE IF EXISTS del_utilisateur;
733 jpm 5
CREATE  OR REPLACE VIEW del_utilisateur AS
6
	SELECT at.U_ID AS id_utilisateur, at.U_SURNAME AS prenom, at.U_NAME AS nom, at.U_MAIL AS courriel, at.U_PASSWD AS mot_de_passe,
7
		ui.licence_acceptee, ui.admin, ui.preferences, ui.date_premiere_utilisation
735 jpm 8
	FROM tb_cel.cel_utilisateurs_infos AS ui
733 jpm 9
		LEFT JOIN tela_prod_v4.annuaire_tela AS at ON (ui.id_utilisateur = at.U_ID);
712 jpm 10
 
731 jpm 11
DROP VIEW IF EXISTS del_observation ;
12
DROP TABLE IF EXISTS del_observation;
712 jpm 13
CREATE VIEW del_observation AS
714 jpm 14
	SELECT id_observation, ce_utilisateur, nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille,
15
		ce_zone_geo, zone_geo, lieudit, station, milieu,
16
		date_observation, mots_cles_texte, commentaire,
17
		date_creation, date_modification, date_transmission
18
	FROM tb_cel.cel_obs
19
	WHERE transmission = '1'
20
		AND ce_utilisateur REGEXP '^[[:digit:]]+$';
712 jpm 21
 
735 jpm 22
DROP VIEW IF EXISTS del_obs_image ;
23
DROP TABLE IF EXISTS del_obs_image;
24
CREATE VIEW del_obs_image AS
714 jpm 25
	SELECT oi.id_image, oi.id_utilisateur, oi.id_observation, oi.date_liaison
26
	FROM tb_cel.cel_obs_images AS oi
27
		INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
28
	WHERE o.transmission = '1'
29
		AND oi.id_utilisateur REGEXP '^[[:digit:]]+$';
30
 
731 jpm 31
DROP VIEW IF EXISTS del_image ;
32
DROP TABLE IF EXISTS del_image;
714 jpm 33
CREATE VIEW del_image AS
34
	SELECT i.id_image, i.ce_utilisateur, i.hauteur, i.largeur, i.date_prise_de_vue, i.mots_cles_texte,
35
		i.commentaire, i.nom_original, i.date_modification, i.date_creation, i.publiable_eflore
733 jpm 36
	FROM tb_cel.cel_images AS i
37
		INNER JOIN tb_cel.cel_obs_images AS oi ON (i.id_image = oi.id_image)
38
		INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
714 jpm 39
	WHERE o.transmission = '1'
734 jpm 40
		AND i.ce_utilisateur REGEXP '^[[:digit:]]+$';