I'm developing a web application using the Play Framework, and I'm hooked on the creation of statistics. In the statistics screen the user will select the month of the year and must return all the complaints made in the selected month, how would this research?
So far I'm using the H2 database and I'm saving the date in Date format.
@Temporal(TemporalType.TIMESTAMP)
public Date data;
The user chooses the month as below:
HTML:
<divclass="col-lg-12">
<input type="hidden" name="funcionario.id" value="${f?.id}" /> <label>Selecione
o mês:</label> <select class="custom-select mb-3 mr-sm-3 mb-sm-0"
id="inlineFormCustomSelect">
<option selected>Selecione...</option>
<option value="1">Janeiro</option>
<option value="2">Fevereiro</option>
<option value="3">Março</option>
<option value="4">Abril</option>
<option value="5">Maio</option>
<option value="6">Junho</option>
<option value="7">Julho</option>
<option value="8">Agosto</option>
<option value="9">Setembro</option>
<option value="10">Outubro</option>
<option value="11">Novembro</option>
<option value="12">Dezembro</option>
</select>
<div>
And how would the search in the bank?
List<Denuncia> denuncias = Denuncia.find("mes" =? and status =?", 01, Status.ATIVO).fetch();