|
|
@@ -281,7 +281,7 @@
|
|
|
limit #{page},#{pageSize}
|
|
|
</select>
|
|
|
|
|
|
- <select id="findStatisticsCountByDriver" resultType="java.util.Map">
|
|
|
+ <select id="findStatisticsCountByDriver" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
select tabA.total + tabB.total as waitTotal,
|
|
|
tabC.total departureTotal,
|
|
|
tabD.total executeTotal,
|
|
|
@@ -294,7 +294,14 @@
|
|
|
and lo.del_flag = 0
|
|
|
and loc.status = 0
|
|
|
and loc.w_order_id is null
|
|
|
- and loc.driver_id = #{driverId, jdbcType=BIGINT}) tabA
|
|
|
+ and loc.driver_id = #{driverId, jdbcType=BIGINT}
|
|
|
+ <if test="specialEntIds != null and specialEntIds.size() > 0">
|
|
|
+ and loc.ent_id in
|
|
|
+ <foreach collection="specialEntIds" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ ) tabA
|
|
|
left join
|
|
|
(SELECT count(1) total,
|
|
|
0 indexNum
|
|
|
@@ -303,7 +310,14 @@
|
|
|
where wo.del_flag = 0
|
|
|
and lo.del_flag = 0
|
|
|
and wo.status = 1
|
|
|
- and wo.driver_id = #{driverId, jdbcType=BIGINT}) tabB on tabB.indexNum = tabA.indexNum
|
|
|
+ and wo.driver_id = #{driverId, jdbcType=BIGINT}
|
|
|
+ <if test="specialEntIds != null and specialEntIds.size() > 0">
|
|
|
+ and wo.ent_id in
|
|
|
+ <foreach collection="specialEntIds" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ ) tabB on tabB.indexNum = tabA.indexNum
|
|
|
left join
|
|
|
(SELECT count(1) total,
|
|
|
0 indexNum
|
|
|
@@ -312,7 +326,14 @@
|
|
|
where wo.del_flag = 0
|
|
|
and lo.del_flag = 0
|
|
|
and wo.status = 2
|
|
|
- and wo.driver_id = #{driverId, jdbcType=BIGINT}) tabC on tabC.indexNum = tabA.indexNum
|
|
|
+ and wo.driver_id = #{driverId, jdbcType=BIGINT}
|
|
|
+ <if test="specialEntIds != null and specialEntIds.size() > 0">
|
|
|
+ and wo.ent_id in
|
|
|
+ <foreach collection="specialEntIds" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ ) tabC on tabC.indexNum = tabA.indexNum
|
|
|
left join
|
|
|
(SELECT count(1) total,
|
|
|
0 indexNum
|
|
|
@@ -321,7 +342,14 @@
|
|
|
where wo.del_flag = 0
|
|
|
and lo.del_flag = 0
|
|
|
and wo.status in (3, 4, 5, 6)
|
|
|
- and wo.driver_id = #{driverId, jdbcType=BIGINT}) tabD on tabD.indexNum = tabA.indexNum
|
|
|
+ and wo.driver_id = #{driverId, jdbcType=BIGINT}
|
|
|
+ <if test="specialEntIds != null and specialEntIds.size() > 0">
|
|
|
+ and wo.ent_id in
|
|
|
+ <foreach collection="specialEntIds" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ ) tabD on tabD.indexNum = tabA.indexNum
|
|
|
left join
|
|
|
(SELECT count(1) total,
|
|
|
0 indexNum
|
|
|
@@ -330,7 +358,14 @@
|
|
|
where wo.del_flag = 0
|
|
|
and lo.del_flag = 0
|
|
|
and wo.status in (7, 8, 9, 10, 12, 13)
|
|
|
- and wo.driver_id = #{driverId, jdbcType=BIGINT}) tabE on tabE.indexNum = tabA.indexNum
|
|
|
+ and wo.driver_id = #{driverId, jdbcType=BIGINT}
|
|
|
+ <if test="specialEntIds != null and specialEntIds.size() > 0">
|
|
|
+ and wo.ent_id in
|
|
|
+ <foreach collection="specialEntIds" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ ) tabE on tabE.indexNum = tabA.indexNum
|
|
|
</select>
|
|
|
|
|
|
<select id="findStatisticsSumByDriver" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
@@ -356,6 +391,12 @@
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
and DATE(wo.create_time) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
|
|
|
</if>
|
|
|
+ <if test="specialEntIds != null and specialEntIds.size() > 0">
|
|
|
+ and wo.ent_id in
|
|
|
+ <foreach collection="specialEntIds" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="deficitLossAmountByDriver" parameterType="java.util.Map">
|
|
|
@@ -391,6 +432,12 @@
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
and DATE(wo.create_time) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
|
|
|
</if>
|
|
|
+ <if test="specialEntIds != null and specialEntIds.size() > 0">
|
|
|
+ and wo.ent_id in
|
|
|
+ <foreach collection="specialEntIds" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
) tab
|
|
|
) tab1
|
|
|
</select>
|
|
|
@@ -436,6 +483,12 @@
|
|
|
and lo.del_flag = 0
|
|
|
and wo.status = 1
|
|
|
and wo.driver_id = #{driverId, jdbcType=BIGINT}
|
|
|
+ <if test="specialEntIds != null and specialEntIds.size() > 0">
|
|
|
+ and wo.ent_id in
|
|
|
+ <foreach collection="specialEntIds" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
UNION
|
|
|
SELECT loc.id wOrderId,
|
|
|
null wOrderNo,
|
|
|
@@ -476,6 +529,12 @@
|
|
|
and loc.status = 0
|
|
|
and loc.w_order_id is null
|
|
|
and loc.driver_id = #{driverId, jdbcType=BIGINT}
|
|
|
+ <if test="specialEntIds != null and specialEntIds.size() > 0">
|
|
|
+ and loc.ent_id in
|
|
|
+ <foreach collection="specialEntIds" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
) tab
|
|
|
order by startTime
|
|
|
</select>
|
|
|
@@ -518,7 +577,6 @@
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
and DATE(wo.create_time) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="busStatus != null and busStatus == 2">
|
|
|
ORDER BY wo.start_time
|
|
|
</if>
|