我的需求场景的,参数下拉框是有A,B-1,B-2 这种值,当下拉框选A的时候,参数sql带入的是and ZZ in ('A')字段,选B-1的时候,sql是and ZQ in ('1'),选B-2的时候 and ZQ in ('2')。
不增加参数框的情况下,要怎么修改这句话:
${if(len(参数名)=0,""," and ZZ in ('"+ZZ+"')")}
已解决
${if(参数名=A,""," and ZZ in ('"+ZZ+"')")}
${if(参数名=B-1,""," and ZQ in ('1')")}
${if(参数名=B-2,""," and ZQ in ('2')")}
直接这样写3个就行了
${if(len(ZZ)=0,"",if(find("-",ZZ)>0," and ZZ in ('"+MID(ZZ,find("-",ZZ)+1,len(ZZ)-find("-",ZZ))+"')"," and ZZ in ('"+ZZ+"')"))}