--
-- BEGIN / [#10387] Mise à jour des données techniques et CERFA
--

-- Mise à jour du CERFA de test pour activer tous les champs
INSERT INTO cerfa (cerfa, libelle, code, om_validite_debut, om_validite_fin, am_lotiss, am_autre_div, am_camping, am_caravane, am_carav_duree, am_statio, am_statio_cont, am_affou_exhau, am_affou_exhau_sup, am_affou_prof, am_exhau_haut, am_coupe_abat, am_prot_plu, am_prot_muni, am_mobil_voyage, am_aire_voyage, am_rememb_afu, am_parc_resid_loi, am_sport_moto, am_sport_attrac, am_sport_golf, am_mob_art, am_modif_voie_esp, am_plant_voie_esp, am_chem_ouv_esp, am_agri_peche, am_crea_voie, am_modif_voie_exist, am_crea_esp_sauv, am_crea_esp_class, am_projet_desc, am_terr_surf, am_tranche_desc, am_lot_max_nb, am_lot_max_shon, am_lot_cstr_cos, am_lot_cstr_plan, am_lot_cstr_vente, am_lot_fin_diff, am_lot_consign, am_lot_gar_achev, am_lot_vente_ant, am_empl_nb, am_tente_nb, am_carav_nb, am_mobil_nb, am_pers_nb, am_empl_hll_nb, am_hll_shon, am_periode_exploit, am_exist_agrand, am_exist_date, am_exist_num, am_exist_nb_avant, am_exist_nb_apres, am_coupe_bois, am_coupe_parc, am_coupe_align, am_coupe_ess, am_coupe_age, am_coupe_dens, am_coupe_qual, am_coupe_trait, am_coupe_autr, co_archi_recours, co_cstr_nouv, co_cstr_exist, co_cloture, co_elec_tension, co_div_terr, co_projet_desc, co_anx_pisc, co_anx_gara, co_anx_veran, co_anx_abri, co_anx_autr, co_anx_autr_desc, co_tot_log_nb, co_tot_ind_nb, co_tot_coll_nb, co_mais_piece_nb, co_mais_niv_nb, co_fin_lls_nb, co_fin_aa_nb, co_fin_ptz_nb, co_fin_autr_nb, co_fin_autr_desc, co_mais_contrat_ind, co_uti_pers, co_uti_vente, co_uti_loc, co_uti_princ, co_uti_secon, co_resid_agees, co_resid_etud, co_resid_tourism, co_resid_hot_soc, co_resid_soc, co_resid_hand, co_resid_autr, co_resid_autr_desc, co_foyer_chamb_nb, co_log_1p_nb, co_log_2p_nb, co_log_3p_nb, co_log_4p_nb, co_log_5p_nb, co_log_6p_nb, co_bat_niv_nb, co_trx_exten, co_trx_surelev, co_trx_nivsup, co_demont_periode, co_sp_transport, co_sp_enseign, co_sp_act_soc, co_sp_ouvr_spe, co_sp_sante, co_sp_culture, co_statio_avt_nb, co_statio_apr_nb, co_statio_adr, co_statio_place_nb, co_statio_tot_surf, co_statio_tot_shob, co_statio_comm_cin_surf, tab_surface, dm_constr_dates, dm_total, dm_partiel, dm_projet_desc, dm_tot_log_nb, tax_surf_tot, tax_surf, tax_surf_suppr_mod, tab_tax_su_princ, tab_tax_su_heber, tab_tax_su_secon, tab_tax_su_tot, tax_ext_pret, tax_ext_desc, tax_surf_tax_exist_cons, tax_log_exist_nb, tax_trx_presc_ppr, tax_monu_hist, tax_comm_nb, tab_tax_su_non_habit_surf, tab_tax_am, vsd_surf_planch_smd, vsd_unit_fonc_sup, vsd_unit_fonc_constr_sup, vsd_val_terr, vsd_const_sxist_non_dem_surf, vsd_rescr_fisc, pld_val_terr, pld_const_exist_dem, pld_const_exist_dem_surf, code_cnil, terr_juri_titul, terr_juri_lot, terr_juri_zac, terr_juri_afu, terr_juri_pup, terr_juri_oin, terr_juri_desc, terr_div_surf_etab, terr_div_surf_av_div, doc_date, doc_tot_trav, doc_tranche_trav, doc_tranche_trav_desc, doc_surf, doc_nb_log, doc_nb_log_indiv, doc_nb_log_coll, doc_nb_log_lls, doc_nb_log_aa, doc_nb_log_ptz, doc_nb_log_autre, daact_date, daact_date_chgmt_dest, daact_tot_trav, daact_tranche_trav, daact_tranche_trav_desc, daact_surf, daact_nb_log, daact_nb_log_indiv, daact_nb_log_coll, daact_nb_log_lls, daact_nb_log_aa, daact_nb_log_ptz, daact_nb_log_autre, am_div_mun, co_perf_energ, architecte, co_statio_avt_shob, co_statio_apr_shob, co_statio_avt_surf, co_statio_apr_surf, co_trx_amgt, co_modif_aspect, co_modif_struct, co_ouvr_elec, co_ouvr_infra, co_trx_imm, co_cstr_shob, am_voyage_deb, am_voyage_fin, am_modif_amgt, am_lot_max_shob, mod_desc, tr_total, tr_partiel, tr_desc, avap_co_elt_pro, avap_nouv_haut_surf, avap_co_clot, avap_aut_coup_aba_arb, avap_ouv_infra, avap_aut_inst_mob, avap_aut_plant, avap_aut_auv_elec, tax_dest_loc_tr, ope_proj_desc, tax_surf_tot_cstr, tax_surf_loc_stat, tax_log_ap_trvx_nb, tax_am_statio_ext_cr, tax_sup_bass_pisc_cr, tax_empl_ten_carav_mobil_nb_cr, tax_empl_hll_nb_cr, tax_eol_haut_nb_cr, tax_pann_volt_sup_cr, tax_surf_loc_arch, tax_surf_pisc_arch, tax_am_statio_ext_arch, tab_tax_su_parc_statio_expl_comm, tax_empl_ten_carav_mobil_nb_arch, tax_empl_hll_nb_arch, tax_eol_haut_nb_arch, ope_proj_div_co, ope_proj_div_contr, tax_desc, erp_cstr_neuve, erp_trvx_acc, erp_extension, erp_rehab, erp_trvx_am, erp_vol_nouv_exist, tab_erp_eff, erp_class_cat, erp_class_type, tax_surf_abr_jard_pig_colom, tax_su_non_habit_abr_jard_pig_colom, dia_imm_non_bati, dia_imm_bati_terr_propr, dia_imm_bati_terr_autr, dia_imm_bati_terr_autr_desc, dia_bat_copro, dia_bat_copro_desc, dia_lot_numero, dia_lot_bat, dia_lot_etage, dia_lot_quote_part, dia_us_hab, dia_us_pro, dia_us_mixte, dia_us_comm, dia_us_agr, dia_us_autre, dia_us_autre_prec, dia_occ_prop, dia_occ_loc, dia_occ_sans_occ, dia_occ_autre, dia_occ_autre_prec, dia_mod_cess_prix_vente, dia_mod_cess_prix_vente_mob, dia_mod_cess_prix_vente_cheptel, dia_mod_cess_prix_vente_recol, dia_mod_cess_prix_vente_autre, dia_mod_cess_commi, dia_mod_cess_commi_ttc, dia_mod_cess_commi_ht, dia_acquereur_nom_prenom, dia_acquereur_adr_num_voie, dia_acquereur_adr_ext, dia_acquereur_adr_type_voie, dia_acquereur_adr_nom_voie, dia_acquereur_adr_lieu_dit_bp, dia_acquereur_adr_cp, dia_acquereur_adr_localite, dia_observation, tab_surface2, dia_occ_sol_su_terre, dia_occ_sol_su_pres, dia_occ_sol_su_verger, dia_occ_sol_su_vigne, dia_occ_sol_su_bois, dia_occ_sol_su_lande, dia_occ_sol_su_carriere, dia_occ_sol_su_eau_cadastree, dia_occ_sol_su_jardin, dia_occ_sol_su_terr_batir, dia_occ_sol_su_terr_agr, dia_occ_sol_su_sol, dia_bati_vend_tot, dia_bati_vend_tot_txt, dia_su_co_sol, dia_su_util_hab, dia_nb_niv, dia_nb_appart, dia_nb_autre_loc, dia_vente_lot_volume, dia_vente_lot_volume_txt, dia_lot_nat_su, dia_lot_bat_achv_plus_10, dia_lot_bat_achv_moins_10, dia_lot_regl_copro_publ_hypo_plus_10, dia_lot_regl_copro_publ_hypo_moins_10, dia_indivi_quote_part, dia_design_societe, dia_design_droit, dia_droit_soc_nat, dia_droit_soc_nb, dia_droit_soc_num_part, dia_droit_reel_perso_grevant_bien_oui, dia_droit_reel_perso_grevant_bien_non, dia_droit_reel_perso_nat, dia_droit_reel_perso_viag, dia_mod_cess_adr, dia_mod_cess_sign_act_auth, dia_mod_cess_terme, dia_mod_cess_terme_prec, dia_mod_cess_bene_acquereur, dia_mod_cess_bene_vendeur, dia_mod_cess_paie_nat, dia_mod_cess_design_contr_alien, dia_mod_cess_eval_contr, dia_mod_cess_rente_viag, dia_mod_cess_mnt_an, dia_mod_cess_mnt_compt, dia_mod_cess_bene_rente, dia_mod_cess_droit_usa_hab, dia_mod_cess_droit_usa_hab_prec, dia_mod_cess_eval_usa_usufruit, dia_mod_cess_vente_nue_prop, dia_mod_cess_vente_nue_prop_prec, dia_mod_cess_echange, dia_mod_cess_design_bien_recus_ech, dia_mod_cess_mnt_soulte, dia_mod_cess_prop_contre_echan, dia_mod_cess_apport_societe, dia_mod_cess_bene, dia_mod_cess_esti_bien, dia_mod_cess_cess_terr_loc_co, dia_mod_cess_esti_terr, dia_mod_cess_esti_loc, dia_mod_cess_esti_imm_loca, dia_mod_cess_adju_vol, dia_mod_cess_adju_obl, dia_mod_cess_adju_fin_indivi, dia_mod_cess_adju_date_lieu, dia_mod_cess_mnt_mise_prix, dia_prop_titu_prix_indique, dia_prop_recherche_acqu_prix_indique, dia_acquereur_prof, dia_indic_compl_ope, dia_vente_adju, am_terr_res_demon, am_air_terr_res_mob, ctx_objet_recours, ctx_moyen_souleve, ctx_moyen_retenu_juge, ctx_reference_sagace, ctx_nature_travaux_infra_om_html, ctx_synthese_nti, ctx_article_non_resp_om_html, ctx_synthese_anr, ctx_reference_parquet, ctx_element_taxation, ctx_infraction, ctx_regularisable, ctx_reference_courrier, ctx_date_audience, ctx_date_ajournement, exo_facul_1, exo_facul_2, exo_facul_3, exo_facul_4, exo_facul_5, exo_facul_6, exo_facul_7, exo_facul_8, exo_facul_9, exo_ta_1, exo_ta_2, exo_ta_3, exo_ta_4, exo_ta_5, exo_ta_6, exo_ta_7, exo_ta_8, exo_ta_9, exo_rap_1, exo_rap_2, exo_rap_3, exo_rap_4, exo_rap_5, exo_rap_6, exo_rap_7, exo_rap_8, mtn_exo_ta_part_commu, mtn_exo_ta_part_depart, mtn_exo_ta_part_reg, mtn_exo_rap, dpc_type, dpc_desc_actv_ex, dpc_desc_ca, dpc_desc_aut_prec, dpc_desig_comm_arti, dpc_desig_loc_hab, dpc_desig_loc_ann, dpc_desig_loc_ann_prec, dpc_bail_comm_date, dpc_bail_comm_loyer, dpc_actv_acqu, dpc_nb_sala_di, dpc_nb_sala_dd, dpc_nb_sala_tc, dpc_nb_sala_tp, dpc_moda_cess_vente_am, dpc_moda_cess_adj, dpc_moda_cess_prix, dpc_moda_cess_adj_date, dpc_moda_cess_adj_prec, dpc_moda_cess_paie_comp, dpc_moda_cess_paie_terme, dpc_moda_cess_paie_terme_prec, dpc_moda_cess_paie_nat, dpc_moda_cess_paie_nat_desig_alien, dpc_moda_cess_paie_nat_desig_alien_prec, dpc_moda_cess_paie_nat_eval, dpc_moda_cess_paie_nat_eval_prec, dpc_moda_cess_paie_aut, dpc_moda_cess_paie_aut_prec, dpc_ss_signe_demande_acqu, dpc_ss_signe_recher_trouv_acqu, dpc_notif_adr_prop, dpc_notif_adr_manda, dpc_obs, co_peri_site_patri_remar, co_abo_monu_hist, co_inst_ouvr_trav_act_code_envir, co_trav_auto_env, co_derog_esp_prot, ctx_reference_dsj, co_piscine, co_fin_lls, co_fin_aa, co_fin_ptz, co_fin_autr, dia_ss_date, dia_ss_lieu, enga_decla_lieu, enga_decla_date, co_archi_attest_honneur, co_bat_niv_dessous_nb, co_install_classe, co_derog_innov, co_avis_abf, tax_surf_tot_demo, tax_surf_tax_demo, tax_terrassement_arch, tax_adresse_future_numero, tax_adresse_future_voie, tax_adresse_future_lieudit, tax_adresse_future_localite, tax_adresse_future_cp, tax_adresse_future_bp, tax_adresse_future_cedex, tax_adresse_future_pays, tax_adresse_future_division, co_bat_projete, co_bat_existant, co_bat_nature, terr_juri_titul_date, co_autre_desc, co_trx_autre, co_autre, erp_modif_facades, erp_trvx_adap, erp_trvx_adap_numero, erp_trvx_adap_valid, erp_prod_dangereux, co_trav_supp_dessus, co_trav_supp_dessous, tax_su_habit_abr_jard_pig_colom, enga_decla_donnees_nomi_comm, x1l_legislation, x1p_precisions, x1u_raccordement, x2m_inscritmh, s1na1_numero, s1va1_voie, s1wa1_lieudit, s1la1_localite, s1pa1_codepostal, s1na2_numero, s1va2_voie, s1wa2_lieudit, s1la2_localite, s1pa2_codepostal, e3c_certification, e3a_competence, a4d_description, m2b_abf, m2j_pn, m2r_cdac, m2r_cnac, u3a_voirieoui, u3f_voirienon, u3c_eauoui, u3h_eaunon, u3g_assainissementoui, u3n_assainissementnon, u3m_electriciteoui, u3b_electricitenon, u3t_observations, u1a_voirieoui, u1v_voirienon, u1q_voirieconcessionnaire, u1b_voirieavant, u1j_eauoui, u1t_eaunon, u1e_eauconcessionnaire, u1k_eauavant, u1s_assainissementoui, u1d_assainissementnon, u1l_assainissementconcessionnaire, u1r_assainissementavant, u1c_electriciteoui, u1u_electricitenon, u1m_electriciteconcessionnaire, u1f_electriciteavant, u2a_observations, f1ts4_surftaxestation, f1ut1_surfcree, f9d_date, f9n_nom, dia_droit_reel_perso_grevant_bien_desc, dia_mod_cess_paie_nat_desc, dia_mod_cess_rente_viag_desc, dia_mod_cess_echange_desc, dia_mod_cess_apport_societe_desc, dia_mod_cess_cess_terr_loc_co_desc, dia_mod_cess_esti_imm_loca_desc, dia_mod_cess_adju_obl_desc, dia_mod_cess_adju_fin_indivi_desc, dia_cadre_titul_droit_prempt, dia_mairie_prix_moyen, dia_propri_indivi, dia_situa_bien_plan_cadas_oui, dia_situa_bien_plan_cadas_non, dia_notif_dec_titul_adr_prop, dia_notif_dec_titul_adr_prop_desc, dia_notif_dec_titul_adr_manda, dia_notif_dec_titul_adr_manda_desc, dia_dia_dpu, dia_dia_zad, dia_dia_zone_preempt_esp_natu_sensi, dia_dab_dpu, dia_dab_zad, dia_mod_cess_commi_mnt, dia_mod_cess_commi_mnt_ttc, dia_mod_cess_commi_mnt_ht, dia_mod_cess_prix_vente_num, dia_mod_cess_prix_vente_mob_num, dia_mod_cess_prix_vente_cheptel_num, dia_mod_cess_prix_vente_recol_num, dia_mod_cess_prix_vente_autre_num, dia_su_co_sol_num, dia_su_util_hab_num, dia_mod_cess_mnt_an_num, dia_mod_cess_mnt_compt_num, dia_mod_cess_mnt_soulte_num, dia_comp_prix_vente, dia_comp_surface, dia_comp_total_frais, dia_comp_mtn_total, dia_comp_valeur_m2, dia_esti_prix_france_dom, dia_prop_collectivite, dia_delegataire_denomination, dia_delegataire_raison_sociale, dia_delegataire_siret, dia_delegataire_categorie_juridique, dia_delegataire_representant_nom, dia_delegataire_representant_prenom, dia_delegataire_adresse_numero, dia_delegataire_adresse_voie, dia_delegataire_adresse_complement, dia_delegataire_adresse_lieu_dit, dia_delegataire_adresse_localite, dia_delegataire_adresse_code_postal, dia_delegataire_adresse_bp, dia_delegataire_adresse_cedex, dia_delegataire_adresse_pays, dia_delegataire_telephone_fixe, dia_delegataire_telephone_mobile, dia_delegataire_telephone_mobile_indicatif, dia_delegataire_courriel, dia_delegataire_fax, dia_entree_jouissance_type, dia_entree_jouissance_date, dia_entree_jouissance_date_effet, dia_entree_jouissance_com, dia_remise_bien_date_effet, dia_remise_bien_com, c2zp1_crete, c2zr1_destination, mh_design_appel_denom, mh_design_type_protect, mh_design_elem_prot, mh_design_ref_merimee_palissy, mh_design_nature_prop, mh_loc_denom, mh_pres_intitule, mh_trav_cat_1, mh_trav_cat_2, mh_trav_cat_3, mh_trav_cat_4, mh_trav_cat_5, mh_trav_cat_6, mh_trav_cat_7, mh_trav_cat_8, mh_trav_cat_9, mh_trav_cat_10, mh_trav_cat_11, mh_trav_cat_12, mh_trav_cat_12_prec, x2c_classe, bi1da1, bi1da2, ci2na1, ci2na2, ci2na3, ci6ra, tab_dia_lot, ci6ba1, ci6ba2, ci7la1, ci7la2, ci8c, ci8t, ci8ma1, ci8ma2, di2oa6, di2oa7, ei1ra1, ei1ra2, fi1c, fi1va1, fi1va2, fi3me1, fi4d, fi4l, fi5da1, fi5da2, gi2pa1, gi2pa2, gi3ma1, gi3ma2, gi3ma3, gi3ma4, gi3ma5, gi4aa1, gi4aa2, gi4aa6, gi4aa7, gi4ab2, gi4aa9, gi4ab3, gi4ab4, gi4ab5, gi4am1_gi4am2, ci4na1, ci4aa1, ci4la1, fi1t, fi1d, fi1e) VALUES
(16,    'cerfa de test',    '123456',   '2013-08-01',   '2033-12-31',   't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    13409,  't',    't',    't',    't',    't',    't',    't',    't',    1340909,    1340909,    1340909,    1340909,    't',    't',    't',    't',    't',    't',    't',    1340909,    13409,  't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    1340903,    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    1382403,    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    1340913,    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    1007203,    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't',    't');

-- Rend obsolète l'ancien cerfa de test
UPDATE cerfa SET om_validite_fin = '2024-04-01' WHERE cerfa = 15;

-- Active le cerfa de test sur tous les datd
UPDATE dossier_autorisation_type_detaille SET cerfa = 16;

--
-- END / [#10387] Mise à jour des données techniques et CERFA
--

--
-- BEGIN / [#10390] Implémentation des nomenclatures Plat'AU - [#10389] [MC0044635][MC0045937] Modules Flux Platau
--

-- Ajout des données liées à la catégorie platau
INSERT INTO document_type_categorie (document_type_categorie, libelle, code) 
    SELECT nextval('document_type_categorie_seq'), 'Plat''AU', 'PLATAU'
    WHERE NOT EXISTS (SELECT 1 FROM document_type_categorie WHERE code = 'PLATAU');
INSERT INTO document_type_categorie (document_type_categorie, libelle, code) 
    SELECT nextval('document_type_categorie_seq'), 'Autres', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type_categorie WHERE code = NULL);

-- Ajout des données liées aux types de documents
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Récépissé', '1', 1, '01/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '1');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Courrier (abandon pré-décision du projet)', '2', 1, '02/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '2');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Lettre du premier mois', '3', 1, '03/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '3');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Lettre de prolongation de délai d’instruction', '4', 1, '04/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '4');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Lettre de relance aux pétitionnaires', '5', 1, '05/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '5');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Demande de pièces complémentaires', '6', 1, '06/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '6');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Consultation', '7', 1, '07/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '7');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Lettre de relance à un service consulté', '8', 1, '08/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '8');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Document lié à un avis', '9', 1, '09/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '9');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Observations relatives à un projet d’arrêté', '10', 1, '10/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '10');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Prescriptions indépendantes d’un avis', '11', 1, '11/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '11');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Eléments complémentaires à des prescriptions', '12', 1, '12/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '12');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Proposition de décision', '13', 1, '13/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '13');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Arrêté', '14', 1, '14/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '14');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Certificat de non-opposition', '15', 1, '15/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '15');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Courrier (confirmation de demande d’autorisation d’urbanisme)', '16', 1, '16/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '16');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Courrier (demande de renseignements pour traitement fiscal)', '17', 1, '17/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '17');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Eléments explicatifs d''une taxation', '18', 1, '18/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '18');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Lettre d’information sur les taxes', '19', 1, '19/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '19');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Courrier (demande de retrait)', '20', 1, '20/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '20');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Attestation de libération de terrain (levée des prescriptions d’archéologie préventive)', '21', 1, '21/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '21');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Recours', '22', 1, '22/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '22');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Décision suite à recours', '23', 1, '23/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '23');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Mise en demeure', '24', 1, '24/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '24');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Constat d’infraction', '25', 1, '25/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '25');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Courrier (procédure contradictoire)', '26', 1, '26/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '26');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Demande de remise gracieuse', '27', 1, '27/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '27');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Courrier (décision relative à une demande de remise gracieuse)', '28', 1, '28/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '28');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Courrier (demande de prorogation)', '29', 1, '29/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '29');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'DOC', '30', 1, '30/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '30');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'DAACT', '31', 1, '31/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '31');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Attestation', '32', 1, '01/02/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '32');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Contestation de DAACT', '33', 1, '02/02/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '33');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Courrier (demande de document par les pétitionnaires)', '34', 1, '03/02/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '34');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Certificat de non contestation de DAACT', '35', 1, '04/02/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '35');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Certificat de libération de terrain', '36', 1, '05/02/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '36');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Courrier simple (contrôle de légalité)', '37', 1, '06/02/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '37');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Lettre d''observation (contrôle de légalité)', '38', 1, '07/02/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '38');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Refus explicite suite à observations (contrôle de légalité)', '39', 1, '08/02/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '39');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Réponse à observation (contrôle de légalité)', '40', 1, '09/02/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '40');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Notification de déféré au tribunal administratif (contrôle de légalité)', '41', 1, '10/02/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '41');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Jugement', '42', 1, '11/02/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '42');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Attestation de numérisation', '43', 1, '08/10/2021', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '43');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Preuve d’horodatage', '44', 1, '08/10/2021', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '44');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Accusé de réception (contrôle de légalité)', '45', 1, '01/04/2022', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '45');
INSERT INTO document_type (document_type, libelle, code, document_type_categorie, om_validite_debut, om_validite_fin) 
    SELECT nextval('document_type_seq'), 'Dossier d''enquête publique', '46', 1, '01/09/2022', NULL
    WHERE NOT EXISTS (SELECT 1 FROM document_type WHERE code = '46');

