From c6ec5bf3f375533c12f2b1034546e4f3212fd71e Mon Sep 17 00:00:00 2001 From: yuemian <--list> Date: Thu, 29 Aug 2024 10:22:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81ams=E5=88=86=E9=98=B5?= =?UTF-8?q?=E5=9C=B0=E6=95=B0=E6=8D=AE=E5=BA=93=E6=9F=A5=E8=AF=A2(?= =?UTF-8?q?=E5=88=9D=E7=89=88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ams/repository/module/ModuleGroupRepository.java | 7 ++++++- .../bocloud/ams/repository/module/ModuleRepository.java | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bocloud.ams.repository/src/main/java/com/bocloud/ams/repository/module/ModuleGroupRepository.java b/bocloud.ams.repository/src/main/java/com/bocloud/ams/repository/module/ModuleGroupRepository.java index 23574ba..d1f7fcf 100644 --- a/bocloud.ams.repository/src/main/java/com/bocloud/ams/repository/module/ModuleGroupRepository.java +++ b/bocloud.ams.repository/src/main/java/com/bocloud/ams/repository/module/ModuleGroupRepository.java @@ -76,7 +76,12 @@ public class ModuleGroupRepository extends BasicGenericDao { } public List all(String positionKey) throws Exception { - String sql = "select * from " + positionKey + ".ci_module_group where is_deleted=0 "; + String sql; + if (StringUtils.isNotEmpty(positionKey)) { + sql = "select * from " + positionKey + ".ci_module_group where is_deleted=0 "; + } else { + sql = "select * from ci_module_group where is_deleted=0 "; + } return this.list(ModuleGroup.class, sql, null); } diff --git a/bocloud.ams.repository/src/main/java/com/bocloud/ams/repository/module/ModuleRepository.java b/bocloud.ams.repository/src/main/java/com/bocloud/ams/repository/module/ModuleRepository.java index 1b2b699..63e8290 100644 --- a/bocloud.ams.repository/src/main/java/com/bocloud/ams/repository/module/ModuleRepository.java +++ b/bocloud.ams.repository/src/main/java/com/bocloud/ams/repository/module/ModuleRepository.java @@ -37,9 +37,9 @@ public class ModuleRepository extends BasicGenericDao { public List list(Pager pager, String positionKey) throws Exception { String sql; if (StringUtils.isNotBlank(positionKey)) { - sql = "select a.* from ci_module a where a.position_key=:positionKey "; + sql = "select a.* from "+positionKey+".ci_module a where a.is_deleted=0 "; } else { - sql = "select a.* from ci_module a where a.position_key=:positionKey "; + sql = "select a.* from ci_module a where a.is_deleted=0 "; } sql = getQueryBuilder().buildRaw(sql, pager, "a"); return this.list(CiModule.class, sql, getQueryBuilder().getParam(pager.getParams()));