select '${a}' from tablename group by '${a}'
这样写会报错,group by不写参数就不会
select '${a}' from tablename ${if(len(a)==0,"","group by "+a)}
select ${a} from tablename ${if(len(a)=0,"","group by '"+ a +"'")}