moved query generation logic to own generator
added single result, multi mapped query generation