新建查询比如
select * from
(select type,id from tableA )A
left join
(select col1,col2,col3,id from tableB )B on A.id =B.id
${if(A.type =='type1',""," and B.col2 = 'xxxx' ")}
以上可以在帆软里直接实现。
select * from (select type,id from tableA )A left join (select col1,col2,col3,id from tableB )B on A.id =B.id where (A.type != 'type1' and B.col2 = 'xxxx') or A.type = 'type1'
这个语句和上面sql语义等效;
这个在if里面是【参数名】,不支持;
可以的,支持以上语句
where 1=1
https://help.fanruan.com/finereport/doc-view-3499.html?source=1 条件属性实现动态列 是这个吗