public class MybatisPlusRelationExecutor extends Object
| 构造器和说明 |
|---|
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> |
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> |
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主键]
|
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的接口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 - 获取业务关系对象idCopyright © 2023. All rights reserved.