有sql函数function1(userId),会输出条件,类似“ AND .... ”,怎样在数据集中的where后面使用function1?
where 1 = 1
${1=1, function1(userId), function1(userId)}
这样写查询结果不会发生变化,${}只能使用fr自带函数?
where 1=1 ${if(isnull(userId),""," and function1('"+userId+"')")}
where 1=1 ${
if
(isnull(userId),
""
,
" and function1('"+userId+"')"
)}
把函数结果拼到sql where 1=1+sql(数据源,"select function1('"+${userid}+"') from 表 ",1,1)
格式参考:。。。where 1=1 ${if(条件, " and function1(userId)", " and function1(userId)")}
需采用SQL函数才能调用function1