mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 16:18:47 +08:00
Update exp to sql
This commit is contained in:
parent
e294f64298
commit
575a9e31b5
@ -92,6 +92,7 @@
|
|||||||
<Compile Include="_OldTest\BugTest\BugModels\TStock.cs" />
|
<Compile Include="_OldTest\BugTest\BugModels\TStock.cs" />
|
||||||
<Compile Include="_OldTest\BugTest\BugModels\TTempStock.cs" />
|
<Compile Include="_OldTest\BugTest\BugModels\TTempStock.cs" />
|
||||||
<Compile Include="_OldTest\BugTest\BugModels\VMaterialInfo.cs" />
|
<Compile Include="_OldTest\BugTest\BugModels\VMaterialInfo.cs" />
|
||||||
|
<Compile Include="_OldTest\BugTest\Bug3t.cs" />
|
||||||
<Compile Include="_OldTest\Demos\H_Queue.cs" />
|
<Compile Include="_OldTest\Demos\H_Queue.cs" />
|
||||||
<Compile Include="_OldTest\Demos\I_InsertOrUpdate.cs" />
|
<Compile Include="_OldTest\Demos\I_InsertOrUpdate.cs" />
|
||||||
<Compile Include="_OldTest\Demos\J_Debugger.cs" />
|
<Compile Include="_OldTest\Demos\J_Debugger.cs" />
|
||||||
|
46
Src/Asp.Net/SqlServerTest/_OldTest/BugTest/Bug3t.cs
Normal file
46
Src/Asp.Net/SqlServerTest/_OldTest/BugTest/Bug3t.cs
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OrmTest.Test
|
||||||
|
{
|
||||||
|
public class BugTest
|
||||||
|
{
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig()
|
||||||
|
{
|
||||||
|
ConnectionString = Config.ConnectionString,
|
||||||
|
DbType = DbType.SqlServer,
|
||||||
|
IsAutoCloseConnection = true,
|
||||||
|
//MoreSettings = new ConnMoreSettings()
|
||||||
|
//{
|
||||||
|
// PgSqlIsAutoToLower = true //我们这里需要设置为false
|
||||||
|
//},
|
||||||
|
InitKeyType = InitKeyType.Attribute,
|
||||||
|
});
|
||||||
|
//调式代码 用来打印SQL
|
||||||
|
Db.Aop.OnLogExecuting = (sql, pars) =>
|
||||||
|
{
|
||||||
|
Console.WriteLine(sql);
|
||||||
|
};
|
||||||
|
|
||||||
|
var list2 = Db.Queryable<Order, OrderItem, Custom>((o, i, c) => new JoinQueryInfos(
|
||||||
|
JoinType.Left, o.Id == i.OrderId,
|
||||||
|
JoinType.Left, c.Id == o.CustomId
|
||||||
|
))
|
||||||
|
.Select((o,i,c) => new Order
|
||||||
|
{
|
||||||
|
Id=SqlFunc.IsNull(
|
||||||
|
SqlFunc.Subqueryable<Order>().Where(f=>f.CreateTime>Convert.ToDateTime( o.CreateTime.AddDays(-1)) ).Select(f => f.Id)
|
||||||
|
,-1)
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -127,6 +127,7 @@ namespace SqlSugar
|
|||||||
copyContext.RefreshMapping = this.RefreshMapping;
|
copyContext.RefreshMapping = this.RefreshMapping;
|
||||||
copyContext.ParameterIndex = this.ParameterIndex;
|
copyContext.ParameterIndex = this.ParameterIndex;
|
||||||
copyContext.PgSqlIsAutoToLower = this.PgSqlIsAutoToLower;
|
copyContext.PgSqlIsAutoToLower = this.PgSqlIsAutoToLower;
|
||||||
|
copyContext.IsSingle = this.IsSingle;
|
||||||
return copyContext;
|
return copyContext;
|
||||||
}
|
}
|
||||||
public ExpressionContext GetCopyContextWithMapping()
|
public ExpressionContext GetCopyContextWithMapping()
|
||||||
@ -141,6 +142,7 @@ namespace SqlSugar
|
|||||||
copyContext.InitMappingInfo = this.InitMappingInfo;
|
copyContext.InitMappingInfo = this.InitMappingInfo;
|
||||||
copyContext.RefreshMapping = this.RefreshMapping;
|
copyContext.RefreshMapping = this.RefreshMapping;
|
||||||
copyContext.PgSqlIsAutoToLower = this.PgSqlIsAutoToLower;
|
copyContext.PgSqlIsAutoToLower = this.PgSqlIsAutoToLower;
|
||||||
|
copyContext.IsSingle = this.IsSingle;
|
||||||
return copyContext;
|
return copyContext;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user