add 接口代码
This commit is contained in:
12
sql/get_current_state.txt
Normal file
12
sql/get_current_state.txt
Normal 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
|
||||
Reference in New Issue
Block a user