(select ToAuditId from rb_workflow_auditrelevance audr where audr.WorkFlowId=ask.Id and audr.TemplateType=ask.TemplateType and audr.Stauts=1 ORDER BY audr.Sort ASC limit 0,1)
ELSE '' END as ToAuditIdStr,
...
...
@@ -183,7 +183,7 @@ ELSE '' END as ToAuditIdStr,
(SELECT a.Id,a.`Status`,a.RB_BranchId,a.CreateBy,a.CreateTime,t.TemplateType,t.`Name` as TemplateName FROM rb_workflow_goout a INNER JOIN rb_workflow_template t on t.id = a.TemplateId where a.RB_GroupId={dmodel.RB_GroupId}{WhereIn}) UNION
(SELECT a.Id,a.`Status`,a.RB_BranchId,a.CreateBy,a.CreateTime,t.TemplateType,t.`Name` as TemplateName FROM rb_workflow_reissuecard a INNER JOIN rb_workflow_template t on t.id = a.TemplateId where a.RB_GroupId={dmodel.RB_GroupId}{WhereIn})
)
ask left JOIN rb_employee e on ask.CreateBy=e.EmployeeId left join rb_branch b on b.Id=ask.RB_BranchId
ask left JOIN rb_employee e on ask.CreateBy=e.EmployeeId
where+=$@" and t.{nameof(Rb_Workflow_SignIn.SignInTime)}<='{dmodel.EndTime+" 23:59:59"}'";
}
stringsql=$@"SELECT t.*,e.EmName,b.BName FROM Rb_Workflow_SignIn t left join rb_employee e on t.EmployeeId=e.EmployeeId left join rb_branch b on b.Id=t.RB_BranchId {where} ";
stringsql=$@"SELECT t.*,e.EmName,e.BName FROM Rb_Workflow_SignIn t left join rb_employee e on t.EmployeeId=e.EmployeeId {where} ";