generate sql once
only call generator once, and optimize string Concatenation