Subversion Repositories eFlore/Applications.del

Rev

Rev 1368 | Rev 1406 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1368 Rev 1376
Line 1... Line 1...
1
-- -----------------------------------------------------
1
-- -----------------------------------------------------
2
-- View `del_utilisateur`
2
-- View `del_utilisateurs`
3
-- -----------------------------------------------------
3
-- -----------------------------------------------------
4
DROP VIEW IF EXISTS `del_utilisateur` ;
4
DROP VIEW IF EXISTS `del_utilisateurs` ;
5
DROP TABLE IF EXISTS `del_utilisateur`;
5
DROP TABLE IF EXISTS `del_utilisateurs`;
6
DELIMITER $$
-
 
7
CREATE  OR REPLACE VIEW del_utilisateur AS 
6
CREATE  OR REPLACE VIEW del_utilisateur AS 
8
	SELECT 
7
	SELECT 
9
    U_ID AS id_utilisateur, 
8
    U_ID AS id_utilisateur, 
10
    CONVERT(U_SURNAME USING UTF8) AS prenom, 
9
    CONVERT(U_SURNAME USING UTF8) AS prenom, 
11
    CONVERT(U_NAME USING UTF8) AS nom, 
10
    CONVERT(U_NAME USING UTF8) AS nom, 
12
    CONVERT(U_MAIL USING UTF8) AS courriel, 
11
    CONVERT(U_MAIL USING UTF8) AS courriel, 
13
    CONVERT(U_PASSWD USING UTF8) AS mot_de_passe 
12
    CONVERT(U_PASSWD USING UTF8) AS mot_de_passe 
14
	FROM tela_prod_v4.annuaire_tela;
13
	FROM tela_prod_v4.annuaire_tela;
15
$$
-
 
16
DELIMITER ;
-
 
17
 
-
 
18
;
-
 
Line 19... Line 14...
19
 
14
 
20
-- -----------------------------------------------------
15
-- -----------------------------------------------------
21
-- View `del_observation`
16
-- View `del_observations`
22
-- -----------------------------------------------------
17
-- -----------------------------------------------------
23
DROP VIEW IF EXISTS `del_observation` ;
18
DROP VIEW IF EXISTS `del_observations` ;
24
DROP TABLE IF EXISTS `del_observation`;
-
 
25
DELIMITER $$
19
DROP TABLE IF EXISTS `del_observations`;
26
CREATE  OR REPLACE VIEW del_observation AS 
20
CREATE  OR REPLACE VIEW del_observation AS 
27
    SELECT id_observation, if((char_length(o.ce_utilisateur) <> 32),cast(o.ce_utilisateur as unsigned),0) AS ce_utilisateur, prenom_utilisateur, nom_utilisateur, courriel_utilisateur, nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille, 
21
    SELECT id_observation, if((char_length(o.ce_utilisateur) <> 32),cast(o.ce_utilisateur as unsigned),0) AS ce_utilisateur, prenom_utilisateur, nom_utilisateur, courriel_utilisateur, nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille, 
28
        nom_referentiel, ce_zone_geo, zone_geo, lieudit, station, milieu, 
22
        ce_zone_geo, zone_geo, lieudit, station, milieu, 
29
        date_observation, mots_cles_texte, commentaire, 
23
        date_observation, mots_cles_texte, commentaire, 
-
 
24
        date_creation, date_modification, date_transmission 
-
 
25
    FROM tb_cel.cel_obs AS o
-
 
26
    WHERE transmission = '1' ;
-
 
27
 
-
 
28
-- -----------------------------------------------------
-
 
29
-- View `del_images`
-
 
30
-- -----------------------------------------------------
-
 
31
DROP VIEW IF EXISTS `del_images` ;
-
 
32
DROP TABLE IF EXISTS `del_images`;
-
 
33
CREATE  OR REPLACE VIEW del_image AS
-
 
34
    SELECT i.id_image, if((char_length(i.ce_utilisateur) <> 32),cast(i.ce_utilisateur as unsigned),0) AS ce_utilisateur, i.prenom_utilisateur, i.nom_utilisateur, i.courriel_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 
