public List <AttendanceDataModel> LoadAttendanceDatasBy(AttendanceDataQueryDto qryDto) { StringBuilder sqlText = new StringBuilder(); sqlText.Append(loadAttendDataSql); if (qryDto.SearchMode == 0) { sqlText.AppendFormat(" where AttendanceDate='{0}'", qryDto.AttendanceDate); } else if (qryDto.SearchMode == 1) { sqlText.AppendFormat(" where AttendanceDate>='{0}' And AttendanceDate<='{1}' And Department='{2}'", qryDto.DateFrom, qryDto.DateTo, qryDto.Department); } else if (qryDto.SearchMode == 2) { sqlText.AppendFormat(" where AttendanceDate>='{0}' And AttendanceDate<='{1}' And WorkerId='{2}'", qryDto.DateFrom, qryDto.DateTo, qryDto.WorkerId); } else if (qryDto.SearchMode == 3) { sqlText.AppendFormat(" where YearMonth='{0}'", qryDto.YearMonth); } sqlText.Append(" order by AttendanceDate"); return(DbHelper.Hrm.LoadEntities <AttendanceDataModel>(sqlText.ToString())); }
/// <summary> /// searchMode: /// 0:按考勤日期查询 /// 1:按考勤日期与部门查询 /// 2:按工号查询 /// 3:按年月份查询 /// </summary> /// <param name="qryDto"></param> /// <returns></returns> public List <AttendanceDataModel> LoadAttendanceDatasBy(AttendanceDataQueryDto qryDto) { return(this.irep.LoadAttendanceDatasBy(qryDto)); }