Browse Source

Add SugarColumn InsertServerTime

Add SugarColumn InsertSql
pull/30/head
sunkaixuan 2 years ago
parent
commit
0a6139c134
  1. 2
      Src/Asp.Net/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs
  2. 4
      Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableHelper.cs
  3. 2
      Src/Asp.Net/SqlSugar/Entities/DbColumnInfo.cs
  4. 2
      Src/Asp.Net/SqlSugar/Entities/EntityColumnInfo.cs
  5. 2
      Src/Asp.Net/SqlSugar/Entities/Mapping/SugarMappingAttribute.cs

2
Src/Asp.Net/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs

@ -291,6 +291,8 @@ namespace SqlSugar
column.SqlParameterDbType = sugarColumn.SqlParameterDbType; column.SqlParameterDbType = sugarColumn.SqlParameterDbType;
column.SqlParameterSize = sugarColumn.SqlParameterSize; column.SqlParameterSize = sugarColumn.SqlParameterSize;
column.CreateTableFieldSort = sugarColumn.CreateTableFieldSort; column.CreateTableFieldSort = sugarColumn.CreateTableFieldSort;
column.InsertServerTime = sugarColumn.InsertServerTime;
column.InsertSql = sugarColumn.InsertSql;
if (sugarColumn.IsJson && String.IsNullOrEmpty(sugarColumn.ColumnDataType)) if (sugarColumn.IsJson && String.IsNullOrEmpty(sugarColumn.ColumnDataType))
{ {
if (this.Context.CurrentConnectionConfig.DbType == DbType.PostgreSQL) if (this.Context.CurrentConnectionConfig.DbType == DbType.PostgreSQL)

4
Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableHelper.cs

@ -210,7 +210,9 @@ namespace SqlSugar
DbColumnName = column.DbColumnName, DbColumnName = column.DbColumnName,
PropertyName = column.PropertyName, PropertyName = column.PropertyName,
PropertyType = UtilMethods.GetUnderType(column.PropertyInfo), PropertyType = UtilMethods.GetUnderType(column.PropertyInfo),
TableId = i TableId = i,
InsertSql = column.InsertSql,
InsertServerTime = column.InsertServerTime
}; };
if (column.DbColumnName == null) if (column.DbColumnName == null)
{ {

2
Src/Asp.Net/SqlSugar/Entities/DbColumnInfo.cs

@ -26,6 +26,8 @@ namespace SqlSugar
public bool IsJson { get; set; } public bool IsJson { get; set; }
public bool? IsUnsigned { get; set; } public bool? IsUnsigned { get; set; }
public int CreateTableFieldSort { get; set; } public int CreateTableFieldSort { get; set; }
public string InsertServerTime { get; set; }
public string InsertSql { get; set; }
internal object SqlParameterDbType { get; set; } internal object SqlParameterDbType { get; set; }
} }
} }

2
Src/Asp.Net/SqlSugar/Entities/EntityColumnInfo.cs

@ -41,5 +41,7 @@ namespace SqlSugar
public Navigate Navigat { get; set; } public Navigate Navigat { get; set; }
public int CreateTableFieldSort { get; set; } public int CreateTableFieldSort { get; set; }
public object SqlParameterSize { get; set; } public object SqlParameterSize { get; set; }
public string InsertSql { get; set; }
public string InsertServerTime { get; set; }
} }
} }

2
Src/Asp.Net/SqlSugar/Entities/Mapping/SugarMappingAttribute.cs

@ -207,6 +207,8 @@ namespace SqlSugar
public object SqlParameterDbType { get; set; } public object SqlParameterDbType { get; set; }
public object SqlParameterSize { get; set; } public object SqlParameterSize { get; set; }
public int CreateTableFieldSort { get; set; } public int CreateTableFieldSort { get; set; }
public string InsertServerTime { get; set; }
public string InsertSql { get; set; }
} }

Loading…
Cancel
Save