I'm doing a J2EE web application with Struts2, MyBatis and a MySQL database, so what I want is to allow the user to be free to choose different parameters to perform a select to a table in the database.
For example, I have a Table called SALES, so I want that user to be able to select different parameters according to what he needs. Maybe, he wants to filter by dates and the employee name, and then he wants to filter just by customer and so on.
Should I show all the necessary data to filter on the client side with Javascript, or can I do a query to several tables after the user chooses the parameters? if that is possible, how should I write the query with parameters that could be present or not?