mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update quest db
This commit is contained in:
parent
25d105122e
commit
2a99020ae3
@ -30,6 +30,47 @@ namespace OrmTest
|
|||||||
}).ExecuteCommand();
|
}).ExecuteCommand();
|
||||||
|
|
||||||
db.Insertable(new ORDER1() { Name = "a" }).ExecuteReturnSnowflakeId();
|
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<Order1>(){ 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<Order1>().SetColumns(it => new Order1()
|
||||||
|
{
|
||||||
|
CustomId = 1,
|
||||||
|
Price = 1,
|
||||||
|
Name = "a"
|
||||||
|
}, true).Where(it => it.Id == 1).ExecuteCommand();
|
||||||
|
|
||||||
|
db.Updateable<ORDER1>().SetColumns(it => new ORDER1()
|
||||||
|
{
|
||||||
|
CustomId = 1,
|
||||||
|
Price = 1,
|
||||||
|
Name = "a"
|
||||||
|
}, true).Where(it => it.Id == 1).ExecuteCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Order1
|
public class Order1
|
||||||
@ -41,7 +82,7 @@ namespace OrmTest
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public decimal Price { get; set; }
|
public decimal Price { get; set; }
|
||||||
[SugarColumn(InsertServerTime =true)]
|
[SugarColumn(InsertServerTime =true,UpdateServerTime =true)]
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime CreateTime { get; set; }
|
||||||
[SugarColumn(IsNullable = true)]
|
[SugarColumn(IsNullable = true)]
|
||||||
public int CustomId { get; set; }
|
public int CustomId { get; set; }
|
||||||
@ -56,7 +97,7 @@ namespace OrmTest
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public decimal Price { get; set; }
|
public decimal Price { get; set; }
|
||||||
[SugarColumn(InsertSql = "now()")]
|
[SugarColumn(InsertSql = "now()",UpdateSql =" NOW() ")]
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime CreateTime { get; set; }
|
||||||
[SugarColumn(IsNullable = true)]
|
[SugarColumn(IsNullable = true)]
|
||||||
public int CustomId { get; set; }
|
public int CustomId { get; set; }
|
||||||
|
@ -33,7 +33,7 @@ namespace SqlSugar
|
|||||||
|
|
||||||
private string GetOracleUpdateColums(int i, DbColumnInfo m, bool iswhere)
|
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)
|
public object FormatValue(int i, string name, object value, bool iswhere)
|
||||||
|
Loading…
Reference in New Issue
Block a user