- 修复 fsql.InsertOrUpdate CanInsert=false,CanUpdate=true (mysql/pgsql)不生效的 bug;

This commit is contained in:
2881099
2022-11-01 18:12:31 +08:00
parent 2d2e3640c9
commit 2bd621da20
11 changed files with 166 additions and 24 deletions

View File

@ -92,9 +92,16 @@ namespace FreeSql.Odbc.MySql
}
else if (_mysqlInsert.InternalIgnore.ContainsKey(col.Attribute.Name))
{
var caseWhen = _mysqlUpdate.InternalWhereCaseSource(col.CsName, sqlval => sqlval).Trim();
sb.Append(caseWhen);
if (caseWhen.EndsWith(" END")) _mysqlUpdate.InternalToSqlCaseWhenEnd(sb, col);
if (string.IsNullOrEmpty(col.DbUpdateValue) == false)
{
sb.Append(_mysqlInsert.InternalCommonUtils.QuoteSqlName(col.Attribute.Name)).Append(" = ").Append(col.DbUpdateValue);
}
else
{
var caseWhen = _mysqlUpdate.InternalWhereCaseSource(col.CsName, sqlval => sqlval).Trim();
sb.Append(caseWhen);
if (caseWhen.EndsWith(" END")) _mysqlUpdate.InternalToSqlCaseWhenEnd(sb, col);
}
}
else
{