mirror of
https://gitee.com/best_handsome/mybatis-plus-join
synced 2025-07-11 00:02:22 +08:00
first
This commit is contained in:
parent
fd51216322
commit
255ea13845
@ -42,7 +42,8 @@
|
|||||||
|
|
||||||
#### 左连接 leftJoin(UserEntity::getId,UserAddressEntity::getUserId,right -> right)
|
#### 左连接 leftJoin(UserEntity::getId,UserAddressEntity::getUserId,right -> right)
|
||||||
|
|
||||||
前连个参数是两个表的连接条件 -> user left join user_address on user.id = User_address.user_id
|
前连个参数是两个表的连接条件:
|
||||||
|
user left join user_address on user.id = User_address.user_id
|
||||||
第三个参数是右表wrapper对象,可以继续使用,以上方法.
|
第三个参数是右表wrapper对象,可以继续使用,以上方法.
|
||||||
|
|
||||||
#### 条件查询eq()
|
#### 条件查询eq()
|
||||||
|
@ -17,6 +17,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 连表
|
* 连表
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("all")
|
||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
class MpJoinTest {
|
class MpJoinTest {
|
||||||
|
|
||||||
@ -111,15 +112,6 @@ class MpJoinTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义别名支持
|
|
||||||
* 如果表重复(自连接,或join同一张表多次 需要用到别名)
|
|
||||||
* <p>
|
|
||||||
* 不只是两张表,这个框架没有限制join数量,理论上可以无限join但不建议 [狗头]
|
|
||||||
* <p>
|
|
||||||
* 自己去探索发现吧!
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
@Test
|
@Test
|
||||||
void test4() {
|
void test4() {
|
||||||
userMapper.selectJoinList(new MyLambdaQueryWrapper<UserEntity>()
|
userMapper.selectJoinList(new MyLambdaQueryWrapper<UserEntity>()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user