You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
4.5 KiB
Transact-SQL

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

/****** Script for SelectTopNRows command from SSMS ******/
INSERT INTO [ShippingWeb_LNHT].[dbo].[t_op_task]
([任务编号] ,[上级任务号],[任务类型],[任务来源],[任务状态],[任务说明]
,[发起人] ,[录入日期] ,[任务开始时间] ,[完成方式] ,[完成时间] ,[KPI值]
,[业务编号],[文件编号],[邮件编号],[电子档案路径],[是否公共],[任务相关人员],[业务编号1])
select v1.*,case when sea. IS null then 1 else 0 end as , sea.,sea. from
(
SELECT newid() as [任务编号],null as [上级任务号], [fileType] as [任务类型],
'FTP' as [任务来源], '未开始' as [任务状态],
case [fileType] when 'ADVANCE' then 'Verify Copy' when 'APPROVED' then '已获得贵司确认的copy'
when'ORIGINAL' then '正本提单' when 'SEAWAY' then 'Seaway Bill' else [fileType] end [任务说明],
'DEMO-SA' as [发起人],GETDATE() as [录入日期],GETDATE() as[任务开始时间], '手动' as [完成方式],null as [完成时间] ,null as [KPI值] ,
SUBSTRING(ftp_filename, CHARINDEX('-',ftp_filename , 1)+1,CHARINDEX('-',ftp_filename , 10)- (CHARINDEX('-',ftp_filename , 1)+1)) as [业务编号],
ReportID as [文件编号], null as [邮件编号],
[local_path] +'\'+ [ftp_filename] as [电子档案路径] from t_op_seae_ftpfile_bc
where ReportID='{0}'
) v1 left join dongshengdata_jf.dbo.t_op_seae sea on v1.[业务编号]=sea.
-----------
INSERT INTO [ShippingWeb_LNHT].[dbo].[t_op_task]
([任务编号] ,[上级任务号],[任务类型],[任务来源],[任务状态],[任务说明]
,[发起人] ,[录入日期] ,[任务开始时间] ,[完成方式] ,[完成时间] ,[KPI值]
,[业务编号],[文件编号],[邮件编号],[电子档案路径],[是否公共],[任务相关人员],[业务编号1])
select v1.*,case when sea. IS null then 1 else 0 end as , sea.,sea. from
(
SELECT newid() as [任务编号],null as [上级任务号], 'VC' as [任务类型],
'邮件' as [任务来源], '未开始' as [任务状态],
'提单号为 {1} VC挂单' as [任务说明],
'DEMO-SA' as [发起人],GETDATE() as [录入日期],GETDATE() as[任务开始时间], '手动' as [完成方式],null as [完成时间] ,null as [KPI值] ,
'{1}' as [业务编号],
null as [文件编号], '{0}' as [邮件编号],
'{2}' as [电子档案路径]
) v1 left join dongshengdata_jf.dbo.t_op_seae sea on v1.[业务编号]=sea.
select * from t_op_task where ='6246ABE2-1968-4203-9CD7-08E3321BFB73'
select * from t_op_task_state
select * from t_op_task where ='26786265-24BE-4362-B061-AC5745C3BEBC'
select * from t_op_seae where ='SE2010090001'
select * from t_op_seae where ='SE2012070001'