public async Task <IResultModel> Log(JobLogQueryModel model) { var result = new QueryResultModel <JobLogEntity> { Rows = await _logRepository.Query(model), Total = model.TotalCount }; return(ResultModel.Success(result)); }
public async Task <IList <JobLogEntity> > Query(JobLogQueryModel model) { var conditions = await _filter.GetConditions <JobLogEntity, JobLogQueryModel>(model); var query = _dbContext.Db.Queryable <JobLogEntity>() .Where(conditions) .OrderBy(model.OrderFileds); RefAsync <int> totalCount = 0; var data = await query.ToPageListAsync(model.PageIndex, model.PageSize, totalCount); model.TotalCount = totalCount; return(data); }
public async Task <IList <JobLogEntity> > Query(JobLogQueryModel model) { var paging = model.Paging(); var query = Db.Find(); query.Where(m => m.JobId == model.JobId); query.WhereNotNull(model.StartDate, m => m.CreatedTime >= model.StartDate.Value); query.WhereNotNull(model.EndDate, m => m.CreatedTime < model.EndDate.Value.AddDays(1)); if (!paging.OrderBy.Any()) { query.OrderByDescending(m => m.Id); } var result = await query.PaginationAsync(paging); model.TotalCount = paging.TotalCount; return(result); }
public Task <IResultModel> Log([FromQuery] JobLogQueryModel model) { return(_service.Log(model)); }