private int rowIteration(List<StepSetOperation> categorySet,
			Map<String, String> fields, String tableName, String sql,
			Connection memConn) throws Exception {
		ResultSet rs = null;
		int upRowNum = 0;
		long time = System.currentTimeMillis();
		try {
			// 修改后的数据
			Map<String, Map<String, Object>> afterRowListMap = new LinkedHashMap<String, Map<String, Object>>();
			rs = util.getResultSetBySql(memConn, sql);
			try {
				IterationEngine engine = IterationEngineImpl.getInstance();
				UnitOperation unitOperation = new UnitOperationImpl();
				IterationContext ctx = new IterationContextImpl();
				// 更新id
				String id = "";
				while (rs.next()) {
//					time = System.currentTimeMillis();
					// 当前行数据
					Map<String, Object> _row = new HashMap<String, Object>();
					id = rs.getString("id");

					for (Entry<String, String> stepOperation : fields
							.entrySet()) {
						String key = stepOperation.getValue();
						Object value = rs.getObject(stepOperation.getKey());
						_row.put(key, value);
					}
					ctx.clear();
					ctx.set(_row);
					
					// 迭代
					for (int i = 0; i < categorySet.size(); i++) {

						StepSetOperation stepSetOperation = categorySet.get(i);
						String columnName = stepSetOperation.getColumnName();
						// 更新条件
						String updateCriteria = stepSetOperation
								.getUpdateCriteria();
						boolean isUpdate = true;
						if (stepSetOperation.isUpdate()) {
							isUpdate = false;
//							Object object = unitOperation.operation(engine,
//									updateCriteria, ctx);
							Expression exp = engine.compileExp(updateCriteria, ctx);
							Object object  = exp.eval(ctx);
							if (object instanceof Boolean) {
								isUpdate = (Boolean) object;
							}
						}
						if (isUpdate) {
							// 修改后的数据
							String formula = stepSetOperation.getFormula();
//							Object value = unitOperation.operation(engine,
//									formula, ctx);
							Expression exp = engine.compileExp(formula, ctx);
							Object value  = exp.eval(ctx);
							ctx.set(columnName, value);
							_row.put(columnName, value);
						}
					}
					afterRowListMap.put(id, _row);
//					System.out.println(System.currentTimeMillis() - time);
				}
				System.out.println(System.currentTimeMillis() - time);
				util.close(rs);
			} catch (Exception e) {
				throw e;
			}
			time = System.currentTimeMillis();
			upRowNum = batchRowUpdate(categorySet, afterRowListMap, tableName,
					memConn);
			System.out.println(System.currentTimeMillis() - time);
		} catch (Exception e) {
			logger.error("{}", e);
			throw e;
		} finally {
			util.close(rs);
		}
		return upRowNum;
	}