From edb1fca3ed219065caaaa79f4964d4d81402148d Mon Sep 17 00:00:00 2001 From: yuxc <653031404@qq.com> Date: 星期二, 01 八月 2023 14:48:56 +0800 Subject: [PATCH] 1、修改参照配置为false调用出错问题。 --- Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 42 insertions(+), 1 deletions(-) diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java index 719627b..8f93c96 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java @@ -3672,7 +3672,48 @@ } else { if (StringUtils.isNotBlank(referConfigVO.getParentFieldName()) && StringUtils.isNotBlank(queryObject.getParentOid())) { queryObject.getConditionMap().put(referConfigVO.getParentFieldName(), queryObject.getParentOid()); - } + //鏌ヨ鍏ㄩ儴鐨勪俊鎭� + String parentOidSql = ""; + if (StringUtils.isNotBlank(referConfigVO.getParentValue())) { + String temp = referConfigVO.getParentValue(); + if (temp.startsWith(QueryOptionConstant.IN)) { + temp = temp.substring((QueryOptionConstant.IN).length()).trim(); + parentOidSql = " in " + "('" + queryObject.getParentOid() + "')"; + } else if (temp.startsWith(QueryOptionConstant.NOTIN)) { + parentOidSql = " not in " + "('" + queryObject.getParentOid() + "')"; + } else if (temp.startsWith(QueryOptionConstant.NOTEQUAL)) { + temp = temp.substring((QueryOptionConstant.NOTEQUAL).length()).trim(); + parentOidSql = QueryOptionConstant.NOTEQUAL + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'"); + } else if (temp.startsWith(QueryOptionConstant.MORETHAN)) { + temp = temp.substring((QueryOptionConstant.MORETHAN).length()).trim(); + parentOidSql = QueryOptionConstant.MORETHAN + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'"); + } else if (temp.startsWith(QueryOptionConstant.MORE)) { + temp = temp.substring((QueryOptionConstant.MORE).length()).trim(); + parentOidSql = QueryOptionConstant.MORE + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'"); + } else if (temp.startsWith(QueryOptionConstant.LESSTHAN)) { + temp = temp.substring((QueryOptionConstant.LESSTHAN).length()).trim(); + parentOidSql = QueryOptionConstant.LESSTHAN + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'"); + } else if (temp.startsWith(QueryOptionConstant.LESS)) { + temp = temp.substring((QueryOptionConstant.LESS).length()).trim(); + parentOidSql = QueryOptionConstant.LESS + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'"); + } else if (temp.startsWith(QueryOptionConstant.ISNOTNULL)) { + parentOidSql = " is not null"; + } else if (temp.startsWith(QueryOptionConstant.ISNULL)) { + parentOidSql = " is null"; + } else if (temp.contains("*")) { + parentOidSql = " like " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'").replace("*", "%"); + } else { + parentOidSql = " = " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'"); + } + + } + //鏌ヨ鍏ㄩ儴鐨勪俊鎭� + queryObject.getConditionMap().put("oid", QueryOptionConstant.IN + "(select oid from " + + getTableName(referConfigVO.getReferType()) + + " START WITH " + referConfigVO.getParentFieldName() + " " + + parentOidSql + + " CONNECT BY PRIOR " + oidFieldName + " = " + referConfigVO.getParentFieldName() + ")"); + } } LambdaQueryWrapper<CodeClassify> lqw = new LambdaQueryWrapper<>(); String sql = queryObject.getConditionMap().get("oid").substring(3); -- Gitblit v1.9.3