mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-17 01:46:18 +08:00
Update 人大金仓
This commit is contained in:
parent
ee71dd1dbc
commit
e66a76d7c3
@ -73,7 +73,14 @@ namespace SqlSugar
|
|||||||
object value = null;
|
object value = null;
|
||||||
if (it.Value is DateTime)
|
if (it.Value is DateTime)
|
||||||
{
|
{
|
||||||
value = ((DateTime)it.Value).ToString("O");
|
if (IsSqlServerModel())
|
||||||
|
{
|
||||||
|
value = ((DateTime)it.Value).ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
value = ((DateTime)it.Value).ToString("O");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (it.Value is DateTimeOffset)
|
else if (it.Value is DateTimeOffset)
|
||||||
{
|
{
|
||||||
@ -98,6 +105,10 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool IsSqlServerModel()
|
||||||
|
{
|
||||||
|
return this.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.SqlServer;
|
||||||
|
}
|
||||||
|
|
||||||
public override string FormatDateTimeOffset(object value)
|
public override string FormatDateTimeOffset(object value)
|
||||||
{
|
{
|
||||||
|
@ -272,6 +272,17 @@ namespace SqlSugar
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Methods
|
#region Methods
|
||||||
|
public override bool IsAnyConstraint(string constraintName)
|
||||||
|
{
|
||||||
|
string query = @"
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM ALL_INDEXES
|
||||||
|
WHERE INDEX_NAME = @constraintName
|
||||||
|
AND OWNER = USER";
|
||||||
|
|
||||||
|
var parameters = new { constraintName = constraintName };
|
||||||
|
return this.Context.Ado.GetInt(query, parameters) > 0;
|
||||||
|
}
|
||||||
public override bool IsAnyTable(string tableName, bool isCache = true)
|
public override bool IsAnyTable(string tableName, bool isCache = true)
|
||||||
{
|
{
|
||||||
if (isCache)
|
if (isCache)
|
||||||
@ -344,7 +355,7 @@ WHERE table_name = '"+tableName+"'");
|
|||||||
public override List<string> GetIndexList(string tableName)
|
public override List<string> GetIndexList(string tableName)
|
||||||
{
|
{
|
||||||
var sql = $"SELECT index_name FROM user_ind_columns\r\nWHERE upper(table_name) = upper('{tableName}')";
|
var sql = $"SELECT index_name FROM user_ind_columns\r\nWHERE upper(table_name) = upper('{tableName}')";
|
||||||
return this.Context.Ado.SqlQuery<string>(sql);
|
return this.Context.Ado.SqlQuery<string>(sql).Distinct().ToList();
|
||||||
}
|
}
|
||||||
public override List<string> GetProcList(string dbName)
|
public override List<string> GetProcList(string dbName)
|
||||||
{
|
{
|
||||||
@ -461,7 +472,7 @@ WHERE table_name = '"+tableName+"'");
|
|||||||
{
|
{
|
||||||
List<DbColumnInfo> columns = GetOracleDbType(tableName);
|
List<DbColumnInfo> columns = GetOracleDbType(tableName);
|
||||||
string sql = "select * /* " + Guid.NewGuid() + " */ from " +SqlBuilder.GetTranslationTableName(SqlBuilder.GetNoTranslationColumnName(tableName)) + " WHERE 1=2 ";
|
string sql = "select * /* " + Guid.NewGuid() + " */ from " +SqlBuilder.GetTranslationTableName(SqlBuilder.GetNoTranslationColumnName(tableName)) + " WHERE 1=2 ";
|
||||||
if (!IsAnyTable(tableName, false))
|
if (!IsAnyTable(tableName, false)&&!GetViewInfoList(false).Any(it=>it.Name.EqualCase(tableName)))
|
||||||
{
|
{
|
||||||
return new List<DbColumnInfo>();
|
return new List<DbColumnInfo>();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user