public abstract class BaseServiceImpl<T> extends Object implements IBaseService<T>
| Modifier and Type | Field and Description |
|---|---|
protected tk.mybatis.mapper.common.Mapper<T> |
mapper |
| Constructor and Description |
|---|
BaseServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
int |
delete(T record)
根据实体属性作为条件进行删除,查询条件使用等号
|
int |
deleteByExample(Object example)
根据Example条件删除数据
|
int |
deleteByPrimaryKey(Object key)
根据主键字段进行删除,方法参数必须包含完整的主键属性
|
tk.mybatis.mapper.common.Mapper<T> |
getMapper() |
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的值
|
@Autowired protected tk.mybatis.mapper.common.Mapper<T> mapper
public tk.mybatis.mapper.common.Mapper<T> getMapper()
public List<T> select(T record)
IBaseServiceselect in interface IBaseService<T>public T selectByPrimaryKey(Object key)
IBaseServiceselectByPrimaryKey in interface IBaseService<T>public List<T> selectAll()
IBaseServiceselectAll in interface IBaseService<T>public T selectOne(T record)
IBaseServiceselectOne in interface IBaseService<T>public int selectCount(T record)
IBaseServiceselectCount in interface IBaseService<T>public int insert(T record)
IBaseServiceinsert in interface IBaseService<T>public int insertSelective(T record)
IBaseServiceinsertSelective in interface IBaseService<T>public int updateByPrimaryKey(T record)
IBaseServiceupdateByPrimaryKey in interface IBaseService<T>public int updateByPrimaryKeySelective(T record)
IBaseServiceupdateByPrimaryKeySelective in interface IBaseService<T>public int delete(T record)
IBaseServicedelete in interface IBaseService<T>public int deleteByPrimaryKey(Object key)
IBaseServicedeleteByPrimaryKey in interface IBaseService<T>public List<T> selectByExample(Object example)
IBaseServiceselectByExample in interface IBaseService<T>public int selectCountByExample(Object example)
IBaseServiceselectCountByExample in interface IBaseService<T>public int updateByExample(T record, Object example)
IBaseServiceupdateByExample in interface IBaseService<T>public int updateByExampleSelective(T record, Object example)
IBaseServiceupdateByExampleSelective in interface IBaseService<T>public int deleteByExample(Object example)
IBaseServicedeleteByExample in interface IBaseService<T>public List<T> selectByRowBounds(T record, org.apache.ibatis.session.RowBounds rowBounds)
IBaseServiceselectByRowBounds in interface IBaseService<T>public List<T> selectByExampleAndRowBounds(Object example, org.apache.ibatis.session.RowBounds rowBounds)
IBaseServiceselectByExampleAndRowBounds in interface IBaseService<T>Copyright © 2020 Pivotal Software, Inc.. All rights reserved.