@SuppressWarnings("unchecked")
	@Override
	public List<T> findAllByConditions(Map<String,Object> sqlWhereMap,Class<T> clazz) throws Exception {
		List<T> list = new ArrayList<T>();
		String tableName = getTableName(clazz);
		String idFieldName = "";
		//存储所有字段的信息
		//通过反射获得要查询的字段
		StringBuffer fieldNames = new StringBuffer();
		Field[] fields = clazz.getDeclaredFields();
		for (Field field : fields) {
			String propertyName = field.getName();
			if (field.isAnnotationPresent(Id.class)) {
				idFieldName = field.getAnnotation(Id.class).value();
				fieldNames.append(TABLE_ALIAS + "." + idFieldName)
						  .append(" as ").append(propertyName).append(",");
			} else if (field.isAnnotationPresent(Column.class)) {
				fieldNames.append(TABLE_ALIAS + "." + field.getAnnotation(Column.class).value())
						  .append(" as ").append(propertyName).append(",");
			}
		}
		fieldNames.deleteCharAt(fieldNames.length()-1);
		//拼装SQL
		String sql = "select " + fieldNames + " from " + tableName + " " + TABLE_ALIAS;
		PreparedStatement ps = null;
		List<Object> values = null;
		if (sqlWhereMap != null) {
			List<Object> sqlWhereWithValues = getSqlWhereWithValues(sqlWhereMap);
			if (sqlWhereWithValues != null) {
				//拼接SQL条件
				String sqlWhere = (String)sqlWhereWithValues.get(0);
				sql += sqlWhere;
				//得到SQL条件中占位符的值
				values = (List<Object>) sqlWhereWithValues.get(1);
			}
		} 
		//设置参数占位符的值
		if (values != null) {
			ps = JdbcDaoHelper.getConnection().prepareStatement(sql);
			setParameter(values, ps, true);
		} else {
			ps = JdbcDaoHelper.getConnection().prepareStatement(sql);
		}
		//执行SQL
		ResultSet rs = ps.executeQuery();
		while(rs.next()) {
			T t = clazz.newInstance();
			initObject(t, fields, rs);
			list.add(t);
		}
		//释放资源
		JdbcDaoHelper.release(ps, rs);
		System.out.println(sql);
		return list;
	}