组织架构图,<根结点>添加回溯联动

pull/188/head
dxfeng 2 years ago
parent c023822ca5
commit 075456caa9

@ -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()) {

Loading…
Cancel
Save