如果参数为 62030Y;70839Y;A8EC2
怎么在sql里把这个转换成
and (code like '%62030Y%' or code like '%70839Y%' or code like '%A8EC2%')
因为数据库的code字段也是用;分割的,所以用不了in去查询,只能用这样or 加上like去查
zd in (replace(${cs},";","','"))
mysql:select concat(concat("code like ('%'",replace((select '62030Y;70839Y;A8EC2' as name from dual),';',"%' or '%")),"%')") as name from dual
https://help.fanruan.com/finereport/doc-view-2066.html 参考
参考下拉复选框多值模糊查询 https://help.fanruan.com/finereport/doc-view-2499.html
============
where 1=1
${if(len(参数)=0,"","and code like '%"+replace(参数,";","%' or code like '%")+"%'")}