You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.7 KiB
65 lines
1.7 KiB
4 years ago
|
using Coldairarrow.Entity.HuiYan;
|
||
|
using Coldairarrow.Util;
|
||
|
using EFCore.Sharding;
|
||
|
using LinqKit;
|
||
|
using Microsoft.EntityFrameworkCore;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Linq.Dynamic.Core;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
namespace Coldairarrow.Business.HuiYan
|
||
|
{
|
||
|
public class itemlabelsBusiness : BaseBusiness<itemlabels>, IitemlabelsBusiness, ITransientDependency
|
||
|
{
|
||
|
public itemlabelsBusiness(IDbAccessor db)
|
||
|
: base(db)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
#region 外部接口
|
||
|
|
||
|
public async Task<PageResult<itemlabels>> GetDataListAsync(PageInput<ConditionDTO> input)
|
||
|
{
|
||
|
var q = GetIQueryable();
|
||
|
var where = LinqHelper.True<itemlabels>();
|
||
|
var search = input.Search;
|
||
|
|
||
|
//筛选
|
||
|
if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty())
|
||
|
{
|
||
|
var newWhere = DynamicExpressionParser.ParseLambda<itemlabels, bool>(
|
||
|
ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword);
|
||
|
where = where.And(newWhere);
|
||
|
}
|
||
|
|
||
|
return await q.Where(where).GetPageResultAsync(input);
|
||
|
}
|
||
|
|
||
|
public async Task<itemlabels> GetTheDataAsync(string id)
|
||
|
{
|
||
|
return await GetEntityAsync(id);
|
||
|
}
|
||
|
|
||
|
public async Task AddDataAsync(itemlabels data)
|
||
|
{
|
||
|
await InsertAsync(data);
|
||
|
}
|
||
|
|
||
|
public async Task UpdateDataAsync(itemlabels data)
|
||
|
{
|
||
|
await UpdateAsync(data);
|
||
|
}
|
||
|
|
||
|
public async Task DeleteDataAsync(List<string> ids)
|
||
|
{
|
||
|
await DeleteAsync(ids);
|
||
|
}
|
||
|
|
||
|
#endregion
|
||
|
|
||
|
#region 私有成员
|
||
|
|
||
|
#endregion
|
||
|
}
|
||
|
}
|