| | |
| | | /// <param name="dicNos"></param> |
| | | /// <param name="executeSql">鏄惁鎵ц鑷畾涔塻ql</param> |
| | | /// <returns></returns> |
| | | public IEnumerable<Sys_Dictionary> GetDictionaries(IEnumerable<string> dicNos, bool executeSql = true) |
| | | public IEnumerable<Sys_Dictionary> GetDictionaries(IEnumerable<string> dicNos, bool executeSql = false) |
| | | { |
| | | List<Sys_Dictionary> Dictionaries = GetAllDictionary(); |
| | | List<Sys_Dictionary> Dictionaries = GetAllDictionary(dicNos); |
| | | |
| | | foreach (var item in Dictionaries.Where(x => dicNos.Contains(x.DicNo))) |
| | | { |
| | | if (executeSql) |
| | | { |
| | | // 2020.05.01澧炲姞鏍规嵁鐢ㄦ埛淇℃伅鍔犺浇瀛楀吀鏁版嵁婧恠ql |
| | | string sql = item.DBSql; |
| | | if (!string.IsNullOrEmpty(sql)) |
| | | { |
| | | item.DicList = Query(sql); |
| | | } |
| | | } |
| | | } |
| | | //foreach (var item in Dictionaries.Where(x => dicNos.Contains(x.DicNo))) |
| | | //{ |
| | | // if (executeSql) |
| | | // { |
| | | // // 2020.05.01澧炲姞鏍规嵁鐢ㄦ埛淇℃伅鍔犺浇瀛楀吀鏁版嵁婧恠ql |
| | | // string sql = item.DBSql; |
| | | // if (!string.IsNullOrEmpty(sql)) |
| | | // { |
| | | // item.DicList = Query(sql); |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | return Dictionaries; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private List<Sys_Dictionary> GetAllDictionary() |
| | | private List<Sys_Dictionary> GetAllDictionary(IEnumerable<string> dicNos) |
| | | { |
| | | //base.QueryData().ToList(); |
| | | List<Sys_Dictionary> _dictionaries = Db.Queryable<Sys_Dictionary>().Includes(x => x.DicList).Where(x => x.Enable == 1).ToList(); |
| | | List<Sys_Dictionary> _dictionaries = Db.Queryable<Sys_Dictionary>().Includes(x => x.DicList).Where(x => x.Enable == 1 && dicNos.Contains(x.DicNo)).ToList(); |
| | | return _dictionaries; |
| | | } |
| | | } |