Commit 4b582289 authored by liudong1993's avatar liudong1993

1

parent 79021de9
...@@ -801,12 +801,12 @@ ORDER BY tt.ClassDate ASC ...@@ -801,12 +801,12 @@ ORDER BY tt.ClassDate ASC
public List<RB_Class_Check_ViewModel> GetClassLearnHoursList(int groupId, string classIds) public List<RB_Class_Check_ViewModel> GetClassLearnHoursList(int groupId, string classIds)
{ {
string sql = $@"SELECT t.ClassId,SUM(t.CurrentDeductionHours) AS CurrentDeductionHours FROM( string sql = $@"SELECT t.ClassId,SUM(t.CurrentDeductionHours) AS CurrentDeductionHours FROM(
SELECT case when cp.PlanType=2 then t2.ClassId else p.ClassId end as ClassId,p.ClassDate,p.ClassTimeId,MAX(p.CurrentDeductionHours) as CurrentDeductionHours SELECT case when cp.PlanType=2 then t2.ClassId else p.ClassId end as ClassId,p.ClassDate,p.ClassTimeId,MAX(p.CurrentDeductionHours) as CurrentDeductionHours,t2.OrderId
FROM rb_class_check p FROM rb_class_check p
INNER JOIN rb_class_time t on p.ClassTimeId = t.ClassTimeId INNER JOIN rb_class_time t on p.ClassTimeId = t.ClassTimeId
inner join rb_class_plan cp on t.ClassPlanId = cp.ClassPlanId inner join rb_class_plan cp on t.ClassPlanId = cp.ClassPlanId
LEFT JOIN rb_order_guest t2 on p.OrderGuestId = t2.Id LEFT JOIN rb_order_guest t2 on p.OrderGuestId = t2.Id
WHERE p.`Status` =0 and p.Group_Id ={groupId} and case when cp.PlanType=2 then t2.ClassId in({classIds}) else p.ClassId in({classIds}) end GROUP BY case when cp.PlanType=2 then t2.ClassId else p.ClassId end,p.ClassDate,p.ClassTimeId WHERE p.`Status` =0 and p.Group_Id ={groupId} and case when cp.PlanType=2 then t2.ClassId in({classIds}) else p.ClassId in({classIds}) end GROUP BY case when cp.PlanType=2 then t2.ClassId else p.ClassId end,p.ClassDate,p.ClassTimeId,t2.OrderId
)t GROUP BY t.ClassId"; )t GROUP BY t.ClassId";
return Get<RB_Class_Check_ViewModel>(sql).ToList(); return Get<RB_Class_Check_ViewModel>(sql).ToList();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment