From b83c40548208609d0d6826be13d742c28a784806 Mon Sep 17 00:00:00 2001 From: cy <1664593601@qq.com> Date: 星期四, 23 六月 2022 17:10:40 +0800 Subject: [PATCH] fix : MySQL=》DMSQL --- src/cn/ksource/web/facade/customerconfig/slacustomer/SlaCustomerFacadeImpl.java | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/cn/ksource/web/facade/customerconfig/slacustomer/SlaCustomerFacadeImpl.java b/src/cn/ksource/web/facade/customerconfig/slacustomer/SlaCustomerFacadeImpl.java index aeafa3c..de3f806 100644 --- a/src/cn/ksource/web/facade/customerconfig/slacustomer/SlaCustomerFacadeImpl.java +++ b/src/cn/ksource/web/facade/customerconfig/slacustomer/SlaCustomerFacadeImpl.java @@ -795,7 +795,7 @@ */ @Override public List<Map> getCiCategoryTree(String pid,String type) { - String sql = " SELECT ID as id,PID as pid,NAME as \"name\",LV as jb,STATE,SERIAL FROM CMDB_CI_CATEGORY WHERE STATE=1 "; + String sql = " SELECT ID as \"id\",PID as \"pid\",NAME as \"name\",LV as \"jb\",STATE,SERIAL FROM CMDB_CI_CATEGORY WHERE STATE=1 "; SqlParameter param = new SqlParameter(); if(StringUtil.notEmpty(type)){ sql+=" and cate_type=:type"; @@ -811,19 +811,21 @@ } if(StringUtil.isBlank(pid) && type.equals("2")){ sql=""; - sql="select DISTINCT LV1_ID AS id,\n" + - " '0' AS pid ,\n" + + sql="select DISTINCT LV1_ID AS \"id\"," + + " '0' AS \"pid\" ,\n" + " LV1_name AS \"name\",\n" + - " '1' AS lv,STATE,SERIAL from CMDB_CI_CATEGORY where STATE=1 and lv=3 and CATE_TYPE=2 "; + " '1' AS \"lv\",STATE,SERIAL from CMDB_CI_CATEGORY where STATE=1 and lv=3 and CATE_TYPE=2 "; }else if(StringUtil.isNotBlank(pid) && type.equals("2")){ CMDB_CI_CATEGORY cmdb_ci_category=new CMDB_CI_CATEGORY(pid).getInstanceById(); Integer lv=cmdb_ci_category.getLv(); if(lv==1){ sql=""; - sql="select DISTINCT LV1_ID AS id,\n" + - " '0' AS pid ,\n" + - " LV1_name AS \"name\",\n" + - " '1' AS lv,STATE,SERIAL from CMDB_CI_CATEGORY where STATE=1 and lv=3 and CATE_TYPE=2 and LV1_ID=:pid "; + sql="select DISTINCT id AS \"id\",'" + + pid+ + "' AS \"pid\" ," + + " name AS \"name\"," + + " '2' AS \"lv\",STATE,SERIAL from CMDB_CI_CATEGORY where STATE=1 and lv=:lv and CATE_TYPE=2 and LV1_ID=:pid "; + param.addValue("lv", lv+1); param.addValue("pid", pid); } -- Gitblit v1.9.1