Many conditions in the foreground and how can the background be quickly and easily added to the filtering conditions

  java, question

Previously, if was used to judge the vacancy, then sql was spliced. as a result, a query passed about 10 parameters. this is good. look at a large section of if. is there a better solution?

Java validation comments if verified. Parameter can be empty, mybatis if judges.