mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update mysql
This commit is contained in:
parent
29c6590540
commit
28f651490c
@ -64,6 +64,16 @@ namespace OrmTest
|
|||||||
.PublicSetColumns(it => it.Price, it => it.Price + 1)
|
.PublicSetColumns(it => it.Price, it => it.Price + 1)
|
||||||
.ExecuteCommand();
|
.ExecuteCommand();
|
||||||
|
|
||||||
|
var list = db.Queryable<Order>().OrderBy(it => it.Id).Take(2).ToList();
|
||||||
|
if (list.Count >= 2)
|
||||||
|
{
|
||||||
|
list[0].Price = 10;
|
||||||
|
list[1].Price = 2;
|
||||||
|
var result69 =
|
||||||
|
db.Updateable(list)
|
||||||
|
.PublicSetColumns(it => it.Price, "+")
|
||||||
|
.ExecuteCommand();
|
||||||
|
}
|
||||||
|
|
||||||
/*** 2.by expression ***/
|
/*** 2.by expression ***/
|
||||||
|
|
||||||
|
@ -109,7 +109,14 @@ namespace SqlSugar
|
|||||||
foreach (var item in ReSetValueBySqlExpList)
|
foreach (var item in ReSetValueBySqlExpList)
|
||||||
{
|
{
|
||||||
var dbColumnName = item.Value.DbColumnName;
|
var dbColumnName = item.Value.DbColumnName;
|
||||||
result = result.Replace($"T.{dbColumnName}", item.Value.Sql.Replace(dbColumnName, "S." + dbColumnName));
|
if (item.Value.Type == ReSetValueBySqlExpListModelType.List)
|
||||||
|
{
|
||||||
|
result = result.Replace($"T.{dbColumnName}", "S." + dbColumnName+item.Value.Sql+ "T." + dbColumnName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = result.Replace($"T.{dbColumnName}", item.Value.Sql.Replace(dbColumnName, "S." + dbColumnName));
|
||||||
|
}
|
||||||
batchUpdateSql = new StringBuilder(result);
|
batchUpdateSql = new StringBuilder(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user