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