问题描述:资产卡片清理时提示不符合清理条件问题分析:卡片后台状态异常--检查余额表是否丢失数据,结果非0即代表丢失;selectCount(FID)fromt_fa_facurcardwherefidnotin(selectffacurcardidfromt_fa_faaccountbalancewherefcompanyORGunitid=(selectfidfromt_org_companywherefnumber='组织编码')andfperiodidin(selectfidfromt_bd_periodwherefnumber=期间))andfcompanyid=(selectfidfromt_org_companywherefnumber='组织编码')AndFperiodIDIn(selectfidfromt_bd_periodwherefnumber<=期间)AndFCheckedStatus=2--检查月结表是否丢失数据,结果非0即代表丢失;月结表不需要查询当期,需要查询上一期间;selectCount(FID),Count(FID)fromt_fa_facurcardwherefidnotin(selectffacurcardidfromt_fa_faMonCardwhereFCOMPANYID=(selectfidfromt_org_companywherefnumber='组织编码')andffaperiodidin(selectfidfromt_bd_periodwherefnumber=期间))andfcompanyid=(selectfidfromt_org_companywherefnumber='组织编码')AndFperiodIDIn(selectfidfromt_bd_periodwherefnumber<=期间)AndFCheckedStatus=2上述脚本执行后如果查出数据异常,根据问题情况选择执行下述语句余额表数据修复--余额表复制上一期补录数据,当期新增卡片缺失则此脚本不合适insertintot_fa_faaccountbalanceselectnewbosid('B719F3F3'),b.frealendbalancefor,0,0,b.frealendbalancefor,b.fdepreendbalancefor,0,0,b.fdepreendbalancefor,c.fAccuDeprTYear,b.fdecvalueendbalancefor,0,0,b.fdecvalueendbalancefor,b.fevalueendbalancefor,0,0,b.fevalueendbalancefor,b.fcreatorid,b.fcreatetime,b.flastupdateuserid,b.flastupdatetime,nextPd.fid,b.fcurrencyid,b.fcompanyorgunitid,b.ffacurcardid,0,b.fcontrolunitidfromt_fa_faaccountbalancebinnerjoint_org_companycponcp.fid=b.fcompanyorgunitidinnerjoint_fa_facurcardconc.fid=b.ffacurcardidinnerjoint_bd_periodpdonpd.fid=b.fperiodidinnerjoint_bd_periodnextPdonpd.ftypeid=nextPd.ftypeidinnerjoint_bd_periodtypeptonpt.fid=pd.ftypeidwherecp.fnumber='组织编码'andpd.fnumber=上一期期间andnextPd.fnumber=当期期间AndC.FIDNotIn(selectffacurcardidfromt_fa_faaccountbalancewherefcompanyORGunitid=(selectfidfromt_org_companywherefnumber='组织编码')andfperiodidin(selectfidfromt_bd_periodwherefnumber=当期期间))月结表数据修复