|
@@ -156,8 +156,8 @@ FROM (
|
|
|
select ""HandlerOrgId"",SUM(( CASE WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1 ELSE 0 END )) AS ""YbOrderCountNum"",0 ""ZbOrderCountNum"",0 ""YbOverdue"",0 ""ZbOverdue"",0 ""HqybOverdue"",0 ""HqzbOverdue"",0 ""DelayEnd"",0 ""DelayWait"",0""Archived"" ,0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"" ,0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"",0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
- where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 {2} --and ""t"".""CountersignPosition""<=1
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 {2} --and ""t"".""CountersignPosition""<=1
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -166,7 +166,7 @@ FROM (
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status""<2 {2} --and ""t"".""CountersignPosition""<=1
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -174,8 +174,8 @@ FROM (
|
|
|
select ""HandlerOrgId"",0 ""YbOrderCountNum"",0 ""ZbOrderCountNum"",SUM(( CASE WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1 ELSE 0 END )) AS ""YbOverdue"" ,0 ""ZbOverdue"",0 ""HqybOverdue"",0 ""HqzbOverdue"",0 ""DelayEnd"",0 ""DelayWait"",0""Archived"",0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"",0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"" ,0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
- where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""t"".""CountersignPosition""=0 {2}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""t"".""CountersignPosition""=0 {2}
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -184,7 +184,7 @@ FROM (
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status""<2 and (SELECT NOW())>""StepExpiredTime"" and ""t"".""CountersignPosition""=0 {2}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -192,8 +192,8 @@ FROM (
|
|
|
select ""HandlerOrgId"",0 ""YbOrderCountNum"",0 ""ZbOrderCountNum"",0 ""YbOverdue"" ,0 ""ZbOverdue"",SUM(( CASE WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1 ELSE 0 END )) AS ""HqybOverdue"",0 ""HqzbOverdue"",0 ""DelayEnd"",0 ""DelayWait"",0""Archived"",0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"",0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"" ,0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
- where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""CountersignPosition"">0 {2}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""CountersignPosition"">0 {2}
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -203,7 +203,7 @@ FROM (
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status""<2 and (SELECT NOW())>""StepExpiredTime""
|
|
|
and ""CountersignPosition"">0 {2}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -211,8 +211,8 @@ FROM (
|
|
|
select ""HandlerOrgId"",0 ""YbOrderCountNum"",0 ""ZbOrderCountNum"",0 ""YbOverdue"" ,0 ""ZbOverdue"",0 ""HqybOverdue"",0 ""HqzbOverdue"",SUM(( CASE WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1 ELSE 0 END )) AS ""DelayEnd"",0 ""DelayWait"" ,0""Archived"",0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"",0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"" ,0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
- where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 and ""CountersignPosition"">0 {2}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""CountersignPosition"">0 {2}
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -221,7 +221,7 @@ FROM (
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status""<2 and ""CountersignPosition"">0 {2}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
UNION ALL
|
|
@@ -354,8 +354,8 @@ FROM (
|
|
|
select ""HandlerOrgId"",SUM(( CASE WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1 ELSE 0 END )) AS ""YbOrderCountNum"",0 ""ZbOrderCountNum"",0 ""YbOverdue"",0 ""ZbOverdue"",0 ""HqybOverdue"",0 ""HqzbOverdue"",0 ""DelayEnd"",0 ""DelayWait"",0""Archived"" ,0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"" ,0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"",0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
- where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 {2} --and ""t"".""CountersignPosition""<=1
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 {2} --and ""t"".""CountersignPosition""<=1
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -364,7 +364,7 @@ FROM (
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status""<2 {2} --and ""t"".""CountersignPosition""<=1
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -372,8 +372,8 @@ FROM (
|
|
|
select ""HandlerOrgId"",0 ""YbOrderCountNum"",0 ""ZbOrderCountNum"",SUM(( CASE WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1 ELSE 0 END )) AS ""YbOverdue"" ,0 ""ZbOverdue"",0 ""HqybOverdue"",0 ""HqzbOverdue"",0 ""DelayEnd"",0 ""DelayWait"",0""Archived"",0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"",0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"" ,0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
- where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""t"".""CountersignPosition""=0 {2}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""t"".""CountersignPosition""=0 {2}
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -382,7 +382,7 @@ FROM (
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status""<2 and (SELECT NOW())>""StepExpiredTime"" and ""t"".""CountersignPosition""=0 {2}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -390,8 +390,8 @@ FROM (
|
|
|
select ""HandlerOrgId"",0 ""YbOrderCountNum"",0 ""ZbOrderCountNum"",0 ""YbOverdue"" ,0 ""ZbOverdue"",SUM(( CASE WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1 ELSE 0 END )) AS ""HqybOverdue"",0 ""HqzbOverdue"",0 ""DelayEnd"",0 ""DelayWait"",0""Archived"",0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"",0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"" ,0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
- where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""CountersignPosition"">0 {2}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""CountersignPosition"">0 {2}
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -401,7 +401,7 @@ FROM (
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status""<2 and (SELECT NOW())>""StepExpiredTime""
|
|
|
and ""CountersignPosition"">0 {2}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -409,8 +409,8 @@ FROM (
|
|
|
select ""HandlerOrgId"",0 ""YbOrderCountNum"",0 ""ZbOrderCountNum"",0 ""YbOverdue"" ,0 ""ZbOverdue"",0 ""HqybOverdue"",0 ""HqzbOverdue"",SUM(( CASE WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1 ELSE 0 END )) AS ""DelayEnd"",0 ""DelayWait"" ,0""Archived"",0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"",0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"" ,0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
- where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 and ""CountersignPosition"">0 {2}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""CountersignPosition"">0 {2}
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -419,7 +419,7 @@ FROM (
|
|
|
select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
|
|
|
left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
|
|
|
where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}' and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status""<2 and ""CountersignPosition"">0 {2}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
UNION ALL
|
|
@@ -504,7 +504,7 @@ order by ""su"".""OrgCode""";
|
|
|
query = _workflowTraceRepository.Queryable()
|
|
|
.LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
|
|
|
.Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime
|
|
|
- && t.Status >= EWorkflowStepStatus.Handled)
|
|
|
+ && t.Status >= EWorkflowStepStatus.Handled && t.TraceState != EWorkflowTraceState.StepRemoveByPrevious)
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.WhereIF(dto.OrgCode != "001", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
@@ -526,20 +526,20 @@ order by ""su"".""OrgCode""";
|
|
|
break;
|
|
|
case EStatisticsType.OrderDelayCount://延期次数
|
|
|
query = _orderDelayRepository.Queryable()
|
|
|
- .Includes(x => x.Order)
|
|
|
- .Where(x => x.Order.CreationTime >= dto.StartTime && x.Order.CreationTime <= dto.EndTime && x.DelayState == EDelayState.Pass)
|
|
|
- .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, x => x.Order.Source == ESource.ProvinceStraight)
|
|
|
- .WhereIF(dto.OrgCode == "001", x => x.ApplyOrgCode == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", x => x.ApplyOrgCode.StartsWith(dto.OrgCode))
|
|
|
- .OrderByDescending(x => x.Order.CreationTime)
|
|
|
- .Select(x => new SelectOrderId { Id = x.Order.Id })
|
|
|
+ .LeftJoin<Order>((d, o) => d.OrderId == o.Id)
|
|
|
+ .Where((d, o) => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && d.DelayState == EDelayState.Pass)
|
|
|
+ .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (d, o) => o.Source == ESource.ProvinceStraight)
|
|
|
+ .WhereIF(dto.OrgCode == "001", (d, o) => d.ApplyOrgCode == dto.OrgCode)
|
|
|
+ .WhereIF(dto.OrgCode != "001", (d, o) => d.ApplyOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .OrderByDescending((d, o) => o.CreationTime)
|
|
|
+ .Select((d, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
|
break;
|
|
|
case EStatisticsType.YBOverdue://已办超期
|
|
|
query = _workflowTraceRepository.Queryable()
|
|
|
.LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
|
|
|
.Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime
|
|
|
- && t.Status >= EWorkflowStepStatus.Handled && t.HandleTime > t.StepExpiredTime && t.CountersignPosition == ECountersignPosition.None)
|
|
|
+ && t.Status >= EWorkflowStepStatus.Handled && t.HandleTime > t.StepExpiredTime && t.CountersignPosition == ECountersignPosition.None && t.TraceState != EWorkflowTraceState.StepRemoveByPrevious)
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.WhereIF(dto.OrgCode != "001", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
@@ -563,7 +563,7 @@ order by ""su"".""OrgCode""";
|
|
|
query = _workflowTraceRepository.Queryable()
|
|
|
.LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
|
|
|
.Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime
|
|
|
- && t.Status >= EWorkflowStepStatus.Handled && t.HandleTime > t.StepExpiredTime && t.CountersignPosition > ECountersignPosition.None)
|
|
|
+ && t.Status >= EWorkflowStepStatus.Handled && t.HandleTime > t.StepExpiredTime && t.CountersignPosition > ECountersignPosition.None && t.TraceState != EWorkflowTraceState.StepRemoveByPrevious)
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.WhereIF(dto.OrgCode != "001", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
@@ -587,7 +587,7 @@ order by ""su"".""OrgCode""";
|
|
|
var cqybquery = _workflowTraceRepository.Queryable()
|
|
|
.LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
|
|
|
.Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime
|
|
|
- && t.Status >= EWorkflowStepStatus.Handled && t.HandleTime > t.StepExpiredTime && t.CountersignPosition >= ECountersignPosition.None)
|
|
|
+ && t.Status >= EWorkflowStepStatus.Handled && t.HandleTime > t.StepExpiredTime && t.CountersignPosition >= ECountersignPosition.None && t.TraceState != EWorkflowTraceState.StepRemoveByPrevious)
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.WhereIF(dto.OrgCode != "001", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
@@ -610,7 +610,7 @@ order by ""su"".""OrgCode""";
|
|
|
query = _workflowTraceRepository.Queryable()
|
|
|
.LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
|
|
|
.Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime
|
|
|
- && t.Status >= EWorkflowStepStatus.Handled && t.CountersignPosition > ECountersignPosition.None)
|
|
|
+ && t.Status >= EWorkflowStepStatus.Handled && t.CountersignPosition > ECountersignPosition.None && t.TraceState != EWorkflowTraceState.StepRemoveByPrevious)
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.WhereIF(dto.OrgCode != "001", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
@@ -677,44 +677,44 @@ order by ""su"".""OrgCode""";
|
|
|
break;
|
|
|
case EStatisticsType.ScreenCount://甄别总量
|
|
|
query = _orderScreenRepository.Queryable()
|
|
|
- .Includes(x => x.Order)
|
|
|
- .Where(x => x.Order.CreationTime >= dto.StartTime && x.Order.CreationTime <= dto.EndTime && x.Order.Id != null)
|
|
|
- .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, x => x.Order.Source == ESource.ProvinceStraight)
|
|
|
- .WhereIF(dto.OrgCode == "001", x => x.CreatorOrgId == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", x => x.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
- .Select(x => new SelectOrderId { Id = x.Order.Id })
|
|
|
+ .LeftJoin<Order>((d, o) => d.OrderId == o.Id)
|
|
|
+ .Where((d, o) => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && o.Id != null)
|
|
|
+ .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (d, o) => o.Source == ESource.ProvinceStraight)
|
|
|
+ .WhereIF(dto.OrgCode == "001", (d, o) => d.CreatorOrgId == dto.OrgCode)
|
|
|
+ .WhereIF(dto.OrgCode != "001", (d, o) => d.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .Select((d, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
|
break;
|
|
|
case EStatisticsType.ScreenApproval://带甄别
|
|
|
query = _orderScreenRepository.Queryable()
|
|
|
- .Includes(x => x.Order)
|
|
|
- .Where(x => x.Order.CreationTime >= dto.StartTime && x.Order.CreationTime <= dto.EndTime && x.Order.Id != null
|
|
|
- && (x.Status == EScreenStatus.Approval || x.Status == EScreenStatus.Apply))
|
|
|
- .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, x => x.Order.Source == ESource.ProvinceStraight)
|
|
|
- .WhereIF(dto.OrgCode == "001", x => x.CreatorOrgId == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", x => x.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
- .Select(x => new SelectOrderId { Id = x.Order.Id })
|
|
|
+ .LeftJoin<Order>((d, o) => d.OrderId == o.Id)
|
|
|
+ .Where((d, o) => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && o.Id != null
|
|
|
+ && (d.Status == EScreenStatus.Approval || d.Status == EScreenStatus.Apply))
|
|
|
+ .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (d, o) => o.Source == ESource.ProvinceStraight)
|
|
|
+ .WhereIF(dto.OrgCode == "001", (d, o) => d.CreatorOrgId == dto.OrgCode)
|
|
|
+ .WhereIF(dto.OrgCode != "001", (d, o) => d.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .Select((d, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
|
break;
|
|
|
case EStatisticsType.ScreenPass://甄别通过
|
|
|
query = _orderScreenRepository.Queryable()
|
|
|
- .Includes(x => x.Order)
|
|
|
- .Where(x => x.Order.CreationTime >= dto.StartTime && x.Order.CreationTime <= dto.EndTime && x.Order.Id != null && x.Status == EScreenStatus.End)
|
|
|
- .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, x => x.Order.Source == ESource.ProvinceStraight)
|
|
|
- .WhereIF(dto.OrgCode == "001", x => x.CreatorOrgId == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", x => x.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
- .Select(x => new SelectOrderId { Id = x.Order.Id })
|
|
|
+ .LeftJoin<Order>((d, o) => d.OrderId == o.Id)
|
|
|
+ .Where((d, o) => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && o.Id != null && d.Status == EScreenStatus.End)
|
|
|
+ .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (d, o) => o.Source == ESource.ProvinceStraight)
|
|
|
+ .WhereIF(dto.OrgCode == "001", (d, o) => d.CreatorOrgId == dto.OrgCode)
|
|
|
+ .WhereIF(dto.OrgCode != "001", (d, o) => d.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .Select((d, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
|
break;
|
|
|
case EStatisticsType.ScreenNotPass://甄别不通过
|
|
|
query = _orderScreenRepository.Queryable()
|
|
|
- .Includes(x => x.Order)
|
|
|
- .Where(x => x.Order.CreationTime >= dto.StartTime && x.Order.CreationTime <= dto.EndTime && x.Order.Id != null && x.Status == EScreenStatus.Refuse)
|
|
|
- .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, x => x.Order.Source == ESource.ProvinceStraight)
|
|
|
- .WhereIF(dto.OrgCode == "001", x => x.CreatorOrgId == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", x => x.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
- .Select(x => new SelectOrderId { Id = x.Order.Id })
|
|
|
- .MergeTable();
|
|
|
+ .LeftJoin<Order>((d, o) => d.OrderId == o.Id)
|
|
|
+ .Where((d, o) => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && o.Id != null && d.Status == EScreenStatus.Refuse)
|
|
|
+ .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (d, o) => o.Source == ESource.ProvinceStraight)
|
|
|
+ .WhereIF(dto.OrgCode == "001", (d, o) => d.CreatorOrgId == dto.OrgCode)
|
|
|
+ .WhereIF(dto.OrgCode != "001", (d, o) => d.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .Select((d, o) => new SelectOrderId { Id = o.Id })
|
|
|
+ .MergeTable();
|
|
|
break;
|
|
|
default:
|
|
|
break;
|