mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 17:20:49 +08:00 
			
		
		
		
	- 修复 fsql.InsertOrUpdate CanInsert=false,CanUpdate=true (mysql/pgsql)不生效的 bug;
This commit is contained in:
		@@ -132,9 +132,16 @@ namespace FreeSql.PostgreSQL.Curd
 | 
			
		||||
                        }
 | 
			
		||||
                        else if (_pgsqlInsert.InternalIgnore.ContainsKey(col.Attribute.Name))
 | 
			
		||||
                        {
 | 
			
		||||
                            var caseWhen = _pgsqlUpdate.InternalWhereCaseSource(col.CsName, sqlval => sqlval).Trim();
 | 
			
		||||
                            sb.Append(caseWhen);
 | 
			
		||||
                            if (caseWhen.EndsWith(" END")) _pgsqlUpdate.InternalToSqlCaseWhenEnd(sb, col);
 | 
			
		||||
                            if (string.IsNullOrEmpty(col.DbUpdateValue) == false)
 | 
			
		||||
                            {
 | 
			
		||||
                                sb.Append(_pgsqlInsert.InternalCommonUtils.QuoteSqlName(col.Attribute.Name)).Append(" = ").Append(col.DbUpdateValue);
 | 
			
		||||
                            }
 | 
			
		||||
                            else
 | 
			
		||||
                            {
 | 
			
		||||
                                var caseWhen = _pgsqlUpdate.InternalWhereCaseSource(col.CsName, sqlval => sqlval).Trim();
 | 
			
		||||
                                sb.Append(caseWhen);
 | 
			
		||||
                                if (caseWhen.EndsWith(" END")) _pgsqlUpdate.InternalToSqlCaseWhenEnd(sb, col);
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                        else
 | 
			
		||||
                        {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user