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()));