StringBuffer sql=new StringBuffer();sql="select * from biao where 1=1";if(判断条件){String sql2="and 条件";sql.append(sql2)}else{......}