public interface IBaseBiz<T>
extends com.baomidou.mybatisplus.extension.service.IService<T>
| Modifier and Type | Method and Description |
|---|---|
int |
countBySQL(String table,
Map wheres)
查询表中记录总数
|
void |
createTable(String table,
Map<Object,List> fileds)
创建表
|
void |
delete(int[] ids)
根据id集合实现批量的删除
|
void |
delete(String[] ids)
根据id集合实现批量的删除
扩展雪花编号的id
|
void |
deleteBySQL(String table,
Map wheres)
动态SQL删除
|
void |
deleteEntity(BaseEntity entity)
根据id删除实体
|
void |
deleteEntity(int id)
根据id删除实体
|
void |
dropTable(String table)
删除表
|
Object |
excuteSql(String sql)
导入执行数据
|
<E> E |
getEntity(BaseEntity entity)
更具ID查询实体信息
|
<E> BaseEntity |
getEntity(int id)
更具ID查询实体信息
|
void |
insertBySQL(String table,
Map fields)
添加记录
|
List<T> |
query(BaseEntity entity)
查询
|
List<T> |
queryAll()
查询所有
|
List |
queryBySQL(String table,
List<String> fields,
Map wheres)
动态sql查询
|
List |
queryBySQL(String table,
List<String> fields,
Map wheres,
Integer begin,
Integer end)
动态sql查询
|
int |
queryCount()
Deprecated.
|
void |
saveBatch(List list)
批量新增
|
int |
saveEntity(BaseEntity entity)
保存
|
void |
updateBySQL(String table,
Map fields,
Map wheres)
动态SQL更新
|
void |
updateCache()
更新缓存
使用场景:当前这个类存在数据缓存,使用了mybitsPlus的更新、保存等方法没有刷新数据缓存,
调用该方法需要dao xml中实现一个更新方法
xml示例:
|
void |
updateEntity(BaseEntity entity)
更新实体
|
count, count, getBaseMapper, getById, getMap, getObj, getOne, getOne, lambdaQuery, lambdaUpdate, list, list, listByIds, listByMap, listMaps, listMaps, listObjs, listObjs, listObjs, listObjs, page, page, pageMaps, pageMaps, query, remove, removeById, removeByIds, removeByMap, save, saveBatch, saveBatch, saveOrUpdate, saveOrUpdate, saveOrUpdateBatch, saveOrUpdateBatch, update, update, update, updateBatchById, updateBatchById, updateByIdint countBySQL(String table, Map wheres)
table - 表名称wheres - 条件 都是key-value对应void createTable(String table, Map<Object,List> fileds)
table - 表名称fileds - key:字段名称 list[0] 类型 list[1]长度 list[2]默认值 list[3]是否不填void delete(String[] ids)
ids - id集合void updateCache()
void delete(int[] ids)
ids - id集合void deleteBySQL(String table, Map wheres)
table - 表名称wheres - 條件 都是key-value对应void deleteEntity(BaseEntity entity)
ene - 要删除的主键idvoid deleteEntity(int id)
id - 要删除的主键idvoid dropTable(String table)
table - 表名称<E> E getEntity(BaseEntity entity)
id - 实体ID<E> BaseEntity getEntity(int id)
id - 实体IDList<T> query(BaseEntity entity)
List queryBySQL(String table, List<String> fields, Map wheres)
table - 表名称fields - list集合wheres - 条件 都是key-value对应List queryBySQL(String table, List<String> fields, Map wheres, Integer begin, Integer end)
table - 表名称fields - list集合wheres - 条件 都是key-value对应begin - 开始end - 结束@Deprecated int queryCount()
void saveBatch(List list)
list - 新增数据int saveEntity(BaseEntity entity)
entity - 实体void updateBySQL(String table, Map fields, Map wheres)
table - 表名称fields - list集合每个map都是key-value对应wheres - 条件 都是key-value对应void updateEntity(BaseEntity entity)
entity - Copyright © 2021. All rights reserved.