mirror of
https://gitee.com/best_handsome/mybatis-plus-join
synced 2025-07-25 00:00:12 +08:00
update
This commit is contained in:
parent
50d1c119f9
commit
c6bc2791c9
12
README.md
12
README.md
@ -61,10 +61,10 @@ class test {
|
|||||||
void testJoin() {
|
void testJoin() {
|
||||||
List<UserDTO> list = userMapper.selectJoinList(new MyLambdaQueryWrapper<UserEntity>()
|
List<UserDTO> list = userMapper.selectJoinList(new MyLambdaQueryWrapper<UserEntity>()
|
||||||
.selectAll(UserEntity.class)
|
.selectAll(UserEntity.class)
|
||||||
.leftJoin(UserEntity::getId, UserAddressEntity::getUserId, r1 -> r1
|
.leftJoin(UserEntity::getId, UserAddressEntity::getUserId,
|
||||||
.select(UserAddressEntity::getAddress)
|
r1 -> r1.select(UserAddressEntity::getAddress)
|
||||||
.leftJoin(UserAddressEntity::getAreaId, AreaEntity::getId,
|
.leftJoin(UserAddressEntity::getAreaId, AreaEntity::getId,
|
||||||
r2 -> r2.select(AreaEntity::getProvince)))
|
r2 -> r2.select(AreaEntity::getProvince)))
|
||||||
, UserDTO.class);
|
, UserDTO.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,8 +93,8 @@ class test {
|
|||||||
.selectAll(主表实体类.class)
|
.selectAll(主表实体类.class)
|
||||||
.leftJoin(主表实体类on属性, 子表实体类on属性, 子表对象 -> 子表对象
|
.leftJoin(主表实体类on属性, 子表实体类on属性, 子表对象 -> 子表对象
|
||||||
.select(子表查询字段)
|
.select(子表查询字段)
|
||||||
.leftJoin(UserAddressEntity::getAreaId, AreaEntity::getId,
|
.leftJoin(第二个表的on属性, 第三个表的on属性,
|
||||||
r2 -> r2.select(AreaEntity::getProvince)))
|
r2 -> r2.select(第三个表的查询字段)))
|
||||||
, UserDTO.class);//返回对象class
|
, UserDTO.class);//返回对象class
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user