mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-18 17:48:11 +08:00
Upate core
This commit is contained in:
@@ -8,6 +8,6 @@ namespace OrmTest
|
||||
{
|
||||
public class Config
|
||||
{
|
||||
public static string ConnectionString = "Data Source=kobato.meibu.net/orclpdb;User ID=sa;Password=123456;";
|
||||
public static string ConnectionString = "Data Source=SUNKAIXUAN.htinns.loc/ORCL;User ID=system;Password=manager;";
|
||||
}
|
||||
}
|
||||
|
@@ -653,7 +653,7 @@ namespace SqlSugar
|
||||
var hasParameter = parameters.HasValue();
|
||||
if (hasParameter)
|
||||
{
|
||||
foreach (var outputParameter in parameters.Where(it => it.Direction.IsIn(ParameterDirection.Output, ParameterDirection.InputOutput)))
|
||||
foreach (var outputParameter in parameters.Where(it => it.Direction.IsIn(ParameterDirection.Output, ParameterDirection.InputOutput,ParameterDirection.ReturnValue)))
|
||||
{
|
||||
var gobalOutputParamter = this.OutputParameters.Single(it => it.ParameterName == outputParameter.ParameterName);
|
||||
outputParameter.Value = gobalOutputParamter.Value;
|
||||
|
@@ -121,7 +121,14 @@ namespace SqlSugar
|
||||
var entityPropertyName = this.Context.EntityMaintenance.GetPropertyName<T>(primaryField);
|
||||
var columnInfo = EntityInfo.Columns.Single(it => it.PropertyName == entityPropertyName);
|
||||
var entityValue = columnInfo.PropertyInfo.GetValue(deleteObj, null);
|
||||
andString.AppendFormat(DeleteBuilder.WhereInEqualTemplate, primaryField, entityValue);
|
||||
if (this.Context.CurrentConnectionConfig.DbType == DbType.Oracle)
|
||||
{
|
||||
andString.AppendFormat(DeleteBuilder.WhereInEqualTemplate, primaryField.ToUpper(), entityValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
andString.AppendFormat(DeleteBuilder.WhereInEqualTemplate, primaryField, entityValue);
|
||||
}
|
||||
++i;
|
||||
}
|
||||
orString.AppendFormat(DeleteBuilder.WhereInAreaTemplate, andString);
|
||||
|
@@ -266,6 +266,7 @@ namespace SqlSugar
|
||||
List<DbColumnInfo> insertItem = new List<DbColumnInfo>();
|
||||
foreach (var column in EntityInfo.Columns)
|
||||
{
|
||||
if (column.IsIgnore || column.IsOnlyIgnoreInsert) continue;
|
||||
var columnInfo = new DbColumnInfo()
|
||||
{
|
||||
Value = column.PropertyInfo.GetValue(item, null),
|
||||
|
@@ -214,15 +214,24 @@ namespace SqlSugar
|
||||
parameter.CommonTempData = CommonTempDataType.Result;
|
||||
this.Expression = expression.Expression;
|
||||
var isConst = this.Expression is ConstantExpression;
|
||||
this.Start();
|
||||
var result = this.Context.DbMehtods.DateValue(new MethodCallExpressionModel()
|
||||
if (this.Expression.Type == UtilConstants.DateType && this.Expression.ToString() == "DateTime.Now")
|
||||
{
|
||||
Args = new List<MethodCallExpressionArgs>() {
|
||||
this.Expression = expression;
|
||||
var parameterName=base.AppendParameter(ExpressionTool.GetMemberValue(expression.Member, expression));
|
||||
base.AppendMember(parameter, isLeft, parameterName);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Start();
|
||||
var result = this.Context.DbMehtods.DateValue(new MethodCallExpressionModel()
|
||||
{
|
||||
Args = new List<MethodCallExpressionArgs>() {
|
||||
new MethodCallExpressionArgs() { IsMember = !isConst, MemberName = parameter.CommonTempData, MemberValue = null },
|
||||
new MethodCallExpressionArgs() { IsMember = true, MemberName = name, MemberValue = name }
|
||||
}
|
||||
});
|
||||
base.AppendMember(parameter, isLeft, result);
|
||||
});
|
||||
base.AppendMember(parameter, isLeft, result);
|
||||
}
|
||||
parameter.CommonTempData = oldCommonTempDate;
|
||||
}
|
||||
|
||||
|
@@ -213,6 +213,9 @@ namespace SqlSugar
|
||||
var addItem = readerValues[info];
|
||||
if (addItem == DBNull.Value)
|
||||
addItem = null;
|
||||
if (prop.PropertyType == UtilConstants.IntType) {
|
||||
addItem = addItem.ObjToInt();
|
||||
}
|
||||
result.Add(name, addItem);
|
||||
}
|
||||
}
|
||||
|
@@ -63,8 +63,8 @@ namespace SqlSugar
|
||||
catch
|
||||
{
|
||||
var message = ErrorMessage.GetThrowMessage(
|
||||
"You need to refer to Oracle.ManagedDataAccess.dll",
|
||||
"Oracle .NET Core官方驱动还没发布,暂不支持Oracle");
|
||||
"You need to refer to Oracle.ManagedDataAccess.Core",
|
||||
"你需要引用 Oracle.ManagedDataAccess.Core");
|
||||
throw new Exception(message);
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
using Microsoft.Data.Sqlite;
|
||||
using MySql.Data.MySqlClient;
|
||||
using Oracle.ManagedDataAccess.Client;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.OracleClient;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@@ -784,7 +784,7 @@ namespace SqlSugar
|
||||
/// <summary>
|
||||
/// 数据填充器
|
||||
/// </summary>
|
||||
public class OracleDataAdapter : IDataAdapter
|
||||
public class MyOracleDataAdapter : IDataAdapter
|
||||
{
|
||||
private OracleCommand command;
|
||||
private string sql;
|
||||
@@ -794,12 +794,12 @@ namespace SqlSugar
|
||||
/// SqlDataAdapter
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
public OracleDataAdapter(OracleCommand command)
|
||||
public MyOracleDataAdapter(OracleCommand command)
|
||||
{
|
||||
this.command = command;
|
||||
}
|
||||
|
||||
public OracleDataAdapter()
|
||||
public MyOracleDataAdapter()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -809,7 +809,7 @@ namespace SqlSugar
|
||||
/// </summary>
|
||||
/// <param name="sql"></param>
|
||||
/// <param name="_sqlConnection"></param>
|
||||
public OracleDataAdapter(string sql, OracleConnection _sqlConnection)
|
||||
public MyOracleDataAdapter(string sql, OracleConnection _sqlConnection)
|
||||
{
|
||||
this.sql = sql;
|
||||
this._sqlConnection = _sqlConnection;
|
||||
|
@@ -52,7 +52,18 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<KeyValuePair<string, CSharpDataType>>()
|
||||
var extService = this.Context.CurrentConnectionConfig.ConfigureExternalServices;
|
||||
if (extService != null && extService.AppendDataReaderTypeMappings.HasValue())
|
||||
{
|
||||
return extService.AppendDataReaderTypeMappings.Union(MappingTypesConst).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
return MappingTypesConst;
|
||||
}
|
||||
}
|
||||
}
|
||||
public static List<KeyValuePair<string, CSharpDataType>> MappingTypesConst = new List<KeyValuePair<string, CSharpDataType>>()
|
||||
{
|
||||
new KeyValuePair<string, CSharpDataType>("int",CSharpDataType.@int),
|
||||
new KeyValuePair<string, CSharpDataType>("integer",CSharpDataType.@int),
|
||||
@@ -94,9 +105,6 @@ namespace SqlSugar
|
||||
new KeyValuePair<string, CSharpDataType>("raw",CSharpDataType.byteArray),
|
||||
new KeyValuePair<string, CSharpDataType>("bfile",CSharpDataType.byteArray),
|
||||
new KeyValuePair<string, CSharpDataType>("varbinary",CSharpDataType.byteArray) };
|
||||
|
||||
}
|
||||
}
|
||||
public override List<string> StringThrow
|
||||
{
|
||||
get
|
||||
|
@@ -169,51 +169,55 @@ namespace SqlSugar
|
||||
return "IDENTITY(1,1)";
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CreateTable(string tableName, List<DbColumnInfo> columns, bool isCreatePrimaryKey = true)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
public override List<DbColumnInfo> GetColumnInfosByTableName(string tableName,bool isCache)
|
||||
public override List<DbColumnInfo> GetColumnInfosByTableName(string tableName,bool isCache=true)
|
||||
{
|
||||
string cacheKey = "DbMaintenanceProvider.GetColumnInfosByTableName." + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower();
|
||||
cacheKey = GetCacheKey(cacheKey);
|
||||
if (!isCache)
|
||||
return GetColumnInfosByTableName(tableName);
|
||||
else
|
||||
return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey,
|
||||
() =>
|
||||
{
|
||||
string sql = "select * from " + tableName + " WHERE 1=2 ";
|
||||
var oldIsEnableLog = this.Context.Ado.IsEnableLogEvent;
|
||||
this.Context.Ado.IsEnableLogEvent = false;
|
||||
using (DbDataReader reader = (DbDataReader)this.Context.Ado.GetDataReader(sql))
|
||||
{
|
||||
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
||||
List<DbColumnInfo> result = new List<DbColumnInfo>();
|
||||
var schemaTable = reader.GetSchemaTable();
|
||||
foreach (DataRow row in schemaTable.Rows)
|
||||
{
|
||||
DbColumnInfo column = new DbColumnInfo()
|
||||
{
|
||||
TableName = tableName,
|
||||
DataType = row["DataType"].ToString().Replace("System.", "").Trim(),
|
||||
IsNullable = (bool)row["AllowDBNull"],
|
||||
//IsIdentity = (bool)row["IsAutoIncrement"],
|
||||
ColumnDescription = null,
|
||||
DbColumnName = row["ColumnName"].ToString(),
|
||||
//DefaultValue = row["defaultValue"].ToString(),
|
||||
IsPrimarykey = GetPrimaryKeyByTableNames(tableName).Any(it=>it.Equals(row["ColumnName"].ToString(), StringComparison.CurrentCultureIgnoreCase)),
|
||||
Length = row["ColumnSize"].ObjToInt(),
|
||||
Scale = row["numericscale"].ObjToInt()
|
||||
};
|
||||
result.Add(column);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return GetColumnInfosByTableName(tableName);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private List<DbColumnInfo> GetColumnInfosByTableName(string tableName)
|
||||
{
|
||||
string sql = "select * from " + tableName + " WHERE 1=2 ";
|
||||
var oldIsEnableLog = this.Context.Ado.IsEnableLogEvent;
|
||||
this.Context.Ado.IsEnableLogEvent = false;
|
||||
using (DbDataReader reader = (DbDataReader)this.Context.Ado.GetDataReader(sql))
|
||||
{
|
||||
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
||||
List<DbColumnInfo> result = new List<DbColumnInfo>();
|
||||
var schemaTable = reader.GetSchemaTable();
|
||||
foreach (System.Data.DataRow row in schemaTable.Rows)
|
||||
{
|
||||
DbColumnInfo column = new DbColumnInfo()
|
||||
{
|
||||
TableName = tableName,
|
||||
DataType = row["DataType"].ToString().Replace("System.", "").Trim(),
|
||||
IsNullable = (bool)row["AllowDBNull"],
|
||||
//IsIdentity = (bool)row["IsAutoIncrement"],
|
||||
ColumnDescription = GetFieldComment(tableName, row["ColumnName"].ToString()),
|
||||
DbColumnName = row["ColumnName"].ToString(),
|
||||
//DefaultValue = row["defaultValue"].ToString(),
|
||||
IsPrimarykey = GetPrimaryKeyByTableNames(tableName).Any(it => it.Equals(row["ColumnName"].ToString(), StringComparison.CurrentCultureIgnoreCase)),
|
||||
Length = row["ColumnSize"].ObjToInt(),
|
||||
Scale = row["numericscale"].ObjToInt()
|
||||
};
|
||||
result.Add(column);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
private List<string> GetPrimaryKeyByTableNames(string tableName)
|
||||
{
|
||||
string cacheKey = "DbMaintenanceProvider.GetPrimaryKeyByTableNames." + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower();
|
||||
@@ -225,12 +229,50 @@ namespace SqlSugar
|
||||
this.Context.Ado.IsEnableLogEvent = false;
|
||||
string sql = @" select distinct cu.COLUMN_name KEYNAME from user_cons_columns cu, user_constraints au
|
||||
where cu.constraint_name = au.constraint_name
|
||||
and au.constraint_type = 'P' and au.table_name = '" +tableName.ToUpper()+ @"'";
|
||||
and au.constraint_type = 'P' and au.table_name = '" + tableName.ToUpper() + @"'";
|
||||
var pks = this.Context.Ado.SqlQuery<string>(sql);
|
||||
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
||||
return pks;
|
||||
});
|
||||
}
|
||||
|
||||
public string GetTableComment(string tableName)
|
||||
{
|
||||
string cacheKey = "DbMaintenanceProvider.GetTableComment." + tableName;
|
||||
var comments = this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey,
|
||||
() =>
|
||||
{
|
||||
string sql = "SELECT COMMENTS FROM USER_TAB_COMMENTS WHERE TABLE_NAME =@tableName ORDER BY TABLE_NAME";
|
||||
var oldIsEnableLog = this.Context.Ado.IsEnableLogEvent;
|
||||
this.Context.Ado.IsEnableLogEvent = false;
|
||||
var pks = this.Context.Ado.SqlQuery<string>(sql,new { tableName=tableName.ToUpper() });
|
||||
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
||||
return pks;
|
||||
});
|
||||
return comments.HasValue() ? comments.First() : "";
|
||||
}
|
||||
|
||||
public string GetFieldComment(string tableName, string filedName)
|
||||
{
|
||||
string cacheKey = "DbMaintenanceProvider.GetFieldComment." + tableName;
|
||||
var comments = this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey,
|
||||
() =>
|
||||
{
|
||||
string sql = "SELECT TABLE_NAME AS TableName, COLUMN_NAME AS DbColumnName,COMMENTS AS ColumnDescription FROM user_col_comments WHERE TABLE_NAME =@tableName ORDER BY TABLE_NAME";
|
||||
var oldIsEnableLog = this.Context.Ado.IsEnableLogEvent;
|
||||
this.Context.Ado.IsEnableLogEvent = false;
|
||||
var pks = this.Context.Ado.SqlQuery<DbColumnInfo>(sql, new { tableName = tableName.ToUpper() });
|
||||
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
||||
return pks;
|
||||
});
|
||||
return comments.HasValue() ? comments.First(it=>it.DbColumnName.Equals(filedName,StringComparison.CurrentCultureIgnoreCase)).ColumnDescription : "";
|
||||
|
||||
}
|
||||
|
||||
public override bool CreateTable(string tableName, List<DbColumnInfo> columns, bool isCreatePrimaryKey = true)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@@ -27,21 +27,32 @@ namespace SqlSugar
|
||||
string sql = InsertBuilder.ToSqlString();
|
||||
RestoreMapping();
|
||||
var count = Ado.ExecuteCommand(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
|
||||
var result = (this.GetIdentityKeys().IsNullOrEmpty() || count == 0) ? 0 : GetSeqValue(GetSeqName());
|
||||
var result = (this.GetIdentityKeys().IsNullOrEmpty() || count == 0) ? 0 : GetSeqValue(GetSeqName()).ObjToInt();
|
||||
return result;
|
||||
}
|
||||
|
||||
public override long ExecuteReturnBigIdentity()
|
||||
{
|
||||
InsertBuilder.IsReturnIdentity = true;
|
||||
PreToSql();
|
||||
string sql = InsertBuilder.ToSqlString();
|
||||
RestoreMapping();
|
||||
var count = Ado.ExecuteCommand(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
|
||||
var result = (this.GetIdentityKeys().IsNullOrEmpty() || count == 0) ? 0 :Convert.ToInt64(GetSeqValue(GetSeqName()));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public override int ExecuteCommand()
|
||||
{
|
||||
base.ExecuteCommand();
|
||||
return base.InsertObjs.Count();
|
||||
}
|
||||
|
||||
private int GetSeqValue(string seqName)
|
||||
private object GetSeqValue(string seqName)
|
||||
{
|
||||
return Ado.GetInt(" SELECT " + seqName + ".currval FROM DUAL");
|
||||
return Ado.GetScalar(" SELECT " + seqName + ".currval FROM DUAL");
|
||||
}
|
||||
|
||||
protected override void PreToSql()
|
||||
{
|
||||
var identities = GetSeqNames();
|
||||
|
@@ -1,16 +1,34 @@
|
||||
using System;
|
||||
using Oracle.ManagedDataAccess.Client;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.OracleClient;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class OracleProvider : AdoProvider
|
||||
{
|
||||
public OracleProvider() { }
|
||||
public OracleProvider()
|
||||
{
|
||||
this.FormatSql = sql =>
|
||||
{
|
||||
if (sql.HasValue()&&sql.Contains("@")) {
|
||||
var exceptionalCaseInfo = Regex.Matches(sql,@"\'.*?\@.*?\'| \w+\@\w+ ");
|
||||
if (exceptionalCaseInfo != null) {
|
||||
foreach (var item in exceptionalCaseInfo.Cast<Match>())
|
||||
{
|
||||
sql = sql.Replace(item.Value, item.Value.Replace("@", UtilConstants.ReplaceKey));
|
||||
}
|
||||
}
|
||||
sql = sql .Replace("@",":");
|
||||
sql = sql.Replace(UtilConstants.ReplaceKey, "@");
|
||||
}
|
||||
return sql;
|
||||
};
|
||||
}
|
||||
public override string SqlParameterKeyWord
|
||||
{
|
||||
get
|
||||
@@ -24,7 +42,6 @@ namespace SqlSugar
|
||||
{
|
||||
try
|
||||
{
|
||||
throw new NotSupportedException("NET Core 2.0 Oracle official driver has not yet, please wait");
|
||||
if (base._DbConnection == null)
|
||||
{
|
||||
base._DbConnection = new OracleConnection(base.Context.CurrentConnectionConfig.ConnectionString);
|
||||
@@ -61,11 +78,12 @@ namespace SqlSugar
|
||||
}
|
||||
public override IDataAdapter GetAdapter()
|
||||
{
|
||||
return new OracleDataAdapter();
|
||||
return new MyOracleDataAdapter();
|
||||
}
|
||||
public override IDbCommand GetCommand(string sql, SugarParameter[] parameters)
|
||||
{
|
||||
OracleCommand sqlCommand = new OracleCommand(sql, (OracleConnection)this.Connection);
|
||||
sqlCommand.BindByName = true;
|
||||
sqlCommand.CommandType = this.CommandType;
|
||||
sqlCommand.CommandTimeout = this.CommandTimeOut;
|
||||
if (this.Transaction != null)
|
||||
@@ -82,7 +100,7 @@ namespace SqlSugar
|
||||
}
|
||||
public override void SetCommandToAdapter(IDataAdapter dataAdapter, IDbCommand command)
|
||||
{
|
||||
((OracleDataAdapter)dataAdapter).SelectCommand = (OracleCommand)command;
|
||||
((MyOracleDataAdapter)dataAdapter).SelectCommand = (OracleCommand)command;
|
||||
}
|
||||
/// <summary>
|
||||
/// if mysql return MySqlParameter[] pars
|
||||
@@ -100,7 +118,7 @@ namespace SqlSugar
|
||||
if (parameter.Value == null) parameter.Value = DBNull.Value;
|
||||
var sqlParameter = new OracleParameter();
|
||||
sqlParameter.Size = parameter.Size == -1 ? 0 : parameter.Size;
|
||||
sqlParameter.ParameterName = parameter.ParameterName.ToLower();
|
||||
sqlParameter.ParameterName = parameter.ParameterName;
|
||||
if (sqlParameter.ParameterName[0] == '@')
|
||||
{
|
||||
sqlParameter.ParameterName = ':' + sqlParameter.ParameterName.Substring(1, sqlParameter.ParameterName.Length - 1);
|
||||
@@ -109,6 +127,10 @@ namespace SqlSugar
|
||||
{
|
||||
sqlParameter.ParameterName = sqlParameter.ParameterName.TrimStart(':');
|
||||
}
|
||||
if (parameter.IsRefCursor)
|
||||
{
|
||||
sqlParameter.OracleDbType = OracleDbType.RefCursor;
|
||||
}
|
||||
if (sqlParameter.DbType == System.Data.DbType.Guid)
|
||||
{
|
||||
sqlParameter.DbType = System.Data.DbType.String;
|
||||
@@ -117,16 +139,27 @@ namespace SqlSugar
|
||||
else if (parameter.DbType == System.Data.DbType.Boolean)
|
||||
{
|
||||
sqlParameter.DbType = System.Data.DbType.Int16;
|
||||
sqlParameter.Value = (bool)parameter.Value ? 1 : 0;
|
||||
if (parameter.Value == DBNull.Value)
|
||||
{
|
||||
parameter.Value = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sqlParameter.Value = (bool)parameter.Value ? 1 : 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (parameter.Value != null && parameter.Value.GetType() == UtilConstants.GuidType)
|
||||
{
|
||||
parameter.Value = parameter.Value.ToString();
|
||||
}
|
||||
sqlParameter.Value = parameter.Value;
|
||||
}
|
||||
if (parameter.Direction != 0)
|
||||
sqlParameter.Direction = parameter.Direction;
|
||||
result[index] = sqlParameter;
|
||||
if (sqlParameter.Direction == ParameterDirection.Output)
|
||||
if (sqlParameter.Direction.IsIn(ParameterDirection.Output, ParameterDirection.InputOutput,ParameterDirection.ReturnValue))
|
||||
{
|
||||
if (this.OutputParameters == null) this.OutputParameters = new List<IDataParameter>();
|
||||
this.OutputParameters.RemoveAll(it => it.ParameterName == sqlParameter.ParameterName);
|
||||
|
@@ -23,6 +23,13 @@ namespace SqlSugar
|
||||
return "sysdate";
|
||||
}
|
||||
}
|
||||
public override string FullSqlDateNow
|
||||
{
|
||||
get
|
||||
{
|
||||
return "select sysdate from dual";
|
||||
}
|
||||
}
|
||||
public override string SqlTranslationLeft { get { return "\""; } }
|
||||
public override string SqlTranslationRight { get { return "\""; } }
|
||||
public override string GetTranslationTableName(string name)
|
||||
|
@@ -25,7 +25,7 @@ namespace SqlSugar
|
||||
whereString += GetOracleUpdateColums(item);
|
||||
whereList.Add(whereString);
|
||||
}
|
||||
return string.Format("{0} {1} WHERE {2};", updateTable, setValues, string.Join("AND",whereList));
|
||||
return string.Format("{0} {1} WHERE {2};", updateTable, setValues, string.Join("",whereList));
|
||||
}).ToArray()));
|
||||
sb.AppendLine("End;");
|
||||
return sb.ToString();
|
||||
|
@@ -13,8 +13,15 @@ namespace SqlSugar
|
||||
}
|
||||
public override int ExecuteCommand()
|
||||
{
|
||||
base.ExecuteCommand();
|
||||
return base.UpdateObjs.Count();
|
||||
if (base.UpdateObjs.Count() == 1)
|
||||
{
|
||||
return base.ExecuteCommand();
|
||||
}
|
||||
else
|
||||
{
|
||||
base.ExecuteCommand();
|
||||
return base.UpdateObjs.Count();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Version>4.6.4.6</Version>
|
||||
<Version>4.6.4.7</Version>
|
||||
<Copyright>sun_kai_xuan</Copyright>
|
||||
<PackageProjectUrl>https://github.com/sunkaixuan/SqlSugar</PackageProjectUrl>
|
||||
<PackageLicenseUrl></PackageLicenseUrl>
|
||||
@@ -12,9 +12,9 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.0.0" />
|
||||
<PackageReference Include="Mono.Data.OracleClientCore" Version="1.0.0" />
|
||||
<PackageReference Include="MySql.Data" Version="6.10.4" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
|
||||
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="2.12.0-beta2" />
|
||||
<PackageReference Include="System.Data.Common" Version="4.3.0" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.4.0" />
|
||||
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" />
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<package >
|
||||
<metadata>
|
||||
<id>sqlSugarCore</id>
|
||||
<version>4.6.4.6</version>
|
||||
<version>4.6.4.7</version>
|
||||
<authors>sunkaixuan</authors>
|
||||
<owners>Landa</owners>
|
||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user