I want to generate postgres query as below:
select * from table1 t1 inner join table2 t2 on t1.id = t2.table1_id where param.name is null or t1.name ilike param.n