using Infrastructure.Attribute;
using System;
using System.Collections.Generic;
using System.Text;
using ZR.Model.System;
namespace ZR.Repository.System
{
///
/// 字典
///
[AppService(ServiceLifetime = LifeTime.Transient)]
public class SysDictRepository : BaseRepository
{
///
/// 查询字段类型列表
///
/// 实体模型
///
public List SelectDictTypeList(SysDictType dictType, Model.PagerInfo pager)
{
var totalNum = 0;
var list = Db
.Queryable()
.WhereIF(!string.IsNullOrEmpty(dictType.DictName), it => it.DictName.Contains(dictType.DictName))
.WhereIF(!string.IsNullOrEmpty(dictType.Status), it => it.Status == dictType.Status)
.WhereIF(!string.IsNullOrEmpty(dictType.DictType), it => it.DictType == dictType.DictType)
.ToPageList(pager.PageNum, pager.PageSize, ref totalNum);
pager.TotalNum = totalNum;
return list;
}
///
/// 批量删除
///
///
///
public int DeleteDictTypeByIds(long[] id)
{
return Db.Deleteable().In(id).ExecuteCommand();
}
///
/// 修改
///
///
///
public int UpdateDictType(SysDictType dictType)
{
return Db.Updateable(dictType).IgnoreColumns(it => new { dictType.Create_by }).ExecuteCommand();
}
}
}