From 7b4a97f670cc95ef30da68c0137744b51450b3ba Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Mon, 20 Feb 2023 15:42:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datadictionary/IDataDictionaryDao.java | 20 +++++ .../pos/datadictionary/DataDictionaryPO.java | 74 +++++++++++++++++++ .../IDataDictionaryService.java | 12 ++- .../impl/DataDictionaryServiceImpl.java | 8 ++ .../datadictionary/datadictionary-mapper.xml | 23 ++++++ 5 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/pojo/pos/datadictionary/DataDictionaryPO.java diff --git a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/dao/datadictionary/IDataDictionaryDao.java b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/dao/datadictionary/IDataDictionaryDao.java index 7e979e0..2d773a8 100644 --- a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/dao/datadictionary/IDataDictionaryDao.java +++ b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/dao/datadictionary/IDataDictionaryDao.java @@ -5,6 +5,7 @@ import com.cm.common.exception.SaveException; import com.cm.common.exception.SearchException; import com.cm.common.exception.UpdateException; import com.cm.common.plugin.pojo.dtos.datadictionary.DataDictionaryDTO; +import com.cm.common.plugin.pojo.pos.datadictionary.DataDictionaryPO; import com.cm.common.pojo.dtos.ZTreeDTO; import org.springframework.stereotype.Repository; @@ -54,6 +55,15 @@ public interface IDataDictionaryDao { */ List listDictionary(Map params) throws SearchException; + /** + * 字典列表 + * + * @param params + * @return + * @throws SearchException + */ + List listPO(Map params) throws SearchException; + /** * 字典详情 * @@ -63,6 +73,16 @@ public interface IDataDictionaryDao { */ DataDictionaryDTO getDictionary(Map params) throws SearchException; + /** + * 字典详情 + * + * @param params + * @return + * @throws SearchException + */ + DataDictionaryPO getPO(Map params) throws SearchException; + + /** * 获取最后一个字字典 * diff --git a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/pojo/pos/datadictionary/DataDictionaryPO.java b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/pojo/pos/datadictionary/DataDictionaryPO.java new file mode 100644 index 0000000..4ccf392 --- /dev/null +++ b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/pojo/pos/datadictionary/DataDictionaryPO.java @@ -0,0 +1,74 @@ +package com.cm.common.plugin.pojo.pos.datadictionary; + +import io.swagger.annotations.ApiModel; + +import java.io.Serializable; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: DictionaryDTO + * @Description: 字典 + * @Author: WangGeng + * @Date: 2019/11/18 14:17 + * @Version: 1.0 + **/ +@ApiModel +public class DataDictionaryPO implements Serializable { + + private String dictionaryId; + private String dictionaryParentId; + private String dictionaryName; + private String dictionarySummary; + private String dictionaryCode; + private String dictionarySort; + + public String getDictionaryId() { + return dictionaryId == null ? "" : dictionaryId.trim(); + } + + public void setDictionaryId(String dictionaryId) { + this.dictionaryId = dictionaryId; + } + + public String getDictionaryParentId() { + return dictionaryParentId == null ? "" : dictionaryParentId.trim(); + } + + public void setDictionaryParentId(String dictionaryParentId) { + this.dictionaryParentId = dictionaryParentId; + } + + public String getDictionaryName() { + return dictionaryName == null ? "" : dictionaryName.trim(); + } + + public void setDictionaryName(String dictionaryName) { + this.dictionaryName = dictionaryName; + } + + public String getDictionarySummary() { + return dictionarySummary == null ? "" : dictionarySummary.trim(); + } + + public void setDictionarySummary(String dictionarySummary) { + this.dictionarySummary = dictionarySummary; + } + + public String getDictionaryCode() { + return dictionaryCode == null ? "" : dictionaryCode.trim(); + } + + public void setDictionaryCode(String dictionaryCode) { + this.dictionaryCode = dictionaryCode; + } + + public String getDictionarySort() { + return dictionarySort == null ? "" : dictionarySort.trim(); + } + + public void setDictionarySort(String dictionarySort) { + this.dictionarySort = dictionarySort; + } +} 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 a7c3bc1..ab1f5b6 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 @@ -1,10 +1,9 @@ package com.cm.common.plugin.service.datadictionary; import com.cm.common.exception.RemoveException; -import com.cm.common.exception.SaveException; import com.cm.common.exception.SearchException; -import com.cm.common.exception.UpdateException; import com.cm.common.plugin.pojo.dtos.datadictionary.DataDictionaryDTO; +import com.cm.common.plugin.pojo.pos.datadictionary.DataDictionaryPO; import com.cm.common.plugin.pojo.vos.datadictionary.DataDictionaryVO; import com.cm.common.pojo.ListPage; import com.cm.common.pojo.dtos.ZTreeDTO; @@ -112,6 +111,15 @@ public interface IDataDictionaryService { */ DataDictionaryDTO getDictionaryById(String dictionaryId) throws SearchException; + /** + * 通过ID获取字典 + * + * @param dictionaryId + * @return + * @throws SearchException + */ + DataDictionaryPO getPOById(String dictionaryId) throws SearchException; + /** * 通过上级ID获取字典列表 * 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 cae2046..dfc21ab 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 @@ -6,6 +6,7 @@ import com.cm.common.exception.RemoveException; import com.cm.common.exception.SearchException; import com.cm.common.plugin.dao.datadictionary.IDataDictionaryDao; import com.cm.common.plugin.pojo.dtos.datadictionary.DataDictionaryDTO; +import com.cm.common.plugin.pojo.pos.datadictionary.DataDictionaryPO; import com.cm.common.plugin.pojo.vos.datadictionary.DataDictionaryVO; import com.cm.common.plugin.service.datadictionary.IDataDictionaryService; import com.cm.common.pojo.ListPage; @@ -136,6 +137,13 @@ public class DataDictionaryServiceImpl extends AbstractService implements IDataD return dictionaryDao.getDictionary(params); } + @Override + public DataDictionaryPO getPOById(String dictionaryId) throws SearchException { + Map params = super.getHashMap(1); + params.put("dictionaryId", dictionaryId); + return dictionaryDao.getPO(params); + } + @Override public List listDictionaryByParentId(String dictionaryParentId) throws SearchException { Map params = getHashMap(1); 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 59ae73f..76bf126 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 @@ -14,6 +14,15 @@ + + + + + + + + + @@ -168,6 +177,20 @@ + + +