mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-25 01:14:33 +08:00
Update README.md
This commit is contained in:
parent
8e1a0d1940
commit
6d01efcdc9
11
README.md
11
README.md
@ -168,8 +168,8 @@ x.AsInsertable.ExecuteCommand();
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Feature8 :Auto split table
|
### Feature8 :Auto split table
|
||||||
|
Split entity
|
||||||
```cs
|
```cs
|
||||||
//entity
|
|
||||||
[SplitTable(SplitType.Year)]//Table by year (the table supports year, quarter, month, week and day)
|
[SplitTable(SplitType.Year)]//Table by year (the table supports year, quarter, month, week and day)
|
||||||
[SugarTable("SplitTestTable_{year}{month}{day}")]
|
[SugarTable("SplitTestTable_{year}{month}{day}")]
|
||||||
public class SplitTestTable
|
public class SplitTestTable
|
||||||
@ -178,14 +178,17 @@ x.AsInsertable.ExecuteCommand();
|
|||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
[SplitField]
|
|
||||||
//When the sub-table field is inserted, which table will be inserted according to this field.
|
//When the sub-table field is inserted, which table will be inserted according to this field.
|
||||||
//When it is updated and deleted, it can also be convenient to use this field to
|
//When it is updated and deleted, it can also be convenient to use this field to
|
||||||
//find out the related table
|
//find out the related table
|
||||||
|
[SplitField]
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime CreateTime { get; set; }
|
||||||
}
|
}
|
||||||
//split query
|
```
|
||||||
|
Split query
|
||||||
|
```cs
|
||||||
var lis2t = db.Queryable<OrderSpliteTest>()
|
var lis2t = db.Queryable<OrderSpliteTest>()
|
||||||
.SplitTable(DateTime.Now.Date.AddYears(-1), DateTime.Now)
|
.SplitTable(DateTime.Now.Date.AddYears(-1), DateTime.Now)
|
||||||
.ToPageList(1,2);
|
.ToPageList(1,2);
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user