${if(len(p)==0 …)}
,"1","select xxx from bb
where 1=1
${if(len(p)==0…)}")}等类似功能要求两个参数都要生效
这样啊
${switch(bt,"0","select xxx from t where 1=1 "+if(len(p)==0,"","and 1=2"),
"1","select xxx from bb where 1=1 "+if(len(p)==0,"","and 2=3")
)}
${switch(bt,
"0","select xxx from t where 1=1"+if(len(p)==0,"",""),
"1","select xxx from bb where 1=1"+if(len(p)==0,"",""))}