diff --git a/Src/Asp.Net/SqliteTest/UnitTest/Main.cs b/Src/Asp.Net/SqliteTest/UnitTest/Main.cs index ea60816ab..80bfc277b 100644 --- a/Src/Asp.Net/SqliteTest/UnitTest/Main.cs +++ b/Src/Asp.Net/SqliteTest/UnitTest/Main.cs @@ -31,6 +31,7 @@ namespace OrmTest } public static void Init() { + UCustom01.Init(); Insert(); CodeFirst(); Updateable(); diff --git a/Src/Asp.Net/SqliteTest/UnitTest/Models/ExToCon.cs b/Src/Asp.Net/SqliteTest/UnitTest/Models/ExToCon.cs new file mode 100644 index 000000000..0983f8b65 --- /dev/null +++ b/Src/Asp.Net/SqliteTest/UnitTest/Models/ExToCon.cs @@ -0,0 +1,38 @@ +using System; +using System.Linq; +using System.Text; + +namespace F9.DataEntity.Entity +{ + /// + /// + /// + public partial class ExToCon + { + public ExToCon(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string Id {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string ExId {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string LcId {get;set;} + + } +} diff --git a/Src/Asp.Net/SqliteTest/UnitTest/Models/Export.cs b/Src/Asp.Net/SqliteTest/UnitTest/Models/Export.cs new file mode 100644 index 000000000..24d1eea70 --- /dev/null +++ b/Src/Asp.Net/SqliteTest/UnitTest/Models/Export.cs @@ -0,0 +1,682 @@ +using System; +using System.Linq; +using System.Text; + +namespace F9.DataEntity.Entity +{ + /// + /// + /// + public partial class Export + { + public Export(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string Id {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string EpId {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string IeId {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ResourceId {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string EntrustCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Entrust {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string EntrContact {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string EntrTel {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string EntrEmail {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ProxyNo {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string SvBookingId {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string SvTrailerId {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string SvCustomsId {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ShipCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Shipper {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ShipDoc {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ShipContact {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ShipTel {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ShipEmail {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ConsCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Consignee {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ConsDoc {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string NotiCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Notify {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string NotiDoc {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string AlsoNotiCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string AlsoNotify {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string AlsoNotiDoc {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string AgentCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Agent {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string AgentDoc {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string PlacerCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Placer {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string PortlCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Portl {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string TransPortCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string TransPort {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string PortdCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Portd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string PlacedCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Placed {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string DestCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Dest {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string LineCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Line {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Dock {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ManagerCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Manager {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ManaContact {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ManaTel {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ManaEmail {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string CarrierCd {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Carrier {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string CarriContact {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string CarriTel {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string CarrieMail {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string DealNo {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string JobNoIn {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string BlNo {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string HblNo {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string MblNo {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string OblNo {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string DealPrice {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Carri {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string CarNo {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string SoNo {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string LclId {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string TradeType {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? ReadyDate {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? OpDate {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? Etsh {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? Etad {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? BizDate {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? DockOpenDate {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? EndConDt {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? EndDeclareDt {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? EndCastDt {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? EndPassDt {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? EndBillDt {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? EndVgmDt {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? EndAmsDt {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Booker {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? BookDate {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? CfmdDate {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string CtrlOffice {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Depart {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Saler {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string SalerAss {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string OpOffice {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string OpDepart {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string BusName {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Op {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Service {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Doc {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string CtrlDoc { get; set; } + + } +} diff --git a/Src/Asp.Net/SqliteTest/UnitTest/Models/LoadCon.cs b/Src/Asp.Net/SqliteTest/UnitTest/Models/LoadCon.cs new file mode 100644 index 000000000..a8b0c51b1 --- /dev/null +++ b/Src/Asp.Net/SqliteTest/UnitTest/Models/LoadCon.cs @@ -0,0 +1,201 @@ +using System; +using SqlSugar; + +namespace F9.DataEntity.Entity +{ + /// + /// + /// + [SugarTable("LoadCon")] + public partial class LoadCon + { + public LoadCon() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true)] + public string Id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string MblId { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string AppOwnerId { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string AppCodeId { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string AppReturnId { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string TcId { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string SizeType { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ConNo { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string SealNo { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string SealNoNew { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string LclId { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Status { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? Ctns { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string CtnsUnit { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public decimal? Weight { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public decimal? Meas { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string VGMWay { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public decimal? VGMWeight { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string TruckNo { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Remark { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Cy { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Driver { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string DriverTel { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? InDockDate { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string Blno { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string WagonNo { get; set; } + + } +} diff --git a/Src/Asp.Net/SqliteTest/UnitTest/UCustom01.cs b/Src/Asp.Net/SqliteTest/UnitTest/UCustom01.cs new file mode 100644 index 000000000..0b2a58608 --- /dev/null +++ b/Src/Asp.Net/SqliteTest/UnitTest/UCustom01.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using F9.DataEntity.Entity; +using SqlSugar; +namespace OrmTest +{ + public class UCustom01 + { + public static void Init() + { + var db = NewUnitTest.Db; + db.CodeFirst.InitTables(); + db.CodeFirst.InitTables(); + db.CodeFirst.InitTables(); + var LclId = "FCL"; + var conno = "conno"; + var withSameCarriCarNo = db.Queryable() + .Where(export => SqlFunc.IsNull(export.IeId, "E") == "E") + .Where(export => SqlFunc.Subqueryable().Where(loadconn => + + SqlFunc.Subqueryable().Where(extocon => + extocon.ExId == export.Id && extocon.LcId == loadconn.Id).Any()) + .WhereIF(LclId == "FCL", + loadconn => SqlFunc.IsNull(loadconn.ConNo, "") == conno) + .WhereIF(LclId != "FCL", + loadconn => SqlFunc.IsNull(loadconn.ConNo, "") == conno && export.LclId == "FCL") + .Any()) + .ToList(); + } + } +}