Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private BooleanBuilder getQueryAgendamentosDeAgendaDisponiveisParaCancelamento(Long agendaId, String periodoFinal, Integer quantidadeVagaEletivoUrgencia) {
- Classificacao situacaoCancelada = classificacaoService.getClassificacaoByAtributo1(TipoClassificacao.AGENDAMENTO_SITUACAO, Agendamento.SITUACAO_CANCELADO);
- Classificacao situacaoFinalizada = classificacaoService.getClassificacaoByAtributo1(TipoClassificacao.AGENDAMENTO_SITUACAO, Agendamento.SITUACAO_FINALIZADO);
- BooleanBuilder periodoFinalFilter = new BooleanBuilder();
- BooleanBuilder qtdVagasEletivosUrgencia = new BooleanBuilder();
- QAgendamento q = QAgendamento.agendamento;
- BooleanBuilder where = new BooleanBuilder(q.agenda().id.eq(agendaId));
- if (quantidadeVagaEletivoUrgencia != null) {
- qtdVagasEletivosUrgencia = new BooleanBuilder(q.posicaoFinal.goe(quantidadeVagaEletivoUrgencia));
- }
- if (periodoFinal != null) {
- LocalDate periodoFinalParsed = LocalDate.parse(periodoFinal);
- periodoFinalFilter = new BooleanBuilder(q.dataAgendamento.goe(periodoFinalParsed));
- }
- where.and(q.classificacaoSituacao().id.notIn(situacaoCancelada.getId(), situacaoFinalizada.getId()));
- where.and(periodoFinalFilter).and(q.inativo.ne(Boolean.TRUE).and(qtdVagasEletivosUrgencia));
- teste(where);
- return where;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement