returnGet<Rb_Workflow_Askforleave_Extend>($@"select t.Id,t.TemplateType from ((SELECT Id, {(int)WFTTemplateTypeEnum.AskForLeave} as TemplateType from rb_workflow_askforleave where CreateBy = {empId} and (('{startTime}'>=StartTime and '{startTime}'<=EndTime) or ('{endTime}'>=StartTime and '{endTime}'<=EndTime)) and (((`Status` = {(int)WFAuditStatus.InReview} or `Status` = {(int)WFAuditStatus.Through}) AND IsCancel = {(int)WFAuditCancelStatus.Normal}) or ((`Status` = {(int)WFAuditStatus.InReview} or `Status` = {(int)WFAuditStatus.NotThrough} ) AND IsCancel = {(int)WFAuditCancelStatus.Cancel})))
returnGet<Rb_Workflow_Askforleave_Extend>($@"select t.Id,t.TemplateType from ((SELECT Id, {(int)WFTTemplateTypeEnum.AskForLeave} as TemplateType from rb_workflow_askforleave where CreateBy = {empId} and (('{startTime}'>=StartTime and '{startTime}'<=EndTime) or ('{endTime}'>=StartTime and '{endTime}'<=EndTime)) and (((`Status` = {(int)UserWFAuditStatus.InReview} or `Status` = {(int)UserWFAuditStatus.Through}) AND IsCancel = {(int)WFAuditCancelStatus.Normal}) or ((`Status` = {(int)UserWFAuditStatus.InReview} or `Status` = {(int)UserWFAuditStatus.NotThrough} ) AND IsCancel = {(int)WFAuditCancelStatus.Cancel})))
union
union
(SELECT e.Id, {(int)WFTTemplateTypeEnum.Evection} as TemplateType from rb_workflow_evection e INNER JOIN rb_workflow_travel t on e.Id = t.EvectionId where e.CreateBy = {empId} and (('{startTime}'>=t.StartTime and '{startTime}'<=t.EndTime) or ('{endTime}'>=t.StartTime and '{endTime}'<=t.EndTime)) and (((e.`Status` = {(int)WFAuditStatus.InReview} or e.`Status` = {(int)WFAuditStatus.Through}) AND e.IsCancel = {(int)WFAuditCancelStatus.Normal}) or ((e.`Status` = {(int)WFAuditStatus.InReview} or e.`Status` = {(int)WFAuditStatus.NotThrough} ) AND e.IsCancel = {(int)WFAuditCancelStatus.Cancel})))
(SELECT e.Id, {(int)WFTTemplateTypeEnum.Evection} as TemplateType from rb_workflow_evection e INNER JOIN rb_workflow_travel t on e.Id = t.EvectionId where e.CreateBy = {empId} and (('{startTime}'>=t.StartTime and '{startTime}'<=t.EndTime) or ('{endTime}'>=t.StartTime and '{endTime}'<=t.EndTime)) and (((e.`Status` = {(int)UserWFAuditStatus.InReview} or e.`Status` = {(int)UserWFAuditStatus.Through}) AND e.IsCancel = {(int)WFAuditCancelStatus.Normal}) or ((e.`Status` = {(int)UserWFAuditStatus.InReview} or e.`Status` = {(int)UserWFAuditStatus.NotThrough} ) AND e.IsCancel = {(int)WFAuditCancelStatus.Cancel})))
union
union
(SELECT Id,{(int)WFTTemplateTypeEnum.Goout} as TemplateType from rb_workflow_goout where CreateBy = {empId} and (('{startTime}'>=StartTime and '{startTime}'<=EndTime) or ('{endTime}'>=StartTime and '{endTime}'<=EndTime)) and (((`Status` = {(int)WFAuditStatus.InReview} or `Status` = {(int)WFAuditStatus.Through}) AND IsCancel = {(int)WFAuditCancelStatus.Normal}) or ((`Status` = {(int)WFAuditStatus.InReview} or `Status` = {(int)WFAuditStatus.NotThrough} ) AND IsCancel = {(int)WFAuditCancelStatus.Cancel})))) as t").ToList();
(SELECT Id,{(int)WFTTemplateTypeEnum.Goout} as TemplateType from rb_workflow_goout where CreateBy = {empId} and (('{startTime}'>=StartTime and '{startTime}'<=EndTime) or ('{endTime}'>=StartTime and '{endTime}'<=EndTime)) and (((`Status` = {(int)UserWFAuditStatus.InReview} or `Status` = {(int)UserWFAuditStatus.Through}) AND IsCancel = {(int)WFAuditCancelStatus.Normal}) or ((`Status` = {(int)UserWFAuditStatus.InReview} or `Status` = {(int)UserWFAuditStatus.NotThrough} ) AND IsCancel = {(int)WFAuditCancelStatus.Cancel})))) as t").ToList();