使用union 用于把多列值查询的值放一个列中
SELECT id FROM indicator where director='xxx'
UNION
SELECT id FROM indicator WHERE iname='数字化';
具体例子
-- finereport中查询多列值(使用一个查询框(用户只需要在一个搜索框里面输入查询的值))
-- 方式1:like模糊查询
SELECT * FROM indicator WHERE 1=1
${if(iname1="","and 1=2","and iname like'"+"%"+iname1+"%"+"'")}
union
SELECT * FROM indicator WHERE 1=1
${if(iname1="","and 1=2","and director like'"+"%"+iname1+"%"+"'")}
-- 方式2:全匹配=
SELECT * FROM indicator WHERE 1=1
${if(iname1="","","and iname='"+iname1+"'")}
union
SELECT * FROM indicator WHERE 1=1
${if(iname1="","","and director='"+iname1+"'")}