mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 16:48:24 +08:00
update docs
This commit is contained in:
parent
8b58b45c13
commit
a9b58f12a8
@ -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 条件。
|
||||
Loading…
x
Reference in New Issue
Block a user