diff --git a/src/com/engine/organization/mapper/comp/CompMapper.xml b/src/com/engine/organization/mapper/comp/CompMapper.xml
index 03a49d57..75381ec0 100644
--- a/src/com/engine/organization/mapper/comp/CompMapper.xml
+++ b/src/com/engine/organization/mapper/comp/CompMapper.xml
@@ -193,6 +193,17 @@
and t.subCompanyName like '%'||#{CompanyPO.subCompanyName}||'%'
+
+
+ and t.subCompanyCode like '%'||#{CompanyPO.subCompanyCode}||'%'
+
+
+ and t.subCompanyDesc like '%'||#{CompanyPO.subCompanyDesc}||'%'
+
+
+ and t.subCompanyName like '%'||#{CompanyPO.subCompanyName}||'%'
+
+
@@ -215,6 +226,9 @@
and isnull(canceled,0)=0
+
+ and COALESCE(canceled,'0')='0'
+
and ifnull(canceled,0)=
@@ -228,5 +242,9 @@
and isnull(canceled,0)=
#{CompanyPO.canceled}
+
+ and COALESCE(canceled,'0')=
+ #{CompanyPO.canceled}
+
\ No newline at end of file
diff --git a/src/com/engine/organization/mapper/department/DepartmentMapper.xml b/src/com/engine/organization/mapper/department/DepartmentMapper.xml
index 6f0dcffb..fda56e2a 100644
--- a/src/com/engine/organization/mapper/department/DepartmentMapper.xml
+++ b/src/com/engine/organization/mapper/department/DepartmentMapper.xml
@@ -175,6 +175,14 @@
and t.departmentName like '%'||#{departmentPO.departmentName}||'%'
+
+
+ and t.departmentCode like '%'||#{departmentPO.departmentCode}||'%'
+
+
+ and t.departmentName like '%'||#{departmentPO.departmentName}||'%'
+
+
@@ -200,5 +208,10 @@
and isnull(canceled,0)= #{departmentPO.canceled}
+
+
+ and COALESCE(canceled,'0')= #{departmentPO.canceled}
+
+
\ No newline at end of file
diff --git a/src/com/engine/organization/mapper/employee/EmployeeMapper.xml b/src/com/engine/organization/mapper/employee/EmployeeMapper.xml
index 78cdb7e9..0e55f4d5 100644
--- a/src/com/engine/organization/mapper/employee/EmployeeMapper.xml
+++ b/src/com/engine/organization/mapper/employee/EmployeeMapper.xml
@@ -12,6 +12,11 @@
AND t.lastname like '%'||#{lastName}||'%'
+
+
+ AND t.lastname like '%'||#{lastName}||'%'
+
+
AND t.lastname like '%'+#{lastName}+'%'
diff --git a/src/com/engine/organization/mapper/jclorgmap/JclOrgMapper.xml b/src/com/engine/organization/mapper/jclorgmap/JclOrgMapper.xml
index 96336796..9c15887c 100644
--- a/src/com/engine/organization/mapper/jclorgmap/JclOrgMapper.xml
+++ b/src/com/engine/organization/mapper/jclorgmap/JclOrgMapper.xml
@@ -120,6 +120,22 @@
left join jcl_org_grade f on d.${grade}=f.id
where a.status < 4
+
+ insert into jcl_org_map
+ (id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleaderimg,
+ fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
+ fisvitual,fdatebegin,fdateend)
+ select a.id+300000000,4,a.id,a.uuid,0,'行政维度',a.workcode,a.LASTNAME,a.messagerurl,
+ c.id,c.jobtitlename,e.level_name,f.grade_name, COALESCE( b.id, 0 ) +200000000,b.id,
+ 0,NOW(),'2099-12-31'
+ from hrmresource a
+ left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle and a.subcompanyid1=b.ec_company and a.departmentid=b.ec_department
+ left join HrmJobTitles c on b.ec_jobTitle = c.id
+ left join cus_fielddata d on a.id = d.id and d.scope='HrmCustomFieldByInfoType' and d.scopeid=3
+ left join jcl_org_level e on NULLIF(d.${level},'')=e.id
+ left join jcl_org_grade f on NULLIF(d.${grade},'')=f.id
+ where a.status < 4
+
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleaderimg,
@@ -181,6 +197,28 @@
left join HrmJobTitles g on a.ec_jobTitle = g.id
where ifnull(a.delete_type,0) <> 1 and ifnull(a.forbidden_tag,0) <> 1
+
+ insert into jcl_org_map
+ (id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,
+ fparentid,fobjparentid,
+ fplan,fonjob,fisvitual,fdatebegin,fdateend)
+ select a.id+200000000,3,a.id,g.uuid,0,'行政维度',a.job_no,g.jobtitlename,
+ ec_department+100000000,
+ ec_department,
+ COALESCE(e.fcnt,0),COALESCE(f.fcnt,0),0,NOW(),'2099-12-31'
+ from JCL_ORG_job as a
+ left join (select job_id,sum(COALESCE(staff_num,0)) fcnt from JCL_ORG_STAFF
+ where plan_id in (select id from JCL_ORG_STAFFPLAN
+ where time_start<=NOW() and time_end > NOW() and delete_type=0)
+ group by job_id) e on a.id=e.job_id
+ left join ( select c.id,count(1) fcnt from hrmresource a
+ left join Hrmjobtitles b on a.jobtitle=b.id and a.status<4
+ left join jcl_org_job c on b.id=c.ec_jobtitle and a.subcompanyid1=c.ec_company and a.departmentid=c.ec_department
+ group by c.id) f
+ on f.id=a.id
+ left join HrmJobTitles g on a.ec_jobTitle = g.id
+ where COALESCE(a.delete_type,0) <> 1 and COALESCE(a.forbidden_tag,0) <> 1
+
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,
@@ -244,6 +282,26 @@
left join jcl_org_grade g on e.${grade}=g.id
where ifnull(a.canceled,0) <> 1
+
+ insert into jcl_org_map
+ (id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
+ fleadername,fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
+ fplan,fonjob,fisvitual,fdatebegin,fdateend)
+ select a.id+100000000,2,a.id,a.uuid,0,'行政维度',a.DEPARTMENTCODE,a.departmentname,b.BMFZR,c.messagerurl,
+ c.lastname,c.jobtitle,d.jobtitlemark,f.level_name,g.grade_name,
+ (case COALESCE(a.supdepid,0) when 0 then a.subcompanyid1 else a.supdepid+100000000 end),
+ (case COALESCE(a.supdepid,0) when 0 then a.subcompanyid1 else a.supdepid end),
+ 0,0,0,NOW(),'2099-12-31'
+ from
+ HrmDepartment as a
+ left join hrmdepartmentdefined as b on a.id=b.deptid
+ left join hrmresource as c on NULLIF(b.BMFZR,'')=c.ID
+ left join hrmjobtitles as d on c.JOBTITLE=d.id
+ left join cus_fielddata e on c.id = e.id and e.scope='HrmCustomFieldByInfoType' and e.scopeid=3
+ left join jcl_org_level f on NULLIF(e.${level},'')=f.id
+ left join jcl_org_grade g on NULLIF(e.${grade},'')=g.id
+ where COALESCE(a.canceled,'0') <> '1'
+
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
@@ -284,6 +342,16 @@
0,0,0,NOW(),'2099-12-31' from hrmsubcompany as a
where IFNULL(a.canceled,0) <> 1
+
+ insert into jcl_org_map
+ (id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
+ fleadername,fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
+ fplan,fonjob,fisvitual,fdatebegin,fdateend)
+ select a.id,1,a.id,a.uuid,0,'行政维度', '',a.subcompanyname,null,'',
+ '',NULL,'','','',COALESCE(a.supsubcomid,0),COALESCE(a.supsubcomid,0),
+ 0,0,0,NOW(),'2099-12-31' from hrmsubcompany as a
+ where COALESCE(a.canceled,'0') <> '1'
+
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
@@ -319,6 +387,14 @@
0, NULL, NULL, 0, NULL, -1, 0,
0, 0, 0, NOW(), '2099-12-31' FROM hrmcompany
+
+ INSERT INTO jcl_org_map ( id, ftype, fobjid, uuid,fclass, fclassname, fnumber, fname,
+ fleader, fleaderimg, fleadername, fleaderjobid, fleaderjob, fparentid,fobjparentid,
+ fplan, fonjob, fisvitual, fdatebegin, fdateend)
+ SELECT 0, 0, 0, uuid, 0, '行政维度', '00', companyname,
+ 0, NULL, NULL, 0, NULL, -1, 0,
+ 0, 0, 0, NOW(), '2099-12-31' FROM hrmcompany
+
delete from jcl_org_map where ftype =3 and fdateend > #{currentDate} and id not in (select a.FPARENTID from (select FPARENTID from jcl_org_map where ftype=4 and fdateend > #{currentDate}) a)
diff --git a/src/com/engine/organization/mapper/job/JobMapper.xml b/src/com/engine/organization/mapper/job/JobMapper.xml
index 5af7f1ce..663ef720 100644
--- a/src/com/engine/organization/mapper/job/JobMapper.xml
+++ b/src/com/engine/organization/mapper/job/JobMapper.xml
@@ -561,6 +561,10 @@
and NVL(ec_department,0) =
#{parentDepartment}
+
+ and COALESCE(ec_department,0) =
+ #{parentDepartment}
+
@@ -604,6 +608,26 @@
and t.work_authority like '%'||#{jobPO.workAuthority}||'%'
+
+
+ and t.job_no like '%'||#{jobPO.jobNo}||'%'
+
+
+ and h.jobtitlename like '%'||#{jobPO.jobTitleName}||'%'
+
+
+ and t.workplace like '%'||#{jobPO.workplace}||'%'
+
+
+ and t.description like '%'||#{jobPO.description}||'%'
+
+
+ and t.work_duty like '%'||#{jobPO.workDuty}||'%'
+
+
+ and t.work_authority like '%'||#{jobPO.workAuthority}||'%'
+
+
diff --git a/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml b/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml
index 4b683853..6269d647 100644
--- a/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml
+++ b/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml
@@ -389,6 +389,11 @@
AND t.lastname like '%'||#{resourcePO.lastName}||'%'
+
+
+ AND t.lastname like '%'||#{resourcePO.lastName}||'%'
+
+
AND t.lastname like '%'+#{resourcePO.lastName}+'%'
diff --git a/src/com/engine/organization/mapper/resource/ResourceMapper.xml b/src/com/engine/organization/mapper/resource/ResourceMapper.xml
index 99b673da..93500789 100644
--- a/src/com/engine/organization/mapper/resource/ResourceMapper.xml
+++ b/src/com/engine/organization/mapper/resource/ResourceMapper.xml
@@ -150,6 +150,11 @@
AND t.last_name like '%'||#{param.lastName}||'%'
+
+
+ AND t.last_name like '%'||#{param.lastName}||'%'
+
+
AND t.last_name like '%'+#{param.lastName}+'%'
diff --git a/src/com/engine/organization/mapper/scheme/GradeMapper.xml b/src/com/engine/organization/mapper/scheme/GradeMapper.xml
index b92e37c7..59fccd53 100644
--- a/src/com/engine/organization/mapper/scheme/GradeMapper.xml
+++ b/src/com/engine/organization/mapper/scheme/GradeMapper.xml
@@ -280,6 +280,9 @@
','||level_id||',' like '%,'||#{levelId}+',%'
+
+ ','||level_id||',' like '%,'||#{levelId}+',%'
+
','+level_id+',' like '%,'+cast(#{levelId} as varchar(20))+',%'
diff --git a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java
index 63590b1e..e9dfa751 100644
--- a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java
+++ b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java
@@ -6,11 +6,9 @@ import com.engine.core.impl.Service;
import com.engine.organization.entity.map.JclOrgMap;
import com.engine.organization.entity.scheme.po.GradePO;
import com.engine.organization.entity.scheme.po.LevelPO;
-import com.engine.organization.entity.staff.po.StaffPO;
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
import com.engine.organization.mapper.scheme.GradeMapper;
import com.engine.organization.mapper.scheme.LevelMapper;
-import com.engine.organization.mapper.staff.StaffMapper;
import com.engine.organization.service.OrgChartService;
import com.engine.organization.util.HasRightUtil;
import com.engine.organization.util.OrganizationDateUtil;
@@ -101,7 +99,11 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
String whereSql = " where 1 = 1 ";
if (DBType.isOracle()) {
whereSql += " and ((fdatebegin <= to_date('" + date + "','yyyy-MM-DD') and fdateend >= to_date('" + date + "','yyyy-MM-DD')) or (fdatebegin <= to_date('" + date + "','yyyy-MM-DD') and fdateend is null )) ";
- } else {
+ }
+ else if (DBType.isPG()) {
+ whereSql += " and ((TO_DATE(to_char(fdatebegin,'yyyy-MM-dd'),'yyyy-MM-dd') <= '" + date + "' and TO_DATE(to_char(fdateend,'yyyy-MM-dd'),'yyyy-MM-dd') >= '" + date + "') or (TO_DATE(to_char(fdatebegin,'yyyy-MM-dd'),'yyyy-MM-dd') <= '" + date + "' and fdateend is null )) ";
+ }
+ else {
whereSql += " and ((fdatebegin <= '" + date + "' and fdateend >= '" + date + "') or (fdatebegin <= '" + date + "' and fdateend is null )) ";
}
whereSql += " and fclass = " + fclass + " ";
@@ -141,7 +143,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
// 获取根节点
RecordSet rs = new RecordSet();
- rs.executeQuery("select id, fname, ftype, fparentid, fnumber, fobjid, fisvitual from jcl_org_map " + whereSql + whereItemSql);
+ String sql = "select id, fname, ftype, fparentid, fnumber, fobjid, fisvitual from jcl_org_map " + whereSql + whereItemSql;
+ rs.executeQuery(sql);
List