一。
select * from fenxiao_jiekou_baiping_daioyong_statis a
where 1=1
${IF(len(data_source) == 0," "," and case when a.p_reptortype = 'OPEN_ROUD_API' then 'OPEN_ROUD_API'
when a.p_reptortype = 'OPEN_TRAVEL_API' then 'OPEN_TRAVEL_API'
else 'WHITE_SCREEN' end in ('" + data_source + "')")}
data_source对应为添加的下拉框控件名,数据字典选中对应的数据列
二。
from fenxiao_jiekou_baiping_daioyong_by_day_statis a
where 1=1
${if(len(Start)=0,""," and day>='"+start+"'")}
${if(len(End)=0,""," and day<='"+end+"'")}
${IF(len(data_source) == 0," "," and case when a.p_reptortype = 'OPEN_ROUD_API' then 'OPEN_ROUD_API'
when a.p_reptortype = 'OPEN_TRAVEL_API' then 'OPEN_TRAVEL_API'
else 'WHITE_SCREEN' end in ('" + data_source + "')")}