/**
* 动态设置表名,查询所有的用户信息
* @param tableName
* @return
*/
List<User> getAllUser(@Param("tableName") String tableName);
<!--List<User> getAllUser(@Param("tableName") String tableName);-->
<select id="getAllUser" resultType="User">
<!--不能用#{},因为#会自动加单引号,比如变成from 't_user',这是错的,因为表名是不能加单引号的-->
select * from ${tableName}
</select>