Merge remote-tracking branch 'origin/develop' into develop
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
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_20250917162650 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if ( isCustomer(IntegryCustomer.Biolevante)) {
|
||||
executeStatement(";with moduli as (\n" +
|
||||
"select *\n" +
|
||||
"from dtb_mod_stampa\n" +
|
||||
"where mod_stampa in ('CMR', 'PACK', 'PACKC') and report_id is not null)\n" +
|
||||
"insert into drl_tipi_report ( cod_dtip, report_id, sort_id, report_type)\n" +
|
||||
"select cod_dtip, moduli.report_id, \n" +
|
||||
"ROW_NUMBER() over (partition by cod_dtip order by moduli.mod_stampa desc) as sort_id,\n" +
|
||||
"IIF(moduli.mod_stampa ='CMR',2, 1) as report_type\n" +
|
||||
"from dtb_tipi,\n" +
|
||||
"moduli\n" +
|
||||
"where dtb_tipi.tipo_emissione = 'DIRETTA'\n" +
|
||||
"and ((gestione = 'A' AND moduli.mod_stampa = 'PACKC') OR\n" +
|
||||
"(gestione = 'V' AND moduli.mod_stampa IN( 'CMR','PACK') ) OR \n" +
|
||||
"(gestione = 'L' AND segno_qta_car - segno_val_scar > 0 AND moduli.mod_stampa = 'PACKC') OR\n" +
|
||||
"(gestione = 'L' AND segno_qta_car - segno_val_scar < 0 AND moduli.mod_stampa = 'PACK')\n" +
|
||||
")\n" +
|
||||
"order by 1");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user