Subversion Repositories eFlore/Applications.del

Rev

Rev 1376 | Rev 1530 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

-- -----------------------------------------------------
-- View `del_utilisateurs`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `del_utilisateurs` ;
DROP TABLE IF EXISTS `del_utilisateurs`;
CREATE  OR REPLACE VIEW del_utilisateur AS 
        SELECT 
    U_ID AS id_utilisateur, 
    CONVERT(U_SURNAME USING UTF8) AS prenom, 
    CONVERT(U_NAME USING UTF8) AS nom, 
    CONVERT(U_MAIL USING UTF8) AS courriel, 
    CONVERT(U_PASSWD USING UTF8) AS mot_de_passe 
        FROM tela_prod_v4.annuaire_tela;

-- -----------------------------------------------------
-- View `del_observations`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `del_observations` ;
DROP TABLE IF EXISTS `del_observations`;
CREATE  OR REPLACE VIEW del_observation AS 
    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, 
        ce_zone_geo, zone_geo, lieudit, station, milieu, nom_referentiel,
        date_observation, mots_cles_texte, commentaire, 
        date_creation, date_modification, date_transmission 
    FROM tb_cel.cel_obs AS o
    WHERE transmission = '1' ;

-- -----------------------------------------------------
-- View `del_images`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `del_images` ;
DROP TABLE IF EXISTS `del_images`;
CREATE  OR REPLACE VIEW del_image AS
    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, 
        i.commentaire, i.nom_original, i.date_modification, i.date_creation, i.publiable_eflore, o.nom_referentiel 
    FROM tb_cel.cel_images AS i 
        INNER JOIN tb_cel.cel_obs_images AS oi ON (i.id_image = oi.id_image)  
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
    WHERE o.transmission = '1' ;

-- -----------------------------------------------------
-- View `del_obs_images`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `del_obs_images` ;
DROP TABLE IF EXISTS `del_obs_images`;
CREATE  OR REPLACE VIEW del_obs_image AS 
    SELECT oi.id_image, oi.id_observation, oi.date_liaison
    FROM tb_cel.cel_obs_images AS oi 
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
    WHERE o.transmission = '1' ;

-- -----------------------------------------------------
-- View `v_del_image`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `v_del_image` ;
DROP TABLE IF EXISTS `v_del_image`;
CREATE OR REPLACE VIEW v_del_image AS
    SELECT o.*, i.id_image, i.ordre AS i_ordre,
           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,
           i.mots_cles_texte AS i_mots_cles_texte, hauteur, largeur, date_prise_de_vue, i.commentaire AS i_commentaire, nom_original, publiable_eflore
    FROM tb_cel.cel_obs AS o
    INNER JOIN tb_cel.cel_obs_images oi ON oi.id_observation = o.id_observation
    INNER JOIN tb_cel.cel_images i ON i.id_image = oi.id_image
    WHERE o.transmission = '1';