diff --git a/src/com/engine/organization/mapper/jclorgmap/JclOrgMapper.xml b/src/com/engine/organization/mapper/jclorgmap/JclOrgMapper.xml
index 9c15887c..6d46360c 100644
--- a/src/com/engine/organization/mapper/jclorgmap/JclOrgMapper.xml
+++ b/src/com/engine/organization/mapper/jclorgmap/JclOrgMapper.xml
@@ -127,7 +127,7 @@
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'
+ 0,TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd'),'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
@@ -205,11 +205,11 @@
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'
+ COALESCE(e.fcnt,0),COALESCE(f.fcnt,0),0,TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd'),'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)
+ where time_start<=TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd') and time_end > TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd') 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
@@ -291,7 +291,7 @@
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'
+ 0,0,0,TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd'),'2099-12-31'
from
HrmDepartment as a
left join hrmdepartmentdefined as b on a.id=b.deptid
@@ -349,7 +349,7 @@
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
+ 0,0,0,TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd'),'2099-12-31' from hrmsubcompany as a
where COALESCE(a.canceled,'0') <> '1'
@@ -393,7 +393,7 @@
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
+ 0, 0, 0, TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd'), '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/trigger/CompTriggerMapper.java b/src/com/engine/organization/mapper/trigger/CompTriggerMapper.java
deleted file mode 100644
index 4ad23e77..00000000
--- a/src/com/engine/organization/mapper/trigger/CompTriggerMapper.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.engine.organization.mapper.trigger;
-
-
-import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
-import org.apache.ibatis.annotations.Param;
-import weaver.hrm.passwordprotection.domain.HrmResource;
-
-import java.sql.Date;
-
-
-/**
- * @Author dxfeng
- * @Date 2022/8/30
- * @Version V1.0
- **/
-public interface CompTriggerMapper {
- Integer getEcCompanyIdByUuid(@Param("uuid") String uuid);
-
- HrmResource getHrmResourceById(@Param("id") Integer id);
-
- String getJobTitleMarkById(@Param("id") Integer id);
-
- Integer sumStaffNum(@Param("fdatebegin") Date fdatebegin, @Param("compId") Integer compId);
-
- int deleteMap(@Param("ftype") Integer ftype, @Param("fobjid") Integer fobjid, @Param("fdatebegin") Date fdatebegin);
-
- int updateMap(@Param("ftype") Integer ftype, @Param("fobjid") Integer fobjid, @Param("fdatebegin") Date fdatebegin, @Param("fdate") Date fdate);
-
- HrmResourcePO getResourceByEcId(@Param("ecId") Integer ecId);
-}
diff --git a/src/com/engine/organization/mapper/trigger/CompTriggerMapper.xml b/src/com/engine/organization/mapper/trigger/CompTriggerMapper.xml
deleted file mode 100644
index 7204e3cb..00000000
--- a/src/com/engine/organization/mapper/trigger/CompTriggerMapper.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
- update jcl_org_map
-
- fdateend=#{fdate},
-
- where ftype=#{ftype} and fobjid=#{fobjid} and fdateend > #{fdatebegin}
-
-
- delete
- from jcl_org_map
- where ftype = #{ftype}
- and fobjid = #{fobjid}
- and fdatebegin = #{fdatebegin}
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/com/engine/organization/mapper/trigger/DepartmentTriggerMapper.java b/src/com/engine/organization/mapper/trigger/DepartmentTriggerMapper.java
deleted file mode 100644
index 482e1da6..00000000
--- a/src/com/engine/organization/mapper/trigger/DepartmentTriggerMapper.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.engine.organization.mapper.trigger;
-
-
-import org.apache.ibatis.annotations.Param;
-
-import java.sql.Date;
-
-/**
- * @Author dxfeng
- * @Date 2022/8/30
- * @Version V1.0
- **/
-public interface DepartmentTriggerMapper {
- Integer getEcDepartmentIdByUuid(@Param("uuid") String uuid);
-
- Integer sumStaffNum(@Param("fdatebegin") Date fdatebegin, @Param("departmentId") Integer departmentId);
-
-
- Integer countHrmResource(@Param("departmentid") Integer departmentid);
-}
diff --git a/src/com/engine/organization/mapper/trigger/DepartmentTriggerMapper.xml b/src/com/engine/organization/mapper/trigger/DepartmentTriggerMapper.xml
deleted file mode 100644
index 6e74a7b6..00000000
--- a/src/com/engine/organization/mapper/trigger/DepartmentTriggerMapper.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/com/engine/organization/mapper/trigger/GroupTriggerMapper.java b/src/com/engine/organization/mapper/trigger/GroupTriggerMapper.java
deleted file mode 100644
index ef14a4ce..00000000
--- a/src/com/engine/organization/mapper/trigger/GroupTriggerMapper.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.engine.organization.mapper.trigger;
-
-
-import org.apache.ibatis.annotations.Param;
-
-import java.sql.Date;
-
-/**
- * @Author dxfeng
- * @Date 2022/8/30
- * @Version V1.0
- **/
-public interface GroupTriggerMapper {
-
- Integer getInfoValue(@Param("id") Integer id);
-
- Integer sumStaffNum(@Param("fdatebegin") Date fdatebegin);
-
- Integer countHrmResource();
-
- int deleteMap(@Param("fobjid") Integer fobjid, @Param("fdatebegin") Date fdatebegin);
-
- int updateMap(@Param("fobjid") Integer fobjid, @Param("fdatebegin") Date fdatebegin, @Param("fdate") Date fdate);
-}
diff --git a/src/com/engine/organization/mapper/trigger/GroupTriggerMapper.xml b/src/com/engine/organization/mapper/trigger/GroupTriggerMapper.xml
deleted file mode 100644
index 41087495..00000000
--- a/src/com/engine/organization/mapper/trigger/GroupTriggerMapper.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
- update jcl_org_map
- set fdateend=#{fdate}
- where fobjid = #{fobjid}
- and fdateend > #{fdatebegin}
-
-
- delete
- from jcl_org_map
- where fobjid = 0
- and fdatebegin = #{fdatebegin}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/com/engine/organization/mapper/trigger/HrmResourceTriggerMapper.java b/src/com/engine/organization/mapper/trigger/HrmResourceTriggerMapper.java
deleted file mode 100644
index 2fb269fe..00000000
--- a/src/com/engine/organization/mapper/trigger/HrmResourceTriggerMapper.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.engine.organization.mapper.trigger;
-
-import org.apache.ibatis.annotations.Param;
-import weaver.hrm.passwordprotection.domain.HrmResource;
-
-import java.sql.Date;
-import java.util.List;
-
-/**
- * @author:dxfeng
- * @createTime: 2022/09/01
- * @version: 1.0
- */
-public interface HrmResourceTriggerMapper {
- HrmResource getHrmResource(@Param("id") Long id);
-
- List getFidsByFleader(@Param("fLeader") String fLeader, @Param("currentDate") Date currentDate);
-
- int updateLeaders(@Param("currentDate") Date currentDate,@Param("fLeader") String fLeader, @Param("fLeaderImg") String fLeaderImg, @Param("fLeaderName") String fLeaderName, @Param("fLeaderJobId") Integer fLeaderJobId, @Param("fLeaderJob") String fLeaderJob, @Param("fLeaderLv") String fLeaderLv, @Param("fLeaderSt") String fLeaderSt);
-
-}
diff --git a/src/com/engine/organization/mapper/trigger/HrmResourceTriggerMapper.xml b/src/com/engine/organization/mapper/trigger/HrmResourceTriggerMapper.xml
deleted file mode 100644
index cd09e5ac..00000000
--- a/src/com/engine/organization/mapper/trigger/HrmResourceTriggerMapper.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
- update jcl_org_map
-
- fleaderimg = #{fLeaderImg},
- fleadername = #{fLeaderName},
- fleaderjobid = #{fLeaderJobId},
- fleaderjob = #{fLeaderJob},
- fleaderlv = #{fLeaderLv},
- fleaderst = #{fLeaderSt},
-
- where fleader = #{fLeader} AND fdatebegin <= #{currentDate}
- AND fdateend >= #{currentDate}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/com/engine/organization/mapper/trigger/JobTriggerMapper.java b/src/com/engine/organization/mapper/trigger/JobTriggerMapper.java
deleted file mode 100644
index 54fcc02a..00000000
--- a/src/com/engine/organization/mapper/trigger/JobTriggerMapper.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.engine.organization.mapper.trigger;
-
-
-import org.apache.ibatis.annotations.Param;
-
-import java.sql.Date;
-
-/**
- * @Author dxfeng
- * @Date 2022/8/30
- * @Version V1.0
- **/
-public interface JobTriggerMapper {
- Integer sumStaffNum(@Param("fdatebegin") Date fdatebegin, @Param("jobId") Integer jobId);
-}
diff --git a/src/com/engine/organization/mapper/trigger/JobTriggerMapper.xml b/src/com/engine/organization/mapper/trigger/JobTriggerMapper.xml
deleted file mode 100644
index 7beb0f61..00000000
--- a/src/com/engine/organization/mapper/trigger/JobTriggerMapper.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/com/engine/organization/mapper/trigger/StaffTriggerMapper.java b/src/com/engine/organization/mapper/trigger/StaffTriggerMapper.java
deleted file mode 100644
index 3b27ad8d..00000000
--- a/src/com/engine/organization/mapper/trigger/StaffTriggerMapper.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.engine.organization.mapper.trigger;
-
-import org.apache.ibatis.annotations.Param;
-
-import java.sql.Date;
-
-/**
- * @author:dxfeng
- * @createTime: 2022/09/21
- * @version: 1.0
- */
-public interface StaffTriggerMapper {
- //Integer countCompanyUsers(@Param("ecCompanyId") String ecCompanyId);
-
- //Integer countDepartmentUsers(@Param("ecDepartmentId") String ecDepartmentId);
-
- //Integer countJobUsers(@Param("jobTitle") String jobTitle);
-
- Integer countOnJobByJObId(@Param("jobId") String jobId);
-
- //Integer countAllUsers();
-
- Integer countCompanyStaffNum(@Param("currentDate") Date currentDate, @Param("companyId") String companyId);
-
- Integer countDepartmentStaffNum(@Param("currentDate") Date currentDate, @Param("departmentId") String departmentId);
-
- Integer countJobStaffNum(@Param("currentDate") Date currentDate, @Param("jobId") String jobId);
-
- Integer updateOrgStaffs(@Param("currentDate") Date currentDate, @Param("fType") String fType, @Param("fObjId") String fObjId, @Param("fPlan") Integer fPlan, @Param("fOnJob") Integer fOnJob);
-
- String getIdByObjIdAndType(@Param("currentDate") Date currentDate, @Param("fObjId") String fObjId, @Param("fType") String fType);
-
- Integer sumPlanByParentId(@Param("currentDate") Date currentDate, @Param("parentId") String parentId);
-
- Integer sumOnJobByParentId(@Param("currentDate") Date currentDate, @Param("parentId") String parentId);
-}
diff --git a/src/com/engine/organization/mapper/trigger/StaffTriggerMapper.xml b/src/com/engine/organization/mapper/trigger/StaffTriggerMapper.xml
deleted file mode 100644
index a74be740..00000000
--- a/src/com/engine/organization/mapper/trigger/StaffTriggerMapper.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
- update jcl_org_map
-
- FPLAN = #{fPlan},
- FONJOB = #{fOnJob},
-
- where FTYPE =#{fType} and FOBJID=#{fObjId}
- AND FDATEBEGIN <= #{currentDate}
- AND FDATEEND >= #{currentDate}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java
index e9dfa751..762dd1af 100644
--- a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java
+++ b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java
@@ -99,11 +99,7 @@ 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 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 {
+ }else {
whereSql += " and ((fdatebegin <= '" + date + "' and fdateend >= '" + date + "') or (fdatebegin <= '" + date + "' and fdateend is null )) ";
}
whereSql += " and fclass = " + fclass + " ";
@@ -230,9 +226,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
String whereSql = " where 1 = 1 ";
if (DBType.isOracle()) {
whereSql += " and ((t.fdatebegin <= to_date('" + date + "','yyyy-MM-DD') and t.fdateend >= to_date('" + date + "','yyyy-MM-DD')) or (t.fdatebegin <= to_date('" + date + "','yyyy-MM-DD') and t.fdateend is null )) ";
- }else if(DBType.isPG()){
- whereSql += " and ((TO_DATE(to_char(t.fdatebegin,'yyyy-MM-dd'),'yyyy-MM-dd') <= '" + date + "' and TO_DATE(to_char(t.fdateend,'yyyy-MM-dd'),'yyyy-MM-dd') >= '" + date + "') or (TO_DATE(to_char(t.fdatebegin,'yyyy-MM-dd'),'yyyy-MM-dd') <= '" + date + "' and t.fdateend is null )) ";
- } else {
+ }else {
whereSql += " and ((t.fdatebegin <= '" + date + "' and t.fdateend >= '" + date + "') or (t.fdatebegin <= '" + date + "' and t.fdateend is null )) ";
}
whereSql += " and t.fclass = " + fclass + " ";
diff --git a/src/com/engine/organization/util/db/DBType.java b/src/com/engine/organization/util/db/DBType.java
index 5b388a54..35fe3346 100644
--- a/src/com/engine/organization/util/db/DBType.java
+++ b/src/com/engine/organization/util/db/DBType.java
@@ -109,9 +109,5 @@ public enum DBType implements DBOperateAdapter {
return DBType.get(new RecordSet().getDBType()).equals(DBType.ORACLE);
}
- public static boolean isPG() {
- return DBType.get(new RecordSet().getDBType()).equals(DBType.POSTGRESQL);
- }
-
}