update docs

This commit is contained in:
开源海哥 2023-04-08 18:03:24 +08:00
parent 8b58b45c13
commit a9b58f12a8

View File

@ -107,4 +107,21 @@ DELETE FROM tb_article where id = ? and tenant_id = ?
DELETE FROM tb_article where id = ? and tenant_id in (?, ?, ?)
```
同理,修改和查询,也都会带有 `tenant_id` 条件。
同理,修改和查询,也都会带有 `tenant_id` 条件。
### 忽略租户条件
在某些场景下,在增删改查等操作,我们可能需要忽略租户条件,此时可以使用如下代码:
```sql
try {
TenantManager.ignoreTenantCondition()
//此处操作的数据不会带有 tenant_id 的条件
accountMapper.selectListByQuery(...)
} finally {
TenantManager.restoreTenantCondition()
}
```
当然TenantFactory 返回空数据,也会忽略 tenant 条件。