public async Task <List <WishUserEntity> > GetList(WishUserListParam param, OperatorInfo opuser)
        {
            var expression = ListFilter(param, opuser);
            var list       = await this.BaseRepository().FindList(expression);

            return(list.ToList());
        }
        public async Task <ActionResult> GetPageListJson(WishUserListParam param, Pagination pagination)
        {
            OperatorInfo user = await Operator.Instance.Current();

            TData <List <WishUserEntity> > obj = await wishUserBLL.GetPageList(param, pagination, user);

            return(Json(obj));
        }
        private Expression <Func <WishUserEntity, bool> > ListFilter(WishUserListParam param, OperatorInfo opuser)
        {
            var expression = LinqExtensions.True <WishUserEntity>();

            if (param != null)
            {
            }
            return(expression);
        }
Exemple #4
0
        public async Task <TData <List <WishUserEntity> > > GetList(WishUserListParam param, OperatorInfo opuser)
        {
            TData <List <WishUserEntity> > obj = new TData <List <WishUserEntity> >();

            obj.Data = await wishUserService.GetList(param, opuser);

            obj.Total = obj.Data.Count;
            obj.Tag   = 1;
            return(obj);
        }
Exemple #5
0
        public async Task <TData <List <WishUserEntity> > > GetPageList(WishUserListParam param, Pagination pagination, OperatorInfo opuser)
        {
            TData <List <WishUserEntity> > obj = new TData <List <WishUserEntity> >();

            obj.Data = await wishUserService.GetPageList(param, pagination, opuser);

            obj.Total     = pagination.TotalCount;
            obj.PageTotal = pagination.TotalPage;
            obj.Tag       = 1;
            return(obj);
        }
        public async Task <List <WishUserEntity> > GetPageList(WishUserListParam param, Pagination pagination, OperatorInfo opuser)
        {
            /*
             * var expression = ListFilter(param);
             * var list= await this.BaseRepository().FindList(expression, pagination);
             * return list.ToList();*/
            StringBuilder sql  = CreateListSql(param, opuser);
            var           data = await this.BaseRepository().FindList <WishUserEntity>(sql.ToString(), pagination);

            return(data.list.ToList <WishUserEntity>());
        }
        /// <summary>
        /// 创建查询sql
        /// </summary>
        /// <param name="param">查询条件数据</param>
        /// <returns></returns>
        private StringBuilder CreateListSql(WishUserListParam param, OperatorInfo opuser)
        {
            StringBuilder sql = new StringBuilder();

            sql.AppendFormat(" SELECT a.*,b.RealName AS TuiJianUserTxt FROM (");

            sql.AppendFormat(" SELECT * ");
            sql.AppendFormat(" FROM wish_user ");
            sql.AppendFormat(" WHERE 1=1");
            if (param != null)
            {
                if (!opuser.IsAdminOrDev)
                {
                    //TuiJianUserId
                    sql.AppendFormat(" AND TuiJianUserId = '{0}'", opuser.UserIdStr);
                }
                if (!string.IsNullOrEmpty(param.MobilePhone))
                {
                    sql.AppendFormat(" AND MobilePhone = '{0}'", param.MobilePhone);
                }
                if (!string.IsNullOrEmpty(param.RealName))
                {
                    sql.AppendFormat(" AND RealName LIKE '{0}%'", param.RealName);
                }
                if (!string.IsNullOrEmpty(param.StartTime))
                {
                    sql.AppendFormat(" AND BaseCreateTime >'{0} 00:00:00'", param.StartTime);
                }
                if (!string.IsNullOrEmpty(param.EndTime))
                {
                    sql.AppendFormat(" AND BaseCreateTime <'{0} 23:59:59'", param.EndTime);
                }
            }
            sql.AppendFormat(" ) a ");

            sql.AppendFormat(" JOIN sysuser b ON a.TuiJianUserId = b.Id ");

            return(sql);
        }