背景:

主流程表中包含员工ID及流程类型ID,在页面查看流程是需要显示员工姓名及流程名称

操作:

 //先进行分页处理原始数据
            var result = from p in _dbContext.Set<BeWorkflowContent>()
                         select p;
            if (searchWhere != null)
                result = result.Where(searchWhere);
            if (order != null)
                result = result.OrderByDescending(order);
            rowCount = result.Count();
            
            //多表查询组装最后的数据模型
            var query = from a in result
                        join b in _dbContext.BeUser on a.UserId equals b.UserId
                        join c in _dbContext.BeWorkflow on a.WorkflowId equals c.WorkflowId
                        select new WorkFlowContentV()
                        {
                            CustomerName = a.CustomerName,
                            WorkflowContentId = a.WorkflowContentId,
                            CarType = a.CarType,
                            CarStyle = a.CarStyle,
                            CarLicense = a.CarLicense,
                            UserName = b.TrueName,
                            WorkflowName = c.WorkflowName
                        };
            return query.ToList();
View Code

相关文章:

  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
  • 2022-01-26
  • 2021-11-07
  • 2022-12-23
  • 2021-10-22
  • 2022-12-23
猜你喜欢
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案