现在有一个这个情况,两个控件FCustNo和FJTCustNumber,有三种情况1)当FCustNo为空时,FJTCustNumber不为空,条件执行 where FJTCustNumber like ‘%FJTCustNumber%’
2)当FCustNo不为空,FJTCustNumber为空时,条件执行 where FCustNo like ‘%FCustNo%’
3)当FCustNo不为空,FJTCustNumber也不为空时,条件执行 where (FCustNo like ‘%FCustNo%’) or (FJTCustNumber like ‘%FJTCustNumber%’)
我写的判定语句:
${if(len(FCustNo)==0 && len(FJTCustNumber)<>0,"and FJTCustNumber like '%"+FJTCust+"%'","and FCustNo like '%"+FCustNo+"%'")}
${if(len(FJTCustNumber)==0 && len(FCustNo)<>0,"and FCustNo like '%"+FCustNo+"%'","and FJTCustNumber like '%"+FJTCust+"%'")}
${if(len(FJTCustNumber)0,"and FCustNo like '%"+FCustNo+"%' or FJTCustNumber like '%"+FJTCust+"%' ","")}
但是结果有些问题,希望有大神能指点下