varpageList=GetPage<RB_Attendance_Extend>(pageIndex,pageSize,outcount,"SELECT * from (select a.Id,a.`Status`,a.UpdateTime,b.Id as RB_BranchId,b.RB_Group_Id as RB_GroupId,case when a.Id is NULL then 2 else 1 end AS IsBind ,e.EmName as UpdateName,b.BName as BranchName,(select count(*) from rb_employee em where em.IsLeave=0 and em.RB_Branch_id=b.Id) as PeopleNum,case when a.Id IS NOT NULL THEN (select GROUP_CONCAT(ws.Workday SEPARATOR '、') from rb_workdayseting ws where ws.AttendanceId=a.Id) ELSE '' END as AttendanceDate from rb_branch b LEFT JOIN Rb_attendance a on b.Id=a.RB_BranchId left join rb_employee e on a.UpdateBy=e.EmployeeId )t "+where+" order by t.IsBind,t.RB_BranchId asc").ToList();
varpageList=GetPage<RB_Attendance_Extend>(pageIndex,pageSize,outcount,$@"SELECT * from (
select a.Id,a.`Status`,a.UpdateTime,b.SId as RB_BranchId,b.Group_Id as RB_GroupId,
case when a.Id is NULL then 2 else 1 end AS IsBind ,e.EmName as UpdateName,b.SName as BranchName,
(select count(*) from rb_employee em where em.IsLeave=0 and em.RB_Branch_id=b.SId) as PeopleNum,
case when a.Id IS NOT NULL THEN (select GROUP_CONCAT(ws.Workday SEPARATOR '、')
from rb_workdayseting ws where ws.AttendanceId=a.Id) ELSE '' END as AttendanceDate
from Rb_attendance a
left join rb_school b on a.RB_BranchId = b.SId
left join rb_employee e on a.UpdateBy=e.EmployeeId )t "+where+" order by t.IsBind,t.RB_BranchId asc").ToList();