From 075456caa9fa75c2eddf526dad5c45354ec29554 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Tue, 11 Jul 2023 16:11:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84=E5=9B=BE?= =?UTF-8?q?=EF=BC=8C<=E6=A0=B9=E7=BB=93=E7=82=B9>=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=9B=9E=E6=BA=AF=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OrgChartServiceImpl.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java index 638c45d1..462ff7d5 100644 --- a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java @@ -106,9 +106,22 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { subcompany = "0"; } String fclass = Util.null2String(params.get("fclass")); - String sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompany where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = '" + subcompany + "'"; - if (StringUtils.isNotBlank(fclass) && !"0".equals(fclass)) { - sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompanyvirtual where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = '" + subcompany + "' and companyid = '" + fclass + "'"; + String id = Util.null2String(params.get("id")); + // 是否展示当前数据 + boolean isSearchCurrent = StringUtils.isBlank(id) || "0".equals(id); + String sql; + if (isSearchCurrent) { + sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompany where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = '" + subcompany + "'"; + if (StringUtils.isNotBlank(fclass) && !"0".equals(fclass)) { + sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompanyvirtual where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = '" + subcompany + "' and companyid = '" + fclass + "'"; + } + } else { + sql = "select id as id, id as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompany where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcompanyid", "0") + " = '" + subcompany + "'"; + if (StringUtils.isNotBlank(fclass) && !"0".equals(fclass)) { + sql = "select id as id, id as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompanyvirtual where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcompanyid", "0") + " = '" + subcompany + "' and companyid = '" + fclass + "'"; + } + // 添加时间轴条件 + sql += " and versionid = " + id; } rs.executeQuery(sql); while (rs.next()) {