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)
@ -101,7 +99,11 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
StringwhereSql=" 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{
}
elseif(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 {
@ -227,6 +230,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
StringwhereSql=" 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 )) ";
}elseif(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{
whereSql+=" and ((t.fdatebegin <= '"+date+"' and t.fdateend >= '"+date+"') or (t.fdatebegin <= '"+date+"' and t.fdateend is null )) ";
}
@ -393,7 +398,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {