Implement where feature for primitive values

implement where feature
fix id bug of model
restructure