Mapper的基类

成员函数:

selectById

根据主键查询实体对象

参数:

名称 类型 说明
id Serializable 主键

返回值:

T 实体对象

getById

根据主键查询实体对象 仅仅查询当前实体

参数:

名称 类型 说明
id Serializable 主键

返回值:

T 实体对象

insert

插入实体对象

参数:

名称 类型 说明
entity T 实体对象

返回值:

Boolean 成功返回true

update

更新实体对象

参数:

名称 类型 说明
entity T 实体对象

返回值:

Boolean 成功返回true

updateField

更新实体对象,只更新部分updateFields指定的字段

参数:

名称 类型 说明
entity T 实体对象
updateFields ZmStringList 要更新的字段列表
retMsg ZmReturnMsg 消息对象

返回值:

Boolean 成功返回true

insertOrUpdate

添加或者更新实体对象 根据id判断存在则更新,不存在插入

参数:

名称 类型 说明
entity T 实体对象

返回值:

Boolean 成功返回true

deleteById

根据主键删除实体对象

参数:

名称 类型 说明
id Serializable 主键

返回值:

Boolean 成功返回true

pageList

查询页面数据列表

参数:

名称 类型 说明
conditions ZmQueryConditionList 查询条件
sorter ZmSorter 排序数据
pager ZmPager 分页数据

返回值:

ZmPageData 页面数据ZmPageData对象

selectListKeyEqValue

根据字段名称和字段值查询数据列表

参数:

名称 类型 说明
keyName String 字段名称
val Serializable 字段值

返回值:

ZmModelList 数据List对象

selectListAll

查询所有数据列表

返回值:

ZmModelList 数据List对象

mergeListSave

合并列表数据集合,决定哪些是需要插入的,哪些需要修改的和哪些需要删除的,并执行相关操作

参数:

名称 类型 说明
curlist ZmModelList 当前变更后的数据列表
orglist ZmModelList 数据库中原始变更前的数据列表
retMsg ZmReturnMsg 消息对象

mergeList

合并列表数据集合,决定哪些是需要插入的,哪些需要修改的和哪些需要删除的

参数:

名称 类型 说明
curlist ZmModelList 当前变更后的数据列表
orglist ZmModelList 数据库中原始变更前的数据列表
insertList ZmModelList 要插入的数据列表
updateList ZmModelList 要修改的的数据列表
deleteList ZmModelList 要删除的数据列表

createBatch

批量创建实体对象

参数:

名称 类型 说明
entity ZmModelList 实体对象列表
retMsg ZmReturnMsg 消息对象

返回值:

Boolean 成功返回true

modifyBatch

批量更新实体对象

参数:

名称 类型 说明
entity ZmModelList 实体对象列表
retMsg ZmReturnMsg 消息对象

返回值:

Boolean 成功返回true

deleteBatch

批量删除实体对象

参数:

名称 类型 说明
entity ZmModelList 实体对象列表
retMsg ZmReturnMsg 消息对象

返回值:

Boolean 成功返回true

deleteListKeyEqValue

根据字段名称和字段值删除数据列表

参数:

名称 类型 说明
keyName String 字段名称
val Serializable 字段值

deleteByConditions

删除指定条件的数据

参数:

名称 类型 说明
keyName ZmQueryConditionList 条件组合

返回值:

int 影响行数

selectListByConditions

删除指定条件的数据

参数:

名称 类型 说明
keyName ZmQueryConditionList 条件组合

返回值:

int 影响行数

selectTopListByConditions

删除指定条件的数据

参数:

名称 类型 说明
keyName ZmQueryConditionList 条件组合

返回值:

int 影响行数

selectPageNoSizeListByConditions

删除指定条件的数据

参数:

名称 类型 说明
keyName ZmQueryConditionList 条件组合

返回值:

int 影响行数

updateByConditions

删除指定条件的数据

参数:

名称 类型 说明
keyName ZmQueryConditionList 条件组合

返回值:

int 影响行数

其它说明: