select * from b where 1=1
${if(len(cs)=0,"and 时间参数",if(cs='月报',"group by 月字段","xxx"))}
WHERE 1=1 ${if(datetype=3||datetype=4),"and dDate between '"+开始日期+"' and '"+结束日期+"' ",if(dateType=1,"group by substr(dDate,1,4)","group by substr(dDate,1,7)"))}
https://help.fanruan.com/finereport10.0/doc-view-1992.html 参考这种方式