/// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="keyword">关键字</param>
        /// <param name="pageIndex">页数</param>
        /// <param name="pageSize">页码</param>
        /// <param name="sortColumn">排序字段</param>
        /// <param name="sortBy">ASC,DESC</param>
        /// <returns></returns>
        public Page <SysButtonView> GetPage(SysButtonSearchModel model)
        {
            var where = new StringBuilder(@" select a.*,menu.name  MenuName from sys_button a 
                                    left join sys_menu menu on menu.id = a.menu_id
                                    where a.state = 0");
            if (!string.IsNullOrWhiteSpace(model.Name))
            {
                where = where.Append(string.Format("and (a.name like '{0}')", "%" + model.Name.Trim() + "%"));
            }
            if (!string.IsNullOrWhiteSpace(model.MenuName))
            {
                where = where.Append(string.Format("and (menu.name like @0)", "%" + model.MenuName.Trim() + "%"));
            }
            where.Append(" order by a.create_on desc ");

            return(fsql.Select <SysButtonView>().WithSql(where.ToString()).ToPage(model.page, model.limit));
        }
Example #2
0
 public Page <SysButtonView> GetPage(SysButtonSearchModel model)
 {
     return(_ISysButtonServices.GetPage(model));
 }