本人q:877439296。固定资产实物清单,过滤所有公司,查询只到99%就不动了。之后提示timeout。以下是错误提示
select * into TMP06C6412FD2AC11E880C544A8422 from (select TOP 1000000 C.FALTERID,TL.FNAME FASSETTYPENAME,TL.FID FASSETTYPEID, C.FNUMBER FNUMBER, CL.FNAME, UL.FNAME FUNITID, 0 AS FISSUMMARY,
C.FQUANTITY AS FCQUANTITY, SL.FNAME FASSETSTATUSID, AL.FNAME FALTERMODEID, C.FBEGINUSEDATE AS FBEGINUSEDATE,
FML.FCAPTION FSOURCE,U.FPRECISION,
ORGL.FNAME FASSETORGID, ORGL2.FNAME FOWNERORGID, C.FREMARK ,O.FAssetNO,O.FBARCODE, O.FSPECIFICATION, PL.FNAME FPOSITIONID, O.FQUANTITY AS FOQUANTITY, OL.FLOCALITY,SL2.Fname FSUPPLIERID,OL.FMANUFACTURER, FISINSURED = Case When O.FISINSURED=1 then '是' else '否' end ,F.FORGVAL,
FORIGINALCOST,
FINPUTTAX,
FEXPENSEVALUE,
FEXPENSETAX,
F.FACCUMDEVALUE,
FPURCHASEVALUE,
CASE WHEN B.FYEAR<2018 THEN 0 ELSE B.FCURYEARDEPR END AS FCURYEARDEPR,
B.FDEPR,
FPURCHASEDEPR,
CASE WHEN B.FASSETCURSTATUS='4' AND B.FYEARPERIOD <> 201809 THEN 0 ELSE FORGVALINC - FORGVALDEC END AS FORGVALCHANGE,
((FORGVALP + FORGVALINC - FORGVALDEC) -
(FACCUMDEPRP + FACCUMDEPRINC - FACCUMDEPRDEC + FDEPR) -
(FDECPREP + FDECPREINC - FDECPREDEC)) AS FVALUE,
((FORGVALP + FORGVALINC - FORGVALDEC) -
(FACCUMDEPRP + FACCUMDEPRINC - FACCUMDEPRDEC + FDEPR)) AS FNETVALUE,
FRESIDUALVALUE,
(FACCUMDEPRP + FACCUMDEPRINC - FACCUMDEPRDEC + FDEPR) AS FACCUMDEPR,
((FORGVALP + FORGVALINC - FORGVALDEC) -
(FACCUMDEPRP + FACCUMDEPRINC - FACCUMDEPRDEC + FDEPR) -
(FDECPREP + FDECPREINC - FDECPREDEC) - F.FRESIDUALVALUE) AS FDEPRREMAIN,
FACCTDATE,
F.FDEPRMETHOD,
FLIFEPERIODS,
B.FDEPRPERIODS,
(CASE WHEN ISNULL(USEDPERIOD.FDEPRCOUNT,0) + F.FUSEDPERIODS>0 THEN ISNULL(USEDPERIOD.FDEPRCOUNT,0) + F.FUSEDPERIODS-1 ELSE 0 END)AS FUSEDPERIODS ,
UL2.FNAME AS FWORKLOADUNITNAME
,CASE WHEN F.FWORKLOADUNITID >0 THEN
U2.FPRECISION ELSE 0 END AS FWORDLOADPRECION,
F.FPREDICTWORKLOAD,
B.FDEPRWORKLOAD,
B.FDEPRWORKLOAD - F.FINITIALDEPRWORKLOAD + F.FINITIALTOTALWORKLOAD AS FUSEDWORKLOAD,
FML2.FCAPTION FDEPRMETHODNAME,
2 FAMOUNTDIGITS ,
CUL.FNAME FCURRENCY , ROW_NUMBER() OVER(ORDER BY C.FOWNERORGID ASC,C.FNUMBER ASC,CL.FNAME ASC,FASSETTYPEID ASC ) FIDENTITYID from T_FA_CARD C LEFT JOIN T_FA_CARD_L CL ON C.FALTERID = CL.FALTERID AND CL.FLOCALEID = 2052
LEFT JOIN T_FA_ASSETTYPE_L TL ON C.FASSETTYPEID = TL.FID AND TL.FLOCALEID=2052
LEFT JOIN T_BD_UNIT U ON C.FUNITID=U.FUNITID
LEFT JOIN T_BD_UNIT_L UL ON C.FUNITID = UL.FUNITID AND UL.FLOCALEID=2052
LEFT JOIN T_FA_STATUS_L SL ON C.FASSETSTATUSID = SL.FID AND SL.FLOCALEID=2052
LEFT JOIN T_FA_ALTERMODE_L AL ON C.FALTERMODEID = AL.FID AND AL.FLOCALEID=2052
INNER JOIN T_FA_FINANCE F ON F.FALTERID = C.FALTERID
LEFT JOIN T_META_FORMENUMITEM FM ON FM.FID = '2a1f2c6d-7515-450f-a3dc-cc46ea4df67c' AND FM.FVALUE=C.FSOURCE
LEFT JOIN T_META_FORMENUMITEM_L FML ON FML.FLOCALEID = 2052 AND FM.FENUMID = FML.FENUMID
LEFT JOIN T_ORG_ORGANIZATIONS_L ORGL ON ORGL.FORGID = C.FASSETORGID AND ORGL.FLOCALEID = 2052
LEFT JOIN T_ORG_ORGANIZATIONS_L ORGL2 ON ORGL2.FORGID = C.FOWNERORGID AND ORGL2.FLOCALEID = 2052
INNER JOIN T_FA_CARDDETAIL O ON C.FALTERID = O.FALTERID
LEFT JOIN T_FA_CARDDETAIL_L OL ON O.FID = OL.FID AND OL.FLOCALEID=CL.FLOCALEID
LEFT JOIN T_FA_POSITION_L PL ON O.FPOSITIONID = PL.FID AND PL.FLOCALEID=CL.FLOCALEID
LEFT JOIN T_BD_SUPPLIER_L SL2 ON SL2.FSUPPLIERID = O.FSUPPLIERID AND SL2.FLOCALEID = CL.FLOCALEID
LEFT JOIN T_META_FORMENUMITEM FM2 ON FM2.FID = '82c2b456-9b03-42fe-a31c-a848a6a6b7d2' AND FM2.FVALUE = F.FDEPRMETHOD
LEFT JOIN T_META_FORMENUMITEM_L FML2 ON FM2.FENUMID = FML2.FENUMID AND FML2.FLOCALEID = CL.FLOCALEID
LEFT JOIN T_BD_CURRENCY_L CUL ON CUL.FCURRENCYID = F.FCURRENCYID AND CUL.FLOCALEID = CL.FLOCALEID
LEFT JOIN T_BD_UNIT_L UL2 ON UL2.FUNITID=F.FWORKLOADUNITID AND UL2.FLOCALEID = CL.FLOCALEID
LEFT JOIN T_BD_UNIT U2 ON U2.FUNITID=F.FWORKLOADUNITID
LEFT JOIN T_FA_BALANCE B
ON C.FASSETID = B.FASSETID
AND F.FACCTPOLICYID = B.FACCTPOLICYID
INNER JOIN TMP06C64130D2AC11E880C544A8422 TMYEARPERIOD
ON TMYEARPERIOD.FASSETID=C.FASSETID AND TMYEARPERIOD.FYEARPERIOD=B.FYEARPERIOD
LEFT JOIN (SELECT T1.FALTERID,CASE WHEN MIN(D.FCLEARDEPRPOLICY)='2' AND MIN(T1.FASSETCURSTATUS) ='4' THEN COUNT(T3.FACCTPOLICYID)+1 ELSE COUNT(T3.FACCTPOLICYID) END AS FDEPRCOUNT
FROM T_FA_CARD T1
INNER JOIN T_FA_BALANCE T2 ON T2.FASSETID=T1.FASSETID AND T2.FISNEWREC=2
INNER JOIN T_FA_BALANCE T3 ON T1.FASSETID = T3.FASSETID AND T2.FACCTPOLICYID = T3.FACCTPOLICYID AND T2.FYEARPERIOD >=T3.FYEARPERIOD
AND T2.FACCTPOLICYID = 1 AND T3.FYEARPERIOD<=201809
INNER JOIN T_FA_ACCTPOLICY P ON T2.FACCTPOLICYID=P.FACCTPOLICYID
INNER JOIN T_FA_ACCTPOLICYASSET E ON (P.FACCTPOLICYID = E.FACCTPOLICYID AND E.FASSETTYPEID =T1.FASSETTYPEID)
INNER JOIN T_FA_DEPRPOLICY D ON D.FPOLICYID = E.FDEPRPOLICYID
GROUP BY T1.FALTERID
) USEDPERIOD ON USEDPERIOD.FALTERID=C.FALTERID
INNER JOIN (SELECT MAX(C.FALTERID) AS FALTERID FROM T_FA_FINANCE F INNER JOIN T_FA_CARD C
ON C.FALTERID=F.FALTERID AND F.FYEARPERIOD<=201809 GROUP BY C.FASSETID
)FIN ON FIN.FALTERID=USEDPERIOD.FALTERID where C.FAssetCurStatus <= '4' AND C.FAssetOrgID in (1,100004,100005,100006,100007,100008,100009,100010,100011,100012,100013,100014,100015,100016,100017,100018,100019,101905,102014,102063,102065,102105,102114,102196,102441,102454,102900,102902,102968,103397,103399,103400,103404,103514,103516,103585,103693,103861,104117,104525,104539) AND C.FOwnerOrgID in (1,100009,100017,103693,102900,100006,100015,102105,102454,100004,102065,103516,100012,100018,102196,104117,100007,102114,100013,100019,101905,103399,103514,103585,100010,100016,102014,103400,100005,102968,100011,103861,100008,103397,102902,100014,104539,102063,102441) AND C.FDocumentStatus in ('C','A','B','D') AND C.FAssetCurStatus!='4' AND F.FAcctPolicyId = 1 And FAcctDate <= {ts'2018-09-30 00:00:00'} order by FIDENTITYID) as T3
update TMP06C6412FD2AC11E880C544A8422 set FIsSummary=1 where fidentityid in
(select MIN(fidentityid) from TMP06C6412FD2AC11E880C544A8422 group by falterid );
Server stack trace:
在 Kingdee.BOS.App.Data.Sql.SqlDatabase.ExecuteBatch(List`1 sqlArray, Int32 batchSize, Int32 commandTimeout)
在 Kingdee.BOS.App.Data.DBUtils.ExecuteBatchWithTime(Context ctx, List`1 sqlArray, Int32 batchSize, Int32 commandTimeout)
在 Kingdee.K3.FIN.FA.App.Report.AssetObjectListService.BuilderReportSqlAndTempTable(IRptParams filter, String tableName)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.CreateTempTable(IRptParams filter, String tablename)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetDataForVirtual(IRptParams filter)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetData(IRptParams filter)
在 Kingdee.BOS.App.Core.PlugInProxy.SysReportServicePlugInProxy.GetReportData(ReportServiceParameter parameter)
在 Kingdee.BOS.App.Core.SysReportService.GetReportData(ReportServiceParameter parameter)
Exception rethrown at [0]:
在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
在 Kingdee.BOS.Contracts.ISysReportService.GetReportData(ReportServiceParameter parameter)
在 Kingdee.BOS.ServiceHelper.SysReportServiceHelper.GetReportData(ReportServiceParameter parameter)
在 Kingdee.BOS.Model.Report.SysReportModel.GetData(Int32 start, Int32 rows)
在 Kingdee.BOS.Web.Report.SysReportView.GetListData()
在 Kingdee.BOS.Web.Report.SysReportView.<>c__DisplayClass55.
推荐阅读