您好,登錄后才能下訂單哦!
本文小編為大家詳細介紹“SqlSugar多表查詢怎么實現”,內容詳細,步驟清晰,細節處理妥當,希望這篇“SqlSugar多表查詢怎么實現”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來學習新知識吧。
List<Dictionaries> list = Db.Queryable<Dictionaries>().In(x => x.TypeId, typeidss) .OrderBy(s=>s.Sort, OrderByType.Desc) //倒序 .Where(x=>x.Del==true) .ToList();
效果:
List<ZyOrder> list = Db.Queryable<ZyOrder, User, Warehouse, Dictionaries, Channel, ZyPackage>((x, u, w, d, c, z) => new object[] { JoinType.Left,x.UserId==u.Id, JoinType.Left,x.WareHouseId==w.Id, JoinType.Left,x.State==d.Value&&d.TypeId==14, JoinType.Left,x.ChannelId==c.Id, JoinType.Left,x.Id==z.ZyOrderId, }) .Where(x => x.Del == true) .Where(x => x.ServiceNumber == ServiceNumber) .Select((x, u, w, d, c, z) => new ZyOrder { Id = x.Id, UserId = u.Id, UserName = u.UserName, ArrivalNumber = z.ArrivalNumber, WareHouseId = w.Id, WareHouseIdName = w.Name, ChannelId = c.Id, ChannelIdName = c.Name, Del = x.Del, Creationtime = x.Creationtime, CustomerNo = x.CustomerNo, Number = x.Number, ServiceNumber = x.ServiceNumber, IsHeXiao = x.IsHeXiao, }) .OrderBy(x => x.Id, OrderByType.Desc) .ToList(); return list;
讀到這里,這篇“SqlSugar多表查詢怎么實現”文章已經介紹完畢,想要掌握這篇文章的知識點還需要大家自己動手實踐使用過才能領會,如果想了解更多相關內容的文章,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。