2024-08-21 09:20:59 +08:00

31 lines
966 B
C#

using DOAN.Service.IService;
using Infrastructure.Attribute;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DOAN.Service
{
[AppService(ServiceType = typeof(ITenantService), ServiceLifetime = LifeTime.Transient)]
public class TenantService : BaseService<TenantList>, ITenantService
{
/// <summary>
/// 获取list
/// </summary>
/// <param name="tenant"></param>
/// <returns></returns>
public List<TenantList> GetALLList(TenantList tenant)
{
return Context.Queryable<TenantList>()
.WhereIF(tenant != null && !string.IsNullOrEmpty(tenant.Name), it => it.Name.Contains(tenant.Name))
.WhereIF(tenant != null && !string.IsNullOrEmpty(tenant.Code), it => it.Name.Contains(tenant.Code))
.Where(it => it.Status == 1)
.ToList();
}
}
}