@@ -410,7 +410,7 @@ LEFT JOIN rb_class as class on a.ClassId=class.ClassId
LEFT JOIN rb_teacher AS T ON A.TeacherId=T.TId
LEFT JOIN (SELECT ClassPlanId,COUNT(*) as LessonPlanNum from rb_class_lessonplan where `Status`=0 GROUP BY ClassPlanId)as lp on a.ClassPlanId=lp.ClassPlanId
LEFT JOIN (SELECT ClassPlanId,COUNT(*) as LessonPlanSummaryNum from rb_class_lessonplan where `Status`=0 and ISNULL(Summary)=0 and LENGTH(trim(Summary))>0 GROUP BY ClassPlanId)as lps on a.ClassPlanId=lps.ClassPlanId
WHERE 1=1 and class.ClassStatus=2 and t.`Status`=0 and a.`Status`=0 ORDER BY a.ClassId,a.ClassDate) as a where 1=1
WHERE 1=1 and class.ClassStatus in(1,2) and t.`Status`=0 and a.`Status`=0 ORDER BY a.ClassId,a.ClassDate) as a where 1=1
");
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Class_Plan_ViewModel.Status),(int)DateStateEnum.Normal);
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
(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
(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();