Subversion Repositories eFlore/Applications.del

Rev

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

Rev 1272 Rev 1354
Line 1... Line 1...
1
-- -----------------------------------------------------
1
-- -----------------------------------------------------
-
 
2
-- View `del_utilisateur`
-
 
3
-- -----------------------------------------------------
-
 
4
DROP VIEW IF EXISTS `del_utilisateur` ;
-
 
5
DROP TABLE IF EXISTS `del_utilisateur`;
-
 
6
DELIMITER $$
-
 
7
CREATE  OR REPLACE VIEW del_utilisateur AS 
-
 
8
	SELECT 
-
 
9
    U_ID AS id_utilisateur, 
-
 
10
    CONVERT(U_SURNAME USING UTF8) AS prenom, 
-
 
11
    CONVERT(U_NAME USING UTF8) AS nom, 
-
 
12
    CONVERT(U_MAIL USING UTF8) AS courriel, 
-
 
13
    CONVERT(U_PASSWD USING UTF8) AS mot_de_passe 
-
 
14
	FROM tela_prod_v4.annuaire_tela;
-
 
15
$$
-
 
16
DELIMITER ;
-
 
17
 
-
 
18
;
-
 
19
 
-
 
20
-- -----------------------------------------------------
2
-- View `del_observation`
21
-- View `del_observation`
3
-- -----------------------------------------------------
22
-- -----------------------------------------------------
4
DROP VIEW IF EXISTS `del_observation` ;
23
DROP VIEW IF EXISTS `del_observation` ;
5
DROP TABLE IF EXISTS `del_observation`;
24
DROP TABLE IF EXISTS `del_observation`;
6
DELIMITER $$
25
DELIMITER $$
7
CREATE  OR REPLACE VIEW del_observation AS 
26
CREATE  OR REPLACE VIEW del_observation AS 
8
    SELECT id_observation, CAST(ce_utilisateur AS UNSIGNED) AS ce_utilisateur, prenom_utilisateur, nom_utilisateur, courriel_utilisateur, nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille, 
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, 
9
        ce_zone_geo, zone_geo, lieudit, station, milieu, 
28
        ce_zone_geo, zone_geo, lieudit, station, milieu, 
10
        date_observation, mots_cles_texte, commentaire, 
29
        date_observation, mots_cles_texte, commentaire, 
11
        date_creation, date_modification, date_transmission 
30
        date_creation, date_modification, date_transmission 
12
    FROM tb_cel.cel_obs AS o
31
    FROM tb_cel.cel_obs AS o
13
    WHERE transmission = '1' 
32
    WHERE transmission = '1' 
Line 21... Line 40...
21
-- -----------------------------------------------------
40
-- -----------------------------------------------------
22
DROP VIEW IF EXISTS `del_image` ;
41
DROP VIEW IF EXISTS `del_image` ;
23
DROP TABLE IF EXISTS `del_image`;
42
DROP TABLE IF EXISTS `del_image`;
24
DELIMITER $$
43
DELIMITER $$
25
CREATE  OR REPLACE VIEW del_image AS
44
CREATE  OR REPLACE VIEW del_image AS
26
    SELECT i.id_image, CAST(i.ce_utilisateur AS UNSIGNED) 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, 
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, 
27
        i.commentaire, i.nom_original, i.date_modification, i.date_creation, i.publiable_eflore 
46
        i.commentaire, i.nom_original, i.date_modification, i.date_creation, i.publiable_eflore 
28
    FROM tb_cel.cel_images AS i 
47
    FROM tb_cel.cel_images AS i 
29
        INNER JOIN tb_cel.cel_obs_images AS oi ON (i.id_image = oi.id_image)  
48
        INNER JOIN tb_cel.cel_obs_images AS oi ON (i.id_image = oi.id_image)  
30
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
49
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
31
    WHERE o.transmission = '1' 
50
    WHERE o.transmission = '1' 
Line 46... Line 65...
46
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
65
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
47
    WHERE o.transmission = '1' 
66
    WHERE o.transmission = '1' 
48
$$
67
$$
49
DELIMITER ;
68
DELIMITER ;
Line 50... Line -...
50
 
-
 
51
;
69
 
-
 
70
;