aggiunta vista
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240426125037 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
createOrUpdateView("avw_scheda_acc_count_row", "create view avw_scheda_acc_count_row as \n" +
|
||||
"SELECT id_scheda,\n" +
|
||||
" COUNT(*) as row_tot,\n" +
|
||||
" SUM(CASE WHEN atb_scheda_accr.flag_registrato = 'S' THEN 1 ELSE 0 END) as row_reg,\n" +
|
||||
" SUM(CASE WHEN atb_scheda_accr.costo_med <> 0 THEN 1 ELSE 0 END) AS row_costo\n" +
|
||||
" FROM atb_scheda_accr\n" +
|
||||
" GROUP BY id_scheda");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user