Spring boot REST GET APIs Generic way using POST

I am trying to implement get and get by id api in single api. Thinking to create POST API With below request body parameters.

I want to use JpaRepository and postgres. Can you tell best approach to create dynamic query Request body paramters in api:

  "criteria": [
      "field": "name",
      "operator": "=",
      "value": "bank",
      "searchType": "C"
  "sort": [
      "field": "name",
      "order": "ASC"
  "fieldSelectors": [
  "page": {
    "size": 20,
    "pageNumber": 0


    @PostMapping(path = "/program-service", headers = {HeaderConst.X_ACCEPT_VERSION_V1}, 
        produces = { MediaType.APPLICATION_JSON },
        consumes = MediaType.APPLICATION_JSON)
        public ResponseEntity<ProgramResponse> findProgramServices(
                @Parameter(description="Accepts a valid fields") @Valid @RequestBody(required = false) SearchCriteriaDto criteria){

SearchCriteriaDto class:

    "page" })
public class SearchCriteriaDto {

    private List<@Valid CriterionDto> criteria;
    public List<@Valid SortDto> sorts;
    public List<@Valid String> fieldSelectors;
    public @Valid PageRequestDto page;


Can you guide to implment service and repository class implmentation?