Skip to content

Commit

Permalink
添加说明
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyning committed Apr 10, 2021
1 parent 2e4d9df commit 10ec241
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@ mpp的lambda方式<br>
</dependency>
````

**在实体类字段上设置@InsertFill,在插入时对seqno字段自动填充复杂计算值**
查询当前最大的seqno值并加3,转换成10位字符串,不够位数时用0填充
````
@TableField(value="seqno",fill=FieldFill.INSERT )
@InsertFill("select lpad(max(seqno)+3,10,'0') from test")
private String seqno;
````


**在实体类上设置@KeySequence,在插入时对id字段自动填充复杂计算值**
````
Expand All @@ -68,7 +62,7 @@ public class TestEntity {
@TableId(value = "id", type=IdType.INPUT)
private Integer id;
````

**1.5.1版本之后需使用@EnableAutoFill注解整体开启自动注入功能**
**在实体类字段上设置@InsertFill @UpdateFill,插入和更新时使用当前时间填充**
````
@InsertFill("select now()")
Expand All @@ -77,6 +71,14 @@ public class TestEntity {
private Date updateTime;
````

**在实体类字段上设置@InsertFill,在插入时对seqno字段自动填充复杂计算值**
查询当前最大的seqno值并加3,转换成10位字符串,不够位数时用0填充
````
@TableField(value="seqno",fill=FieldFill.INSERT )
@InsertFill("select lpad(max(seqno)+3,10,'0') from test")
private String seqno;
````

**在启动类中使用@EnableMPP启动扩展自定义填充功能和自动创建resultmap功能**
**在启动类中使用@EnableKeyGen启动主键自定义主键填充功能**
注意如果自己实现了IKeyGenerator会与@EnableKeyGen冲突
Expand Down

0 comments on commit 10ec241

Please sign in to comment.