LIKE '% @ Title%' would resolve to MySQL function splicing method '%' @ Title '%' splice used here is not enough '%' + @ Title + '%' can only be used
Dynamic GetListByFilter public (ArticleModel filter, PageInfo PageInfo) { String _where = "WHERE =. 1. 1"; (! String.IsNullOrEmpty (filter.Title)) IF { // the LIKE '% @% the Title' would resolve to '%' @ title '%' used here splicing is not acceptable '%' + @ title + ' %' can only MySQL function method splice _where + = "and title the LIKE CONCAT ( '%', @ title, '%')"; } IF (! filter.Status = null) { _where + = "@ and the Status the Status ="; } return GetListByFilter (filter, PageInfo, _where); }