sb.AppendFormat(" AND A.StartDate<'{0}' AND A.EndDate>'{0}' ",dateStr);
if(!string.IsNullOrEmpty(StuAccountId))
{
sb.AppendFormat(" AND NOT EXISTS(SELECT 1 FROM rb_guestsurvey WHERE UserType=2 AND ActivitySurveyId=A.ID AND UserId={0}) ",StuId);
//sb.AppendFormat(" AND NOT EXISTS(SELECT 1 FROM rb_guestsurvey WHERE UserType=2 AND ActivitySurveyId=A.ID AND UserId={0}) ", StuAccountId);
sb.AppendFormat(" AND EXISTS(SELECT 1 FROM RB_ActivitySurvey_Guest WHERE GuestType=2 AND IsFinish=0 AND SurveyId=A.ID AND GuestId={0} AND StartTime<'{1}' AND EndTime>'{1}' )",StuAccountId,dateStr);