/* 查询字典已选择的类型 */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");