数据集中的参数company_code是一个字符串,值是逗号分隔的company_code,比如“000000,000001,0000002”,需要实现如果company_code包含000000,那么拼接 AND company_code in ('" + company_code + "'),否则拼接 AND company_code in (select company_code from b )。下面的数据集是不对的,会导致不识别参数,请问该如何实现? select * from a where 1=1 ${if(company_code LIKE '%000000%', " AND company_code in ('" + company_code + "')", "AND company_code in (select company_code from dim_company4select union select 'all') ")} |