因为这是必要的条件,这两个参数没有值的时候可以不查,但有值的时候必须得要
现在就是想把这两句给插进去${IF(LEN(CAIGOU_Y_N)==0,"","AND CAIGOU_Y_N = '"+CAIGOU_Y_N+"'")}${IF(LEN(CAIWU_Y_N)==0,"","AND CAIWU_Y_N = '"+CAIWU_Y_N+"'")}
"+IF(LEN($CAIGOU_Y_N)==0,""," AND CAIGOU_Y_N = '"+$CAIGOU_Y_N+"'")+IF(LEN($CAIWU_Y_N)==0,""," AND CAIWU_Y_N = '"+$CAIWU_Y_N+"' ")+"
放到group by 前面
sql 拼接用“+”。
sql("xxx","select id from A where 1=1 "
+if(LEN($CAIGOU_Y_N)=0,"","AND CAIGOU_Y_N ='"+$CAIGOU_Y_N+"'")
+if(LEN($CAIWU_Y_N)=0,"","AND CAIWU_Y_N ='"+$CAIWU_Y_N+"'")
,1)