sql("数据连接1", " SELECT 字段1, 字段2 FROM table_name where 1=1" +if(org1 == 'teat',"","and Z_NAME = '" + org1 + "'") +if(INDEXOFARRAY(REVERSEARRAY(split(array1,",")),1) == 0000,"",if(find('Z',INDEXOFARRAY(REVERSEARRAY(split(array1,",")),1))>0,"and ID1 = '" + INDEXOFARRAY(REVERSEARRAY(split(array1,",")),1) + "'","and ID2 = '" + INDEXOFARRAY(REVERSEARRAY(split(array1,",")),1) + "'"))+"order by case when 字段1 is null then 0 else 字段1"",2,1) |