-
 
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)
-
 
39
    WHERE o.transmission = '1' ;
-
 
40
 
-
 
41
-- -----------------------------------------------------
-
 
42
-- View `del_obs_images`
-
 
43
-- -----------------------------------------------------
-
 
44
DROP VIEW IF EXISTS `del_obs_images` ;
-
 
45
DROP TABLE IF EXISTS `del_obs_images`;
-
 
46
CREATE  OR REPLACE VIEW del_obs_image AS 
-
 
47
    SELECT oi.id_image, oi.id_observation, oi.date_liaison
-
 
48
    FROM tb_cel.cel_obs_images AS oi 
-
 
49
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
-
 
50
    WHERE o.transmission = '1' ;
-
 
51
 
-
 
52
-- -----------------------------------------------------
-
 
53
-- View `v_del_image`
-
 
54
-- -----------------------------------------------------
-
 
55
DROP VIEW IF EXISTS `v_del_image` ;
-
 
56
DROP TABLE IF EXISTS `v_del_image`;
-
 
57
CREATE OR REPLACE VIEW v_del_image AS
-
 
58
    SELECT o.*, i.id_image, i.ordre AS i_ordre,
-
 
59
           i.ce_utilisateur AS i_ce_utilisateur, i.prenom_utilisateur AS i_prenom_utilisateur, i.nom_utilisateur AS i_nom_utilisateur, i.courriel_utilisateur AS  i_courriel_utilisateur,
30
        date_creation, date_modification, date_transmission 
60
           i.mots_cles_texte AS i_mots_cles_texte, hauteur, largeur, date_prise_de_vue, i.commentaire AS i_commentaire, nom_original, publiable_eflore
31
    FROM tb_cel.cel_obs AS o
-
 
32
    WHERE transmission = '1' 
-
 
33
$$
-
 
34
DELIMITER ;
-
 
35
 
-
 
36
;
-
 
37
 
-
 
38
-- -----------------------------------------------------
-
 
39
-- View `del_image`
-
 
40
-- -----------------------------------------------------
-
 
41
DROP VIEW IF EXISTS `del_image` ;
-
 
42
DROP TABLE IF EXISTS `del_image`;
-
 
43
DELIMITER $$
-
 
44
CREATE  OR REPLACE VIEW del_image AS
-
 
45
    SELECT i.id_image, if((char_length(i.ce_utilisateur) <> 32),cast(i.ce_utilisateur as unsigned),0) AS ce_utilisateur, i.prenom_utilisateur, i.nom_utilisateur, i.courriel_utilisateur, i.hauteur, i.largeur, i.date_prise_de_vue, i.mots_cles_texte, 
-
 
46
        i.commentaire, i.nom_original, i.date_modification, i.date_creation, i.publiable_eflore 
-
 
47
    FROM tb_cel.cel_images AS i 
-
 
48
        INNER JOIN tb_cel.cel_obs_images AS oi ON (i.id_image = oi.id_image)  
61
    FROM tb_cel.cel_obs AS o
49
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
-
 
50
    WHERE o.transmission = '1' 
-
 
51
$$
-
 
52
DELIMITER ;
-
 
53
 
-
 
54
;
-
 
55
 
-
 
56
-- -----------------------------------------------------
-
 
57
-- View `del_obs_image`
-
 
58
-- -----------------------------------------------------
-
 
59
DROP VIEW IF EXISTS `del_obs_image` ;
-
 
60
DROP TABLE IF EXISTS `del_obs_image`;
-
 
61
DELIMITER $$
-
 
62
CREATE  OR REPLACE VIEW del_obs_image AS 
-
 
63
    SELECT oi.id_image, oi.id_observation, oi.date_liaison
-
 
64
    FROM tb_cel.cel_obs_images AS oi 
62
    INNER JOIN tb_cel.cel_obs_images oi ON oi.id_observation = o.id_observation
65
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
63
    INNER JOIN tb_cel.cel_images i ON i.id_image = oi.id_image
66
    WHERE o.transmission = '1' 
-
 
67
$$
-
 
68
DELIMITER ;
-
 
69
 
-