Skip to content

多表联查后怎么返回一个新的对象呢 #1981

Open
@zhangxiaolin-git

Description

@zhangxiaolin-git

var query = freeSql.Select()
.WhereIf(req.JobId > 0, a => a.Id == req.JobId)
.WhereIf(req.ProcessId > 0, a => a.ProcessId == req.ProcessId)
.WhereIf(!string.IsNullOrEmpty(req.JobName), a => a.JobName.Contains(req.JobName))
.WhereIf(!string.IsNullOrEmpty(req.Enable), a => a.Enable == req.Enable)
.OrderByDescending(a => a.UpdateTime)
.LeftJoin((rpaScheduleInfo, rpaProcessInfo) =>
rpaScheduleInfo.ProcessId == rpaProcessInfo.Id)
.Select((a, b) => new RpaProcessJobReq
{
JobId = a.Id,
JobName = a.JobName,
CronExpression = a.CronExpression,
CronDesc = a.CronDesc,
CronType = a.CronType,
Mark = a.Mark,
Enable = a.Enable,
ConflictChoose = a.ConflictChoose,
ProcessId = a.ProcessId,
CreateTime = a.CreateTime,
UpdateTime = a.UpdateTime,
ProcessName = b.ProcessName,
VersionNum = b.VersionNum,
PublishDirAddress = b.PublishDirAddress,
ProcessDesc = b.ProcessDesc,
VersionDesc = b.VersionDesc
})
.Page(req.PageNum, req.PageSize)
.ToList();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions