-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/migrations/2024-11-10_classroom_qtd_students_9º_ano/sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
CREATE OR REPLACE VIEW `classroom_qtd_students` AS | ||
select | ||
`c`.`school_inep_fk` AS `school_inep_fk`, | ||
`c`.`inep_id` AS `inep_id`, | ||
`c`.`id` AS `id`, | ||
`c`.`name` AS `name`, | ||
concat_ws(' - ',concat_ws(':',`c`.`initial_hour`,`c`.`initial_minute`), | ||
concat_ws(':',`c`.`final_hour`,`c`.`final_minute`)) AS `time`, | ||
|
||
`c`.`schooling` AS `schooling`, | ||
`c`.`complementary_activity` AS `complementary_activity`, | ||
`c`.`aee` AS `aee`, | ||
|
||
case `c`.`modality` when 1 then 'Ensino Regular' when 2 then 'Educação Especial' when 3 then 'Educação de Jovens e Adultos (EJA)' when 4 then 'Educação Profissional' when 5 then 'Atendimento Educacional Especializado (AEE)' else 'Não se Aplica' end AS `modality`, | ||
|
||
`esm`.`name` AS `stage`,count(`c`.`id`) AS `students`,`c`.`school_year` AS `school_year`,`se`.`status` AS `status` from ((`classroom` `c` join `student_enrollment` `se` on(`c`.`id` = `se`.`classroom_fk`)) left join `edcenso_stage_vs_modality` `esm` on(`c`.`edcenso_stage_vs_modality_fk` = `esm`.`id`)) where `se`.`status` in (1,6,7,8,9,10) or `se`.`status` is null group by `c`.`id`; | ||
|
||
|
||
update edcenso_stage_vs_modality set stage = 3 where upper(name) like '%9º ANO' or upper(alias) = '9º ANO'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters