Compare commits

...

2 Commits

Author SHA1 Message Date
ababbf6142 Merge remote-tracking branch 'origin/develop' into develop
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
2025-12-12 10:12:20 +01:00
e97fd0aacb inserita nota bio nella dtb_note_doc, associata ai tipi documenti e svuotata setup stampa_documenti per rossogargano 2025-12-12 10:12:09 +01:00

View File

@@ -0,0 +1,68 @@
package it.integry.ems.migration.model;
import it.integry.ems.migration._base.BaseMigration;
import it.integry.ems.migration._base.IntegryCustomer;
import it.integry.ems.migration._base.MigrationModelInterface;
public class Migration_20251212095000 extends BaseMigration implements MigrationModelInterface {
@Override
public void up() throws Exception {
if (isHistoryDB())
return;
if(isCustomer(IntegryCustomer.RossoGargano)) {
executeStatement("INSERT INTO dtb_note_doc (note, data_iniz, data_fine, flag_bio)\n" +
"SELECT \n" +
" (\n" +
" SELECT value \n" +
" FROM stb_gest_setup \n" +
" WHERE gest_name = 'stampa_documenti'\n" +
" AND section = 'bio'\n" +
" AND key_section = 'descrizione'\n" +
" )\n" +
" + ' ' +\n" +
" (\n" +
" SELECT value \n" +
" FROM stb_gest_setup \n" +
" WHERE gest_name = 'stampa_documenti'\n" +
" AND section = 'bio'\n" +
" AND key_section = 'certificato'\n" +
" ) AS note,\n" +
" '2025-07-01',\n" +
" '2099-12-31',\n" +
" 1;",
"INSERT INTO drl_tipi_note_doc (cod_dtip, id_note, id_riga)\n" +
"SELECT\n" +
" t.cod_dtip,\n" +
" n.id_note,\n" +
" ISNULL(\n" +
" (\n" +
" SELECT MAX(d.id_riga)\n" +
" FROM drl_tipi_note_doc d\n" +
" WHERE d.cod_dtip = t.cod_dtip\n" +
" ), 0\n" +
" ) + 1 AS id_riga\n" +
"FROM (\n" +
" SELECT MAX(id) AS id_note\n" +
" FROM dtb_note_doc\n" +
" WHERE flag_bio = 1\n" +
" ) n\n" +
"JOIN (\n" +
" SELECT cod_dtip\n" +
" FROM dtb_tipi\n" +
" WHERE gestione = 'V'\n" +
" AND mod_stamp IN ('bolac', 'fat', 'fatac')\n" +
" ) t\n" +
"ON 1 = 1;",
"UPDATE stb_gest_setup set value = null \n" +
"WHERE gest_name = 'stampa_documenti'\n" +
" AND section = 'bio'\n" +
" AND key_section IN ('certificato','descrizione');");
}
}
@Override
public void down() throws Exception {
}
}