diff --git a/src/main/java/org/redkale/persistence/SourceResource.java b/src/main/java/org/redkale/persistence/SourceResource.java
new file mode 100644
index 000000000..b45543929
--- /dev/null
+++ b/src/main/java/org/redkale/persistence/SourceResource.java
@@ -0,0 +1,33 @@
+/*
+ *
+ */
+package org.redkale.persistence;
+
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * 指定Source的资源名
+ *
+ *
+ * 详情见: https://redkale.org
+ *
+ *
+ * @see org.redkale.source.DataSqlMapper
+ *
+ * @author zhangjx
+ *
+ * @since 2.8.0
+ */
+@Inherited
+@Documented
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface SourceResource {
+
+ String value();
+}
diff --git a/src/main/java/org/redkale/source/DataSqlMapper.java b/src/main/java/org/redkale/source/DataSqlMapper.java
new file mode 100644
index 000000000..43bdc4a9f
--- /dev/null
+++ b/src/main/java/org/redkale/source/DataSqlMapper.java
@@ -0,0 +1,3407 @@
+/*
+ *
+ */
+package org.redkale.source;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+import java.util.stream.Stream;
+import org.redkale.util.LambdaFunction;
+import org.redkale.util.LambdaSupplier;
+import org.redkale.util.SelectColumn;
+import org.redkale.util.Sheet;
+
+/**
+ * 类似Mybatis的Mapper接口类, 接口系列和DataSource相似度高
+ * 子类需要注解数据源{@link org.redkale.persistence.SourceResource},没有指定会找资源名为空的默认DataSqlSource
+ *
+ *
+ * 详情见: https://redkale.org
+ *
+ * @see org.redkale.persistence.SourceResource
+ *
+ * @author zhangjx
+ * @param T
+ *
+ * @since 2.8.0
+ */
+public interface DataSqlMapper {
+
+ /**
+ * 获取当前数据源
+ *
+ * @return DataSqlSource
+ */
+ DataSqlSource dataSource();
+
+ /**
+ * 获取当前实体类型
+ *
+ *
+ * @return Class
+ */
+ Class entityType();
+
+ /**
+ * 新增记录
+ *
+ * @param entitys Entity对象
+ *
+ * @return CompletableFuture
+ */
+ default int insert(T... entitys) {
+ return dataSource().insert(entitys);
+ }
+
+ /**
+ * 新增记录
+ *
+ * @param entitys Entity对象
+ *
+ * @return CompletableFuture
+ */
+ default int insert(Collection entitys) {
+ return dataSource().insert(entitys);
+ }
+
+ /**
+ * 新增记录
+ *
+ * @param entitys Entity对象
+ *
+ * @return CompletableFuture
+ */
+ default int insert(Stream entitys) {
+ return dataSource().insert(entitys);
+ }
+
+ /**
+ * 新增记录
+ *
+ * @param entitys Entity对象
+ *
+ * @return CompletableFuture
+ */
+ default CompletableFuture insertAsync(T... entitys) {
+ return dataSource().insertAsync(entitys);
+ }
+
+ /**
+ * 新增记录
+ *
+ * @param entitys Entity对象
+ *
+ * @return CompletableFuture
+ */
+ default CompletableFuture insertAsync(Collection entitys) {
+ return dataSource().insertAsync(entitys);
+ }
+
+ /**
+ * 新增记录
+ *
+ * @param entitys Entity对象
+ *
+ * @return CompletableFuture
+ */
+ default CompletableFuture insertAsync(Stream entitys) {
+ return dataSource().insertAsync(entitys);
+ }
+
+ /**
+ * 删除指定主键值的记录
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {values.id}
+ *
+ * @param entitys Entity对象
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default int delete(T... entitys) {
+ return dataSource().delete(entitys);
+ }
+
+ /**
+ * 删除指定主键值的记录
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {values.id}
+ *
+ * @param entitys Entity对象
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default int delete(Collection entitys) {
+ return dataSource().delete(entitys);
+ }
+
+ /**
+ * 删除指定主键值的记录
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {values.id}
+ *
+ * @param entitys Entity对象
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default int delete(Stream entitys) {
+ return dataSource().delete(entitys);
+ }
+
+ /**
+ * 删除指定主键值的记录
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {values.id}
+ *
+ * @param entitys Entity对象
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture deleteAsync(T... entitys) {
+ return dataSource().deleteAsync(entitys);
+ }
+
+ /**
+ * 删除指定主键值的记录
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {values.id}
+ *
+ * @param entitys Entity对象
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture deleteAsync(Collection entitys) {
+ return dataSource().deleteAsync(entitys);
+ }
+
+ /**
+ * 删除指定主键值的记录
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {values.id}
+ *
+ * @param entitys Entity对象
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture deleteAsync(Stream entitys) {
+ return dataSource().deleteAsync(entitys);
+ }
+
+ /**
+ * 删除指定主键值的记录,多主键值必须在同一张表中
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {ids}
+ *
+ * @param pks 主键值
+ *
+ * @return 影响的记录条数
+ */
+ default int deleteById(Serializable... pks) {
+ return dataSource().delete(entityType(), pks);
+ }
+
+ /**
+ * 删除指定主键值的记录,多主键值必须在同一张表中
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {ids}
+ *
+ * @param pks 主键值
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture deleteByIdAsync(Serializable... pks) {
+ return dataSource().deleteAsync(entityType(), pks);
+ }
+
+ //------------------------update---------------------------
+ /**
+ * 更新记录
+ * 等价SQL:
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
+ * ···
+ *
+ * @param entitys Entity对象
+ *
+ * @return 影响的记录条数
+ */
+ default int update(T... entitys) {
+ return dataSource().update(entitys);
+ }
+
+ /**
+ * 更新记录
+ * 等价SQL:
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
+ * ···
+ *
+ * @param entitys Entity对象
+ *
+ * @return 影响的记录条数
+ */
+ default int update(Collection entitys) {
+ return dataSource().update(entitys);
+ }
+
+ /**
+ * 更新记录
+ * 等价SQL:
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
+ * ···
+ *
+ * @param entitys Entity对象
+ *
+ * @return 影响的记录条数
+ */
+ default int update(Stream entitys) {
+ return dataSource().update(entitys);
+ }
+
+ /**
+ * 更新记录
+ * 等价SQL:
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
+ * ···
+ *
+ * @param entitys Entity对象
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateAsync(T... entitys) {
+ return dataSource().updateAsync(entitys);
+ }
+
+ /**
+ * 更新记录
+ * 等价SQL:
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
+ * ···
+ *
+ * @param entitys Entity对象
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateAsync(Collection entitys) {
+ return dataSource().updateAsync(entitys);
+ }
+
+ /**
+ * 更新记录
+ * 等价SQL:
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
+ * ···
+ *
+ * @param entitys Entity对象
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateAsync(Stream entitys) {
+ return dataSource().updateAsync(entitys);
+ }
+
+ /**
+ * 更新单个记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {primary} = {id}
+ *
+ * @param pk 主键
+ * @param column 待更新的字段名
+ * @param value 更新值
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(Serializable pk, String column, Serializable value) {
+ return dataSource().updateColumn(entityType(), pk, column, value);
+ }
+
+ /**
+ * 更新单个记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {primary} = {id}
+ *
+ * @param 更新值泛型
+ * @param pk 主键
+ * @param func 更新值Lambda
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(Serializable pk, LambdaSupplier func) {
+ return dataSource().updateColumn(entityType(), pk, func);
+ }
+
+ /**
+ * 更新单个记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {primary} = {id}
+ *
+ * @param pk 主键
+ * @param column 待更新的字段名
+ * @param value 更新值
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateColumnAsync(Serializable pk, String column, Serializable value) {
+ return dataSource().updateColumnAsync(entityType(), pk, column, value);
+ }
+
+ /**
+ * 更新单个记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {primary} = {id}
+ *
+ * @param 更新值泛型
+ * @param pk 主键
+ * @param func 更新值Lambda
+ *
+ * @return 影响的记录条数
+ */
+ default CompletableFuture updateColumnAsync(Serializable pk, LambdaSupplier func) {
+ return dataSource().updateColumnAsync(entityType(), pk, func);
+ }
+
+ /**
+ * 更新符合过滤条件记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {filter node}
+ *
+ * @param clazz Entity类
+ * @param column 待更新的字段名
+ * @param value 更新值
+ * @param node 过滤条件
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(String column, Serializable value, FilterNode node) {
+ return dataSource().updateColumn(entityType(), column, value, node);
+ }
+
+ /**
+ * 更新符合过滤条件记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {filter node}
+ *
+ * @param 更新值泛型
+ * @param func 更新值Lambda
+ * @param node 过滤条件
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(LambdaSupplier func, FilterNode node) {
+ return dataSource().updateColumn(entityType(), func, node);
+ }
+
+ /**
+ * 更新符合过滤条件记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {filter node}
+ *
+ * @param column 待更新的字段名
+ * @param value 更新值
+ * @param node 过滤条件
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateColumnAsync(String column, Serializable value, FilterNode node) {
+ return dataSource().updateColumnAsync(entityType(), column, value, node);
+ }
+
+ /**
+ * 更新符合过滤条件记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {filter node}
+ *
+ * @param 更新值泛型
+ * @param func 更新值Lambda
+ * @param node 过滤条件
+ *
+ * @return 影响的记录条数
+ */
+ default CompletableFuture updateColumnAsync(LambdaSupplier func, FilterNode node) {
+ return dataSource().updateColumnAsync(entityType(), func, node);
+ }
+
+ /**
+ * 更新指定主键值记录的部分字段
+ * 字段赋值操作选项见 ColumnExpress
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}
+ *
+ * @param pk 主键
+ * @param values 更新字段
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(Serializable pk, ColumnValue... values) {
+ return dataSource().updateColumn(entityType(), pk, values);
+ }
+
+ /**
+ * 更新指定主键值记录的部分字段
+ * 字段赋值操作选项见 ColumnExpress
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}
+ *
+ * @param pk 主键
+ * @param func 更新字段
+ * @param value 更新字段值
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(Serializable pk, LambdaFunction func, Serializable value) {
+ return dataSource().updateColumn(entityType(), pk, func, value);
+ }
+
+ /**
+ * 更新指定主键值记录的部分字段
+ * 字段赋值操作选项见 ColumnExpress
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}
+ *
+ * @param pk 主键
+ * @param values 更新字段
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateColumnAsync(Serializable pk, ColumnValue... values) {
+ return dataSource().updateColumnAsync(entityType(), pk, values);
+ }
+
+ /**
+ * 更新指定主键值记录的部分字段
+ * 字段赋值操作选项见 ColumnExpress
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}
+ *
+ * @param pk 主键
+ * @param func 更新字段
+ * @param value 更新字段值
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateColumnAsync(Serializable pk, LambdaFunction func, Serializable value) {
+ return dataSource().updateColumnAsync(entityType(), pk, func, value);
+ }
+
+ /**
+ * 更新符合过滤条件记录的部分字段
+ * 字段赋值操作选项见 ColumnExpress
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}
+ *
+ * @param node 过滤条件
+ * @param values 更新字段
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(FilterNode node, ColumnValue... values) {
+ return dataSource().updateColumn(entityType(), node, values);
+ }
+
+ /**
+ * 更新符合过滤条件记录的部分字段
+ * 字段赋值操作选项见 ColumnExpress
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}
+ *
+ * @param node 过滤条件
+ * @param values 更新字段
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateColumnAsync(FilterNode node, ColumnValue... values) {
+ return dataSource().updateColumnAsync(entityType(), node, values);
+ }
+
+ /**
+ * 更新符合过滤条件的记录的指定字段
+ * Flipper中offset字段将被忽略
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node} ORDER BY
+ * {flipper.sort}
+ *
+ *
+ * @param node 过滤条件
+ * @param flipper 翻页对象
+ * @param values 更新字段
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(FilterNode node, Flipper flipper, ColumnValue... values) {
+ return dataSource().updateColumn(entityType(), node, flipper, values);
+ }
+
+ /**
+ * 更新符合过滤条件的记录的指定字段
+ * Flipper中offset字段将被忽略
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node} ORDER BY
+ * {flipper.sort}
+ *
+ * @param node 过滤条件
+ * @param flipper 翻页对象
+ * @param values 更新字段
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateColumnAsync(FilterNode node, Flipper flipper, ColumnValue... values) {
+ return dataSource().updateColumnAsync(entityType(), node, flipper, values);
+ }
+
+ /**
+ * 更新单个记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}
+ *
+ * @param entity 待更新的Entity对象
+ * @param columns 需更新的字段名
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(T entity, String... columns) {
+ return dataSource().updateColumn(entityType(), columns);
+ }
+
+ /**
+ * 更新单个记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}
+ *
+ * @param entity 待更新的Entity对象
+ * @param funcs 需更新的字段名Lambda集合
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(T entity, LambdaFunction... funcs) {
+ return dataSource().updateColumn(entityType(), funcs);
+ }
+
+ /**
+ * 更新单个记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}
+ *
+ * @param entity 待更新的Entity对象
+ * @param columns 需更新的字段名
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateColumnAsync(T entity, String... columns) {
+ return dataSource().updateColumnAsync(entityType(), columns);
+ }
+
+ /**
+ * 更新单个记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}
+ *
+ * @param entity 待更新的Entity对象
+ * @param funcs 需更新的字段名Lambda集合
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateColumnAsync(T entity, LambdaFunction... funcs) {
+ return dataSource().updateColumnAsync(entityType(), funcs);
+ }
+
+ /**
+ * 更新符合过滤条件记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}
+ *
+ * @param entity 待更新的Entity对象
+ * @param node 过滤条件
+ * @param columns 需更新的字段名
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(T entity, FilterNode node, String... columns) {
+ return dataSource().updateColumn(entity, node, columns);
+ }
+
+ /**
+ * 更新符合过滤条件记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}
+ *
+ * @param entity 待更新的Entity对象
+ * @param node 过滤条件
+ * @param funcs 需更新的字段名Lambda集合
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(T entity, FilterNode node, LambdaFunction... funcs) {
+ return dataSource().updateColumn(entity, node, funcs);
+ }
+
+ /**
+ * 更新符合过滤条件记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}
+ *
+ * @param entity 待更新的Entity对象
+ * @param node 过滤条件
+ * @param columns 需更新的字段名
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateColumnAsync(T entity, FilterNode node, String... columns) {
+ return dataSource().updateColumnAsync(entity, node, columns);
+ }
+
+ /**
+ * 更新符合过滤条件记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}
+ *
+ * @param entity 待更新的Entity对象
+ * @param node 过滤条件
+ * @param funcs 需更新的字段名Lambda集合
+ *
+ * @return 影响的记录条数
+ */
+ default CompletableFuture updateColumnAsync(T entity, FilterNode node, LambdaFunction... funcs) {
+ return dataSource().updateColumnAsync(entity, node, funcs);
+ }
+
+ /**
+ * 更新单个记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}
+ *
+ * @param entity 待更新的Entity对象
+ * @param selects 指定字段
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(T entity, SelectColumn selects) {
+ return dataSource().updateColumn(entity, selects);
+ }
+
+ /**
+ * 更新单个记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}
+ *
+ * @param entity 待更新的Entity对象
+ * @param selects 指定字段
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateColumnAsync(T entity, SelectColumn selects) {
+ return dataSource().updateColumnAsync(entity, selects);
+ }
+
+ /**
+ * 更新符合过滤条件记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}
+ *
+ * @param entity 待更新的Entity对象
+ * @param node 过滤条件
+ * @param selects 指定字段
+ *
+ * @return 影响的记录条数
+ */
+ default int updateColumn(T entity, FilterNode node, SelectColumn selects) {
+ return dataSource().updateColumn(entity, node, selects);
+ }
+
+ /**
+ * 更新符合过滤条件记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}
+ *
+ * @param entity 待更新的Entity对象
+ * @param node 过滤条件
+ * @param selects 指定字段
+ *
+ * @return 影响的记录条数CompletableFuture
+ */
+ default CompletableFuture updateColumnAsync(T entity, FilterNode node, SelectColumn selects) {
+ return dataSource().updateColumnAsync(entity, node, selects);
+ }
+
+ //-----------------------getXXXXResult-----------------------------
+ default Number getNumberResult(FilterFunc func, String column) {
+ return dataSource().getNumberResult(entityType(), func, column);
+ }
+
+ /**
+ * 获取符合过滤条件记录的聚合结果, 无结果返回null
+ * 等价SQL: SELECT FUNC{column} FROM {table}
+ * 如 getNumberResultAsync(User.class, FilterFunc.COUNT, null) 等价于: SELECT COUNT(*) FROM {table}
+ *
+ *
+ * @param func 聚合函数
+ * @param column 指定字段
+ *
+ * @return 聚合结果CompletableFuture
+ */
+ default CompletableFuture getNumberResultAsync(FilterFunc func, String column) {
+ return dataSource().getNumberResultAsync(entityType(), func, column);
+ }
+
+ /**
+ * 获取符合过滤条件记录的聚合结果, 无结果返回null
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter bean}
+ * 如 getNumberResultAsync(User.class, FilterFunc.COUNT, null, (FilterBean)null) 等价于: SELECT COUNT(*) FROM {table}
+ *
+ *
+ * @param func 聚合函数
+ * @param column 指定字段
+ * @param bean 过滤条件
+ *
+ * @return 聚合结果
+ */
+ default Number getNumberResult(FilterFunc func, String column, FilterBean bean) {
+ return dataSource().getNumberResult(entityType(), func, column, bean);
+ }
+
+ /**
+ * 获取符合过滤条件记录的聚合结果, 无结果返回null
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter bean}
+ * 如 getNumberResultAsync(User.class, FilterFunc.COUNT, null, (FilterBean)null) 等价于: SELECT COUNT(*) FROM {table}
+ *
+ *
+ * @param func 聚合函数
+ * @param column 指定字段
+ * @param bean 过滤条件
+ *
+ * @return 聚合结果CompletableFuture
+ */
+ default CompletableFuture getNumberResultAsync(FilterFunc func, String column, FilterBean bean) {
+ return dataSource().getNumberResultAsync(entityType(), func, column, bean);
+ }
+
+ /**
+ * 获取符合过滤条件记录的聚合结果, 无结果返回null
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter node}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}
+ *
+ *
+ * @param func 聚合函数
+ * @param column 指定字段
+ * @param node 过滤条件
+ *
+ * @return 聚合结果
+ */
+ default Number getNumberResult(FilterFunc func, String column, FilterNode node) {
+ return dataSource().getNumberResult(entityType(), func, column, node);
+ }
+
+ /**
+ * 获取符合过滤条件记录的聚合结果, 无结果返回null
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter node}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}
+ *
+ *
+ * @param func 聚合函数
+ * @param column 指定字段
+ * @param node 过滤条件
+ *
+ * @return 聚合结果
+ */
+ default CompletableFuture getNumberResultAsync(FilterFunc func, String column, FilterNode node) {
+ return dataSource().getNumberResultAsync(entityType(), func, column, node);
+ }
+
+ /**
+ * 获取符合过滤条件记录的聚合结果, 无结果返回默认值
+ * 等价SQL: SELECT FUNC{column} FROM {table}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime") 等价于: SELECT MAX(createtime) FROM {table}
+ *
+ *
+ * @param func 聚合函数
+ * @param defVal 默认值
+ * @param column 指定字段
+ *
+ * @return 聚合结果
+ */
+ default Number getNumberResult(FilterFunc func, Number defVal, String column) {
+ return dataSource().getNumberResult(entityType(), func, defVal, column);
+ }
+
+ /**
+ * 获取符合过滤条件记录的聚合结果, 无结果返回默认值
+ * 等价SQL: SELECT FUNC{column} FROM {table}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime") 等价于: SELECT MAX(createtime) FROM {table}
+ *
+ *
+ * @param func 聚合函数
+ * @param defVal 默认值
+ * @param column 指定字段
+ *
+ * @return 聚合结果CompletableFuture
+ */
+ default CompletableFuture getNumberResultAsync(FilterFunc func, Number defVal, String column) {
+ return dataSource().getNumberResultAsync(entityType(), func, defVal, column);
+ }
+
+ /**
+ * 获取符合过滤条件记录的聚合结果, 无结果返回默认值
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter bean}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}
+ *
+ *
+ * @param func 聚合函数
+ * @param defVal 默认值
+ * @param column 指定字段
+ * @param bean 过滤条件
+ *
+ * @return 聚合结果
+ */
+ default Number getNumberResult(FilterFunc func, Number defVal, String column, FilterBean bean) {
+ return dataSource().getNumberResult(entityType(), func, defVal, column, bean);
+ }
+
+ /**
+ * 获取符合过滤条件记录的聚合结果, 无结果返回默认值
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter bean}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}
+ *
+ *
+ * @param func 聚合函数
+ * @param defVal 默认值
+ * @param column 指定字段
+ * @param bean 过滤条件
+ *
+ * @return 聚合结果CompletableFuture
+ */
+ default CompletableFuture getNumberResultAsync(FilterFunc func, Number defVal, String column, FilterBean bean) {
+ return dataSource().getNumberResultAsync(entityType(), func, defVal, column, bean);
+ }
+
+ /**
+ * 获取符合过滤条件记录的聚合结果, 无结果返回默认值
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter node}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}
+ *
+ *
+ * @param func 聚合函数
+ * @param defVal 默认值
+ * @param column 指定字段
+ * @param node 过滤条件
+ *
+ * @return 聚合结果
+ */
+ default Number getNumberResult(FilterFunc func, Number defVal, String column, FilterNode node) {
+ return dataSource().getNumberResult(entityType(), func, defVal, column, node);
+ }
+
+ /**
+ * 获取符合过滤条件记录的聚合结果, 无结果返回默认值
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter node}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}
+ *
+ *
+ * @param func 聚合函数
+ * @param defVal 默认值
+ * @param column 指定字段
+ * @param node 过滤条件
+ *
+ * @return 聚合结果CompletableFuture
+ */
+ default CompletableFuture getNumberResultAsync(FilterFunc func, Number defVal, String column, FilterNode node) {
+ return dataSource().getNumberResultAsync(entityType(), func, defVal, column, node);
+ }
+
+ /**
+ * 获取符合过滤条件记录的聚合结果Map
+ * 等价SQL: SELECT FUNC1{column1}, FUNC2{column2}, ··· FROM {table}
+ * 如 getNumberMapAsync(User.class, new FilterFuncColumn(FilterFunc.MAX, "createtime")) 等价于: SELECT MAX(createtime) FROM {table}
+ *
+ * @param Number
+ *
+ * @param columns 聚合字段
+ *
+ * @return 聚合结果Map
+ */
+ default Map getNumberMap(FilterFuncColumn... columns) {
+ return dataSource().getNumberMap(entityType(), columns);
+ }
+
+ /**
+ * 获取符合过滤条件记录的聚合结果Map
+ * 等价SQL: SELECT FUNC1{column1}, FUNC2{column2}, ··· FROM {table}
+ * 如 getNumberMapAsync(User.class, new FilterFuncColumn(FilterFunc.MAX, "createtime")) 等价于: SELECT MAX(createtime) FROM {table}
+ *
+ * @param Number
+ *
+ * @param columns 聚合字段
+ *
+ * @return 聚合结果Map CompletableFuture
+ */
+ default CompletableFuture