${if(len(参数)=0," order by 时间","order by "+参数)}
2021年国庆前没有问题,现在报错。
select * from ABC占比 ${if(len(控件名)=0," order by 占比","order by "+控件名)}
——————————————
-- 保证:控件名一定属性数据表的字段名,否则就报找不到排序字段的异常。
这样呢?
${if(len(a)=0," order by num","order by "+a+" desc")}