fix sql condition for query reglog