mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update demo
This commit is contained in:
parent
61e90d456e
commit
6d51dac4df
@ -31,6 +31,7 @@ namespace OrmTest
|
|||||||
}
|
}
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
Unitsdfa1231.Init();
|
||||||
Unitadfad1.Init();
|
Unitadfad1.Init();
|
||||||
UnitWeek.Init();
|
UnitWeek.Init();
|
||||||
UnitTest.Init();
|
UnitTest.Init();
|
||||||
|
@ -0,0 +1,38 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OrmTest
|
||||||
|
{
|
||||||
|
internal class Unitsdfa1231
|
||||||
|
{
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
var db = NewUnitTest.Db;
|
||||||
|
db.CodeFirst.InitTables<CnDataDTO>();
|
||||||
|
var sql1 = db.Queryable<CnDataDTO>()
|
||||||
|
.Distinct()
|
||||||
|
.Select(it => new CnDataDTO()
|
||||||
|
{
|
||||||
|
time = SqlFunc.ToDate(it.time)
|
||||||
|
}, true)
|
||||||
|
.MergeTable()
|
||||||
|
.OrderBy(it => it.time)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
[SugarTable("Unit1sacndata")]
|
||||||
|
public class CnDataDTO
|
||||||
|
{
|
||||||
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "序号")]
|
||||||
|
public int id { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public string code { get; set; }
|
||||||
|
public string type { get; set; }
|
||||||
|
|
||||||
|
public DateTime time { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -33,6 +33,7 @@ namespace OrmTest
|
|||||||
}
|
}
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
Unitsdfa1231.Init();
|
||||||
Unitasxdfaaa.Init();
|
Unitasxdfaaa.Init();
|
||||||
UnitSplitadfaf1.Init();
|
UnitSplitadfaf1.Init();
|
||||||
Unitaadfas1.Init();
|
Unitaadfas1.Init();
|
||||||
|
@ -0,0 +1,38 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OrmTest
|
||||||
|
{
|
||||||
|
internal class Unitsdfa1231
|
||||||
|
{
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
var db = NewUnitTest.Db;
|
||||||
|
db.CodeFirst.InitTables<CnDataDTO>();
|
||||||
|
var sql1 = db.Queryable<CnDataDTO>()
|
||||||
|
.Distinct()
|
||||||
|
.Select(it => new CnDataDTO()
|
||||||
|
{
|
||||||
|
time = SqlFunc.ToDate(it.time)
|
||||||
|
}, true)
|
||||||
|
.MergeTable()
|
||||||
|
.OrderBy(it => it.time)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
[SugarTable("Unit1sacndata")]
|
||||||
|
public class CnDataDTO
|
||||||
|
{
|
||||||
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "序号")]
|
||||||
|
public int id { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public string code { get; set; }
|
||||||
|
public string type { get; set; }
|
||||||
|
|
||||||
|
public DateTime time { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user