mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 16:48:24 +08:00
style: add .editorconfig
This commit is contained in:
parent
e0dea23822
commit
28ebaacb7e
19
.editorconfig
Normal file
19
.editorconfig
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
# 告诉EditorConfig插件,这是根文件,不用继续往上查找
|
||||
root = true
|
||||
|
||||
# 匹配全部文件
|
||||
[*]
|
||||
# 结尾换行符,可选"lf"、"cr"、"crlf"
|
||||
end_of_line = lf
|
||||
# 在文件结尾插入新行
|
||||
insert_final_newline = true
|
||||
# 删除一行中的前后空格
|
||||
trim_trailing_whitespace = true
|
||||
# 设置字符集
|
||||
charset = utf-8
|
||||
# 缩进风格,可选"space"、"tab"
|
||||
indent_style = tab
|
||||
# 缩进的空格数
|
||||
indent_size = 4
|
||||
|
||||
@ -61,7 +61,7 @@ delete from tb_account where id >= 100;
|
||||
Account account = UpdateEntity.of(Account.class, 100);
|
||||
//Account account = UpdateEntity.of(Account.class);
|
||||
//account.setId(100);
|
||||
|
||||
|
||||
account.setUserName(null);
|
||||
account.setAge(10);
|
||||
|
||||
@ -79,7 +79,7 @@ accountMapper.update(account);
|
||||
|
||||
```sql
|
||||
update tb_account
|
||||
set user_name = ?, age = ? where id = ?
|
||||
set user_name = ?, age = ? where id = ?
|
||||
#参数: null,10,100
|
||||
```
|
||||
|
||||
@ -101,7 +101,7 @@ account.setId(100);
|
||||
|
||||
```sql
|
||||
update tb_account
|
||||
set user_name = ?, age = age + 1 where id = ?
|
||||
set user_name = ?, age = age + 1 where id = ?
|
||||
```
|
||||
此时,我们可以直接把 `Account` 强转为 `UpdateWrapper` 然后进行更新,例如:
|
||||
|
||||
@ -167,6 +167,6 @@ accountMapper.update(account);
|
||||
|
||||
```sql
|
||||
update tb_account
|
||||
set user_name = "michael", age = (select ... from ... )
|
||||
set user_name = "michael", age = (select ... from ... )
|
||||
where id = 100
|
||||
```
|
||||
```
|
||||
|
||||
@ -87,7 +87,7 @@ public class ArticleDTO {
|
||||
private Long accountId;
|
||||
private String title;
|
||||
private String content;
|
||||
|
||||
|
||||
//以下用户相关字段
|
||||
private String userName;
|
||||
private int age;
|
||||
@ -141,7 +141,7 @@ QueryWrapper query = QueryWrapper.create()
|
||||
.where(ACCOUNT.ID.ge(0));
|
||||
|
||||
List<ArticleDTO> results = mapper.selectListByQueryAs(query, ArticleDTO.class);
|
||||
System.out.println(results);
|
||||
System.out.println(results);
|
||||
```
|
||||
|
||||
### 方式 3 <Badge type="tip" text="^ v1.3.3" />
|
||||
@ -155,7 +155,7 @@ public class ArticleDTO {
|
||||
private Long accountId;
|
||||
private String title;
|
||||
private String content;
|
||||
|
||||
|
||||
//直接定义 Account 对象
|
||||
private Account account;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user