mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 08:37:25 +08:00
Update WhereColumns
This commit is contained in:
parent
825127e8e8
commit
54d7743a36
@ -28,6 +28,14 @@ namespace SqlSugar
|
||||
var updateTable = string.Format("UPDATE {0} SET", base.GetTableNameStringNoWith);
|
||||
var setValues = string.Join(",", t.Where(s => !s.IsPrimarykey).Where(s => OldPrimaryKeys == null || !OldPrimaryKeys.Contains(s.DbColumnName)).Select(m => GetOracleUpdateColums(i, m)).ToArray());
|
||||
var pkList = t.Where(s => s.IsPrimarykey).ToList();
|
||||
if (this.IsWhereColumns && this.PrimaryKeys?.Any() == true)
|
||||
{
|
||||
var whereColumns = pkList.Where(it => this.PrimaryKeys?.Any(p => p.EqualCase(it.PropertyName) || p.EqualCase(it.DbColumnName)) == true).ToList();
|
||||
if (whereColumns.Any())
|
||||
{
|
||||
pkList = whereColumns;
|
||||
}
|
||||
}
|
||||
List<string> whereList = new List<string>();
|
||||
foreach (var item in pkList)
|
||||
{
|
||||
|
@ -22,6 +22,14 @@ namespace SqlSugar
|
||||
var updateTable = string.Format("UPDATE {0} SET", base.GetTableNameStringNoWith);
|
||||
var setValues = string.Join(",", t.Where(s => !s.IsPrimarykey).Where(s => OldPrimaryKeys == null || !OldPrimaryKeys.Contains(s.DbColumnName)).Select(m => GetOracleUpdateColums(m)).ToArray());
|
||||
var pkList = t.Where(s => s.IsPrimarykey).ToList();
|
||||
if (this.IsWhereColumns && this.PrimaryKeys?.Any() == true)
|
||||
{
|
||||
var whereColumns = pkList.Where(it => this.PrimaryKeys?.Any(p => p.EqualCase(it.PropertyName) || p.EqualCase(it.DbColumnName)) == true).ToList();
|
||||
if (whereColumns.Any())
|
||||
{
|
||||
pkList = whereColumns;
|
||||
}
|
||||
}
|
||||
List<string> whereList = new List<string>();
|
||||
foreach (var item in pkList)
|
||||
{
|
||||
|
@ -17,6 +17,14 @@ namespace SqlSugar
|
||||
var updateTable = string.Format("UPDATE {0} SET", base.GetTableNameStringNoWith);
|
||||
var setValues = string.Join(",", t.Where(s => !s.IsPrimarykey).Where(s=> OldPrimaryKeys==null||!OldPrimaryKeys.Contains(s.DbColumnName)).Select(m => GetOracleUpdateColums(i,m,false)).ToArray());
|
||||
var pkList = t.Where(s => s.IsPrimarykey).ToList();
|
||||
if (this.IsWhereColumns&& this.PrimaryKeys?.Any()==true)
|
||||
{
|
||||
var whereColumns = pkList.Where(it => this.PrimaryKeys?.Any(p => p.EqualCase(it.PropertyName) || p.EqualCase(it.DbColumnName))==true).ToList();
|
||||
if (whereColumns.Any())
|
||||
{
|
||||
pkList = whereColumns;
|
||||
}
|
||||
}
|
||||
List<string> whereList = new List<string>();
|
||||
foreach (var item in pkList)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user