fix where condition

hash key would be escaped.
use name_mapping for ordering when possible