From de55ab217f7ee0902d3fb63012e3743b910e4798 Mon Sep 17 00:00:00 2001 From: yuemian Date: Thu, 31 Oct 2024 15:50:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bocloud/ams/repository/instance/InstanceRepository.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bocloud.ams.repository/src/main/java/com/bocloud/ams/repository/instance/InstanceRepository.java b/bocloud.ams.repository/src/main/java/com/bocloud/ams/repository/instance/InstanceRepository.java index 411b068..c60434a 100644 --- a/bocloud.ams.repository/src/main/java/com/bocloud/ams/repository/instance/InstanceRepository.java +++ b/bocloud.ams.repository/src/main/java/com/bocloud/ams/repository/instance/InstanceRepository.java @@ -208,7 +208,7 @@ public class InstanceRepository extends BasicGenericDao { // 行转列的表头 String sql; if (StringUtils.isNotEmpty(positionKey)) { - sql = "SELECT GROUP_CONCAT('MAX(IF(P.ID = ',P.id,',INSV.PROPERTY_VALUE,NULL)) AS ''',P.code,'''') as sqlResult" + " from " +positionKey+"ci_property AS P where P.is_deleted = 0 and P.module_id=" + moduleId; + sql = "SELECT GROUP_CONCAT('MAX(IF(P.ID = ',P.id,',INSV.PROPERTY_VALUE,NULL)) AS ''',P.code,'''') as sqlResult" + " from " +positionKey+".ci_property AS P where P.is_deleted = 0 and P.module_id=" + moduleId; } else { sql = "SELECT GROUP_CONCAT('MAX(IF(P.ID = ',P.id,',INSV.PROPERTY_VALUE,NULL)) AS ''',P.code,'''') as sqlResult" + " from ci_property AS P where P.is_deleted = 0 and P.module_id=" + moduleId; } @@ -228,13 +228,13 @@ public class InstanceRepository extends BasicGenericDao { sqlBuilder.append(" FROM " + instanceTable + " INS"); sqlBuilder.append(" LEFT JOIN " + instanceValueTable + " AS INSV ON INS.ID = INSV.instance_id and INSV.is_deleted=0 "); if (StringUtils.isNotEmpty(positionKey)) { - sqlBuilder.append(" LEFT JOIN" +positionKey+" ci_property AS P ON INS.module_id = P.module_id and INSV.property_id=P.id "); + sqlBuilder.append(" LEFT JOIN" +positionKey+".ci_property AS P ON INS.module_id = P.module_id and INSV.property_id=P.id "); } else { sqlBuilder.append(" LEFT JOIN ci_property AS P ON INS.module_id = P.module_id and INSV.property_id=P.id "); } if (!hasAdminRole) { if (StringUtils.isNotEmpty(positionKey)) { - sqlBuilder.append(" LEFT JOIN" +positionKey+" ci_instance_authority AU on INS.module_id = AU.module_id and INS.id = AU.instance_id"); + sqlBuilder.append(" LEFT JOIN" +positionKey+".ci_instance_authority AU on INS.module_id = AU.module_id and INS.id = AU.instance_id"); } else { sqlBuilder.append(" LEFT JOIN ci_instance_authority AU on INS.module_id = AU.module_id and INS.id = AU.instance_id"); }