
-- 处理年报A000000，A100000，A105050，A105060 比例为小数的数据升级
update t_tccit_qysds_a000000 set ffzjdnsbl = ffzjdnsbl/100 where ffzjdnsbl is not null and ffzjdnsbl > 1;

update t_tccit_qysds_a100000 set fsl1 = fsl1/100 where fsl1 is not null  and fsl1 > 1;

/*dialect*/update t_tccit_qysds_a000000_gd set ftzbl =round(CAST(ftzbl AS DECIMAL(5,2))/100,2) where  ftzbl != ' ' and ftzbl != '' and ftzbl is not null  and CAST(ftzbl AS DECIMAL(5,2)) > 1;


update t_tccit_qysds_a105050 set fzgflfzc = fzgflfzc/100 where fewblxh = '3' and  fzgflfzc is not null and fzgflfzc > 1;
update t_tccit_qysds_a105050 set fblkcjyjf = fblkcjyjf/100 where fewblxh = '3' and  fblkcjyjf is not null and fblkcjyjf > 1;
update t_tccit_qysds_a105050 set fqekcpxfy = fqekcpxfy/100 where fewblxh = '3' and  fqekcpxfy is not null and fqekcpxfy > 1;
update t_tccit_qysds_a105050 set fghjfzc = fghjfzc/100 where fewblxh = '3' and  fghjfzc is not null and fghjfzc > 1;
update t_tccit_qysds_a105050 set fbcylbx = fbcylbx/100 where fewblxh = '3' and  fbcylbx is not null and fbcylbx > 1;
update t_tccit_qysds_a105050 set fbcyiliaobx = fbcyiliaobx/100 where fewblxh = '3' and  fbcyiliaobx is not null and fbcyiliaobx > 1;

update t_tccit_qysds_a105060 set fssgdkce = fssgdkce/100 where  fewblxh = '1' and fssgdkce is not null and fssgdkce > 1;
update t_tccit_qysds_a105060 set fssgdkce = fssgdkce/100 where  fewblxh = '2' and fssgdkce is not null and fssgdkce > 1;


-- 处理年报A000000，105所属国民经济行业（填写代码）基础资料数据升级
update t_tccit_qysds_a000000_gd set fgjbasedata =(select fentryid from t_tpo_ictm_bizdef_entry where fprojectname=fguoji and fguoji != ' ' and fguoji != '' and fguoji is not null ) where fgjbasedata is null;

update t_tccit_qysds_a000000 set fssgmjjhybasedata = (select fid from  t_tpo_tcvat_code_tree where fnumber = fssgmjjhy and fssgmjjhy != ' ' and fssgmjjhy != '' and fssgmjjhy is not null) where fssgmjjhybasedata is null;


-- 处理年报A107011，投资性质基础资料数据升级
update t_tccit_qysds_a107011 set ftzxzbasedata = 1646260294139589632 where ftzxz = '直接投资居民企业' and ftzxzbasedata is null;
update t_tccit_qysds_a107011 set ftzxzbasedata = 1646260294139589633 where ftzxz = '股票投资 (不含H股)'and ftzxzbasedata is null;
update t_tccit_qysds_a107011 set ftzxzbasedata = 1646260294139589634 where ftzxz = '股票投资 (沪港通H股投资)'and ftzxzbasedata is null;
update t_tccit_qysds_a107011 set ftzxzbasedata = 1646260294139589635 where ftzxz = '股票投资 (深港通H股投资)'and ftzxzbasedata is null;
update t_tccit_qysds_a107011 set ftzxzbasedata = 1646260294139589636 where ftzxz = '创新企业CDR'and ftzxzbasedata is null;
update t_tccit_qysds_a107011 set ftzxzbasedata = 1646260294139589637 where ftzxz = '永续债 (权益性)'and ftzxzbasedata is null;

