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.
38 lines
1.2 KiB
38 lines
1.2 KiB
using Entity.DbModel.System.SysBaseObject;
|
|
using HybirdFrameworkCore.Autofac.Attribute;
|
|
using Repository.System;
|
|
|
|
namespace Service.Mgr
|
|
{
|
|
[Scope("SingleInstance")]
|
|
public class SysDictDataMgr
|
|
{
|
|
private readonly SysDicDataRepository _sysDictDataRep;
|
|
public SysDictDataMgr(SysDicDataRepository sysDicTypeRep)
|
|
{
|
|
_sysDictDataRep = sysDicTypeRep;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据字典类型Id获取字典值集合
|
|
/// </summary>
|
|
/// <param name="dictTypeId"></param>
|
|
/// <returns></returns>
|
|
public async Task<List<SysDictData>> GetDictDataListByDictTypeId(long dictTypeId)
|
|
{
|
|
return await _sysDictDataRep.QueryByOrderByClauseAsync(
|
|
u => u.DictTypeId == dictTypeId, u => new { u.OrderNo, u.Code });
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据字典类型Id删除字典值
|
|
/// </summary>
|
|
/// <param name="dictTypeId"></param>
|
|
/// <returns></returns>
|
|
public async Task<bool> DeleteDictData(long dictTypeId)
|
|
{
|
|
return await _sysDictDataRep.DeleteAsync(u => u.DictTypeId == dictTypeId);
|
|
}
|
|
}
|
|
}
|