多数据库数据导入
--导入项目,在PublicFund数据库中执行
INSERT INTO AdfV2_PublicFund.dbo.AgileCorp_Fund_Project
(ProjectCode,ProjectName,ProjectPrice,ProjectTypeCode
,ProjectInviteTypeCode,Area,ProjectAddress,ProjectDescript,
CreateDate,PCode,IsSend,SendDate,ApprovePrice,ApproveStatus,
ApproveDate,CateGory,CreateUserCode,AddDate,OldProjectCode,EngineeringProperties)
SELECT ProjectCode,ProjectName,ProjectPrice,ProjectTypeCode
,ProjectInviteTypeCode,Area,ProjectAddress,ProjectDescript,
CreateDate,PCode,IsSend,SendDate,ApprovePrice,ApproveStatus,
ApproveDate,CateGory,UserCode,AddDate,OldProjectCode,EngineeringProperties
FROM AgileCorp_Fund_Project
--导入项目附件
INSERT INTO AdfV2_PublicFund.dbo.AgileCorp_Fund_ProjectMaterial
(ProjectCode,MaterialName,CateCode,MaterialUrl
,DeptCode,UserCode,WriteDate)
SELECT ProjectCode,MaterialName,CateCode,MaterialUrl
,DeptCode,UserCode,WriteDate
FROM AgileCorp_Fund_ProjectMaterial
--导入合同
INSERT INTO AdfV2_PublicFund.dbo.AgileCorp_Fund_Contract
(ContractCode,ProjectCode,ContractName,ContractType,FklbCode,ContractPrice,CateGoryCode,Jia,Yi,JiaName,YiName,
StartDate,EndDate,ProjectPerPrice,CheckBeforePrice,BeforePrice,ProTime,Quality,PayType,ContractFinStatus,ContractPayStatus,
CreateUserCode,WriteDate,HistoryId,fenTan,signDate,IsCheckByJsj,IsCheckByZtb,IsSend,AuditStatus,NewMemo,
MakeNum,MakePrice,InitFactInputPrice,InitFactInputRemark,IsInput,InitFactVerifyPrice,ConFinStatus,AddDate,OldContractCode,
IsAdmin,AdminDesc,AdminRemark,AdminUserCode,AdminDate,AdminWord,ShenJiWord)
SELECT ContractCode,ProjectCode,ContractName,ContractType,FklbCode,ContractPrice,CateGoryCode,Jia,Yi,JiaName,YiName,
StartDate,EndDate,ProjectPerPrice,CheckBeforePrice,BeforePrice,ProTime,Quality,PayType,ContractFinStatus,ContractPayStatus,
UserCode,WriteDate,HistoryId,fenTan,signDate,IsCheckByZtbjsj,IsCheckByZtb,IsSend,0,NewMemo,
ShenJiCode,MakePrice,InitFactInputPrice,ShenJiMemo,IsInput,InitFactVerifyPrice,ConFinStatus,AddDate,OldContractCode,
IsAdmin,AdminDesc,AdminRemark,AdminUserCode,AdminDate,'',ShenJiWord
FROM AgileCorp_Fund_Contract
--导入合同附件
INSERT INTO AdfV2_PublicFund.dbo.AgileCorp_Fund_ContractMaterial
(ContractCode,MaterialName,CateCode,MaterialUrl
,DeptCode,UserCode,WriteDate)
SELECT ContractCode,MaterialName,CateCode,MaterialUrl
,DeptCode,UserCode,WriteDate
FROM AgileCorp_Fund_ContractMaterial
--导入申请
INSERT INTO AdfV2_PublicFund.dbo.AgileCorp_Fund_PayApply
(PayApplyCode,ContractCode,ProjectCode,PayPlanObject,PayPlanPhase,PayPlanTDate,PayPlanPrice,PayPlanProgress,
HasPay,Remark,PayApplyDate,PayApplyPrice,PayApplyProgress,FKSQRemark,IsAudit,VerifyStatus,VerifyMoney,VerifyRemark,VerifyTime,
HeaderStatus,HeaderMoney,HeaderRemark,HeaderTime,ApplyStatus,InputStatus,BwdNumber,CompanyContactMan,CompanyContactPhone,
ConFinStatus,CContractPrice,CMakePrice,CVerifyPrice,CFactVerifyPrice,ApplyRemark,CreateUserCode,CreateDate,
VContractPrice,VMakePrice,VVerifyPrice,VFactVerifyPrice,HContractPrice,HMakePrice,HVerifyPrice,HFactVerifyPrice,CurFactInputPrice)
SELECT PayApplyCode,ContractCode,'',PayPlanObject,PayPlanPhase,PayPlanTDate,PayPlanPrice,PayPlanProgress,
HasPay,FKSQRemark,PayApplyDate,PayApplyPrice,PayApplyProgress,Remark,IsAudit,VerifyStatus,VerifyMoney,VerifyRemark,VerifyTime,
HeaderStatus,HeaderMoney,HeaderRemark,HeaderTime,AuditStatus,InputStatus,BwdNumber,CompanyContactMan,CompanyContactPhone,
ConFinStatus,CContractPrice,CMakePrice,CVerifyPrice,CFactVerifyPrice,FKSQRemark,UserCode,WriteDate,
VContractPrice,VMakePrice,VVerifyPrice,VFactVerifyPrice,HContractPrice,HMakePrice,HVerifyPrice,HFactVerifyPrice,0
FROM aa
--导入申请材料
INSERT INTO AdfV2_PublicFund.dbo.AgileCorp_Fund_PayApplyMaterial
(PayApplyMaterialCode,PayApplyCode,MaterialName,CateCode,
MaterialUrl,DeptCode,UserCode,WriteDate)
SELECT newid(),PayApplyCode,MaterialName,CateCode,
MaterialUrl,DeptCode,UserCode,WriteDate
FROM AgileCorp_Fund_PayApplyMaterial
--导入建设局申请
INSERT INTO AdfV2_PublicFund.dbo.AgileCorp_Fund_CheckByJsj
(CheckCode,ContractCode,IsCheck,AddDate,
ZtbDesc,JsjDesc)
SELECT newid(),ContractCode,IsCheck,AddDate,
ZtbDesc,JsjDesc
FROM AgileCorp_Fund_CheckByZTBJSJ
--导入招投标申请
INSERT INTO AdfV2_PublicFund.dbo.AgileCorp_Fund_CheckByZTB
(CheckCode,ContractCode,IsCheck,AddDate,
ZtbDesc,JsjDesc)
SELECT newid(),ContractCode,IsCheck,AddDate,
ZtbDesc,JsjDesc
FROM AgileCorp_Fund_CheckByZTB
--导入财务付款
INSERT INTO AdfV2_PublicFund.dbo.AgileCorp_Fund_PayFact
(PayPlanCode,PayApplyCode,FactInputPrice,FactInputDate,
InputType,BillNumber,Remark)
SELECT PayPlanCode,PayApplyCode,FactInputPrice,FactInputDate,InputType,
BillNumber,Remark
FROM bb