add a query class for condition query