doc: update docs

This commit is contained in:
开源海哥 2023-08-03 18:33:23 +08:00
parent f4de1f1e5a
commit 4d273dc74e
2 changed files with 89 additions and 42 deletions

View File

@ -778,6 +778,41 @@ ON tb_account.id = a.id
WHERE tb_account.age >= ? WHERE tb_account.age >= ?
``` ```
## join 自己
```java
QueryWrapper queryWrapper = QueryWrapper.create();
queryWrapper.from(ACCOUNT)
.leftJoin(ACCOUNT).as("a1").on(ACCOUNT.ID.eq(ACCOUNT.PARENT_ID))
.leftJoin(ACCOUNT).as("a2").on(ACCOUNT.ID.eq(ACCOUNT.PARENT_ID))
.where(ACCOUNT.ID.ge(1));
```
其查询生成的 Sql 如下:
```sql
SELECT * FROM `tb_account`
LEFT JOIN `tb_account` AS `a1`
ON `a1`.`id` = `tb_account`.`parent_id`
LEFT JOIN `tb_account` AS `a2`
ON `a2`.`id` = `tb_account`.`parent_id`
WHERE `tb_account`.`id` >= ?
```
`tb_account` 表带有逻辑删除,那么其生成的 SQL 如下:
```sql
SELECT * FROM `tb_account`
LEFT JOIN `tb_account` AS `a1`
ON `a1`.`id` = `tb_account`.`parent_id` AND `a1`.`is_delete` = ?
LEFT JOIN `tb_account` AS `a2`
ON `a2`.`id` = `tb_account`.`parent_id` AND `a2`.`is_delete` = ?
WHERE `tb_account`.`id` >= ?
AND `tb_account`.`is_delete` = ?
```
> 关于逻辑删除更多文档请参考 [这里](../core/logic-delete.html)。
## union, union all ## union, union all
```java ```java

View File

@ -7,7 +7,19 @@
- 熟悉 Spring Boot 及相关框架 - 熟悉 Spring Boot 及相关框架
- 熟悉 Java 构建工具,比如 Maven - 熟悉 Java 构建工具,比如 Maven
## Hello World > 当前章节涉及到的源码已经全部上传到https://gitee.com/Suomm/mybatis-flex-test ,在开始之前,
> 您也可以先下载到本地,导入到 idea 开发工具后,在继续看文档。
## Hello World 视频教程
<iframe width="100%" height="400px" src="//player.bilibili.com/player.html?aid=955526987&bvid=BV1yW4y1Z74j&cid=1187300793&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>
MyBatis-Flex 视频系列详情https://www.bilibili.com/video/BV1yW4y1Z74j
## Hello World 文档
**第 1 步:创建数据库表** **第 1 步:创建数据库表**