Interface SuperService<Id extends Serializable,Entity extends SuperEntity<?>>

Type Parameters:
Id - ID
Entity - 实体
All Known Subinterfaces:
SuperCacheService<Id,Entity>
All Known Implementing Classes:
SuperCacheServiceImpl, SuperServiceImpl

public interface SuperService<Id extends Serializable,Entity extends SuperEntity<?>>
业务层
Author:
zuihou
  • Method Details

    • getEntityClass

      Class<Entity> getEntityClass()
      获取实体的类型
      Returns:
      实体类class类型
    • getIdClass

      Class<Id> getIdClass()
      获取主键的类型
      Returns:
      主键class类型
    • getSuperManager

      SuperManager<Entity> getSuperManager()
      获取Manager的类型
      Returns:
      Manager的class类型
    • save

      <SaveVO> Entity save(SaveVO entity)
      插入一条记录(选择字段,策略插入)
      Parameters:
      entity - 实体对象
      Returns:
      是否插入成功
    • saveBatch

      boolean saveBatch(List<Entity> saveList)
      批量保存
      Parameters:
      saveList - 实体集合
      Returns:
      是否执行成功
    • copy

      Entity copy(Id id)
      复制一条数据

      注意:若该数据存在唯一索引等限制条件,需要重写该方法进行判断或处理。

      Parameters:
      id - ID
      Returns:
      复制后的实体
    • updateById

      <UpdateVO> Entity updateById(UpdateVO entity)
      根据 ID 修改实体中非空的字段
      Parameters:
      entity - 实体对象
      Returns:
      是否修改成功
    • updateAllById

      <UpdateVO> Entity updateAllById(UpdateVO entity)
      根据id修改 entity 的所有字段
      Parameters:
      entity - 实体对象
      Returns:
      是否修改成功
    • removeByIds

      boolean removeByIds(Collection<Id> idList)
      删除(根据ID 批量删除)
      Parameters:
      idList - 主键ID列表
      Returns:
      是否删除成功
    • getById

      Entity getById(Id id)
      根据 ID 查询
      Parameters:
      id - 主键ID
      Returns:
      实体对象或null
    • list

      List<Entity> list(com.baomidou.mybatisplus.core.conditions.Wrapper<Entity> queryWrapper)
      查询列表
      Parameters:
      queryWrapper - 实体对象封装操作类 QueryWrapper
      Returns:
      实体对象集合或空集合
    • listByIds

      List<Entity> listByIds(List<Id> ids)
      批量查询
      Parameters:
      ids - 主键
      Returns:
      实体对象集合或空集合
    • page

      <E extends com.baomidou.mybatisplus.core.metadata.IPage<Entity>> E page(E page, com.baomidou.mybatisplus.core.conditions.Wrapper<Entity> queryWrapper)
      翻页查询
      Parameters:
      page - 翻页对象
      queryWrapper - 实体对象封装操作类 QueryWrapper
      Returns:
      实体分页对象