|
|
@@ -1348,4 +1348,28 @@
|
|
|
from public_release a left join public_release_details b on a.id=b.prid where aid= #{aid}
|
|
|
and a.release_start BETWEEN #{startTime} and #{endTime} group by a.aid)z on x.aid=z.aid
|
|
|
</select>
|
|
|
+ <select id="consultantthisMonthUser" resultType="com.goafanti.admin.bo.ConsultantUserCount">
|
|
|
+ select x.dates,sum(projectCount)projectCount,sum(inProgress)inProgress,sum(notStarted)notStarted
|
|
|
+ ,0 complete,0 stop,0 countPublicRelease,0 countAssist
|
|
|
+ from (select commodity_quantity projectCount, if(a.project_status=1,commodity_quantity,0)inProgress,
|
|
|
+ if(a.project_status=0,commodity_quantity,0)notStarted,DATE_FORMAT(a.task_distribution_time,'%Y-%m-%d') dates
|
|
|
+ from t_order_task a where a.split_status in (0,2) and a.task_receiver = #{aid}
|
|
|
+ and a.task_distribution_time BETWEEN #{firstDay} and #{endDay})x
|
|
|
+ group by x.dates
|
|
|
+ union
|
|
|
+ select x.dates,0 projectCount,0 inProgress,0 notStarted,sum(complete)complete,sum(stop)stop,0,0
|
|
|
+ from (SELECT if(a.project_status in (19,27) ,commodity_quantity,0) complete,
|
|
|
+ if(a.project_status in (2,3,29),commodity_quantity,0) stop ,DATE_FORMAT(b.date_time ,'%Y-%m-%d') dates
|
|
|
+ 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 #{firstDay} and #{endDay})x
|
|
|
+ group by x.dates
|
|
|
+ union
|
|
|
+ select x.dates,0,0,0,0,0,sum(countPublicRelease)countPublicRelease,sum(countAssist)countAssist
|
|
|
+ from ( select if(a.`type` in (0,1,2),1,0) countPublicRelease,if(a.`type` in (3),1,0) countAssist,
|
|
|
+ DATE_FORMAT(a.release_start ,'%Y-%m-%d') dates
|
|
|
+ from public_release a left join public_release_details b on a.id=b.prid where aid= #{aid}
|
|
|
+ and a.release_start BETWEEN #{firstDay} and #{endDay})x
|
|
|
+ group by x.dates
|
|
|
+ </select>
|
|
|
</mapper>
|