-- Ajout des données liées aux type d'acteur platau
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Guichet unique', '1', '01/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '1');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Service instructeur CT', '2', '02/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '2');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Service consultable', '3', '03/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '3');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Autorité compétente', '4', '04/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '4');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Autorité de recours', '5', '05/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '5');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Service fiscal', '6', '06/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '6');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Bénéficiaire d’une taxe', '7', '07/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '7');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Contrôle de légalité', '8', '08/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '8');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Service statistique', '9', '09/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '9');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Service du cadastre', '10', '10/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '10');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Administrateur Plat’AU', '11', '11/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '11');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'ADAU', '12', '12/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '12');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Service instructeur DDT', '13', '13/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '13');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'RIEAU', '14', '14/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '14');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Support', '15', '14/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '15');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Ministère de la culture', '16', '16/01/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '16');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'AVISAU', '17', '24/03/2021', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '17');
INSERT INTO type_acteur_platau (type_acteur_platau, libelle, code, om_validite_debut, om_validite_fin) 
    SELECT nextval('type_acteur_platau_seq'), 'Prestataire de numérisation', '18', '04/11/2020', NULL
    WHERE NOT EXISTS (SELECT 1 FROM type_acteur_platau WHERE code = '18');

--
-- END / [#10390] Implémentation des nomenclatures Plat'AU - [#10389] [MC0044635][MC0045937] Modules Flux Platau
--