类 MybatisPlusRelationExecutor
- java.lang.Object
-
- cn.woodwhales.common.mybatisplus.MybatisPlusRelationExecutor
-
public class MybatisPlusRelationExecutor extends Object
一对多查询工具- 作者:
- woodwhales on 2022-09-05 9:28
-
-
构造器概要
构造器 构造器 说明 MybatisPlusRelationExecutor()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static <LeftId extends Serializable,LeftService extends com.baomidou.mybatisplus.extension.service.impl.ServiceImpl<LeftMapper,LeftEntity>,LeftMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<LeftEntity>,LeftEntity,RelationService extends com.baomidou.mybatisplus.extension.service.impl.ServiceImpl<RelationMapper,RelationEntity>,RelationMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<RelationEntity>,RelationEntity>
List<RelationEntity>executeQuery(LeftId leftId, LeftService leftService, java.util.function.Function<LeftEntity,?> getLeftIdFunction, RelationService relationService, com.baomidou.mybatisplus.core.toolkit.support.SFunction<RelationEntity,LeftId> getLeftIdRelationFunction)一对多查询static <LeftId extends Serializable,RightId,LeftService extends com.baomidou.mybatisplus.extension.service.impl.ServiceImpl<LeftMapper,LeftEntity>,LeftMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<LeftEntity>,LeftEntity,RelationService extends com.baomidou.mybatisplus.extension.service.impl.ServiceImpl<RelationMapper,RelationEntity>,RelationMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<RelationEntity>,RelationEntity,RightService extends com.baomidou.mybatisplus.extension.service.impl.ServiceImpl<RightMapper,RightEntity>,RightMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<RightEntity>,RightEntity>
List<RightEntity>executeQuery(LeftId leftId, LeftService leftService, java.util.function.Function<LeftEntity,?> getLeftIdFunction, RelationService relationService, com.baomidou.mybatisplus.core.toolkit.support.SFunction<RelationEntity,LeftId> getLeftIdRelationFunction, java.util.function.Function<RelationEntity,RightId> getRightIdRelationFunction, RightService rightService, com.baomidou.mybatisplus.core.toolkit.support.SFunction<RightEntity,?> getRightIdFunction)多对多查询
-
-
-
方法详细资料
-
executeQuery
public static <LeftId extends Serializable,LeftService extends com.baomidou.mybatisplus.extension.service.impl.ServiceImpl<LeftMapper,LeftEntity>,LeftMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<LeftEntity>,LeftEntity,RelationService extends com.baomidou.mybatisplus.extension.service.impl.ServiceImpl<RelationMapper,RelationEntity>,RelationMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<RelationEntity>,RelationEntity> List<RelationEntity> executeQuery(LeftId leftId, LeftService leftService, java.util.function.Function<LeftEntity,?> getLeftIdFunction, RelationService relationService, com.baomidou.mybatisplus.core.toolkit.support.SFunction<RelationEntity,LeftId> getLeftIdRelationFunction)
一对多查询- 类型参数:
LeftId- 业务id类型LeftService- 业务关系的id类型LeftMapper- 业务mapper类型LeftEntity- 业务对象类型RelationService- 业务关系service类型RelationMapper- 业务关系mapper类型RelationEntity- 业务关系对象类型- 参数:
leftId- 业务idleftService- 业务servicegetLeftIdFunction- 获取业务对象主键relationService- 获取关系servicegetLeftIdRelationFunction- 获取业务id的接口- 返回:
- 业务id对应的业务关系对象集合
-
executeQuery
public static <LeftId extends Serializable,RightId,LeftService extends com.baomidou.mybatisplus.extension.service.impl.ServiceImpl<LeftMapper,LeftEntity>,LeftMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<LeftEntity>,LeftEntity,RelationService extends com.baomidou.mybatisplus.extension.service.impl.ServiceImpl<RelationMapper,RelationEntity>,RelationMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<RelationEntity>,RelationEntity,RightService extends com.baomidou.mybatisplus.extension.service.impl.ServiceImpl<RightMapper,RightEntity>,RightMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<RightEntity>,RightEntity> List<RightEntity> executeQuery(LeftId leftId, LeftService leftService, java.util.function.Function<LeftEntity,?> getLeftIdFunction, RelationService relationService, com.baomidou.mybatisplus.core.toolkit.support.SFunction<RelationEntity,LeftId> getLeftIdRelationFunction, java.util.function.Function<RelationEntity,RightId> getRightIdRelationFunction, RightService rightService, com.baomidou.mybatisplus.core.toolkit.support.SFunction<RightEntity,?> getRightIdFunction)
多对多查询通过用户查询对应的角色列表 user - roleList user1 - role1 - role2 - role3
user [user主键] user_role [user主键,role主键] role [role主键]- 类型参数:
LeftId- 业务id类型RightId- 业务关系的id类型LeftService- 业务service类型LeftMapper- 业务mapper类型LeftEntity- 业务对象类型RelationService- 业务关系service类型RelationMapper- 业务关系mapper类型RelationEntity- 业务关系对象类型RightService- 业务关系service类型RightMapper- 业务关系mapper类型RightEntity- 业务关系对象类型- 参数:
leftId- 业务idleftService- 业务servicegetLeftIdFunction- 获取业务对象主键relationService- 业务关系对象servicegetLeftIdRelationFunction- 获取业务id的接口getRightIdRelationFunction- 获取关系对象id的接口rightService- 获取关系servicegetRightIdFunction- 获取业务关系对象id- 返回:
- 业务id对应的业务关系对象集合
-
-