|
|
@@ -305,4 +305,30 @@
|
|
|
and dr.id = #{id, jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="driverStatistics" resultType="java.util.Map" >
|
|
|
+ select
|
|
|
+ tabA.abnormalTotal, tabB.idleTotal, tabC.inTaskTotal, (tabB.idleTotal + tabC.inTaskTotal) allTotal
|
|
|
+ from
|
|
|
+ (SELECT
|
|
|
+ count(1) abnormalTotal, '' indexNum
|
|
|
+ from kwf_driver tr
|
|
|
+ left join kwf_driver_ent tre on tre.driver_id = tr.id
|
|
|
+ where tr.del_flag = 0 and tre.del_flag = 0 and tr.auth_status = 3 and tre.ent_id = #{entId, jdbcType=BIGINT}
|
|
|
+ ) tabA
|
|
|
+ left join
|
|
|
+ (SELECT
|
|
|
+ count(1) idleTotal, '' indexNum
|
|
|
+ from kwf_driver tr
|
|
|
+ left join kwf_driver_ent tre on tre.driver_id = tr.id
|
|
|
+ where tr.del_flag = 0 and tre.del_flag = 0 and tr.business_status = 0 and tre.ent_id = #{entId, jdbcType=BIGINT}
|
|
|
+ ) tabB on tabB.indexNum = tabA.indexNum
|
|
|
+ left join
|
|
|
+ (SELECT
|
|
|
+ count(1) inTaskTotal, '' indexNum
|
|
|
+ from kwf_driver tr
|
|
|
+ left join kwf_driver_ent tre on tre.driver_id = tr.id
|
|
|
+ where tr.del_flag = 0 and tre.del_flag = 0 and tr.business_status = 1 and tre.ent_id = #{entId, jdbcType=BIGINT}
|
|
|
+ ) tabC on tabC.indexNum = tabA.indexNum
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|