using PadApplication.DB; using PadApplication.Entites.DbModels; using PadApplication.Entites.Dto; namespace PadApplication.Services; public class MesStaffManager : Repository { //当前类已经继承了 Repository 增、删、查、改的方法 public List GetAllXS0101() { var departmentNos = new[] { "MS01", "MS0102", "MS0103" }; return Db.Queryable() .Where(s => departmentNos.Contains(s.DepartmentNo) && s.State == "Y") .ToList(); } //public List GetAllXS0101() //{ // return Db.Queryable() // .Where(s => // s.DepartmentNo == "XS0101" && s.State == "Y" && s.Memo == "注塑工") // .ToList(); //} public List GetMesReportingList(OrderMachineDto dto) { return Db.Queryable() .LeftJoin((a, b) => a.BgPerson == b.StaffNo) .Where((a, b) => a.AddressCode == "XF" && a.BillNo == dto.orderNo) .OrderByDescending(a => a.BgDate) .Select((a, b) => new MesReporting { BillNo = a.BillNo, ItemNoCade = a.ItemNoCade, BgPerson = a.BgPerson, StaffName = b.StaffName, BgDate = a.BgDate, OkQty = a.OkQty }) .ToList(); } }