using Infrastructure.Attribute; using SqlSugar; using ZR.Model.mes.md; using ZR.Service.mes.md.IService; namespace ZR.Service.mes.md { [AppService(ServiceType = typeof(IMdTechnologicalProrouteService), ServiceLifetime = LifeTime.Transient)] public class MdTechnologicalProrouteService : BaseService, IMdTechnologicalProrouteService { public int AddWorkProroute(MdTechnologicalProroute proroute) { return Add(proroute); } public int deleteWorksProroute(int[] ids) { return Delete(ids); } public (int, List) GetAll(string ProrouteCode, string ProrouteName, int pageNum, int pageSize) { int totalNum = 0; var predicate = Expressionable.Create() .AndIF(!string.IsNullOrEmpty(ProrouteCode), it => it.ProrouteCode.Contains(ProrouteCode)) .AndIF(!string.IsNullOrEmpty(ProrouteName), it => it.ProrouteName.Contains(ProrouteName)) .ToExpression(); List data = Context.Queryable().Where(predicate).ToPageList(pageNum, pageSize, ref totalNum); return (totalNum, data); } public int UpdateWorkProroute(MdTechnologicalProroute proroute) { return Update(proroute, true); } } }