diff --git a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/apis/datadictionary/DataDictionaryController.java b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/apis/datadictionary/DataDictionaryController.java index f9758ad..cf1ba96 100644 --- a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/apis/datadictionary/DataDictionaryController.java +++ b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/apis/datadictionary/DataDictionaryController.java @@ -135,4 +135,14 @@ public class DataDictionaryController extends AbstractController { return dataDictionaryService.listZTreeDictionary(params); } + @ApiOperation(value = "字典列表(通过字典编码)", notes = "字典列表(通过字典编码)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "dictionaryCode", value = "字典编码", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listdictionarybydictionarycode/{dictionaryCode}") + public List listDictionaryByDictionaryCode(@PathVariable("dictionaryCode") String dictionaryCode) { + return dataDictionaryService.listDictionaryByDictionaryCode(dictionaryCode); + } + } diff --git a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/IDataDictionaryService.java b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/IDataDictionaryService.java index ac3a417..a7c3bc1 100644 --- a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/IDataDictionaryService.java +++ b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/IDataDictionaryService.java @@ -148,5 +148,12 @@ public interface IDataDictionaryService { */ List listZTreeDictionary(Map params) throws SearchException; - + /** + * 字典列表(通过字典编码) + * + * @param dictionaryCode + * @return + * @throws SearchException + */ + List listDictionaryByDictionaryCode(String dictionaryCode) throws SearchException; } diff --git a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/impl/DataDictionaryServiceImpl.java b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/impl/DataDictionaryServiceImpl.java index 8d20016..cae2046 100644 --- a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/impl/DataDictionaryServiceImpl.java +++ b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/impl/DataDictionaryServiceImpl.java @@ -170,6 +170,13 @@ public class DataDictionaryServiceImpl extends AbstractService implements IDataD return zTreeDTOs; } + @Override + public List listDictionaryByDictionaryCode(String dictionaryCode) throws SearchException { + Map params = getHashMap(1); + params.put("dictionaryCode", dictionaryCode); + return dictionaryDao.listDictionary(params); + } + /** * 递归查询子组 * diff --git a/cloud-common-plugin-dictionary/src/main/resources/mybatis/mapper/datadictionary/datadictionary-mapper.xml b/cloud-common-plugin-dictionary/src/main/resources/mybatis/mapper/datadictionary/datadictionary-mapper.xml index d4cdfa6..ca16b6f 100644 --- a/cloud-common-plugin-dictionary/src/main/resources/mybatis/mapper/datadictionary/datadictionary-mapper.xml +++ b/cloud-common-plugin-dictionary/src/main/resources/mybatis/mapper/datadictionary/datadictionary-mapper.xml @@ -104,7 +104,12 @@