-- 行政组织
 update t_org_org o set fisadministrative ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 1);
-- 行政组织
 update t_org_org o set fisadministrative ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 1);
-- 采购组织
 update t_org_org o set fispurchase ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 2);
-- 采购组织
 update t_org_org o set fispurchase ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 2);
-- 销售组织
 update t_org_org o set fissale ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 3);
-- 销售组织
 update t_org_org o set fissale ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 3);
-- 生产组织
 update t_org_org o set fisproduce ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 4);
-- 生产组织
 update t_org_org o set fisproduce ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 4);
-- 库存组织
 update t_org_org o set fisinventory ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 5);
-- 库存组织
 update t_org_org o set fisinventory ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 5);
-- 质检组织
 update t_org_org o set fisqc ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 6);
-- 质检组织
 update t_org_org o set fisqc ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 6);
-- 结算组织
 update t_org_org o set fissettlement ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 7);
-- 结算组织
 update t_org_org o set fissettlement ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 7);
-- 资金组织
 update t_org_org o set fisbankroll ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 8);
-- 资金组织
 update t_org_org o set fisbankroll ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 8);
-- 资产组织
 update t_org_org o set fisasset ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 9);
-- 资产组织
 update t_org_org o set fisasset ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 9);
-- 核算组织
 update t_org_org o set fisaccounting ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 10);
-- 核算组织
 update t_org_org o set fisaccounting ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 10);
-- HR组织
 update t_org_org o set fishr ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 11);
-- HR组织
 update t_org_org o set fishr ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 11);
-- 共享中心
 update t_org_org o set fisscc ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 12);
-- 共享中心
 update t_org_org o set fisscc ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 12);
-- 预算组织
 update t_org_org o set fisbudget ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 13);
-- 预算组织
 update t_org_org o set fisbudget ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 13);
-- 控制单元
 update t_org_org o set fiscontrolunit ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 14);
-- 控制单元
 update t_org_org o set fiscontrolunit ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 14);
-- 组织规划责任单位
 update t_org_org o set fishrod ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 21);
-- 组织规划责任单位
 update t_org_org o set fishrod ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 21);
-- 组织绩效中心
 update t_org_org o set fishrop ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 22);
-- 组织绩效中心
 update t_org_org o set fishrop ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 22);
-- 编制/预算组织
 update t_org_org o set fishrbg ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 23);
-- 编制/预算组织
 update t_org_org o set fishrbg ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 23);
-- 人才招聘组织
 update t_org_org o set fishrtr ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 24);
-- 人才招聘组织
 update t_org_org o set fishrtr ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 24);
-- 人事组织
 update t_org_org o set fishrpa ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 25);
-- 人事组织
 update t_org_org o set fishrpa ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 25);
-- 考勤组织
 update t_org_org o set fishrwt ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 26);
-- 考勤组织
 update t_org_org o set fishrwt ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 26);
-- 薪酬管理组织
 update t_org_org o set fishrcmp ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 27);
-- 薪酬管理组织
 update t_org_org o set fishrcmp ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 27);
-- 定调薪组织
 update t_org_org o set fishrbs ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 28);
-- 定调薪组织
 update t_org_org o set fishrbs ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 28);
-- 算发薪组织
 update t_org_org o set fishrpay ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 29);
-- 算发薪组织
 update t_org_org o set fishrpay ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 29);
-- 个税组织
 update t_org_org o set fishrtax ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 30);
-- 个税组织
 update t_org_org o set fishrtax ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 30);
-- 社保公积金组织
 update t_org_org o set fishrsi ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 31);
-- 社保公积金组织
 update t_org_org o set fishrsi ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 31);
-- 长期激励组织
 update t_org_org o set fishrlti ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 32);
-- 长期激励组织
 update t_org_org o set fishrlti ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 32);
-- 奖金组织
 update t_org_org o set fishrbm ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 33);
-- 奖金组织
 update t_org_org o set fishrbm ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 33);
-- 人才管理组织
 update t_org_org o set fishrtd ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 34);
-- 人才管理组织
 update t_org_org o set fishrtd ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 34);
-- 培训学习组织
 update t_org_org o set fishrtl ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 35);
-- 培训学习组织
 update t_org_org o set fishrtl ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 35);
-- 个人绩效组织
 update t_org_org o set fishrip ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 36);
-- 个人绩效组织
 update t_org_org o set fishrip ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 36);
-- HR共享服务组织
 update t_org_org o set fishrssc ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 37);
-- HR共享服务组织
 update t_org_org o set fishrssc ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 37);
-- 人力成本组织
 update t_org_org o set fishrlc ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 38);
-- 人力成本组织
 update t_org_org o set fishrlc ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 38);
-- 假期组织
 update t_org_org o set fishrab ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 39);
-- 假期组织
 update t_org_org o set fishrab ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 39);
-- 税务组织
 update t_org_org o set fistax ='0' where NOT EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 40);
-- 税务组织
 update t_org_org o set fistax ='1' where EXISTS (select 1 from t_org_structure s where s.forgid = o.fid and fviewid = 40);