${IF(len(bftype) = 0,""," and si.status in (" +SqlInString(bftype,",") +")")}
==========
and前面留个空格,in与()之间保留空隙,前往别连,连着肯定报语法错误;
==========
-- SqlInString()你这个自定义函数返回值类型的不同,in里面的内容分隔符也要注意;
Log 输出级别-https://help.fanruan.com/finereport/doc-view-991.html
语法排查,可以参考反馈日志定位;
===========