Browse Source

高新复审开发

anderx 4 years ago
parent
commit
daec4e35e8
1 changed files with 6 additions and 17 deletions
  1. 6 17
      src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

+ 6 - 17
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -2164,29 +2164,18 @@ inner join department de on x.department_id=de.id left join business_category bc
                 where a.id= #{tid}
   </select>
     <select id="highNewRetrialStatistics" resultType="com.goafanti.order.bo.OutHighNewRetrialStatistics">
-      select t1. province,dg.name provinceName ,t1.quantity,t1.pass,t1.notPass,ifnull(t2.counts,0)  signBacks
-      from  (SELECT e.province ,sum(1) quantity,sum(if(a.project_status=10,1,0))pass,sum(if(a.project_status != 10,1,0))notPass
-            from t_order_task a left join business_project b on a.commodity_id =b.id
-            left join t_order_new c on a.order_no =c.order_no  left join admin d on c.salesman_id =d.id
-            left join department e on d.department_id =e.id  where b.`type` =5  and c.process_status >4
-            <if test="depId!=null">
-              and e.id= #{depId}
-            </if>
-            <if test="startDate!=null and endDate!=null">
-              and c.sign_time  between #{startDate} and #{endDate}
-            </if>
-        group by e.province )t1 left join (select y.province,count(*)counts from (select e.province,c.buyer_id,count(*)counts
-            from (select order_no from t_order_task a left join business_project b on a.commodity_id =b.id
-       where b.`type` =5 group by order_no )x left join t_order_new c on x.order_no=c.order_no left join admin d on c.salesman_id =d.id
-        left join department e on d.department_id =e.id  and c.process_status > 4
+      SELECT e.province ,sum(1) quantity,sum(if(a.project_status=10,1,0))pass,sum(if(a.project_status != 10,1,0))notPass,
+      sum(ttm.high_new_retrial)highNewRetrial
+      from t_order_task a left join business_project b on a.commodity_id =b.id left join t_task_mid ttm on a.id=ttm.tid
+      left join t_order_new c on a.order_no =c.order_no  left join admin d on c.salesman_id =d.id
+      left join department e on d.department_id =e.id  where b.`type` =5  and c.process_status >4
       <if test="depId!=null">
         and e.id= #{depId}
       </if>
       <if test="startDate!=null and endDate!=null">
         and c.sign_time  between #{startDate} and #{endDate}
       </if>
-        group by e.province,c.buyer_id )y where y.counts>1 group by y.province)t2 on t1.province=t2.province
-        left join district_glossory dg on t1.province=dg.id
+      group by e.province
     </select>
   <select id="getHighNewRetrial" resultType="java.lang.Integer">
     select count(*) from t_order_new a left join t_order_new b on a.buyer_id =b.buyer_id