From 8276c9a37749216736627684c14fd612fce2ce04 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Wed, 26 Aug 2020 18:28:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8A=A8=E6=80=81=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/dao/dynamic/IDynamicDataDao.java | 9 +++++++++ .../service/dynamic/IDynamicDataService.java | 11 +++++++++++ .../dynamic/impl/DynamicDataServiceImpl.java | 16 ++++++++++++++++ .../mapper/dynamic/dynamicdata-mapper.xml | 18 ++++++++++++++++++ 4 files changed, 54 insertions(+) diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/dao/dynamic/IDynamicDataDao.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/dao/dynamic/IDynamicDataDao.java index a95e2e0..1533e80 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/dao/dynamic/IDynamicDataDao.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/dao/dynamic/IDynamicDataDao.java @@ -82,4 +82,13 @@ public interface IDynamicDataDao { * @throws SearchException */ Map getDynamicJoinData(Map params) throws SearchException; + + /** + * 动态数据(链接)列表 + * + * @param params + * @return + * @throws SearchException + */ + List> listDynamicJoinData(Map params) throws SearchException; } diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicDataService.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicDataService.java index 9c7055a..59ac79a 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicDataService.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicDataService.java @@ -161,6 +161,17 @@ public interface IDynamicDataService { */ Map getDynamicJoinData(String tableName, String joinKey, String joinId) throws SearchException; + /** + * 动态数据详情 + * + * @param tableName + * @param joinKey + * @param joinIds + * @return + * @throws SearchException + */ + List> listDynamicJoinData(String tableName, String joinKey, List joinIds) throws SearchException; + /** * 设置表字段为驼峰式 * diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicDataServiceImpl.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicDataServiceImpl.java index c0fab4d..3be9384 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicDataServiceImpl.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicDataServiceImpl.java @@ -206,6 +206,22 @@ public class DynamicDataServiceImpl extends AbstractService implements IDynamicD return dynamicData; } + @Override + public List> listDynamicJoinData(String tableName, String joinKey, List joinIds) throws SearchException { + Map params = getHashMap(0); + setSearchBaseGetInfo(tableName, params); + params.put("joinKey", WStringUtil.lowerUpper2UnderLine(joinKey)); + params.put("joinIds", joinIds); + List> dynamicDatas = dynamicDataDao.listDynamicJoinData(params); + if (Objects.isNull(dynamicDatas)) { + dynamicDatas = new ArrayList<>(); + } + for (Map dynamicData : dynamicDatas) { + resetDynamicDataKey2LowerUpper(dynamicData); + } + return dynamicDatas; + } + @Override public void resetDynamicDataKey2LowerUpper(List> listDynamicData) { for (Map dynamicData : listDynamicData) { diff --git a/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/dynamicdata-mapper.xml b/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/dynamicdata-mapper.xml index 90976aa..5ac0540 100644 --- a/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/dynamicdata-mapper.xml +++ b/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/dynamicdata-mapper.xml @@ -195,4 +195,22 @@ ${joinKey} = #{joinId} + + + \ No newline at end of file