public interface IBaseService<T>
Modifier and Type | Method and Description |
---|---|
int |
delete(T record)
根据实体属性作为条件进行删除,查询条件使用等号
|
int |
deleteByExample(Object example)
根据Example条件删除数据
|
int |
deleteByPrimaryKey(Object key)
根据主键字段进行删除,方法参数必须包含完整的主键属性
|
int |
insert(T record)
保存一个实体,null的属性也会保存,不会使用数据库默认值
|
int |
insertSelective(T record)
保存一个实体,null的属性不会保存,会使用数据库默认值
|
List<T> |
select(T record)
根据实体中的属性值进行查询,查询条件使用等号
|
List<T> |
selectAll()
查询全部结果,select(null)方法能达到同样的效果
|
List<T> |
selectByExample(Object example)
根据Example条件进行查询,这个查询支持通过Example类指定查询列,通过selectProperties方法指定查询列
|
List<T> |
selectByExampleAndRowBounds(Object example,
org.apache.ibatis.session.RowBounds rowBounds)
根据example条件和RowBounds进行分页查询
|
T |
selectByPrimaryKey(Object key)
根据主键字段进行查询,方法参数必须包含完整的主键属性,查询条件使用等号
|
List<T> |
selectByRowBounds(T record,
org.apache.ibatis.session.RowBounds rowBounds)
根据实体属性和RowBounds进行分页查询
|
int |
selectCount(T record)
根据实体中的属性查询总数,查询条件使用等号
|
int |
selectCountByExample(Object example)
根据Example条件进行查询总数
|
T |
selectOne(T record)
根据实体中的属性进行查询,只能有一个返回值,有多个结果是抛出异常,查询条件使用等号
|
int |
updateByExample(T record,
Object example)
根据Example条件更新实体record包含的全部属性,null值会被更新
|
int |
updateByExampleSelective(T record,
Object example)
根据Example条件更新实体record包含的不是null的属性值
|
int |
updateByPrimaryKey(T record)
根据主键更新实体全部字段,null值会被更新
|
int |
updateByPrimaryKeySelective(T record)
根据主键更新属性不为null的值
|
T selectByPrimaryKey(Object key)
key
- T selectOne(T record)
record
- int selectCount(T record)
record
- int insert(T record)
record
- int insertSelective(T record)
record
- int updateByPrimaryKey(T record)
record
- int updateByPrimaryKeySelective(T record)
record
- int delete(T record)
record
- int deleteByPrimaryKey(Object key)
key
- List<T> selectByExample(Object example)
example
- int selectCountByExample(Object example)
example
- int updateByExample(@Param(value="record") T record, @Param(value="example") Object example)
record
- example
- int updateByExampleSelective(@Param(value="record") T record, @Param(value="example") Object example)
record
- example
- int deleteByExample(Object example)
example
- List<T> selectByRowBounds(T record, org.apache.ibatis.session.RowBounds rowBounds)
record
- rowBounds
- Copyright © 2020 Pivotal Software, Inc.. All rights reserved.