mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-03 20:27:56 +08:00
Add unit test
This commit is contained in:
parent
e5104b4f15
commit
53347c49bb
@ -1297,9 +1297,9 @@ namespace SqlSugar
|
|||||||
var name = this.SqlBuilder.GetTranslationTableName(TableName);
|
var name = this.SqlBuilder.GetTranslationTableName(TableName);
|
||||||
var columns = "";
|
var columns = "";
|
||||||
sql = "";
|
sql = "";
|
||||||
//var isSqlFunc = this.QueryBuilder.GetSelectValue?.Contains(")") == true && this.QueryBuilder.SelectValue is Expression;
|
var isSqlFunc = this.QueryBuilder.SelectValue is Expression;
|
||||||
//if (isSqlFunc)
|
if (isSqlFunc)
|
||||||
//{
|
{
|
||||||
columns = "(";
|
columns = "(";
|
||||||
foreach (var item in ExpressionTool.GetNewExpressionItemList((Expression)this.QueryBuilder.SelectValue))
|
foreach (var item in ExpressionTool.GetNewExpressionItemList((Expression)this.QueryBuilder.SelectValue))
|
||||||
{
|
{
|
||||||
@ -1313,21 +1313,21 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
columns = columns.TrimEnd(',') + ")";
|
columns = columns.TrimEnd(',') + ")";
|
||||||
sql = $" INSERT INTO {name} {columns} " + sqlInfo.Key;
|
sql = $" INSERT INTO {name} {columns} " + sqlInfo.Key;
|
||||||
//}
|
}
|
||||||
//else
|
else
|
||||||
//{
|
{
|
||||||
// if (this.QueryBuilder.GetSelectValue != null && this.QueryBuilder.GetSelectValue.Contains(",")) ;
|
if (this.QueryBuilder.GetSelectValue != null && this.QueryBuilder.GetSelectValue.Contains(",")) ;
|
||||||
// {
|
{
|
||||||
// columns = "(";
|
columns = "(";
|
||||||
// foreach (var item in this.QueryBuilder.GetSelectValue.Split(','))
|
foreach (var item in this.QueryBuilder.GetSelectValue.Split(','))
|
||||||
// {
|
{
|
||||||
// var column = Regex.Split(item, " AS ").Last().Trim();
|
var column = Regex.Split(item, " AS ").Last().Trim();
|
||||||
// columns += $"{column},";
|
columns += $"{column},";
|
||||||
// }
|
}
|
||||||
// columns = columns.TrimEnd(',') + ")";
|
columns = columns.TrimEnd(',') + ")";
|
||||||
// }
|
}
|
||||||
// sql = $" INSERT INTO {name} {columns} " + sqlInfo.Key;
|
sql = $" INSERT INTO {name} {columns} " + sqlInfo.Key;
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetTableName(EntityInfo entity, string tableName)
|
private string GetTableName(EntityInfo entity, string tableName)
|
||||||
|
Loading…
Reference in New Issue
Block a user