|
@@ -1,14 +1,17 @@
|
|
|
-DECLARE @siteid nvarchar(20)=$siteid$,@fagentnum nvarchar(20)=$fagentnum$,@allcount int=0,@pending int =0,@processing int =0,@closed int=0,@created int =0
|
|
|
|
|
|
|
+DECLARE @siteid nvarchar(20)=$siteid$,@fagentnum nvarchar(20)=$fagentnum$,@allcount int=0,@pending int =0,@tobeaccepted int =0,@processing int =0,@closed int=0,@created int =0
|
|
|
select @allcount=isnull(sum(1),0) from Serviceform t
|
|
select @allcount=isnull(sum(1),0) from Serviceform t
|
|
|
where t.siteid=@siteid and t.fagentnum=@fagentnum
|
|
where t.siteid=@siteid and t.fagentnum=@fagentnum
|
|
|
select @created=isnull(sum(1),0) from Serviceform t
|
|
select @created=isnull(sum(1),0) from Serviceform t
|
|
|
where t.siteid=@siteid and t.fstatus='待指派' and t.fagentnum=@fagentnum
|
|
where t.siteid=@siteid and t.fstatus='待指派' and t.fagentnum=@fagentnum
|
|
|
select @pending=isnull(sum(1),0) from Serviceform t
|
|
select @pending=isnull(sum(1),0) from Serviceform t
|
|
|
where t.siteid=@siteid and t.fstatus='待处理' and t.fagentnum=@fagentnum
|
|
where t.siteid=@siteid and t.fstatus='待处理' and t.fagentnum=@fagentnum
|
|
|
|
|
+select @tobeaccepted=isnull(sum(1),0) from Serviceform t
|
|
|
|
|
+where t.siteid=@siteid and t.fstatus='待验收' and t.fagentnum=@fagentnum
|
|
|
select @processing=isnull(sum(1),0) from Serviceform t
|
|
select @processing=isnull(sum(1),0) from Serviceform t
|
|
|
where t.siteid=@siteid and t.fstatus='进行中' and t.fagentnum=@fagentnum
|
|
where t.siteid=@siteid and t.fstatus='进行中' and t.fagentnum=@fagentnum
|
|
|
select @closed=isnull(sum(1),0) from Serviceform t
|
|
select @closed=isnull(sum(1),0) from Serviceform t
|
|
|
where t.siteid=@siteid and t.fstatus='已完成' and t.fagentnum=@fagentnum
|
|
where t.siteid=@siteid and t.fstatus='已完成' and t.fagentnum=@fagentnum
|
|
|
|
|
|
|
|
-select @allcount allcount,@created created,@pending pending,@processing processing,@closed closed
|
|
|
|
|
|
|
+
|
|
|
|
|
+select @allcount allcount,@created created,@pending pending,@tobeaccepted tobeaccepted,@processing processing,@closed closed
|
|
|
|
|
|