写sql公式时怎么写参数为空时后面还有加上group by 呀SQL("frdemo","SELECT a.bm FROM org_info a LEFT JOIN (SELECT bm, length(bm) len, dj FROM org_info WHERE 1=1 "+if(len(shi) == 0,"","and bm = '" +shi + "'") GROUP BY bm, dj) t1 ON 1 = 1 WHERE substr( a.bm, 1, len - 6 )= substr( t1.bm, 1, len - 6 )) ",1)