From 2949a33d71d58193adee05965f059e2a1b535357 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Thu, 13 Jun 2024 15:23:56 +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=E5=B2=97=E4=BD=8D=E6=95=B0=E6=8D=AE=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/service/impl/ChartServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index cccadf74..284dc846 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -279,9 +279,13 @@ public class ChartServiceImpl extends Service implements ChartService { if (showJob) { // 查询部门下的岗位 if (isRealTime) { - sql = "select a.id,a.jobtitlename as name from hrmjobtitles a inner join jcl_org_job b on a.id = b.ec_jobtitle and (b.delete_type is null or b.delete_type = 0) where b.ec_department = '" + departmentId + "'"; + String subcompanyid1 = new DepartmentComInfo().getSubcompanyid1(departmentId); + sql = "select a.id,a.jobtitlename as name from hrmjobtitles a inner join jcl_org_job b on a.id = b.ec_jobtitle and (b.delete_type is null or b.delete_type = 0) where b.ec_department = '" + departmentId + "' and b.ec_company='" + subcompanyid1 + "'"; } else { - sql = "select jobid as id ,jobname as name from jcl_chart_job where departmentid = '" + departmentId + "' and versionid = " + versionId; + rs.executeQuery("select subcompanyid from jcl_chart_department where departmentid = '" + departmentId + "' and versionid = " + versionId); + rs.next(); + String subcompanyid = rs.getString("subcompanyid"); + sql = "select jobid as id ,jobname as name from jcl_chart_job where departmentid = '" + departmentId + "' and subcompanyid = '" + subcompanyid + "' and versionid = " + versionId; } rs.executeQuery(sql); while (rs.next()) {