select calendario0_.id_calendario as id1_71_, calendario0_.ano as ano71_, calendario0_.anoFeriasVigente as anoFeria3_71_, calendario0_.anoNovasTurmas as anoNovas4_71_, calendario0_.ativo as ativo71_, calendario0_.id_convenio as id65_71_, calendario0_.id_curso as id68_71_, calendario0_.data_atualizacao as data6_71_, calendario0_.data_cadastro as data7_71_, calendario0_.fimAjustesMatricula as fimAjust8_71_, calendario0_.fimAjustesReMatricula as fimAjust9_71_, calendario0_.fimCadastroTurma as fimCada10_71_, calendario0_.fimCadastroTurmaEnsinoIndiv as fimCada11_71_, calendario0_.fimCadastroTurmaFerias as fimCada12_71_, calendario0_.fimConsolidacaoParcialTurma as fimCons13_71_, calendario0_.fimConsolidacaoTurma as fimCons14_71_, calendario0_.fimCoordenacaoAnaliseMatricula as fimCoor15_71_, calendario0_.fimCoordenacaoAnaliseReMatricula as fimCoor16_71_, calendario0_.fimDiscenteAnaliseMatricula as fimDisc17_71_, calendario0_.fimDiscenteAnaliseReMatricula as fimDisc18_71_, calendario0_.fimFerias as fimFerias71_, calendario0_.fimMatriculaAlunoCadastrado as fimMatr20_71_, calendario0_.fimMatriculaAlunoEspecial as fimMatr21_71_, calendario0_.fimMatriculaOnline as fimMatr22_71_, calendario0_.fimMatriculaTurmaFerias as fimMatr23_71_, calendario0_.fimPeriodoLetivo as fimPeri24_71_, calendario0_.fimProcessamentoMatricula as fimProc25_71_, calendario0_.fimProcessamentoReMatricula as fimProc26_71_, calendario0_.fimReMatricula as fimReMa27_71_, calendario0_.fimRequerimentoEnsinoIndiv as fimRequ28_71_, calendario0_.fimRequerimentoTurmaFerias as fimRequ29_71_, calendario0_.fimSolicitacaoTurma as fimSoli30_71_, calendario0_.fimSolicitacaoTurmaEnsinoIndiv as fimSoli31_71_, calendario0_.fimSolicitacaoTurmaFerias as fimSoli32_71_, calendario0_.fimTrancamentoTurma as fimTran33_71_, calendario0_.inicioAjustesMatricula as inicioA34_71_, calendario0_.inicioAjustesReMatricula as inicioA35_71_, calendario0_.inicioCadastroTurma as inicioC36_71_, calendario0_.inicioCadastroTurmaEnsinoIndiv as inicioC37_71_, calendario0_.inicioCadastroTurmaFerias as inicioC38_71_, calendario0_.inicioConsolidacaoParcialTurma as inicioC39_71_, calendario0_.inicioConsolidacaoTurma as inicioC40_71_, calendario0_.inicioCoordenacaoAnaliseMatricula as inicioC41_71_, calendario0_.inicioCoordenacaoAnaliseReMatricula as inicioC42_71_, calendario0_.inicioDiscenteAnaliseMatricula as inicioD43_71_, calendario0_.inicioDiscenteAnaliseReMatricula as inicioD44_71_, calendario0_.inicioFerias as inicioF45_71_, calendario0_.inicioMatriculaAlunoCadastrado as inicioM46_71_, calendario0_.inicioMatriculaAlunoEspecial as inicioM47_71_, calendario0_.inicioMatriculaOnline as inicioM48_71_, calendario0_.inicioMatriculaTurmaFerias as inicioM49_71_, calendario0_.inicioPeriodoLetivo as inicioP50_71_, calendario0_.inicioProcessamentoMatricula as inicioP51_71_, calendario0_.inicioProcessamentoReMatricula as inicioP52_71_, calendario0_.inicioReMatricula as inicioR53_71_, calendario0_.inicioRequerimentoEnsinoIndiv as inicioR54_71_, calendario0_.inicioRequerimentoTurmaFerias as inicioR55_71_, calendario0_.inicioSolicitacaoTurma as inicioS56_71_, calendario0_.inicioSolicitacaoTurmaEnsinoIndiv as inicioS57_71_, calendario0_.inicioSolicitacaoTurmaFerias as inicioS58_71_, calendario0_.inicioTrancamentoTurma as inicioT59_71_, calendario0_.id_modalidade as id69_71_, calendario0_.nivel as nivel71_, calendario0_.periodo as periodo71_, calendario0_.periodoFeriasVigente as periodo62_71_, calendario0_.periodoNovasTurmas as periodo63_71_, calendario0_.id_registro_atualizacao as id66_71_, calendario0_.id_registro_cadastro as id70_71_, calendario0_.id_unidade as id67_71_, calendario0_.vigente as vigente71_
from comum.calendario_academico calendario0_
where calendario0_.ativo=trueValue()
and calendario0_.id_unidade=605
and calendario0_.nivel='G'
order by calendario0_.ano desc, calendario0_.periodo desc, calendario0_.id_modalidade desc
-- SQL gerada para discente regular
select calendario0_.id_calendario as id1_71_, calendario0_.ano as ano71_, calendario0_.anoFeriasVigente as anoFeria3_71_, calendario0_.anoNovasTurmas as anoNovas4_71_, calendario0_.ativo as ativo71_, calendario0_.id_convenio as id65_71_, calendario0_.id_curso as id68_71_, calendario0_.data_atualizacao as data6_71_, calendario0_.data_cadastro as data7_71_, calendario0_.fimAjustesMatricula as fimAjust8_71_, calendario0_.fimAjustesReMatricula as fimAjust9_71_, calendario0_.fimCadastroTurma as fimCada10_71_, calendario0_.fimCadastroTurmaEnsinoIndiv as fimCada11_71_, calendario0_.fimCadastroTurmaFerias as fimCada12_71_, calendario0_.fimConsolidacaoParcialTurma as fimCons13_71_, calendario0_.fimConsolidacaoTurma as fimCons14_71_, calendario0_.fimCoordenacaoAnaliseMatricula as fimCoor15_71_, calendario0_.fimCoordenacaoAnaliseReMatricula as fimCoor16_71_, calendario0_.fimDiscenteAnaliseMatricula as fimDisc17_71_, calendario0_.fimDiscenteAnaliseReMatricula as fimDisc18_71_, calendario0_.fimFerias as fimFerias71_, calendario0_.fimMatriculaAlunoCadastrado as fimMatr20_71_, calendario0_.fimMatriculaAlunoEspecial as fimMatr21_71_, calendario0_.fimMatriculaOnline as fimMatr22_71_, calendario0_.fimMatriculaTurmaFerias as fimMatr23_71_, calendario0_.fimPeriodoLetivo as fimPeri24_71_, calendario0_.fimProcessamentoMatricula as fimProc25_71_, calendario0_.fimProcessamentoReMatricula as fimProc26_71_, calendario0_.fimReMatricula as fimReMa27_71_, calendario0_.fimRequerimentoEnsinoIndiv as fimRequ28_71_, calendario0_.fimRequerimentoTurmaFerias as fimRequ29_71_, calendario0_.fimSolicitacaoTurma as fimSoli30_71_, calendario0_.fimSolicitacaoTurmaEnsinoIndiv as fimSoli31_71_, calendario0_.fimSolicitacaoTurmaFerias as fimSoli32_71_, calendario0_.fimTrancamentoTurma as fimTran33_71_, calendario0_.inicioAjustesMatricula as inicioA34_71_, calendario0_.inicioAjustesReMatricula as inicioA35_71_, calendario0_.inicioCadastroTurma as inicioC36_71_, calendario0_.inicioCadastroTurmaEnsinoIndiv as inicioC37_71_, calendario0_.inicioCadastroTurmaFerias as inicioC38_71_, calendario0_.inicioConsolidacaoParcialTurma as inicioC39_71_, calendario0_.inicioConsolidacaoTurma as inicioC40_71_, calendario0_.inicioCoordenacaoAnaliseMatricula as inicioC41_71_, calendario0_.inicioCoordenacaoAnaliseReMatricula as inicioC42_71_, calendario0_.inicioDiscenteAnaliseMatricula as inicioD43_71_, calendario0_.inicioDiscenteAnaliseReMatricula as inicioD44_71_, calendario0_.inicioFerias as inicioF45_71_, calendario0_.inicioMatriculaAlunoCadastrado as inicioM46_71_, calendario0_.inicioMatriculaAlunoEspecial as inicioM47_71_, calendario0_.inicioMatriculaOnline as inicioM48_71_, calendario0_.inicioMatriculaTurmaFerias as inicioM49_71_, calendario0_.inicioPeriodoLetivo as inicioP50_71_, calendario0_.inicioProcessamentoMatricula as inicioP51_71_, calendario0_.inicioProcessamentoReMatricula as inicioP52_71_, calendario0_.inicioReMatricula as inicioR53_71_, calendario0_.inicioRequerimentoEnsinoIndiv as inicioR54_71_, calendario0_.inicioRequerimentoTurmaFerias as inicioR55_71_, calendario0_.inicioSolicitacaoTurma as inicioS56_71_, calendario0_.inicioSolicitacaoTurmaEnsinoIndiv as inicioS57_71_, calendario0_.inicioSolicitacaoTurmaFerias as inicioS58_71_, calendario0_.inicioTrancamentoTurma as inicioT59_71_, calendario0_.id_modalidade as id69_71_, calendario0_.nivel as nivel71_, calendario0_.periodo as periodo71_, calendario0_.periodoFeriasVigente as periodo62_71_, calendario0_.periodoNovasTurmas as periodo63_71_, calendario0_.id_registro_atualizacao as id66_71_, calendario0_.id_registro_cadastro as id70_71_, calendario0_.id_unidade as id67_71_, calendario0_.vigente as vigente71_
from comum.calendario_academico calendario0_
where calendario0_.ativo=trueValue()
and calendario0_.id_unidade=605
and calendario0_.nivel='G'
and (calendario0_.id_modalidade is null or calendario0_.id_modalidade<>1)
order by calendario0_.ano desc, calendario0_.periodo desc, calendario0_.id_modalidade desc