${if(条件,"select * from A where clunm=$getuserdepartments(1)","select * from B where 1=1$if(条件),“and clunm=%getuserdepartments(1)”,"and clumn2= xxx"")}大概结构是这个样子
${if(条件1,"select * from A where clunm='"+getuserdepartments(1)+"'","select * from B where 1=1 "+if(统计2,"and clunm='"+getuserdepartments(1)+"'","and clumn2= xxx"))}
Maxizzz(提问者)${if(条件,\"select * from A where clunm=$getuserdepartments(1)\",\"select * from B where 1=1
$if(条件),“and clunm=%getuserdepartments(1)”,\"and clumn2= xxx\"
\")}
大概结构是这个样子
${if(a=="1"," and 部门1='"+getuserdepartments(1)+",",if(b=="1",""," and 部门2='"+getuserdepartments(1)+","))}
==============
${if(条件,"select * from A where clunm='"+getuserdepartments(1)+"'","select * from B where 1=1"+if(条件,“and clunm='"+getuserdepartments(1)+"'”,"and clumn2= 'xxx'"))}