START TRANSACTION;

DELETE FROM scad_deadline_attachments;
DELETE FROM scad_deadlines;
DELETE FROM scad_subjects;

ALTER TABLE scad_deadlines AUTO_INCREMENT = 1;
ALTER TABLE scad_subjects AUTO_INCREMENT = 1;

INSERT INTO scad_subjects (name, color) VALUES ('Ambiente', '#198754') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Manutenzioni', '#5a8fd8') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Sicurezza', '#e8930c') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Ambienti - Scarichi idrici', '#0dcaf0') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Prescrizioni generali', '#6f42c1') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Antincendio', '#dc3545') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Ambiente - Manutenzione', '#20c997') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Ambiente - Rifiuti', '#795548') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Medicina del Lavoro', '#d63384') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Prescrizioni generali    Medicina del Lavoro', '#343a40') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Adempimenti', '#b88a44') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Attività in appalto', '#8b4513') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Formazione', '#17a2b8') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Appaltatori', '#212529') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Ambienti - Emissioni in atmosfera', '#0d6efd') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Ambiente - Emissioni in atmosfera', '#28a745') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Prevenzione - Sicurezza', '#ffc107') ON DUPLICATE KEY UPDATE color = VALUES(color);
INSERT INTO scad_subjects (name, color) VALUES ('Pronto Soccorso', '#e83e8c') ON DUPLICATE KEY UPDATE color = VALUES(color);


INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES (NULL, 'Autorizzazione raccolta e trasporto rifiuti speciali non pericolosi TRAMONTO ANTONIO', 'D.M. 10.03.1998, UNI 9994', 'quinquennial', '2025-12-22', '2021-01-02', '2020-12-22', 7, NULL, NULL, 1, 'Amministrazione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente'), 'Autorizzazione raccolta e trasporto rifiuti speciali pericolosi TRAMONTO ANTONIO', 'D.Lgs 81/08 art. 174, 176', 'quinquennial', '2026-01-09', '2021-01-19', '2021-01-09', 7, NULL, NULL, 1, 'Amministrazione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Manutenzioni'), 'Manutenzione Transpalett manuali', 'D.Lgs 81/08 all.V', 'quarterly', '2026-03-31', '2026-02-24', '2025-12-23', 7, 'Locale Archivio', NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Sicurezza'), 'Manutenzione Carrelli Elevatori', 'D.Lgs 81/08 all.V', 'quarterly', '2026-03-31', '2026-02-24', '2025-12-23', 7, 'Locale Archivio', NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambienti - Scarichi idrici'), 'Sostituzione valvola Recipienti Pressione', NULL, 'triennial', '2026-04-03', '2024-07-05', '2023-07-04', 7, 'Locale Archivio', 'Autoclave l 1.000 pozzi', 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Rinnovo CPI', 'D.M. 10.03.1998, D.M. 16.06.1982, DPR 151 del 2011', 'quinquennial', '2026-04-30', '2021-10-21', '2021-10-21', 7, NULL, 'Scadenza 09/06/2026', 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Verifica funzionamento impianto schiuma', 'D.Lgs. 81/2008 (art. 18, c 1, u) D.Lgs. 81/2008 (art. 26)', 'semiannual', '2026-04-30', '2026-02-24', '2026-02-19', 7, 'Locale Archivio', 'Attività in appalto a Ditta specializzata', 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Verifica funzionamento stazione di pompaggio antincendio', 'D.Lgs. 81/2008 (art. 18, c 1, u) D.Lgs. 81/2008 (art. 26)', 'quarterly', '2026-04-30', '2026-02-24', '2026-02-19', 7, 'Locale Archivio', 'Attività in appalto a Ditta specializzata', 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Verifica funzionamento valvola a diluvio impianto schiuma', 'D.Lgs. 81/2008 (art. 18, c 1, u) D.Lgs. 81/2008 (art. 26)', 'quarterly', '2026-04-30', '2026-02-24', '2026-02-19', 7, 'Locale Archivio', 'Attività in appalto a Ditta specializzata', 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Manutenzioni'), 'Verifica impianto rivelazione incendi', 'D.Lgs. 81/2008 (art. 18, c 1, u) D.Lgs. 81/2008 (art. 26)', 'semiannual', '2026-05-12', '2026-03-21', '2025-11-13', 7, 'Locale Archivio', NULL, 1, 'Delegato di funzioni');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambienti - Scarichi idrici'), 'Sanificazione filtri rubinetti e pigne docce con candeggina', 'D.Lgs 81/08 art. 209', 'quarterly', '2026-05-31', '2026-02-24', '2026-02-24', 7, NULL, NULL, 1, 'Ditta Incaricata');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES (NULL, 'Manutenzione e controllo fughe pompa di calore ELCO', 'D.M. 17/03/03', 'annual', '2026-05-31', '2026-02-24', NULL, 7, NULL, 'Presentazione a cura delle ditte incaricate', 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente'), 'Gestione Rischi Impianto Trattamento Aria ((Unità trattamento aria - Filtri Aria - Umidificazione a vapore - Batterie di scambio termico - Ventilazione UTA - Raffreddatori di liquido - Apparecchi terminali) e registrazione su quaderno e libretti', 'D.Lgs 81/08', 'once', '2026-05-31', '2026-03-21', '2025-10-13', 7, 'Locale Archivio', NULL, 1, 'Delegato di funzioni');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente - Manutenzione'), 'Dichiarazione MUD', NULL, 'annual', '2026-06-30', '2026-02-24', '2025-06-19', 7, NULL, NULL, 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente - Rifiuti'), 'Comunicazione BANCA DATI GAS FLUORURATI refrigeratori produzione riguardante le emissioni in atmosfera di gas fluorurati', 'Accordo Stato regioni 07.02.2013', 'annual', '2026-06-30', '2026-02-24', NULL, 7, NULL, 'Presentazione a cura delle ditte incaricate', 1, 'DdL-RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Comunicazione BANCA DATI GAS FLUORURATI pompa di calore riguardante le emissioni in atmosfera di gas fluorurati', 'Accordo Stato regioni 07.02.2013', 'annual', '2026-06-30', '2026-02-24', NULL, 7, NULL, 'Presentazione a cura delle ditte incaricate', 1, 'DdL-RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Manutenzione e controllo fughe refrigeratori produzione', 'D.M. 17/03/03', 'annual', '2026-06-30', '2026-02-24', NULL, 7, NULL, NULL, 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Formazione RLS - 4 ore anno', 'D.Lgs 81/08 art. 18, 35', 'annual', '2026-06-30', '2026-02-24', '2025-06-12', 7, 'Locale Archivio', NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Medicina del Lavoro'), 'Derattizzazione', NULL, 'semiannual', '2026-06-30', '2026-02-24', NULL, 7, 'Locale Matrici', NULL, 1, 'Incaricato');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Manutenzioni'), 'Pulizia piazzali', NULL, 'semiannual', '2026-06-30', '2026-02-24', NULL, 7, NULL, 'Audit Interno', 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Autorizzazione raccolta e trasporto rifiuti speciali non pericolosi FEROLMET', 'D.Lgs 81/08 art. 19, Accordo Stato Regioni 2011', 'once', '2026-07-30', '2023-02-07', NULL, 7, NULL, NULL, 1, 'Amministrazione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente'), 'Autorizzazione raccolta e trasporto rifiuti speciali pericolosi FEROLMET', 'D.Lgs 81/08 art. 202', 'once', '2026-07-30', '2023-02-07', NULL, 7, NULL, NULL, 1, 'Amministrazione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Autocontrolli periodici emissioni in atmosfera', 'D.Lgs 81/08 art. 223', 'annual', '2026-07-31', '2026-02-24', '2025-06-18', 7, NULL, NULL, 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES (NULL, 'Comunicazione BANCA DATI GAS FLUORURATI Pompa di Calore Evaporatore  riguardante le emissioni in atmosfera di gas fluorurati', 'D.Lgs 81/08 art. 53', 'annual', '2026-07-31', '2026-03-21', NULL, 7, 'Locale Archivio', 'Presentazione a cura della ditta incaricata EcoTechno', 1, 'Delegato di funzioni');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Manutenzioni'), 'Controllo documentazione Sicurezza', 'D.Lgs 152/2006 Parte III (art. 124)', 'semiannual', '2026-08-31', '2026-02-24', '2026-02-23', 7, 'Locale Archivio', 'Audit Interno', 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES (NULL, 'Comunicazione BANCA DATI GAS FLUORURATI refrigeratore raffrescamento inizio linee riguardante le emissioni in atmosfera di gas fluorurati', 'Accordo Stato regioni 07.02.2013', 'annual', '2026-08-31', '2026-02-24', NULL, 7, NULL, 'Presentazione a cura delle ditte incaricate', 1, 'DdL-RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Manutenzioni'), 'Verifica dispositivi su uscite di emergenza', 'D.Lgs 81/08 art. 26', 'semiannual', '2026-08-31', '2026-02-24', '2026-02-26', 7, 'Locale Archivio', NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Verifica integrità ed efficienza porte tagliafuoco', 'D.Lgs. 81/2008 (art. 18, c 1, u) D.Lgs. 81/2008 (art. 26)', 'semiannual', '2026-08-31', '2026-02-24', '2026-02-26', 7, 'Locale Archivio', NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali    Medicina del Lavoro'), 'Controllo dispositivi lotta antincendio (estintori, idranti, lance, manichette)', 'D.Lgs 81/08 art. 37, 73, Accordo Stato Regioni 2011', 'semiannual', '2026-08-31', '2026-02-24', '2026-02-26', 7, 'Locale Archivio', NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Adempimenti'), 'Formazione del Preposto', NULL, 'quinquennial', '2026-09-20', '2023-02-07', '2021-09-21', 7, NULL, 'Accordo Stato Regioni 21.12.2011', 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Indagine Ambientale', 'D.Lgs 81/08  - Salute e Sicurezza nei luoghi di lavoro', 'annual', '2026-09-30', '2026-02-24', '2025-09-10', 7, 'Locale Archivio', NULL, 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente'), 'Controllo fumi e funzionamento caldaia', 'D.Lgs 81/08 art. 190', 'annual', '2026-10-31', '2026-03-21', '2025-05-15', 7, 'Locale Archivio', NULL, 1, 'Delegato di funzioni');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Attività in appalto'), 'Riunione periodica art. 35', 'D.Lgs 152/2006 Parte III (art. 124)', 'annual', '2026-11-30', '2025-11-20', '2025-11-20', 7, 'Locale Archivio', NULL, 1, 'Delegato di Funzioni');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Valutazione Rischio Vibrazioni', 'D.M. 10.03.1998', 'quadriennial', '2026-12-01', '2023-02-07', '2022-12-02', 7, 'Locale Archivio', 'Accordo Stato Regioni 21.12.2011', 1, 'DdL - RSPP Medico - RLS');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Medicina del Lavoro'), 'Valutazione stress lavoro-correllato', 'D. 20 del 24/01/2011', 'biennial', '2026-12-19', '2024-12-20', '2024-12-20', 7, 'Locale Archivio', NULL, 1, 'DdL - RSPP Medico - RLS');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Formazione'), 'Verifica scadenza sostanze assorbenti e neutralizzanti al fine di prevenire l''inquinamento del suolo da parte dell''elettrolita delle batterie', 'D.Lgs 152/2006 Parte V', 'annual', '2026-12-31', '2025-12-22', '2025-12-22', 7, NULL, 'Audit Interno', 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambienti - Scarichi idrici'), 'Emergenze (alluvione e sversamento oli) Verifica stato tombini e armadio materiale emergenza alluvione e presenza materiale per pulizia olii', 'D.Lgs 81/08 art. 216', 'annual', '2026-12-31', '2025-12-22', '2025-12-22', 7, NULL, 'Verifica stato tombini eseguita da Roberto+Daniele', 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Formazione'), 'Simulazione periodica di evacuazione antincendio', 'D.Lgs 81/08 art. 25', 'annual', '2026-12-31', '2025-12-22', '2025-12-22', 7, 'Locale Archivio', NULL, 1, 'Delegato di Funzioni');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Contributo CONAI', 'D.Lgs 152/2006 Parte V', 'once', '2027-01-20', '2026-01-20', '2026-01-20', 7, NULL, NULL, 1, '--');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Sicurezza'), 'Nomina 3° resp. per caldaie >35kw', 'D.Lgs 81/08 art. 71', 'once', '2027-01-31', '2026-01-19', '2026-01-19', 7, NULL, NULL, 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente'), 'Analisi schiuma delll''impianto', 'D.Lgs. 81/2008 (art. 18, c 1, u) D.Lgs. 81/2008 (art. 26)', 'annual', '2027-01-31', '2026-03-21', '2026-02-04', 7, 'Locale Archivio', 'Attività in appalto a Ditta specializzata', 1, 'Delegato di funzioni');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Verifica impianto di Messa a Terra', 'DPR 462/01', 'biennial', '2027-02-12', '2025-02-19', '2025-02-12', 7, 'Locale Archivio', NULL, 1, 'Delegato di funzioni');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Test carrellisti uso sostanze dopanti', 'D.Lgs 81/08', 'annual', '2027-02-28', '2025-02-10', '2026-02-09', 7, NULL, NULL, 1, 'Medico competente');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Visite Mediche ai dipendenti', 'D.Lgs 81/08 art. 18, 38, 41', 'annual', '2027-02-28', '2025-02-19', '2026-02-09', 7, 'Locale Archivio', NULL, 1, 'Medico Competente');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambienti - Scarichi idrici'), 'Controllo Legionella Acqua', 'D.Lgs 81/08 art. 32, Accordo Stato Regioni 2006', 'annual', '2027-02-28', '2026-02-24', '2026-02-19', 7, 'Locale Archivio', NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Appaltatori'), 'Verbale di Sopralluogo dei Locali del Medico Competente', 'D.Lgs 81/08', 'annual', '2027-02-28', '2026-02-24', '2026-02-09', 7, 'Locale Archivio', NULL, 1, 'Medico Competente');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Manutenzioni'), 'Dichiarazione acque derivate da pozzi', 'ART. 22 DEL D.LGS. 11 MAGGIO 1999, N. 152, COSÌ COME MODIFICATO DALL’ART. 6, COMMA 1, LETT. A) DEL D.LGS. 18 AGOSTO 2000, N. 258', 'annual', '2027-03-31', '2026-03-21', '2026-03-20', 7, 'Locale Archivio', NULL, 1, 'Delegato di funzioni');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Formazione'), 'Verifica Periodica Recipienti Pressione', NULL, 'triennial', '2027-04-04', '2024-07-05', '2024-07-05', 7, 'Locale Archivio', 'Autoclave l 1.000 pozzi', 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Revisione scala a gabbia Stp sul tetto del fabbricato tra porzione uffici (più alta) e porzione reparto', 'D.Lgs. n. 81/2008', 'quinquennial', '2027-10-24', '2023-01-31', '2022-10-25', 7, 'Locale Archivio', NULL, 1, 'DdL-RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Visita medica per Addetti VDT', 'D.Lgs 152/2006 Parte III (art. 124)', 'biennial', '2028-02-28', '2026-02-09', '2026-02-09', 7, 'Locale Archivio', NULL, 1, 'Medico Competente');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Formazione'), 'Valutazione Rischio da ROA', 'D.P.R. 147 del 15/02/2006', 'quadriennial', '2028-07-14', '2024-11-23', '2024-07-15', 7, 'Locale Archivio', 'Accordo Stato Regioni 21.12.2011', 1, 'DdL - RSPP Medico - RLS');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Valutazione Rischio da CEM', 'LEGGE N. 70/94 D.M. 17/12/2009', 'quadriennial', '2028-07-14', '2024-11-23', '2024-07-15', 7, 'Locale Archivio', 'Accordo Stato Regioni 21.12.2011', 1, 'DdL - RSPP Medico - RLS');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Sicurezza'), 'Valutazione Rischio Rumore', 'D.M. 16/03/1998 L. n° 447/95', 'quadriennial', '2028-09-30', '2024-11-23', '2024-10-02', 7, 'Locale Archivio', NULL, 1, 'DdL - RSPP Medico - RLS');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Protezione contro i fulmini - Valutazione del rischio e scelta delle misure di protezione', 'D.Lgs. 81/2008 / CEI EN 62305-1-2-3-4 / CEI 81-29 /  CEI EN IEC 62858', 'quinquennial', '2028-12-31', '2023-09-04', '2023-07-31', 7, 'Locale Archivio', 'Rivalutazione del valore NG', 1, 'DdL-RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambienti - Scarichi idrici'), 'Autorizzazione allo scarico rete fognaria di acque reflue domestiche', 'D.Lgs 152/2006 Parte III (art. 124)', 'quadriennial', '2028-05-21', '2026-03-21', '2025-05-22', 7, NULL, 'Validità 4 anni sino al 21/05/2029. Domanda di rinnovo almeno 1 anno prima della scadenza', 1, 'Condominio Fornace Venere in persona dell''Amministratore');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambienti - Emissioni in atmosfera'), 'Bombola acetilene l 5 omologata 2020/01', 'D.Lgs 03.04.2006 n.152 Legge R. 21.06.1999 n.18', 'decennial', '2030-01-31', '2021-02-23', '2021-02-23', 7, 'Locale Archivio', NULL, 1, 'DdL');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Formazione'), 'Bombola ossigeno l 5 omologata 2020/11', 'D.Lgs 81/08 art. 36, 73,', 'decennial', '2030-11-30', '2021-02-23', '2021-02-23', 7, 'Locale Archivio', NULL, 1, 'DdL');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Sicurezza'), 'Revisione parapetti sul tetto del fabbricato (n. 3 sui lati corti)', 'EN14122 - NTC2018', 'decennial', '2032-10-24', '2023-01-31', '2022-10-25', 7, 'Locale Archivio', NULL, 1, 'DdL-RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Sicurezza'), 'Revisione parapetti soletta locali tecnici (refrigeratori)', 'EN ISO 14122-3:2001+A1:2010', 'decennial', '2032-12-18', '2023-01-31', '2022-12-19', 7, 'Locale Archivio', NULL, 1, 'DdL-RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente - Emissioni in atmosfera'), 'Rinnovo Autorizzazione alle emissioni in atmosfera', 'D.Lgs 152/2006 Parte III (art. 124)', 'quindecennial', '2037-08-23', '2023-02-24', '2023-02-24', 7, 'Locale Archivio', NULL, 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Medicina del Lavoro'), 'Informazione ai lavoratori specifica', 'D.Lgs 81/08 art. 18', 'once', '2027-04-18', NULL, NULL, 7, NULL, 'Accordo Stato Regioni 21.12.2011', 1, 'Delegato di funzioni');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Formazione ai lavoratori specifica', 'D.Lgs 81/08 art. 17,28,29', 'once', '2027-04-18', NULL, NULL, 7, NULL, 'Accordo Stato Regioni 21.12.2011', 1, 'Delegato di funzioni');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Documento Valutazione dei Rischi', 'D.Lgs 81/08 art. 18   D.M. 10.03.1998', 'once', '2026-10-13', '2025-10-13', '2025-10-13', 7, 'Locale Archivio', NULL, 1, 'DdL');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Piano di Emergenza', 'D.Lgs 81/08 art. 47', 'once', '2026-01-15', '2025-01-15', '2025-01-15', 7, 'Locale Archivio', NULL, 1, 'Delegato di Funzioni');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Nomina Medico Competente', 'D.Lgs 81/08 art. 47', 'once', '2026-11-20', '2025-11-20', '2025-11-20', 7, 'Locale Archivio', NULL, 1, 'DdL');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Segnalazione all''INAIL nominativo RLS', 'D.Lgs 81/08 art. 31', 'once', '2027-04-18', '2023-02-07', NULL, 7, 'Locale Archivio', NULL, 1, 'DdL');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prevenzione - Sicurezza'), 'Nomina RSPP', 'D.P.R. 43/12 attuazione del Regolamento CE 842/2006', 'once', '2023-02-01', '2023-02-07', '2022-02-01', 7, NULL, NULL, 1, 'DdL');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES (NULL, 'Elezione RLS', NULL, 'once', '2020-02-18', '2023-02-07', '2019-02-18', 7, 'Locale Archivio', NULL, 1, 'Direzione-Lavoratori');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Formazione'), 'Valutazione impatto acustico', 'D.Lgs 81/08 art. 19, Accordo Stato Regioni 2011', 'once', '2018-11-07', '2023-02-07', '2017-11-07', 7, NULL, NULL, 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Adempimenti'), 'Nomina Addetti Prev. Incendi', 'Lege n° 457/78', 'once', '2027-04-18', '2023-02-07', NULL, 7, 'Locale Archivio', 'Vedi Organigramma', 1, 'DdL');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Adempimenti'), 'Comunicazione dei requisiti come Medico Competente', 'Regolamento Comunale 56', 'once', '2027-04-18', '2023-02-07', NULL, 7, 'Locale Archivio', NULL, 1, 'Medico Competente');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Adempimenti'), 'Protocollo Sanitario', 'D.M. 37/08', 'annual', '2022-12-02', '2023-02-07', '2021-12-02', 7, 'Locale Archivio', 'Rivalidato tramite Riunione Periodica', 1, 'Medico Competente');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Adempimenti'), 'Nomina Dirigenti e Preposti', 'D.M. 37/08', 'once', '2027-04-18', '2023-02-07', NULL, 7, 'Locale Archivio', 'v. incarichi', 1, 'DdL');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Adempimenti'), 'Cassetta di Pronto Soccorso, controllo presenza e scadenza dispositivi e medicinali', 'D.M. 37/08', 'monthly', '2026-05-18', '2023-02-07', NULL, 7, 'Cassette P.S. Reparto e magazzino', NULL, 1, 'Incaricata');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Adempimenti'), 'Nomina Addetti Primo Soccorso', 'D.Lgs 334/99', 'once', '2027-04-18', '2023-02-07', NULL, 7, 'Locale Archivio', 'Vedi Organigramma', 1, 'DdL');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente'), 'Formazione RSPP', 'SIS - Corporate', 'quinquennial', '2031-04-18', '2023-02-07', NULL, 7, NULL, 'Non applicabile. Nomina R.S.P.P. esterno', 1, 'DdL');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente'), 'Decontaminazione/Sanificazione ambienti uffici-spogliatoi-servizi igienici-parti comuni con perossido di idrogeno', NULL, 'once', '2022-12-18', '2023-02-07', '2021-12-18', 7, NULL, NULL, 1, 'Ditta Incaricata');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Controllo  scaffalature', 'D.Lgs 81/08 art. 71', 'annual', '2023-01-17', '2023-02-07', '2022-01-17', 7, NULL, 'Audit Interno', 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Valutazione Rischio Esplosione', 'D.M. 10.03.1998, UNI 9994', 'once', '2018-03-24', '2023-02-07', '2017-03-24', 7, 'Locale Archivio', NULL, 1, 'DdL - RSPP Medico - RLS');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente - Rifiuti'), 'Valutazione Rischio Chimico', 'D.Lgs 152/2006 Parte IV', 'once', '2027-03-05', '2026-03-21', '2026-03-05', 7, 'Locale Archivio', 'Accordo Stato Regioni 21.12.2011', 1, 'DdL - RSPP Medico - RLS');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente - Rifiuti'), 'Agibilità locali', 'D.Lgs 152/2006 Parte IV', 'once', '2027-04-18', NULL, NULL, 7, 'Locale Archivio', NULL, 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente - Rifiuti'), 'Autorizzazione Sanitaria', 'D.M. 17/12/2009', 'once', '2027-04-18', NULL, NULL, 7, 'Locale Archivio', NULL, 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente - Rifiuti'), 'Conformità Impianto Elettrico', 'D.M. 17/12/2009', 'once', '2027-04-18', NULL, NULL, 7, 'Locale Archivio', NULL, 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente - Rifiuti'), 'Conformità Impianto Gas', 'D.Lgs 152/2006 Parte IV', 'once', '2027-04-18', NULL, NULL, 7, 'Locale Archivio', NULL, 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente - Rifiuti'), 'Conformità Impianto Idrico', 'D.Lgs 152/2006 Parte IV', 'once', '2027-04-18', NULL, NULL, 7, 'Locale Archivio', NULL, 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Notifica per aziende a rischio rilevante d''incendio', NULL, 'once', '2027-04-18', NULL, NULL, 7, NULL, NULL, 1, '--');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambienti - Scarichi idrici'), 'Rendicontazione indicatori ambientali', 'D.Lgs 152/2006 Parte III (art. 124)', 'annual', '2027-04-18', NULL, NULL, 7, NULL, NULL, 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente - Rifiuti'), 'Etichettatura contenitori rifiuti pericolosi', 'D.M. 10.03.1998, UNI 9994', 'once', '2027-04-18', NULL, NULL, 7, NULL, 'Audit Interno', 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente - Rifiuti'), 'Formulario d’identificazione-compilazione 1° copia e rientro 4° entro 3 mesi', 'D.M. 10.03.1998, UNI 9994', 'once', '2027-04-18', NULL, NULL, 7, NULL, 'Audit Interno', 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente - Rifiuti'), 'Tenuta dei registri di carico e scarico rifiuti', 'DPR 151/2011 (art. 6) D.M. 10/03/1998', 'once', '2027-04-18', NULL, NULL, 7, NULL, 'Audit Interno', 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente - Rifiuti'), 'Verifica autorizzazione trasportatori-smaltitori', 'D.Lgs 81/08 art. 290', 'annual', '2027-04-18', NULL, NULL, 7, NULL, 'Audit Interno', 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente'), 'Monitoraggio consumi: acqua, energia elettrica, metano. materia prima trasformate e rottamata', 'D.M. 10.03.1998', 'monthly', '2026-05-18', NULL, NULL, 7, NULL, 'Audit Interno', 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente'), 'Aggiornamento quaderno conduzione impianti. Verifica ed eventuale pulizia/sostituzione filtri cappe emissioni', 'D.LGS. 06.11.2011', 'once', '2027-04-18', NULL, NULL, 7, NULL, 'vedi registro', 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Ambiente'), 'Invio analisi dati analitici acque scaricate', 'D.M. 10.03.1998, UNI 9994', 'once', '2027-04-18', NULL, NULL, 7, NULL, 'Presenza di scarichi assimilabili ai domestici', 1, '--');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Controllo segnaletica / cartellonistica antincendio', 'D.M. 10.03.1998, UNI 9994', 'semiannual', '2026-10-18', NULL, NULL, 7, 'Locale Archivio', NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Tenuta di REGISTO ANTINCENDIO per attività soggette al DPR 151/2011', 'D.M. 10.03.1998, UNI 9994', 'once', '2027-04-18', NULL, NULL, 7, NULL, NULL, 1, '--');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Valutazione Rischio Incendio', 'D.M. 10.03.1998, UNI 9994', 'once', '2027-04-18', NULL, NULL, 7, NULL, NULL, 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Antincendio'), 'Verifica  Maniglioni antipanico non certificati CE', 'D.M. 10.03.1998, UNI 9994', 'semiannual', '2026-10-18', NULL, NULL, 7, NULL, 'Maniglioni certificati CE', 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Formazione'), 'Verifica periodica funzionamento impianto luci di emergenza', 'Norma CEI 11-27:2014 " lavoratori su quadri elettrici"', 'semiannual', '2026-10-18', NULL, NULL, 7, 'Locale Archivio', NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Formazione'), 'Qualifica Appaltatori', 'D.M. 10.03.1998', 'once', '2027-04-18', NULL, NULL, 7, 'Locale Archivio', NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Formazione'), 'DURC aggiornato', 'D.M. 388/2003', 'once', '2027-04-18', NULL, NULL, 7, NULL, NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Formazione'), 'Presenza DUVRI per attività in appalto (aggiornamento o prima emissione)', 'Accordo Stato Regioni 22.02.2012', 'once', '2027-04-18', NULL, NULL, 7, NULL, NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Formazione'), 'Presenza verbale di sopralluogo per coordinamento', 'D.Lgs 81/08 art. 19, Accordo Stato Regioni 2011', 'once', '2027-04-18', NULL, NULL, 7, NULL, 'All''avvio dei lavori, se necessario', 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Manutenzioni'), 'Richiesta all''appaltatore / prestatore d''Opera dell''idoneità tecnico professionale: iscrizione Camera di Commercio, autocertificazione i.d.p.', 'D.M. 329/04', 'once', '2027-04-18', NULL, NULL, 7, NULL, NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Manutenzioni'), 'Verificare che i lavoratori in regime di appalto mostrino apposita tessera di riconoscimento (fotografia, generalità del lavoratore e indicazione del datore di lavoro)', 'D.M. 17/03/03', 'once', '2027-04-18', NULL, NULL, 7, NULL, NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Medicina del Lavoro'), 'Formazione  addetti che effettuano lavoro sotto tensione', 'D.Lgs 81/08 art. 25, 40', 'quinquennial', '2031-04-18', NULL, NULL, 7, NULL, 'vedi Elenco formazione', 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Medicina del Lavoro'), 'Formazione Addetti Prev. Incendi', 'D.Lgs 81/08 art. 25', 'triennial', '2029-04-18', NULL, NULL, 7, 'Locale Archivio', 'vedi Elenco formazione', 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Formazione Addetti Primo Soccorso', 'D.Lgs 81/08', 'triennial', '2029-04-18', NULL, NULL, 7, 'Locale Archivio', 'vedi Elenco formazione', 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Formazione Carrellisti', 'D.Lgs 81/08 art. 18', 'quinquennial', '2031-04-18', NULL, NULL, 7, 'Locale Archivio', 'vedi Elenco formazione', 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Formazione del Dirigente', 'D.Lgs 81/08 art. 63, allegato IV', 'quinquennial', '2031-04-18', NULL, NULL, 7, NULL, 'Accordo Stato Regioni 21.12.2011', 1, '--');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Comunicazione Messa in Servizio rec. Pressione', 'D.Lgs 81/08 art. 18,74, 75, 76, 77, 78, 79', 'once', '2019-09-07', NULL, '2018-09-07', 7, NULL, NULL, 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Controllo dispositivi lotta antincendio', 'D.Lgs 81/08 art. 71', 'monthly', '2026-05-18', NULL, NULL, 7, 'Locale Archivio', NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Comunicazione all''INAIL degli infortuni', 'D.Lgs 81/08 art. 71', 'once', '2027-04-18', NULL, NULL, 7, NULL, NULL, 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Conformità Ambienti di Lavoro', 'D.Lgs 81/08 art. 19, 37', 'annual', '2027-04-18', NULL, NULL, 7, NULL, 'Audit Interno', 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Consegna e Gestione DPI', 'D.Lgs 81/08 art. 161', 'once', '2027-04-18', NULL, NULL, 7, NULL, NULL, 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Controllo  scale', 'D.Lgs 81/08 art. 167', 'once', '2027-04-18', NULL, NULL, 7, NULL, 'Audit Interno', 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Controllo imbragature, golfari', 'D.Lgs 81/08 art. 172', 'once', '2027-04-18', NULL, NULL, 7, NULL, NULL, 1, '--');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Controllo macchinari', 'D.Lgs 81/08', 'once', '2027-04-18', NULL, NULL, 7, NULL, 'Audit Interno', 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Presenza segnaletica', 'D.Lgs 81/08 art. 271', 'once', '2027-04-18', NULL, NULL, 7, 'Locale Archivio', 'Audit Interno', 1, 'RSPP');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Valutazione del Rischio da MMC', 'D.Lgs 81/08 art. 249', 'once', '2027-04-18', NULL, NULL, 7, 'Locale Archivio', 'in caso di variazioni', 1, 'DdL - RSPP Medico - RLS');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Medicina del Lavoro'), 'Valutazione del Rischio da VDT', 'D.Lgs 81/08 art. 236', 'once', '2027-04-18', NULL, NULL, 7, 'Locale Archivio', 'in caso di variazioni', 1, 'DdL - RSPP Medico - RLS');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Pronto Soccorso'), 'Valutazione Protezione Fulmini', 'D.M. 388/2003', 'once', '2027-04-18', NULL, NULL, 7, 'Locale Archivio', NULL, 1, 'Direzione');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Pronto Soccorso'), 'Valutazione Rischio da Agenti Biologici', 'D.Lgs 81/08 art. 18, 43, 45', 'annual', '2018-05-22', NULL, '2017-05-22', 7, 'Locale Archivio', 'Riunione periodica', 1, 'DdL - RSPP Medico - RLS');
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Valutazione Rischio da Amianto', NULL, 'once', '2027-04-18', NULL, NULL, 7, NULL, NULL, 1, NULL);
INSERT INTO scad_deadlines
    (subject_id, topic, law_regulation, recurrence_type, due_date, check_date,
     document_date, notification_days, storage_location, notes, created_by, departments)
  VALUES ((SELECT id FROM scad_subjects WHERE name = 'Prescrizioni generali'), 'Valutazione Rischio da Cancerogeni', NULL, 'once', '2027-04-18', NULL, NULL, 7, NULL, NULL, 1, NULL);

COMMIT;
