mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Synchronization code
This commit is contained in:
parent
f1733039d2
commit
d9c8bb5ca4
@ -53,7 +53,7 @@ namespace SqlSugar
|
||||
}
|
||||
}
|
||||
public partial class DmMethod : DefaultDbMethod, IDbMethods
|
||||
{
|
||||
{
|
||||
public override string WeekOfYear(MethodCallExpressionModel mode)
|
||||
{
|
||||
var parameterNameA = mode.Args[0].MemberName;
|
||||
|
@ -54,7 +54,7 @@ namespace SqlSugar
|
||||
{
|
||||
sql = sql.Replace("sys_", "pg_");
|
||||
}
|
||||
else if (IsSqlServerModel())
|
||||
else if (IsSqlServerModel())
|
||||
{
|
||||
|
||||
sql = sql.Replace("sys_", "pg_");
|
||||
@ -67,6 +67,10 @@ namespace SqlSugar
|
||||
sql = sql.Replace("pcolumn on pcolumn.table_name = ptables.tablename", "pcolumn on pcolumn.table_name::text = ptables.tablename::text ");
|
||||
sql = sql.Replace("pkey on pcolumn.table_name = pkey.relname", "pkey on pcolumn.table_name::text = pkey.relname::text ");
|
||||
}
|
||||
else if (IsMySql())
|
||||
{
|
||||
sql = sql.Replace("pcolumn.udt_name", "pcolumn.data_type");
|
||||
}
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
@ -697,6 +701,10 @@ WHERE tgrelid = '" + tableName + "'::regclass");
|
||||
{
|
||||
return this.Context.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.SqlServer;
|
||||
}
|
||||
private bool IsMySql()
|
||||
{
|
||||
return this.Context.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.MySql;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -86,6 +86,10 @@ namespace SqlSugar
|
||||
{
|
||||
return FormatDateTimeOffset(it.Value);
|
||||
}
|
||||
else if (it.Value is bool&& (IsMySqlModel()|| IsSqlServerModel()))
|
||||
{
|
||||
return Convert.ToBoolean(it.Value)?"1":"0";
|
||||
}
|
||||
else
|
||||
{
|
||||
value = it.Value;
|
||||
@ -109,7 +113,10 @@ namespace SqlSugar
|
||||
{
|
||||
return this.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.SqlServer;
|
||||
}
|
||||
|
||||
private bool IsMySqlModel()
|
||||
{
|
||||
return this.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.MySql;
|
||||
}
|
||||
public override string FormatDateTimeOffset(object value)
|
||||
{
|
||||
var date = UtilMethods.ConvertFromDateTimeOffset((DateTimeOffset)value);
|
||||
|
@ -52,7 +52,14 @@ namespace SqlSugar
|
||||
{
|
||||
if (PartitionByValue.HasValue())
|
||||
{
|
||||
return base.ToSqlString();
|
||||
if (this.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.SqlServer)
|
||||
{
|
||||
return base.ToSqlString();
|
||||
}
|
||||
else
|
||||
{
|
||||
return base.ToSqlString().Replace(" GetDate() ", " NOW() ");
|
||||
}
|
||||
}
|
||||
base.AppendFilter();
|
||||
string oldOrderValue = this.OrderByValue;
|
||||
|
Loading…
Reference in New Issue
Block a user