I'm doing a J2EE web application with Struts2, Mybatis and a MySQL database, so what I want to allow to the user is 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 to that the user select different parameters according to what he needs. Maybe, he wants to filter by dates and the employee name, and then he want to filter just by customer and so on.
Should I show all the necessary data to filter on the client side with js, or can I do a query to several tables after the user choose the parameters? if that is possible, how should I write the query with parameters that could be present or not?