E - public interface IBaseDao<E>
extends com.baomidou.mybatisplus.core.mapper.BaseMapper<E>
| 限定符和类型 | 方法和说明 |
|---|---|
void |
alterTable(String table,
Map fileds,
String type)
SQL修改表
|
int |
countBySQL(String table,
Map wheres,
List<Map> sqlWhereList)
SQL总数
|
void |
createTable(String table,
Map<Object,List> fileds)
SQL创建表
|
void |
delete(int[] ids)
根据id集合实现批量的删除
|
void |
delete(String[] ids)
根据id集合实现批量的删除
|
void |
deleteByEntity(BaseEntity entity)
已过时。
|
void |
deleteBySQL(String table,
Map wheres)
SQL动态SQL删除
|
void |
deleteEntity(int id)
已过时。
|
void |
dropTable(String table)
SQL删除表
|
List |
excuteSql(String sql)
SQL导入执行数据
|
<E> E |
getByEntity(BaseEntity entity)
已过时。
|
BaseEntity |
getEntity(Integer id)
已过时。
|
void |
insertBySQL(String table,
Map fields)
SQL添加记录
|
List<E> |
query(BaseEntity entity)
查询
|
List<E> |
queryAll()
已过时。
|
List<E> |
queryByPage(int pageNo,
int pageSize,
String orderBy,
boolean order)
已过时。
|
List |
queryBySQL(String table,
List<String> fields,
Map wheres,
List<Map> sqlWhereList,
Integer begin,
Integer end,
String orderBy,
String order)
SQL动态sql查询
|
int |
queryCount()
已过时。
|
void |
saveBatch(List list)
已过时。
|
int |
saveEntity(BaseEntity entity)
已过时。
|
void |
updateBySQL(String table,
Map fields,
Map wheres)
SQL动态SQL更新
|
void |
updateCache()
更新缓存
使用场景:当前这个类存在数据缓存,使用了mybitsPlus的更新、保存等方法没有刷新数据缓存,
调用该方法需要dao xml中实现一个更新方法
xml示例:
|
void |
updateEntity(BaseEntity entity)
已过时。
|
void alterTable(@Param(value="table")
String table,
@Param(value="fileds")
Map fileds,
@Param(value="type")
String type)
table - 表名称fileds - key:字段名称 list[0] 类型 list[1]长度 list[2]默认值 list[3]是否不填int countBySQL(@Param(value="table")
String table,
@Param(value="wheres")
Map wheres,
@Param(value="sqlWhereList")
List<Map> sqlWhereList)
table - 表名称wheres - 条件 都是key-value对应void createTable(@Param(value="table")
String table,
@Param(value="fileds")
Map<Object,List> fileds)
table - 表名称fileds - key:字段名称 list[0] 类型 list[1]长度 list[2]默认值 list[3]是否不填void deleteBySQL(@Param(value="table")
String table,
@Param(value="wheres")
Map wheres)
table - 表名称wheres - 條件 都是key-value对应void dropTable(@Param(value="table")
String table)
table - 表名称@InterceptorIgnore(tenantLine="1") List excuteSql(@Param(value="sql") String sql)
sql - sql语句void insertBySQL(@Param(value="table")
String table,
@Param(value="fields")
Map fields)
table - 表名称fields - 编号List queryBySQL(@Param(value="table") String table, @Param(value="fields") List<String> fields, @Param(value="wheres") Map wheres, @Param(value="sqlWhereList") List<Map> sqlWhereList, @Param(value="begin") Integer begin, @Param(value="end") Integer end, @Param(value="orderBy") String orderBy, @Param(value="order") String order)
table - 表名称fields - list集合wheres - 条件 都是key-value对应begin - 开始位置end - 结束位置order - 排序方式,asc;descvoid updateBySQL(@Param(value="table")
String table,
@Param(value="fields")
Map fields,
@Param(value="wheres")
Map wheres)
table - 表名称fields - list集合每个map都是key-value对应wheres - 条件 都是key-value对应void delete(@Param(value="ids")
int[] ids)
ids - id集合void delete(@Param(value="ids")
String[] ids)
ids - id集合void updateCache()
@Deprecated void deleteEntity(int id)
id - 要删除的主键id@Deprecated void deleteByEntity(BaseEntity entity)
entity - @Deprecated BaseEntity getEntity(Integer id)
id - 实体ID@Deprecated <E> E getByEntity(BaseEntity entity)
entity - 实体List<E> query(BaseEntity entity)
@Deprecated List<E> queryAll()
@Deprecated List<E> queryByPage(@Param(value="pageNo") int pageNo, @Param(value="pageSize") int pageSize, @Param(value="orderBy") String orderBy, @Param(value="order") boolean order)
pageNo - 页码pageSize - 显示条数orderBy - 排序字段order - order 排序方式,true:asc;fales:desc@Deprecated int queryCount()
@Deprecated void saveBatch(@Param(value="list") List list)
list - 新增数据
过期理由不适配oracle,请使用mybatis-plus的biz.saveBatch批量保存,注:mybatis-plus在dao层没有批量保存方法@Deprecated int saveEntity(BaseEntity entity)
entity - 实体@Deprecated void updateEntity(BaseEntity entity)
entity - 实体Copyright © 2023. All rights reserved.