feat:新增自定义字典功能
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Infrastructure;
|
||||
using Infrastructure.Attribute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ZR.Model;
|
||||
@@ -111,5 +112,21 @@ namespace ZR.Service.System
|
||||
{
|
||||
return DictRepository.GetFirst(f => f.DictId == dictId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据字典类型查询自定义sql
|
||||
/// </summary>
|
||||
/// <param name="dictType"></param>
|
||||
/// <returns></returns>
|
||||
public List<SysDictData> SelectDictDataByCustomSql(string dictType)
|
||||
{
|
||||
var dictInfo = DictRepository.Queryable()
|
||||
.Where(f => f.DictType == dictType).First();
|
||||
if (dictInfo == null || !dictInfo.CustomSql.StartsWith("select", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return DictDataRepository.SelectDictDataByCustomSql(dictInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user