public interface BaseMapper<T>
| 限定符和类型 | 方法和说明 |
|---|---|
DbContext |
db()
当前数据源
|
Integer |
delete(Act1<MapperWhereQ> condition) |
Integer |
deleteById(Object id) |
Integer |
deleteByIds(Iterable idList) |
Integer |
deleteByMap(Map<String,Object> columnMap) |
Class<?> |
entityClz()
当前实体类
|
boolean |
exists(Act1<MapperWhereQ> condition) |
boolean |
existsById(Object id) |
Long |
insert(T entity,
Act2<T,DataItem> dataBuilder)
插入数据,由外部组装数据
|
Long |
insert(T entity,
boolean excludeNull)
插入数据,根据excludeNull决定是否要拼接值为null的数据
|
void |
insertList(List<T> list)
批量插入数据
|
void |
insertList(List<T> list,
Act2<T,DataItem> dataBuilder)
批量插入数据
|
List<Object> |
selectArray(String column,
Act1<MapperWhereQ> condition) |
List<Object> |
selectArray(String column,
int start,
int size,
Act1<MapperWhereQ> condition) |
T |
selectById(Object id) |
List<T> |
selectByIds(Iterable idList) |
List<T> |
selectByMap(Map<String,Object> columnMap) |
Long |
selectCount(Act1<MapperWhereQ> condition) |
T |
selectItem(Act1<MapperWhereQ> condition) |
T |
selectItem(T entity) |
List<T> |
selectList(Act1<MapperWhereQ> condition) |
List<T> |
selectList(int start,
int size,
Act1<MapperWhereQ> condition) |
Map<String,Object> |
selectMap(Act1<MapperWhereQ> condition) |
List<Map<String,Object>> |
selectMapList(Act1<MapperWhereQ> condition) |
List<Map<String,Object>> |
selectMapList(int start,
int size,
Act1<MapperWhereQ> condition) |
IPage<Map<String,Object>> |
selectMapPage(int start,
int size,
Act1<MapperWhereQ> condition) |
List<Map<String,Object>> |
selectMapTop(int size,
Act1<MapperWhereQ> condition) |
IPage<T> |
selectPage(int start,
int size,
Act1<MapperWhereQ> condition) |
List<T> |
selectTop(int size,
Act1<MapperWhereQ> condition) |
Object |
selectValue(String column,
Act1<MapperWhereQ> condition) |
String |
tableName()
当前表名
|
String |
tablePk()
当前表主键
|
Integer |
update(T entity,
Act2<T,DataItem> dataBuilder,
Act1<MapperWhereQ> condition) |
Integer |
update(T entity,
boolean excludeNull,
Act1<MapperWhereQ> condition) |
Integer |
updateById(T entity,
Act2<T,DataItem> dataBuilder) |
Integer |
updateById(T entity,
boolean excludeNull) |
int[] |
updateList(List<T> list,
Act2<T,DataItem> dataBuilder,
Property<T,?>... conditionFields) |
Long |
upsert(T entity,
Act2<T,DataItem> dataBuilder)
新增或修改数据 更新时根据主键更新
|
Long |
upsert(T entity,
boolean excludeNull)
新增或修改数据 更新时根据主键更新
|
Long |
upsertBy(T entity,
Act2<T,DataItem> dataBuilder,
String conditionFields)
新增或修改数据 更新时根据条件字段更新
|
Long |
upsertBy(T entity,
boolean excludeNull,
String conditionFields)
新增或修改数据 更新时根据条件字段更新
|
DbContext db()
String tableName()
String tablePk()
Class<?> entityClz()
Long insert(T entity, boolean excludeNull)
entity - 写入的实体excludeNull - 是否排除null属性Long insert(T entity, Act2<T,DataItem> dataBuilder)
entity - 写入的实体dataBuilder - 数据组装器void insertList(List<T> list, Act2<T,DataItem> dataBuilder)
list - 待插入的数据dataBuilder - 数据组装器Integer delete(Act1<MapperWhereQ> condition)
Integer updateById(T entity, Act2<T,DataItem> dataBuilder)
entity - 待更新的实体dataBuilder - 组装data的方式,方便支持部分属性允许设置为null,部分不允许Integer update(T entity, boolean excludeNull, Act1<MapperWhereQ> condition)
Integer update(T entity, Act2<T,DataItem> dataBuilder, Act1<MapperWhereQ> condition)
entity - 待更新的实体dataBuilder - 组装data的方式,方便支持部分属性允许设置为null,部分不允许condition - 更新数据的条件int[] updateList(List<T> list, Act2<T,DataItem> dataBuilder, Property<T,?>... conditionFields)
Long upsert(T entity, boolean excludeNull)
entity - 要处理的实体excludeNull - 是否排除null值Long upsert(T entity, Act2<T,DataItem> dataBuilder)
entity - 要处理的实体dataBuilder - 数据组装器Long upsertBy(T entity, boolean excludeNull, String conditionFields)
entity - 要处理的实体excludeNull - 是否排除null值conditionFields - 更新的条件Long upsertBy(T entity, Act2<T,DataItem> dataBuilder, String conditionFields)
entity - 要处理的实体dataBuilder - 数据组装器conditionFields - 更新的条件boolean existsById(Object id)
boolean exists(Act1<MapperWhereQ> condition)
T selectItem(Act1<MapperWhereQ> condition)
Map<String,Object> selectMap(Act1<MapperWhereQ> condition)
Object selectValue(String column, Act1<MapperWhereQ> condition)
Long selectCount(Act1<MapperWhereQ> condition)
List<T> selectList(Act1<MapperWhereQ> condition)
List<Object> selectArray(String column, Act1<MapperWhereQ> condition)
List<T> selectList(int start, int size, Act1<MapperWhereQ> condition)
List<Map<String,Object>> selectMapList(int start, int size, Act1<MapperWhereQ> condition)
List<Object> selectArray(String column, int start, int size, Act1<MapperWhereQ> condition)
IPage<T> selectPage(int start, int size, Act1<MapperWhereQ> condition)
start - 从0开始IPage<Map<String,Object>> selectMapPage(int start, int size, Act1<MapperWhereQ> condition)
List<T> selectTop(int size, Act1<MapperWhereQ> condition)
Copyright © 2024. All rights reserved.