${if(参数== 1,"sql1 ","sql2")},SQL里面带参数怎么写,也是需要根据参数进行IF判断的,类似下面的逻辑
: ${ if(lx='1' ,"if(len(dpdj)>0,"c_dpdj","c_diqmc") AS zt, dp from SSS" ,"if(len(dpdj)>0,"c_dpdj","c_diqmc") AS zt, dp from BBB" }
我在执行的时候,提示没有返回的结果集,麻烦大佬们看一下,这样的逻辑要怎么写
${if(参数== 1,"SELECT "+IF(LEN(dpdj)>0,"c_dpdj","c_diqmc")+" AS ZT FROM A","sql2")}
${if(参数==1,"select * from a where zd='"+cs+"'","sql2")}