using MES.Service.DB; using MES.Service.Dto.service; using MES.Service.Modes; using SqlSugar; namespace MES.Service.service.Warehouse; public class MesDepotSectionsManager : Repository { //当前类已经继承了 Repository 增、删、查、改的方法 public string GetSectionName(WarehouseQuery query) { var sectionName = Db.Queryable((a, b) => new JoinQueryInfos(JoinType.Inner, a.DepotId == b.DepotId)) .Where((a, b) => a.DepotSectionCode == query.sectionCode) .Select((a, b) => a.DepotSectionName).Single(); if (sectionName == null) { throw new Exception("库位编码 " + query.sectionCode + " 不存在,请确认!"); } return sectionName; } }