/** 更新是否叶子节点 */
update t_org_structure p set fisleaf = 1;
update t_org_structure p set fisleaf = 0 where EXISTS(select fparentid from (select c.fparentid,c.FVIEWID from t_org_structure c) as tmp where tmp.fviewid = p.fviewid and p.forgid = tmp.fparentid);
/** 更新标志 */
update T_ORG_Structure set fisbizunit = '1',FISSTATSUM='0' where fisleaf = '1';
update T_ORG_Structure set fisbizunit = '0',FISSTATSUM='1' where fisleaf = '0';
update t_org_org set fisbizorg = '0';
update t_org_org o set fisbizorg = '1' where EXISTS (SELECT 1 from t_org_structure where o.FID = FORGID AND fviewid not in (1));