您好,登錄后才能下訂單哦!
本文小編為大家詳細(xì)介紹“SqlSugar多表查詢(xún)?cè)趺磳?shí)現(xiàn)”,內(nèi)容詳細(xì),步驟清晰,細(xì)節(jié)處理妥當(dāng),希望這篇“SqlSugar多表查詢(xún)?cè)趺磳?shí)現(xiàn)”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來(lái)學(xué)習(xí)新知識(shí)吧。
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多表查詢(xún)?cè)趺磳?shí)現(xiàn)”文章已經(jīng)介紹完畢,想要掌握這篇文章的知識(shí)點(diǎn)還需要大家自己動(dòng)手實(shí)踐使用過(guò)才能領(lǐng)會(huì),如果想了解更多相關(guān)內(nèi)容的文章,歡迎關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。