Exemple #1
0
        /// <summary>
        /// 用户列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public PagedList<GetUserListResponse> GetUserList(GetUserListRequest request)
        {
            StringBuilder sbSql = new StringBuilder();
            sbSql.Append(@"select a.*,b.Name as RoleName,c.Name as CreateName from T_User a
                            left join T_Role b on b.ID=a.RoleID
                            left join T_User c on c.ID=a.CreateBy
                            where 1=1 ");
            List<MySqlParameter> param = new List<MySqlParameter>();

            if (!string.IsNullOrEmpty(request.UserName))
            {
                sbSql.Append(" and a.UserName like ?UserName");
                param.Add(new MySqlParameter("UserName", "%" + request.UserName + "%"));
            }
            if (!string.IsNullOrEmpty(request.Name))
            {
                sbSql.Append(" and a.Name like ?Name");
                param.Add(new MySqlParameter("Name", "%" + request.Name + "%"));
            }
            sbSql.Append(" order by a.CreateTime desc");
            return GetPageList<GetUserListResponse>(sbSql.ToString(), param.ToArray(), request.PageIndex, request.PageSize,request.OrderBy);
        }
Exemple #2
0
 /// <summary>
 /// 用户列表
 /// </summary>
 /// <param name="search"></param>
 /// <returns></returns>
 public PagedList<GetUserListResponse> GetUserList(GetUserListRequest request)
 {
     return UserRepository.GetUserList(request);
 }
Exemple #3
0
 /// <summary>
 /// 用户列表
 /// </summary>
 /// <param name="search"></param>
 /// <returns></returns>
 public ActionResult UserList(GetUserListRequest request)
 {
     PagedList<GetUserListResponse> list = UserService.GetUserList(request);
     return View(list);
 }