How do I use parameters for a custom global sql in Mybatis Plus?

< H2 > as in the question, we want to define a global method to get any random data, but we can"t find out how to use parameters in the global method. < / H2 >
official documentation does not indicate how to use it.
// BaseDao.java
/**
 * 
 */
List<T> listByRandom(@Param("num") Integer num);

// CustomSqlInjector.java
/**
 * 
 */
private static final String SQL_LIST_BY_RANDOM = "select %s from %s where id >= ((select max(id) from user_default_avatar) - (select min(id) from user_default_avatar)) * rand() + (select min(id) from user_default_avatar)limit %s";

public void listByRandom(Class<?> mapperClass, Class<?> modelClass, TableInfo table) {
    final String sql = String.format(SQL_LIST_BY_RANDOM, this.sqlSelectColumns(table, false), table.getTableName());
    final SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass);
    this.addSelectMappedStatement(mapperClass, "listByRandom", sqlSource, modelClass, table);
}

does anyone know? (please tell me) *: please tell

Oct.31,2021

has been resolved. Use-sharp {param} directly. For more information, please see
https://blog.rxliuli.com/p/5b.

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38d3d-2c14b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38d3d-2c14b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?