mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update SqlSugar.MySqlConnectorCore
This commit is contained in:
parent
61b895b896
commit
658f0fd130
@ -27,7 +27,8 @@ namespace SqlSugar.MySqlConnector
|
||||
}
|
||||
}
|
||||
}
|
||||
public override object FormatValue(object value)
|
||||
int i = 0;
|
||||
public object FormatValue(object value,string name)
|
||||
{
|
||||
var n = "N";
|
||||
if (this.Context.CurrentConnectionConfig.MoreSettings != null && this.Context.CurrentConnectionConfig.MoreSettings.DisableNvarchar)
|
||||
@ -72,7 +73,10 @@ namespace SqlSugar.MySqlConnector
|
||||
}
|
||||
else if (type == UtilConstants.StringType || type == UtilConstants.ObjType)
|
||||
{
|
||||
return n+"'" + GetString(value).ToSqlFilter() + "'";
|
||||
++i;
|
||||
var parameterName = this.Builder.SqlParameterKeyWord + name + i;
|
||||
this.Parameters.Add(new SugarParameter(parameterName, value));
|
||||
return parameterName;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -115,7 +119,7 @@ namespace SqlSugar.MySqlConnector
|
||||
foreach (var item in groupList)
|
||||
{
|
||||
batchInsetrSql.Append("(");
|
||||
insertColumns = string.Join(",", item.Select(it => FormatValue(it.Value)));
|
||||
insertColumns = string.Join(",", item.Select(it => FormatValue(it.Value,it.PropertyName)));
|
||||
batchInsetrSql.Append(insertColumns);
|
||||
if (groupList.Last() == item)
|
||||
{
|
||||
|
@ -62,6 +62,10 @@ namespace SqlSugar.MySqlConnector
|
||||
}
|
||||
this.OrderByValue = oldOrderValue;
|
||||
result = GetSqlQuerySql(result);
|
||||
if (result.IndexOf("-- No table") > 0)
|
||||
{
|
||||
return "-- No table";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
private string ToCountSqlString()
|
||||
|
@ -59,7 +59,7 @@ namespace SqlSugar.MySqlConnector
|
||||
{
|
||||
updateTable.Append(SqlTemplateBatchUnion);
|
||||
}
|
||||
updateTable.Append("\r\n SELECT " + string.Join(",", columns.Select(it => string.Format(SqlTemplateBatchSelect, FormatValue(it.Value),this.Builder.GetTranslationColumnName(it.DbColumnName)))));
|
||||
updateTable.Append("\r\n SELECT " + string.Join(",", columns.Select(it => string.Format(SqlTemplateBatchSelect, FormatValue(it.Value,it.PropertyName),this.Builder.GetTranslationColumnName(it.DbColumnName)))));
|
||||
++i;
|
||||
}
|
||||
pageIndex++;
|
||||
@ -89,7 +89,8 @@ namespace SqlSugar.MySqlConnector
|
||||
}
|
||||
return batchUpdateSql.ToString();
|
||||
}
|
||||
public override object FormatValue(object value)
|
||||
int i = 0;
|
||||
public object FormatValue(object value,string name)
|
||||
{
|
||||
var n = "N";
|
||||
if (this.Context.CurrentConnectionConfig.MoreSettings != null&&this.Context.CurrentConnectionConfig.MoreSettings.DisableNvarchar)
|
||||
@ -142,7 +143,10 @@ namespace SqlSugar.MySqlConnector
|
||||
}
|
||||
else if (type == UtilConstants.StringType || type == UtilConstants.ObjType)
|
||||
{
|
||||
return n+"'" + GetString(value).ToSqlFilter() + "'";
|
||||
++i;
|
||||
var parameterName = this.Builder.SqlParameterKeyWord + name + i;
|
||||
this.Parameters.Add(new SugarParameter(parameterName, value));
|
||||
return parameterName;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Version>1.1</Version>
|
||||
<Version>1.3</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<package >
|
||||
<metadata>
|
||||
<id>SqlSugar.MySqlConnectorCore</id>
|
||||
<version>1.1</version>
|
||||
<version>1.3</version>
|
||||
<authors>sunkaixuan</authors>
|
||||
<owners>Landa</owners>
|
||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||
|
Loading…
Reference in New Issue
Block a user