Browse Source

首页BUG修复

anderx 2 years ago
parent
commit
4ec59f7135
1 changed files with 7 additions and 5 deletions
  1. 7 5
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml

+ 7 - 5
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -1346,17 +1346,19 @@
         where b.task_receiver= #{aid} and a.status in(0,1,2) group by b.task_receiver )v on x.aid=v.aid
   </select>
   <select id="consultantStatisticsInfoByTime" resultType="com.goafanti.admin.bo.ConsultantStatisticsBo">
-    select x.aid,x.projectCount,x.inProgress,x.notStarted,y.complete,y.stop,z.countPublicRelease,z.countAssist
-    from (select a.task_receiver aid,sum(commodity_quantity) projectCount, sum(if(a.project_status=1,commodity_quantity,0)) inProgress,
+    select a.id,x.projectCount,x.inProgress,x.notStarted,y.complete,y.stop,z.countPublicRelease,z.countAssist
+    from admin a left join (select a.task_receiver aid,sum(commodity_quantity) projectCount,
+        sum(if(a.project_status=1,commodity_quantity,0)) inProgress,
         sum(if(a.project_status=0,commodity_quantity,0)) notStarted from t_order_task a  where a.split_status in (0,2)
-        and a.task_receiver = #{aid} and a.task_distribution_time BETWEEN #{startTime} and #{endTime} group by a.task_receiver )x
+        and a.task_receiver = #{aid} and a.task_distribution_time BETWEEN #{startTime} and #{endTime} group by a.task_receiver )x on a.id=x.aid
     left join (SELECT a.task_receiver aid,sum(if(a.project_status in (19,27) ,commodity_quantity,0)) complete,
         sum(if(a.project_status in (2,3,29),commodity_quantity,0)) stop from t_order_task a left join task_time b on a.id=b.tid
         where a.split_status in (0,2) and b.project_status =a.project_status and a.task_receiver = #{aid}
-        and b.date_time  BETWEEN #{startTime} and #{endTime} group by a.task_receiver )y on x.aid=y.aid
+        and b.date_time  BETWEEN #{startTime} and #{endTime} group by a.task_receiver )y on a.id=y.aid
     left join (select aid,sum(if(a.`type` in (0,1,2),1,0)) countPublicRelease,sum(if(a.`type` in (3),1,0)) countAssist
         from public_release a left join public_release_details b on a.id=b.prid where aid=  #{aid} and a.status =2
-        and a.release_start BETWEEN #{startTime} and #{endTime} group by a.aid)z on x.aid=z.aid
+        and a.release_start BETWEEN #{startTime} and #{endTime} group by a.aid)z on a.id=z.aid
+    where a.id=#{aid}
   </select>
   <select id="consultantthisMonthUser" resultType="com.goafanti.admin.bo.ConsultantUserCount">
     select x.dates,sum(projectCount)projectCount,sum(inProgress)inProgress,sum(notStarted)notStarted