|
|
@@ -1,10 +1,7 @@
|
|
|
-select t.fworknum,convert(char(24),t.createdate,120)createdate,t.ftype,(isnull(t.FPROVINCE,'')+isnull(t.FCITY,'')+isnull(t.FCOUNTY,0)) fcounty,t.faddress,t1.fname projectleader,t.fstatus,t.progress,t.customername,
|
|
|
- (
|
|
|
- select count(1) from ordernode t2 where t2.fparentid=t.Workorderid and ischilden=0 and isconfirm=1
|
|
|
- ) confirmcount,
|
|
|
- (
|
|
|
- select count(1) from ordernode t2 where t2.fparentid=t.Workorderid and ischilden=0
|
|
|
- )count,isnull(convert (varchar,acceptancedate,120),'')acceptancedate,t.Workorderid ownerid
|
|
|
-from Workorder t
|
|
|
-left join worker t1 on t1.workphone=t.ProjectLeader
|
|
|
-where t.siteid=$siteid$ and $where$
|
|
|
+select t.fworknum,t.faddress,convert(varchar,t.ACCEPTANCEDATE,120)createdate,t.progress,
|
|
|
+(
|
|
|
+ select top 1 isnull(t1.oneprocessname,'')+isnull(t1.twoprocessname,'') from hyordernode t1 where t1.fparentid=t.hyWorkorderid and t1.isconfirm=0 and t1.ischilden=0 order by t1.FROWNUM
|
|
|
+)curcontent
|
|
|
+from hyWorkorder t
|
|
|
+where EXISTS(select 1 from hyworkorder_team t1 where t1.fparentid=t.hyWorkorderid) and t.siteid=$siteid$ and t.fstatus<>'×÷·Ï' and $where$
|
|
|
+
|