Interface BaseMapper<T,P>

Type Parameters:
T - 实体类型
P - 主键类型

public interface BaseMapper<T,P>
基本 SQL 映射
Version:
2021-07-16 09:40
Author:
夜雨
  • Field Details

  • Method Details

    • selectByPage

      @SelectProvider(type=SQLProvider.class, method="selectByPage") List<T> selectByPage(Page<T> page)
      根据 Page 对象查询数据列表
      Parameters:
      page - 分页参数
      Returns:
      数据列表
    • countByPage

      @SelectProvider(type=SQLProvider.class, method="countByPage") long countByPage(Page<T> page)
      根据 Page 对象统计数据量
      Parameters:
      page - 分页参数
      Returns:
      数据量
    • selectPageResult

      default PageResult<T> selectPageResult(Page<T> page)
      分页查询
      Parameters:
      page - 分页参数
      Returns:
      分页结果
    • selectAll

      @SelectProvider(type=SQLProvider.class, method="selectAll") List<T> selectAll()
      查询全部数据
      Returns:
      数据列表
    • insert

      @InsertProvider(type=SQLProvider.class, method="insert") @Options(useGeneratedKeys=true, keyProperty="id") void insert(T t)
      创建数据
      Parameters:
      t - 数据对象
    • select

      @SelectProvider(type=SQLProvider.class, method="select") T select(P id)
      根据 ID 获取对象
      Parameters:
      id - 索引
      Returns:
      数据对象
    • selectByExample

      default T selectByExample(T t)
      根据示例查询单条数据
      Parameters:
      t - 示例对象
      Returns:
      数据对象
    • selectByExample

      @SelectProvider(type=SQLProvider.class, method="selectByExample") T selectByExample(@Param("entity") T t, @Param("logic") Logic logic)
      根据示例查询单条数据
      Parameters:
      t - 示例对象
      logic - 条件连接逻辑
      Returns:
      数据对象
    • selectAllByExample

      default List<T> selectAllByExample(T t)
      根据示例查询全部数据
      Parameters:
      t - 示例对象
      Returns:
      数据列表
    • selectAllByExample

      @SelectProvider(type=SQLProvider.class, method="selectAllByExample") List<T> selectAllByExample(@Param("entity") T t, @Param("logic") Logic logic)
      根据示例查询全部数据
      Parameters:
      t - 示例对象
      logic - 条件连接逻辑
      Returns:
      数据列表
    • update

      @UpdateProvider(type=SQLProvider.class, method="update") void update(T t)
      修改数据
      Parameters:
      t - 数据对象
    • updateSelective

      @UpdateProvider(type=SQLProvider.class, method="updateSelective") void updateSelective(T t)
      选择性更新
      Parameters:
      t - 数据对象
    • delete

      @UpdateProvider(type=SQLProvider.class, method="delete") void delete(P id)
      软删除
      Parameters:
      id - 索引
    • deleteAllByExample

      default void deleteAllByExample(T t)
      根据示例批量逻辑删除
      Parameters:
      t - 示例对象
    • deleteAllByExample

      @UpdateProvider(type=SQLProvider.class, method="deleteAllByExample") void deleteAllByExample(@Param("entity") T t, @Param("logic") Logic logic)
      根据示例批量逻辑删除
      Parameters:
      t - 示例对象
      logic - 条件连接逻辑
    • destroy

      @DeleteProvider(type=SQLProvider.class, method="destroy") void destroy(P id)
      销毁(物理删除)
      Parameters:
      id - 索引
    • destroyAllByExample

      default void destroyAllByExample(T t)
      根据示例批量销毁(物理删除)
      Parameters:
      t - 示例对象
    • destroyAllByExample

      @DeleteProvider(type=SQLProvider.class, method="destroyAllByExample") void destroyAllByExample(@Param("entity") T t, @Param("logic") Logic logic)
      根据示例批量销毁(物理删除)
      Parameters:
      t - 示例对象
      logic - 条件连接逻辑