Synchronization code

This commit is contained in:
sunkaixuan 2023-12-01 15:50:37 +08:00
parent 2320b40c3e
commit db3f4b97f0
3 changed files with 28 additions and 3 deletions

View File

@ -284,6 +284,14 @@ namespace SqlSugar
{
return LambdaExpressions.DbMehtods.GetDate();
}
else if (UtilMethods.IsErrorDecimalString() == true)
{
var pname = Builder.SqlParameterKeyWord + "Decimal" + GetDbColumnIndex;
var p = new SugarParameter(pname, columnInfo.Value);
this.Parameters.Add(p);
GetDbColumnIndex++;
return pname;
}
else if (columnInfo.InsertSql.HasValue())
{
return columnInfo.InsertSql;

View File

@ -426,11 +426,19 @@ namespace SqlSugar
{
return LambdaExpressions.DbMehtods.GetDate();
}
else if (IsListSetExp(columnInfo)|| IsSingleSetExp(columnInfo))
else if (UtilMethods.IsErrorDecimalString()==true)
{
var pname = Builder.SqlParameterKeyWord + "Decimal" + GetDbColumnIndex;
var p = new SugarParameter(pname, columnInfo.Value);
this.Parameters.Add(p);
GetDbColumnIndex++;
return pname;
}
else if (IsListSetExp(columnInfo) || IsSingleSetExp(columnInfo))
{
if (this.ReSetValueBySqlExpList[columnInfo.PropertyName].Type == ReSetValueBySqlExpListModelType.List)
{
return Builder.GetTranslationColumnName(columnInfo.DbColumnName)+this.ReSetValueBySqlExpList[columnInfo.PropertyName].Sql+name;
return Builder.GetTranslationColumnName(columnInfo.DbColumnName) + this.ReSetValueBySqlExpList[columnInfo.PropertyName].Sql + name;
}
else
{

View File

@ -18,7 +18,16 @@ namespace SqlSugar
{
public class UtilMethods
{
internal static bool? _IsErrorDecimalString { get; set; }
internal static bool? IsErrorDecimalString()
{
if (_IsErrorDecimalString == null)
{
decimal dec = Convert.ToDecimal(1.1);
_IsErrorDecimalString = dec.ToString().Contains(",");
}
return _IsErrorDecimalString;
}
internal static bool IsParameterConverter(EntityColumnInfo columnInfo)
{
return columnInfo != null && columnInfo.SqlParameterDbType != null && columnInfo.SqlParameterDbType is Type