update t_fpm_templateinfo set fsmartgetvalset = 'fillplanamt' where fsmartgetvalset = ' ';

INSERT INTO t_fpm_tpl_reporttypeentry
(fid, fentryid ,freporttype)
select fid, fpkid,fbasedataid from t_fpm_template_reporttype where fid not in(select distinct fid from t_fpm_tpl_reporttypeentry);

update t_fpm_templateinfo_bak set fsmartgetvalset = 'fillplanamt' where fsmartgetvalset = ' ';

INSERT INTO t_fpm_tplbak_retypeentry
(fid, fentryid ,freporttype)
select fid, fpkid,fbasedataid from t_fpm_tplbak_reporttype where fid not in(select distinct fid from t_fpm_tplbak_retypeentry);