using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Ys.Core.Common; using djy.Model; using djy.Paas.IService; using djy.Paas.Model; namespace djy.Paas.Service { public class ClientLinkInfoService : ServBase, IClientLinkInfoService { public ReturnPagedResult GetList(ClientLinkInfoDto Dto, ApiFromDto apiFrom) { var rs=new ReturnPagedResult(); //var sql = DbBus.Get(DbList.djyolddb).Select().LeftJoin((link, com) => link.LINKID == com.GID); //sql.WhereIf(Dto.CompGid.IsNotNull(), (link, com) => com.CompId == Dto.CompGid) //.WhereIf(Dto.ClientName.IsNotNull(), (link, com) => com.SHORTNAME.Contains(Dto.ClientName)) //.WhereIf(Dto.ClientCodeName.IsNotNull(), (link, com) => com.CODENAME.Contains(Dto.ClientCodeName)) //.WhereIf(Dto.LinkName.IsNotNull(), (link, com) => link.SHOWNAME.Contains(Dto.LinkName)); //rs.Data = sql.Count(out var totalcount).Page(apiFrom.Page, apiFrom.Limit).ToList((info,com)=>new ClientLinkInfoDto {CompGid=com.CompId,ClientName=com.SHORTNAME,ClientCodeName=com.CODENAME, LinkName=info.SHOWNAME,Email=info.EMAIL }); var sql = DbBus.Get(DbList.djyolddb).Select().LeftJoin((comp,user)=>comp.AdminUser==user.USERID); rs.Data = sql.Count(out var totalcount).Page(apiFrom.Page, apiFrom.Limit).ToList((comp, user) => new ClientLinkInfoDto { CompGid = comp.CompId, ClientName = comp.CompName, ClientCodeName = "", LinkName = comp.AdminShowName, Email = user.EMAIL1 }); rs.OK(); return rs; } } }