generated from wenjy/SlnMesnac
数据访问类
parent
fb81e8812c
commit
888257e749
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using SqlSugar;
|
||||
|
||||
namespace SlnMesnac.Model.domain
|
||||
{
|
||||
[SugarTable("ScanLog"), Tenant("mes")]
|
||||
[DataContract(Name = "ScanLog ɨÃèÈÕÖ¾")]
|
||||
public class ScanLog
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
[SugarColumn(ColumnName = "create_time")]
|
||||
public DateTime CreateTime { get; set; }
|
||||
[SugarColumn(ColumnName = "data_type")]
|
||||
public int DataType { get; set; }
|
||||
[SugarColumn(ColumnName = "rfid")]
|
||||
public string Rfid { get; set; }
|
||||
[SugarColumn(ColumnName = "code")]
|
||||
public string Code { get; set; }
|
||||
[SugarColumn(ColumnName = "ocr")]
|
||||
public string Ocr { get; set; }
|
||||
[SugarColumn(ColumnName = "url")]
|
||||
public string Url { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using SlnMesnac.Model.domain;
|
||||
using SlnMesnac.Repository.service.@base;
|
||||
|
||||
namespace SlnMesnac.Repository.service.ScanLog
|
||||
{
|
||||
public class ScanLogServiceImpl:BaseServiceImpl<ScanLogModel>,IScanLogService
|
||||
{
|
||||
public ScanLogServiceImpl(Repository<ScanLogModel> rep) : base(rep)
|
||||
{
|
||||
}
|
||||
|
||||
public void CreatTable()
|
||||
{
|
||||
_rep.Context.CodeFirst.InitTables<ScanLogModel>();
|
||||
List<ScanLogModel> ls = new List<ScanLogModel>();
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
ls.Add(new ScanLogModel()
|
||||
{
|
||||
CreateTime = DateTime.Now,
|
||||
DataType = 1,
|
||||
Rfid = "12",
|
||||
Code = "21",
|
||||
Ocr = "2",
|
||||
Url="badi.com"
|
||||
});
|
||||
}
|
||||
|
||||
this.Insert(ls);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue