add 接口代码

This commit is contained in:
路 范
2021-09-07 17:42:30 +08:00
parent ae17583411
commit 5807fbf9fe
21 changed files with 2073 additions and 16 deletions

12
sql/get_current_state.txt Normal file
View File

@@ -0,0 +1,12 @@
if exists(select * from sys.objects where name='get_current_state')
drop function get_current_state;
go
create function get_current_state(@projectid uniqueidentifier)
RETURNS varchar(30)
as
begin
declare @current_state varchar(30)
select top 1 @current_state = b.StepName from Projects a inner join ProjectsStep b on a.id=b.ProjectId where a.id=@projectid and StartTime<=(select GETDATE()) order by StepSort desc
return @current_state
end