mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update unit test
This commit is contained in:
parent
b31d49180d
commit
5224b2e818
@ -6,7 +6,7 @@ using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SqlSugar;
|
||||
using SqlSugar;
|
||||
using TDengineDriver;
|
||||
|
||||
namespace OrmTest
|
||||
@ -377,9 +377,36 @@ CACHEMODEL 'both'");//不支持 UPDATE 1 选项
|
||||
voltage = 11
|
||||
}).ExecuteCommand();
|
||||
var list=db.Queryable<MyTable02_NS>().ToList();
|
||||
|
||||
db.Ado.ExecuteCommand(@" CREATE TABLE aoi_recordsuper (fcreatetime timestamp, fsncode VARCHAR(50), fmachineno VARCHAR(50),lotno VARCHAR(50),billno VARCHAR(50),fresult VARCHAR(50)
|
||||
,fproduct VARCHAR(50),machinetime VARCHAR(50),id VARCHAR(50),uploadtype VARCHAR(50),dimbin VARCHAR(50))
|
||||
TAGS (workstation VARCHAR(50));");
|
||||
|
||||
var dt2=Convert.ToDateTime("2023-09-23 08:00:00.12345");
|
||||
db.Ado.ExecuteCommand(@"
|
||||
|
||||
|
||||
INSERT INTO aoirecord_2309 USING aoi_recordsuper TAGS (""AOI"")
|
||||
VALUES ('2023-09-23', ""10.2"", ""A219"",""2309050001"",""B03123"",""OK"",""681-ABC"",""2023-9-5"",""123"",""首测"",""A"")
|
||||
(now, ""10.2"", ""A219"",""2309050001"",""B03123"",""OK"",""681-ABC"",""2023-9-5"",""123"",""首测"",""A"")");
|
||||
|
||||
var date = Convert.ToDateTime("2023-9-25 00:00:00");
|
||||
var list3=db.Queryable<T_TD_AOIRecord>().ToList();
|
||||
var list2 = db.Queryable<T_TD_AOIRecord>()
|
||||
.Where(t => t.fcreatetime >= date).ToList();
|
||||
|
||||
if (list2.Count != 1)
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
|
||||
}
|
||||
private static void US()
|
||||
{
|
||||
//clear static config
|
||||
SqlSugar.TDengine.TDengineProvider._IsIsNanosecond = false;
|
||||
SqlSugar.TDengine.TDengineProvider._IsMicrosecond = false;
|
||||
|
||||
//说明:
|
||||
//字符串中指定TsType=config_ns
|
||||
//实体加上 SqlParameterDbType =typeof(DateTime19)
|
||||
@ -418,6 +445,28 @@ CACHEMODEL 'both'");//不支持 UPDATE 1 选项
|
||||
voltage = 11
|
||||
}).ExecuteCommand();
|
||||
var list = db.Queryable<MyTable02_US>().ToList();
|
||||
|
||||
db.Ado.ExecuteCommand(@" CREATE TABLE aoi_recordsuper (fcreatetime timestamp, fsncode VARCHAR(50), fmachineno VARCHAR(50),lotno VARCHAR(50),billno VARCHAR(50),fresult VARCHAR(50)
|
||||
,fproduct VARCHAR(50),machinetime VARCHAR(50),id VARCHAR(50),uploadtype VARCHAR(50),dimbin VARCHAR(50))
|
||||
TAGS (workstation VARCHAR(50));");
|
||||
|
||||
var dt2 = Convert.ToDateTime("2023-09-23 08:00:00.12345");
|
||||
db.Ado.ExecuteCommand(@"
|
||||
|
||||
|
||||
INSERT INTO aoirecord_2309 USING aoi_recordsuper TAGS (""AOI"")
|
||||
VALUES ('2023-09-23', ""10.2"", ""A219"",""2309050001"",""B03123"",""OK"",""681-ABC"",""2023-9-5"",""123"",""首测"",""A"")
|
||||
(now, ""10.2"", ""A219"",""2309050001"",""B03123"",""OK"",""681-ABC"",""2023-9-5"",""123"",""首测"",""A"")");
|
||||
|
||||
var date = Convert.ToDateTime("2023-9-25 00:00:00");
|
||||
var list3 = db.Queryable<T_TD_AOIRecord>().ToList();
|
||||
var list2 = db.Queryable<T_TD_AOIRecord>()
|
||||
.Where(t => t.fcreatetime >= date).ToList();
|
||||
|
||||
if (list2.Count != 1)
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
}
|
||||
|
||||
private static List<MyTable02> GetInsertDatas()
|
||||
|
73
Src/Asp.NetCore2/TDengineTest/Models/Unit/T_TD_AOIRecord.cs
Normal file
73
Src/Asp.NetCore2/TDengineTest/Models/Unit/T_TD_AOIRecord.cs
Normal file
@ -0,0 +1,73 @@
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OrmTest
|
||||
{
|
||||
|
||||
[SugarTable("aoi_recordsuper")]
|
||||
public class T_TD_AOIRecord
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true, SqlParameterDbType = typeof(DateTime19))]
|
||||
public DateTime fcreatetime { get; set; }
|
||||
/// <summary>
|
||||
/// 产品唯一码
|
||||
/// </summary>
|
||||
[SugarColumn(SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||
public string fsncode { get; set; }
|
||||
/// <summary>
|
||||
/// 机台号
|
||||
/// </summary>
|
||||
[SugarColumn(SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||
public string fmachineno { get; set; }
|
||||
/// <summary>
|
||||
/// 批次号
|
||||
/// </summary>
|
||||
[SugarColumn(SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||
public string lotno { get; set; }
|
||||
/// <summary>
|
||||
/// 单据号
|
||||
/// </summary>
|
||||
[SugarColumn(SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||
public string billno { get; set; }
|
||||
/// <summary>
|
||||
/// 结果
|
||||
/// </summary>
|
||||
[SugarColumn(SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||
public string fresult { get; set; }
|
||||
/// <summary>
|
||||
/// bin编号
|
||||
/// </summary>
|
||||
[SugarColumn(SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||
public string dimbin { get; set; }
|
||||
/// <summary>
|
||||
/// 工站
|
||||
/// </summary>
|
||||
[SugarColumn(SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||
public string workstation { get; set; }
|
||||
/// <summary>
|
||||
/// 料号
|
||||
/// </summary>
|
||||
[SugarColumn(SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||
public string fproduct { get; set; }
|
||||
/// <summary>
|
||||
/// 机台时间
|
||||
/// </summary>
|
||||
[SugarColumn(SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||
public string machinetime { get; set; }
|
||||
/// <summary>
|
||||
/// 唯一ID
|
||||
/// </summary>
|
||||
[SugarColumn(SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||
public string id { get; set; }
|
||||
/// <summary>
|
||||
/// 测试状态
|
||||
/// </summary>
|
||||
[SugarColumn(SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||
public string uploadtype { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user