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": [
    "cid",
    "name",
    "status"
  ],
  "page": {
    "size": 20,
    "pageNumber": 0
  }
}

Controller:

    @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){
    
                 serviceImpl.searchApi(criteria)
    }

SearchCriteriaDto class:

@JsonPropertyOrder({
    "criteria",
    "sorts",
    "fieldSelectors",
    "page" })
@Data
public class SearchCriteriaDto {

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

}

Can you guide to implment service and repository class implmentation?