First, let's distinguish between an implementation strategy and a business rule.
Since you already have data, consider getting results directly from the data. This forms a data domain model. Create a data model to store all your data. Then create a set of queries, views, and stored procedures to access and update data.
Once you have these views, use a data access library such as the Spring JDBC Template to get this data and present it in Java objects (lists, maps, faces, point tables, etc.).
What you have completed so far has not changed much, regardless of what happens in the upper layers of the system. This is called Model.
Then create a rule base or logical implementation that determines under which inputs, user actions, data conditions or for all other conditions what data is needed. In a mathematical sense, it looks like a matrix. In terms of programming, it will be a set of logical statements. If this and this, and this is true, then get this data, still get this data, etc. This includes the logic of your system. Therefore, it is called the “Controller”.
Do not move this logic to queries / stored procedure / views.
Then, finally, create an interface or console for this. In the simplest case, create a console input system that accepts ... and displays a result set. This is your "view" of the system.
Ultimately, you can create a view in a web application. The above command line representation may be viable as a Restful API server.