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.

48 lines
1.3 KiB
Transact-SQL

/****** Object: Table [dbo].[t_code_source] Script Date: 2021-09-30 8:27:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[t_code_filetype](
[代码] [varchar](2) NOT NULL,
[文件类型] [varchar](8) NOT NULL,
[是否必须] [bit] NULL,
CONSTRAINT [PK_t_code_filetype] PRIMARY KEY CLUSTERED
(
[代码] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
insert t_sys_code(,,,)
values(617,'海运业务管理','海运业务管理','修改电子档案')
insert t_sys_code_emp (,,,,,)
select 617,'海运业务管理','海运业务管理','修改电子档案',,0
from t_sys_employee
declare @vs_DocType varchar(50)
declare CurPlu cursor for
select from t_code_filetype where =1
open CurPlu
fetch next from CurPlu into @vs_DocType
while @@Fetch_Status=0
begin
update t_op_seae set ='扣单' from t_op_seae b where datediff(day,b.,getdate())=7
and not EXISTS (select 1 from Receipt_Doc d where d.bsno=b. and RECEIPTTYPE=@vs_DocType)
fetch next from CurPlu into @vs_DocType
end
close CurPlu
dealLocate CurPlu