${if(e==0, " select t3.office_name, t1.total_spec_gene_rate `今年`, t2.total_spec_gene_rate `去年`, t1.freight_yoy `同比` from ( select distinct office_code,office_name from freight_sales_amount_rate_analyze_day ) t3 left join ( SELECT data_day,office_name,office_code, ifnull(total_spec_gene_rate,0) total_spec_gene_rate, ifnull(freight_yoy,0)-1 as `freight_yoy` FROM `freight_sales_amount_rate_analyze_day` where "+if(len(a)=0,'1=1',' distribution_center_name = '+a+'')+" and data_day = '"+b+"' group by office_name,office_code ) t1 on t1.office_code=t3.office_code left join ( SELECT data_day,office_name,office_code, ifnull(total_spec_gene_rate,0) total_spec_gene_rate FROM `freight_sales_amount_rate_analyze_day` where "+if(len(a)=0,'1=1',' distribution_center_name = '+a+'')+" and data_day = date_sub('"+b+"' ,interval 1 year) group by office_name,office_code ) t2 on t2.office_code=t3.office_code " ,"")} 在${if()} 里面怎么使用if函数 现在这么写报错 |