joinTable=string.Format(" INNER JOIN (SELECT PlanId,DutyMan FROM rb_duty_plandetails WHERE 1=1 AND DutyMan IN({0})) AS C ON A.Id=C.PlanId ",query.QDutyMan);
stringjoinWhere="";
if(!string.IsNullOrEmpty(query.QDutyMan))
{
joinWhere+=string.Format(" AND DutyMan IN({0}) ",query.QDutyMan);
}
if(query.QDutyStatus>-1)
{
joinWhere+=string.Format(" AND Status={0} ",query.QDutyStatus);
}
//迟到
if(query.QAttendanceStatus==1)
{
joinWhere+=string.Format(" AND CheckLateTime>0 ");
}
//早退
if(query.QAttendanceStatus==2)
{
joinWhere+=string.Format(" AND FinishLateTime>0 ");
}
//缺勤
if(query.QAttendanceStatus==3)
{
joinWhere+=string.Format(" AND Status=0 AND FinishLateTime=0 AND CheckLateTime=0 ");
}
//正常
if(query.QAttendanceStatus==4)
{
joinWhere+=string.Format(" AND Status=2 AND FinishLateTime=0 AND CheckLateTime=0 ");
}
joinTable=string.Format(" INNER JOIN (SELECT PlanId FROM rb_duty_plandetails WHERE 1=1 {0} GROUP BY PlanId ) AS C ON A.Id=C.PlanId ",joinWhere);
}
StringBuilderbuilder=newStringBuilder();
...
...
@@ -125,6 +154,10 @@ WHERE 1=1 AND A.`Status`=0
{
builder.AppendFormat(@" AND B.{0}={1} ",nameof(RB_Duty_PlanDetails_ViewModel.DutyMan),query.QDutyMan);
}
if(query.QShift>0)
{
builder.AppendFormat(@" AND B.{0}={1} ",nameof(RB_Duty_PlanDetails_ViewModel.Shift),query.QShift);
}
if(query.Id>0)
{
builder.AppendFormat(@" AND A.{0}={1} ",nameof(RB_Duty_Plan_ViewModel.Id),query.Id);