jeecg 根据数据类型key查询数据字典
生活随笔
收集整理的這篇文章主要介紹了
jeecg 根据数据类型key查询数据字典
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
/* 查詢字典已選擇的類型 */String typeGroupCode = "emp_level";//字典類型keyTSTypegroup typeGroup = ResourceUtil.getCacheTypeGroup(typeGroupCode.toLowerCase());List<TSType> types = ResourceUtil.getCacheTypes(typeGroupCode.toLowerCase());/*StringBuilder typesHql = new StringBuilder("FROM ").append(TSType.class.getName()).append(" AS entity WHERE 1=1 ");typesHql.append(" AND entity.TSTypegroup.typegroupcode = ?");//typesHql.append(" AND entity.typecode = ?");List<TSType> types = this.systemService.findHql(typesHql.toString(),typeGroupCode);*/
/*** 根據 組code和具體值 獲取字典對象or Text * @param dictCode 類型組code* @param dictValue 具體類型 code 值 非文本描述* @return*/@SuppressWarnings("unused")public static TSType getDictTextByValue(String dictCode,String dictValue){TSType tsType = new TSType();List<TSType> cacheTypes = ResourceUtil.getCacheTypes(dictCode);for(TSType ts:cacheTypes){if(ts.getTypecode().equals(dictValue)){tsType = ts;break;}}return tsType;}/調用方式/TSType tsType =ResourceUtil.getDictTextByValue("syq_state","1");
?
總結
以上是生活随笔為你收集整理的jeecg 根据数据类型key查询数据字典的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【机器学习】一文读懂层次聚类(Pytho
- 下一篇: 全面解析并实现逻辑回归(Python)