diff --git a/Src/Asp.Net/QuestDbTest/Demo/UInsert3.cs b/Src/Asp.Net/QuestDbTest/Demo/UInsert3.cs index 411a53867..9a1769694 100644 --- a/Src/Asp.Net/QuestDbTest/Demo/UInsert3.cs +++ b/Src/Asp.Net/QuestDbTest/Demo/UInsert3.cs @@ -30,6 +30,47 @@ namespace OrmTest }).ExecuteCommand(); db.Insertable(new ORDER1() { Name = "a" }).ExecuteReturnSnowflakeId(); + + db.Updateable(new Order1() + { + CustomId = 1, + CreateTime = DateTime.Now, + Id = 1, + Price = 1, + Name = "a" + }).ExecuteCommand(); + + //db.Updateable(new List(){ new Order1() + //{ + // CustomId = 1, + // CreateTime = DateTime.Now, + // Id = 1, + // Price = 1, + // Name = "a" + //}, + //new Order1() + //{ + // CustomId = 1, + // CreateTime = DateTime.Now, + // Id = 1, + // Price = 1, + // Name = "a" + //} }).ExecuteCommand(); + + + db.Updateable().SetColumns(it => new Order1() + { + CustomId = 1, + Price = 1, + Name = "a" + }, true).Where(it => it.Id == 1).ExecuteCommand(); + + db.Updateable().SetColumns(it => new ORDER1() + { + CustomId = 1, + Price = 1, + Name = "a" + }, true).Where(it => it.Id == 1).ExecuteCommand(); } public class Order1 @@ -41,7 +82,7 @@ namespace OrmTest /// public string Name { get; set; } public decimal Price { get; set; } - [SugarColumn(InsertServerTime =true)] + [SugarColumn(InsertServerTime =true,UpdateServerTime =true)] public DateTime CreateTime { get; set; } [SugarColumn(IsNullable = true)] public int CustomId { get; set; } @@ -56,7 +97,7 @@ namespace OrmTest /// public string Name { get; set; } public decimal Price { get; set; } - [SugarColumn(InsertSql = "now()")] + [SugarColumn(InsertSql = "now()",UpdateSql =" NOW() ")] public DateTime CreateTime { get; set; } [SugarColumn(IsNullable = true)] public int CustomId { get; set; } diff --git a/Src/Asp.Net/SqlSugar/Realization/QuestDB/SqlBuilder/QuestDBUpdateBuilder.cs b/Src/Asp.Net/SqlSugar/Realization/QuestDB/SqlBuilder/QuestDBUpdateBuilder.cs index f6476e6ec..5e3766115 100644 --- a/Src/Asp.Net/SqlSugar/Realization/QuestDB/SqlBuilder/QuestDBUpdateBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Realization/QuestDB/SqlBuilder/QuestDBUpdateBuilder.cs @@ -33,7 +33,7 @@ namespace SqlSugar private string GetOracleUpdateColums(int i, DbColumnInfo m, bool iswhere) { - return string.Format(" \"{0}\"={1}", m.DbColumnName.ToUpper(), FormatValue(i, m.DbColumnName, m.Value, iswhere)); + return string.Format(" \"{0}\"={1}", m.DbColumnName.ToUpper(),base.GetDbColumn(m, FormatValue(i, m.DbColumnName, m.Value, iswhere))); } public object FormatValue(int i, string name, object value, bool iswhere)