同步工具(同步云之家)数据问题的常用后台sql处理原创
金蝶云社区-云社区用户W6nS4886
云社区用户W6nS4886
4人赞赏了该文章 428次浏览 未经作者许可,禁止转载编辑于2020年08月29日 18:43:02

用administrator 打开 EAS客户端 查询分析器:


一、人员数据同步云之家:


查询一个云之家人员映射了两个eas人员的数据 select fxtid,count(*) from t_pm_easxtusermap where fxtid is not null  group by fxtid having count(*)>1


查询中间表中存在重复手机号的记录:

select fcell from t_pm_easxtusermap where fcell is not null  group by fcell having count(*)>1

删除中间表中重复手机号的记录:

delete from t_pm_easxtusermap where fcell in (select fcell from t_pm_easxtusermap where fcell is not null  group by fcell having count(*)>1 )


查询职员表中不存在 在中间表却存在的脏数据:

select * from t_pm_easxtusermap where fpersonid not in (select fid from t_bd_person)

删除职员表中不存在 在中间表却存在的脏数据:

delete from t_pm_easxtusermap where fpersonid not in (select fid from t_bd_person)


执行以上sql 后,去eas 网页端 同步云之家的功能页面 点击“数据更新”后 再次同步! 

可以解决 60%以上的 同步云之家“人员”数据同步的问题


---------------------------------------------------------------------------------------------------------------


二、组织数据同步云之家:


查询中间表中一个云之家组织绑定多个EAS组织的记录:

select fxtorgid from t_pm_easxtorgmap where fxtorgid is not null  group by fxtorgid having count(*)>1

删除中间表中一个云之家组织绑定多个EAS组织的记录:

delete from t_pm_easxtorgmap where fxtorgid in (select fxtorgid from t_pm_easxtorgmap where fxtorgid is not null  group by fcell having count(*)>1 )


查询行政组织表中不存在 在中间表却存在的脏数据:

select * from t_pm_easxtorgmap where feasorgid not in (select fid from t_org_admin)

删除行政组织表中不存在 在中间表却存在的脏数据:

delete from t_pm_easxtorgmap where feasorgid not in (select fid from t_org_admin)


执行以上sql 后,去eas 网页端 同步云之家的功能页面 点击“数据更新”后 再次同步! 

可以解决 60%以上的 同步云之家“组织”数据同步的问题


赞 4