}
// 查找散表参数
protected static Object findShardParamValue(StatementRuntime runtime, Column column) {
if (runtime.getMetaData().getShardByIndex() < 0) {
throw new BadSqlGrammarException("interpreter.findShardParamValue@ShardByIndex < 0", "SQL [" + runtime.getSQL()
+ "] shardByIndex: " // NL
+ runtime.getMetaData().getShardByIndex(), null);
}
Object value = null;
int sqlIndex = runtime.getMetaData().getShardByIndex() + 1;
Map<String, Object> parameters = runtime.getParameters();
value = parameters.get(":" + sqlIndex);
if (value == null) {
throw new BadSqlGrammarException("interpreter.findShardParamValue@ShardParam", "SQL [" + runtime.getSQL()
+ "] Query without shard parameter: " + runtime.getParameters().toString(), null);
}
return value;
}