Interface LogicalMapper<T,​I extends Serializable>

    • Method Detail

      • updateByPrimaryKeySelectiveWithForceFields

        @Lang(io.mybatis.provider.Caching.class)
        @UpdateProvider(type=LogicalProvider.class,
                        method="updateByPrimaryKeySelectiveWithForceFields")
        <S extends T> int updateByPrimaryKeySelectiveWithForceFields​(@Param("entity")
                                                                     S entity,
                                                                     @Param("fns")
                                                                     io.mybatis.mapper.fn.Fn.Fns<T> forceUpdateFields)
        Description copied from interface: BaseMapper
        根据主键更新实体中不为空的字段,强制字段不区分是否 null,都更新

        当前方法来自 FnMapper,该接口中的其他方法用 ExampleMapper 也能实现

        Specified by:
        updateByPrimaryKeySelectiveWithForceFields in interface BaseMapper<T,​I extends Serializable>
        Specified by:
        updateByPrimaryKeySelectiveWithForceFields in interface FnMapper<T>
        Parameters:
        entity - 实体类
        forceUpdateFields - 强制更新的字段,不区分字段是否为 null,通过 Fn.of(Fn...) 创建 Fn.Fns
        Returns:
        1成功,0失败
      • selectColumnsOne

        @Lang(io.mybatis.provider.Caching.class)
        @SelectProvider(type=LogicalProvider.class,
                        method="selectColumns")
        Optional<T> selectColumnsOne​(@Param("entity")
                                     T entity,
                                     @Param("fns")
                                     io.mybatis.mapper.fn.Fn.Fns<T> selectFields)
        Description copied from interface: FnMapper
        根据实体字段条件查询唯一的实体(ExampleMapper 可以实现一样的功能,当前方法只是示例)
        Specified by:
        selectColumnsOne in interface FnMapper<T>
        Parameters:
        entity - 实体类
        selectFields - 查询的字段,不区分字段是否为 null,通过 Fn.of(Fn...) 创建 Fn.Fns
        Returns:
        单个实体,查询结果由多条时报错
      • selectColumns

        @Lang(io.mybatis.provider.Caching.class)
        @SelectProvider(type=LogicalProvider.class,
                        method="selectColumns")
        List<T> selectColumns​(@Param("entity")
                              T entity,
                              @Param("fns")
                              io.mybatis.mapper.fn.Fn.Fns<T> selectFields)
        Description copied from interface: FnMapper
        根据实体字段条件批量查询(ExampleMapper 可以实现一样的功能,当前方法只是示例)
        Specified by:
        selectColumns in interface FnMapper<T>
        Parameters:
        entity - 实体类
        selectFields - 查询的字段,不区分字段是否为 null,通过 Fn.of(Fn...) 创建 Fn.Fns
        Returns:
        实体列表
      • delete

        @Lang(io.mybatis.provider.Caching.class)
        @DeleteProvider(type=LogicalProvider.class,
                        method="delete")
        int delete​(T entity)
        Description copied from interface: EntityMapper
        保存实体信息批量删除
        Specified by:
        delete in interface EntityMapper<T,​I extends Serializable>
        Parameters:
        entity - 实体类
        Returns:
        大于等于1成功,0失败
      • updateByPrimaryKey

        @Lang(io.mybatis.provider.Caching.class)
        @UpdateProvider(type=LogicalProvider.class,
                        method="updateByPrimaryKey")
        <S extends T> int updateByPrimaryKey​(S entity)
        Description copied from interface: EntityMapper
        根据主键更新实体
        Specified by:
        updateByPrimaryKey in interface EntityMapper<T,​I extends Serializable>
        Parameters:
        entity - 实体类
        Returns:
        1成功,0失败
      • updateByPrimaryKeySelective

        @Lang(io.mybatis.provider.Caching.class)
        @UpdateProvider(type=LogicalProvider.class,
                        method="updateByPrimaryKeySelective")
        <S extends T> int updateByPrimaryKeySelective​(S entity)
        Description copied from interface: EntityMapper
        根据主键更新实体中不为空的字段
        Specified by:
        updateByPrimaryKeySelective in interface EntityMapper<T,​I extends Serializable>
        Parameters:
        entity - 实体类
        Returns:
        1成功,0失败
      • selectOne

        @Lang(io.mybatis.provider.Caching.class)
        @SelectProvider(type=LogicalProvider.class,
                        method="select")
        Optional<T> selectOne​(T entity)
        Description copied from interface: EntityMapper
        根据实体字段条件查询唯一的实体
        Specified by:
        selectOne in interface EntityMapper<T,​I extends Serializable>
        Parameters:
        entity - 实体类
        Returns:
        单个实体,查询结果由多条时报错
      • selectCount

        @Lang(io.mybatis.provider.Caching.class)
        @SelectProvider(type=LogicalProvider.class,
                        method="selectCount")
        long selectCount​(T entity)
        Description copied from interface: EntityMapper
        根据实体字段条件查询总数
        Specified by:
        selectCount in interface EntityMapper<T,​I extends Serializable>
        Parameters:
        entity - 实体类
        Returns:
        总数
      • selectCursor

        @Lang(io.mybatis.provider.Caching.class)
        @SelectProvider(type=LogicalProvider.class,
                        method="select")
        org.apache.ibatis.cursor.Cursor<T> selectCursor​(T entity)
        Description copied from interface: CursorMapper
        根据实体字段条件查询
        Specified by:
        selectCursor in interface CursorMapper<T,​I extends Serializable>
        Parameters:
        entity - 实体类
        Returns:
        实体列表
      • updateByExample

        @Lang(io.mybatis.provider.Caching.class)
        @UpdateProvider(type=LogicalProvider.class,
                        method="updateByExample")
        <S extends T> int updateByExample​(@Param("entity")
                                          S entity,
                                          @Param("example")
                                          Example<T> example)
        Description copied from interface: ExampleMapper
        根据 Example 条件批量更新实体信息
        Specified by:
        updateByExample in interface ExampleMapper<T,​I extends Serializable>
        Parameters:
        entity - 实体类
        example - 条件
        Returns:
        大于等于1成功,0失败
      • updateByExampleSetValues

        @Lang(io.mybatis.provider.Caching.class)
        @UpdateProvider(type=LogicalProvider.class,
                        method="updateByExampleSetValues")
        int updateByExampleSetValues​(@Param("example")
                                     Example<T> example)
        Description copied from interface: ExampleMapper
        根据 Example 条件和 setValue 值更新字段
        Specified by:
        updateByExampleSetValues in interface ExampleMapper<T,​I extends Serializable>
        Parameters:
        example - 条件
        Returns:
        大于等于1成功,0失败
      • updateByExampleSelective

        @Lang(io.mybatis.provider.Caching.class)
        @UpdateProvider(type=LogicalProvider.class,
                        method="updateByExampleSelective")
        <S extends T> int updateByExampleSelective​(@Param("entity")
                                                   S entity,
                                                   @Param("example")
                                                   Example<T> example)
        Description copied from interface: ExampleMapper
        根据 Example 条件批量更新实体不为空的字段
        Specified by:
        updateByExampleSelective in interface ExampleMapper<T,​I extends Serializable>
        Parameters:
        entity - 实体类
        example - 条件
        Returns:
        大于等于1成功,0失败
      • selectByExample

        List<T> selectByExample​(Example<T> example,
                                org.apache.ibatis.session.RowBounds rowBounds)
        Description copied from interface: ExampleMapper
        根据 Example 条件批量查询
        Specified by:
        selectByExample in interface ExampleMapper<T,​I extends Serializable>
        Parameters:
        example - 条件
        rowBounds - 分页信息
        Returns:
        实体列表