Explorar o código

服务人员行程查询逻辑变更

hu %!s(int64=4) %!d(string=hai) anos
pai
achega
f34d0521db

+ 4 - 1
src/rest/openapi/restcontroller/hyworkorder/web/workorder/HyWorkOrder.java

@@ -79,8 +79,11 @@ public class HyWorkOrder extends Controller {
         String wherestr="t.fstatus='进行中' ";
         if(where!=null){
             DBConnect dbConnect=new DBConnect();
+            if(where.containsKey("projectleader")&&!StringUtils.isBlank(where.getString("projectleader"))){
+                wherestr+=" and PROJECTLEADER = '"+where.getString("projectleader")+"'";
+            }
             if(where.containsKey("customerphone")&&!StringUtils.isBlank(where.getString("customerphone"))){
-                wherestr+=" and PROJECTLEADER = '"+where.getString("customerphone")+"'";
+                wherestr+=" and SCENEPHONE = '"+where.getString("customerphone")+"'";
             }
             SQLFactory factory=new SQLFactory(this,"服务人员行程列表查询",pageSize,pageNumber,"t.fworknum desc");
             //factory.addParameter("fagentnum",fagentnum);

+ 7 - 10
src/rest/openapi/restcontroller/hyworkorder/web/workorder/SQL/服务人员行程列表查询.sql

@@ -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$
+