using Infrastructure.Attribute;
using SqlSugar;
using System.Collections.Generic;
using ARW.Model;
using ARW.Model.System;
namespace ARW.Repository.System
{
///
/// 字典
///
[AppService(ServiceLifetime = LifeTime.Transient)]
public class SysDictRepository : BaseRepository
{
public List GetAll()
{
return Context.Queryable().ToList();
}
///
/// 查询字段类型列表
///
/// 实体模型
///
public PagedInfo SelectDictTypeList(SysDictType dictType, PagerInfo pager)
{
var exp = Expressionable.Create();
exp.AndIF(!string.IsNullOrEmpty(dictType.DictName), it => it.DictName.Contains(dictType.DictName));
exp.AndIF(!string.IsNullOrEmpty(dictType.Status), it => it.Status == dictType.Status);
exp.AndIF(!string.IsNullOrEmpty(dictType.DictType), it => it.DictType.Contains(dictType.DictType));
exp.AndIF(!string.IsNullOrEmpty(dictType.Type), it => it.Type.Equals(dictType.Type));
return GetPages(exp.ToExpression(), pager, f => f.DictId, OrderByType.Desc);
}
///
/// 批量删除
///
///
///
public int DeleteDictTypeByIds(long[] id)
{
return Context.Deleteable().In(id).ExecuteCommand();
}
///
/// 修改
///
///
///
public int UpdateDictType(SysDictType dictType)
{
return Context.Updateable(dictType).IgnoreColumns(it => new { dictType.Create_by }).ExecuteCommand();
}
}
}