Просмотр исходного кода

海盐优化2021年12月16日 14:58:57

hu 4 лет назад
Родитель
Сommit
2627248baf

+ 6 - 2
src/rest/openapi/restcontroller/hyworkorder/webapp/workorder/SQL/工单状态统计.sql

@@ -1,4 +1,4 @@
-DECLARE @hrid nvarchar(50)=$hrid$,@siteid nvarchar(20)=$siteid$,@tostart int =0,@starting int=0,@complete int=0,@qualitycard int=0
+DECLARE @hrid nvarchar(50)=$hrid$,@siteid nvarchar(20)=$siteid$,@tostart int =0,@starting int=0,@complete int=0,@qualitycard int=0,@tostop int=0
 
 select @tostart=count(1)
 from hyWorkorder t
@@ -12,9 +12,13 @@ select @complete=count(1)
 from hyWorkorder t
 where EXISTS(select 1 from hyworkorder_team t1 where t1.hyworkernum=@hrid and t1.fparentid=t.hyWorkorderid) and t.siteid=@siteid
   and t.fstatus='ÒÑÍê³É'
+select @tostop=count(1)
+from hyWorkorder t
+where EXISTS(select 1 from hyworkorder_team t1 where t1.hyworkernum=@hrid and t1.fparentid=t.hyWorkorderid) and t.siteid=@siteid
+  and t.fstatus='ÔÝÍ£'
 select @qualitycard=count(1)
 from hyWorkorder t
 where EXISTS(select 1 from hyworkorder_team t1 where t1.hyworkernum=@hrid and t1.fparentid=t.hyWorkorderid) and t.siteid=@siteid
   and t.fstatus='Öʱ£¿¨ÉóÅú'
 
-select @tostart tostart,@starting starting,@complete complete,@qualitycard qualitycard
+select @tostart tostart,@starting starting,@complete complete,@tostop tostop,@qualitycard qualitycard