${}does not support parameter index according to my test. You can use annotation Paramto specify the parameter name in the mapper API declaration.
public MatchResult get(long id, @Param("tablename") String tablename);
Mapper xml:
<select id="get" resultType="myresult">
select * from ${tabelname} where id=#{0}
</select>
An alternative is to use an object of your own class or map as a parameter if you do not want to use a IBatis/MyBatisspecific annotation Paramin the mapper API declaration.
Take a map as an example, your java API might be:
public MatchResult get(Map<String, Object> params);
xml- mapper :
<select id="get" parameterType="map" resultType="myresult">
select * from ${tablename} where id=#{id}
</select>
id tablename "id" "tablename" API.