如果没有where 条件则
where 1=1 ${if(len(area) == 0,"","and 货主地区 in ('" + area + "')")}
有where 条件 直接后边跟着
${if(len(area) == 0,"","and 货主地区 in ('" + area + "')")}
就行
${if(len(sex)==0,"","and sex in ('" + sex + "')")}
https://help.fanruan.com/finereport/doc-view-2395.html
-----