怎么根据参数条件给查询字段赋值空值?
select ${if(loginid=458,"","t2.dwcb")} as from tab
如上查询,参数loginid没有填值的时候查询正常,填写458后就会报错。
想实现输入458时,查询字段为空值
select ${if(loginid=458,"''","t2.dwcb")} as from tab
select 列1 ${if(loginid='458',"",",t2.dwcb")} from tab