mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 10:24:55 +08:00
Update exp to sql
This commit is contained in:
@@ -291,6 +291,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
column.DataType = "json";
|
column.DataType = "json";
|
||||||
}
|
}
|
||||||
|
else if (column.Length > 0)
|
||||||
|
{
|
||||||
|
column.DataType = "varchar";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
column.DataType = "varchar(4000)";
|
column.DataType = "varchar(4000)";
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace SqlSugar
|
namespace SqlSugar
|
||||||
@@ -155,11 +156,21 @@ namespace SqlSugar
|
|||||||
if (sql == null) return sql;
|
if (sql == null) return sql;
|
||||||
joinInfos.Last().ThisEntityInfo.Columns.ForEach(it =>
|
joinInfos.Last().ThisEntityInfo.Columns.ForEach(it =>
|
||||||
{
|
{
|
||||||
this.whereSql = this.whereSql.Replace(sqlBuilder.GetTranslationColumnName(it.DbColumnName),
|
if (it.DbColumnName != null)
|
||||||
lastShortName+"." + sqlBuilder.GetTranslationColumnName(it.DbColumnName));
|
{
|
||||||
|
if (this.whereSql.Contains("." + sqlBuilder.GetTranslationColumnName(it.DbColumnName)))
|
||||||
|
{
|
||||||
|
this.whereSql =Regex.Replace(this.whereSql,@"\w+\."+sqlBuilder.GetTranslationColumnName(it.DbColumnName),
|
||||||
|
lastShortName + "." + sqlBuilder.GetTranslationColumnName(it.DbColumnName));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.whereSql = this.whereSql.Replace(sqlBuilder.GetTranslationColumnName(it.DbColumnName),
|
||||||
|
lastShortName + "." + sqlBuilder.GetTranslationColumnName(it.DbColumnName));
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return sql;
|
return this.whereSql;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetWhereSql(MethodCallExpression memberExp)
|
private string GetWhereSql(MethodCallExpression memberExp)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace SqlSugar
|
namespace SqlSugar
|
||||||
@@ -155,11 +156,21 @@ namespace SqlSugar
|
|||||||
if (sql == null) return sql;
|
if (sql == null) return sql;
|
||||||
joinInfos.Last().ThisEntityInfo.Columns.ForEach(it =>
|
joinInfos.Last().ThisEntityInfo.Columns.ForEach(it =>
|
||||||
{
|
{
|
||||||
this.whereSql = this.whereSql.Replace(sqlBuilder.GetTranslationColumnName(it.DbColumnName),
|
if (it.DbColumnName != null)
|
||||||
lastShortName+"." + sqlBuilder.GetTranslationColumnName(it.DbColumnName));
|
{
|
||||||
|
if (this.whereSql.Contains("." + sqlBuilder.GetTranslationColumnName(it.DbColumnName)))
|
||||||
|
{
|
||||||
|
this.whereSql =Regex.Replace(this.whereSql,@"\w+\."+sqlBuilder.GetTranslationColumnName(it.DbColumnName),
|
||||||
|
lastShortName + "." + sqlBuilder.GetTranslationColumnName(it.DbColumnName));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.whereSql = this.whereSql.Replace(sqlBuilder.GetTranslationColumnName(it.DbColumnName),
|
||||||
|
lastShortName + "." + sqlBuilder.GetTranslationColumnName(it.DbColumnName));
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return sql;
|
return this.whereSql;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetWhereSql(MethodCallExpression memberExp)
|
private string GetWhereSql(MethodCallExpression memberExp)
|
||||||
|
|||||||
Reference in New Issue
Block a user