mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-11 19:01:00 +08:00
- 修复 MySql.Data MySqlDateTime 读取为 null 的情况;#1960 #1948
This commit is contained in:
@@ -618,6 +618,43 @@ namespace base_entity
|
||||
BaseEntity.Initialization(fsql, () => _asyncUow.Value);
|
||||
#endregion
|
||||
|
||||
fsql.Delete<RequestEntity>().Where("1=1").ExecuteAffrows();
|
||||
fsql.Delete<RequestDetailEntity>().Where("1=1").ExecuteAffrows();
|
||||
fsql.Insert(new RequestEntity
|
||||
{
|
||||
ID = 21968,
|
||||
AddDate = DateTime.Now,
|
||||
ApproveDate = DateTime.Now,
|
||||
}).ExecuteAffrows();
|
||||
fsql.Insert(new RequestDetailEntity
|
||||
{
|
||||
ID = 55377,
|
||||
RequestID = 21968,
|
||||
OutboundDate = DateTime.Now,
|
||||
}).ExecuteAffrows();
|
||||
// 1.联表, 主表id查询,返回RequestEntity,AddDate不为null
|
||||
var aaa = fsql.Select<RequestEntity, RequestDetailEntity>()
|
||||
.LeftJoin((a, b) => a.ID == b.RequestID)
|
||||
.Where((a, b) => a.ID == 21968)
|
||||
.ToList();
|
||||
|
||||
// 2.联表, 相同的主表ID,AddDate为null, 子表的OutboundDate也为null
|
||||
var bbb = fsql.Select<RequestEntity, RequestDetailEntity>()
|
||||
.LeftJoin((a, b) => a.ID == b.RequestID)
|
||||
.Where((a, b) => a.ID == 21968)
|
||||
.ToList((a, b) => new
|
||||
{
|
||||
a.ID,
|
||||
DetailID = b.ID,
|
||||
a.AddDate,
|
||||
b.OutboundDate,
|
||||
});
|
||||
|
||||
// 3.单表, 以上相同的子表id, OutboundDate 不为null
|
||||
var data = fsql.Select<RequestDetailEntity>()
|
||||
.Where(a => a.ID == 55377)
|
||||
.ToList();
|
||||
|
||||
fsql.Delete<IdentityTable>().Where("1=1").ExecuteAffrows();
|
||||
fsql.Insert(new IdentityTable { name = "name01", create_time = DateTime.Now }).ExecuteAffrows();
|
||||
var itrt01 = fsql.Select<IdentityTable>().ToList();
|
||||
@@ -3353,4 +3390,31 @@ class TableOptions
|
||||
{
|
||||
public int Value1 { get; set; }
|
||||
public string Value2 { get; set; }
|
||||
}
|
||||
|
||||
[Table(Name = "tb_request_detail")]
|
||||
public class RequestDetailEntity
|
||||
{
|
||||
[Column(IsPrimary = true)]
|
||||
public int ID { get; set; }
|
||||
|
||||
[Column(IsNullable = false)]
|
||||
public int RequestID { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public DateTime? OutboundDate { get; set; }
|
||||
}
|
||||
|
||||
|
||||
[Table(Name = "tb_request")]
|
||||
public class RequestEntity
|
||||
{
|
||||
[Column(IsPrimary = true, Position = 1)]
|
||||
public int ID { get; set; }
|
||||
|
||||
[Column(Position = -2, IsNullable = false, DbType = "datetime")]
|
||||
public DateTime? AddDate { get; set; }
|
||||
|
||||
[Column(IsNullable = true, Position = 71)]
|
||||
public DateTime? ApproveDate { get; set; }
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Confluent.Kafka" Version="2.2.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="MessagePack" Version="2.4.35" />
|
||||
<PackageReference Include="MessagePack" Version="3.1.1" />
|
||||
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.5" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -41,9 +41,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="DmProvider">
|
||||
<HintPath>..\..\Providers\FreeSql.Provider.Dameng\lib\DmProvider\netstandard2.0\DmProvider.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="XuguClient">
|
||||
<HintPath>..\..\Providers\FreeSql.Provider.Xugu\lib\XuguClient\netstandard2.0\XuguClient.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -501,5 +501,11 @@
|
||||
用户导航
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:MessagePack.GeneratedMessagePackResolver">
|
||||
<summary>A MessagePack resolver that uses generated formatters for types in this assembly.</summary>
|
||||
</member>
|
||||
<member name="F:MessagePack.GeneratedMessagePackResolver.Instance">
|
||||
<summary>An instance of this resolver that only returns formatters specifically generated for types in this assembly.</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
||||
Reference in New Issue
Block a user