| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
BaseBizImpl() |
| Modifier and Type | Method and Description |
|---|---|
int |
countBySQL(String table,
Map wheres)
查询表中记录总数
|
void |
createTable(String table,
Map 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)
导入执行数据
|
protected abstract IBaseDao<T> |
getDao()
不需要重写此方法,自动会
|
T |
getEntity(BaseEntity entity)
更具ID查询实体信息
|
BaseEntity |
getEntity(int id)
更具ID查询实体信息
|
void |
insertBySQL(String table,
Map fields)
添加记录
|
List<T> |
query(BaseEntity entity)
查询
|
List<T> |
queryAll()
查询所有
|
List |
queryBySQL(String table,
List fields,
Map wheres)
动态sql查询
|
List |
queryBySQL(String table,
List 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)
更新实体
|
closeSqlSession, currentMapperClass, currentModelClass, executeBatch, executeBatch, executeBatch, getBaseMapper, getMap, getObj, getOne, getSqlStatement, retBool, saveBatch, saveOrUpdate, saveOrUpdateBatch, sqlSessionBatch, sqlStatement, updateBatchByIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcount, 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, updateByIdpublic int saveEntity(BaseEntity entity)
IBaseBizsaveEntity in interface IBaseBiz<T>entity - 实体public void deleteEntity(int id)
IBaseBizdeleteEntity in interface IBaseBiz<T>id - 要删除的主键idpublic void updateEntity(BaseEntity entity)
IBaseBizupdateEntity in interface IBaseBiz<T>@Deprecated public int queryCount()
IBaseBizqueryCount in interface IBaseBiz<T>public BaseEntity getEntity(int id)
IBaseBizpublic List queryBySQL(String table, List fields, Map wheres, Integer begin, Integer end)
IBaseBizqueryBySQL in interface IBaseBiz<T>table - 表名称fields - list集合wheres - 条件 都是key-value对应begin - 开始end - 结束public int countBySQL(String table, Map wheres)
IBaseBizcountBySQL in interface IBaseBiz<T>table - 表名称wheres - 条件 都是key-value对应public List queryBySQL(String table, List fields, Map wheres)
IBaseBizqueryBySQL in interface IBaseBiz<T>table - 表名称fields - list集合wheres - 条件 都是key-value对应public void updateBySQL(String table, Map fields, Map wheres)
IBaseBizupdateBySQL in interface IBaseBiz<T>table - 表名称fields - list集合每个map都是key-value对应wheres - 条件 都是key-value对应public void deleteBySQL(String table, Map wheres)
IBaseBizdeleteBySQL in interface IBaseBiz<T>table - 表名称wheres - 條件 都是key-value对应public void insertBySQL(String table, Map fields)
IBaseBizinsertBySQL in interface IBaseBiz<T>table - 表名称fields - 编号public void createTable(String table, Map fileds)
IBaseBizcreateTable in interface IBaseBiz<T>table - 表名称fileds - key:字段名称 list[0] 类型 list[1]长度 list[2]默认值 list[3]是否不填public void updateCache()
IBaseBizupdateCache in interface IBaseBiz<T>public void delete(int[] ids)
IBaseBizpublic void delete(String[] ids)
IBaseBizpublic void deleteEntity(BaseEntity entity)
IBaseBizdeleteEntity in interface IBaseBiz<T>public T getEntity(BaseEntity entity)
IBaseBizCopyright © 2021. All rights reserved.