From 2f54af91228f7723815c1884cbedbb42001e9b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=80=E6=BA=90=E6=B5=B7=E5=93=A5?= Date: Sat, 25 Mar 2023 12:30:21 +0800 Subject: [PATCH] add selectListByMap(Map whereConditions, int count) in BaseMapper --- .../main/java/com/mybatisflex/core/BaseMapper.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/BaseMapper.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/BaseMapper.java index 45b7d69a..9d9a04f9 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/BaseMapper.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/BaseMapper.java @@ -218,6 +218,17 @@ public interface BaseMapper { } + /** + * 根据 map 来构建查询条件,查询多条数据 + * + * @param whereConditions 条件列表 + * @return 数据列表 + */ + default List selectListByMap(Map whereConditions, int count) { + return selectListByQuery(QueryWrapper.create().where(whereConditions).limit(count)); + } + + /** * 根据 query 来构建条件查询数据列表 *