add BaseMapper.listOrder
This commit is contained in:
@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.SelectProvider;
|
||||
import org.apache.ibatis.annotations.UpdateProvider;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 基本 SQL 映射,子接口可以不实现
|
||||
@ -46,6 +47,10 @@ public interface BaseMapper<T, P> {
|
||||
@SelectProvider(type = SQLProvider.class, method = "count")
|
||||
long count();
|
||||
|
||||
default List<T> list(long offset, int limit) {
|
||||
return listOrder(offset, limit, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部分数据
|
||||
*
|
||||
@ -53,8 +58,8 @@ public interface BaseMapper<T, P> {
|
||||
* @param limit 数据量
|
||||
* @return 数据列表
|
||||
*/
|
||||
@SelectProvider(type = SQLProvider.class, method = "list")
|
||||
List<T> list(long offset, int limit);
|
||||
@SelectProvider(type = SQLProvider.class, method = "listOrder")
|
||||
List<T> listOrder(long offset, int limit, Map<String, OrderType> orderMap);
|
||||
|
||||
/**
|
||||
* 创建数据。默认自增主键为 id,如需修改请重写此接口
|
||||
|
||||
Reference in New Issue
Block a user