Ver Fonte

feat:司机未绑定车辆bug

wangweiyu há 4 anos atrás
pai
commit
11746eb4f9

+ 2 - 0
src/main/java/com/aoyang/tms/mapper/TruckMapper.java

@@ -25,6 +25,8 @@ public interface TruckMapper extends BaseMapper<Truck> {
 
     Page<Truck> listUnAllocatedTruck(@Param("page") Page page, @Param("orgId") Long orgId);
 
+    int getUnExecutedOrderTruckCount(@Param("orgId") Long orgId);
+
     int getUnAllocatedTruckCount(@Param("orgId") Long orgId);
 
     int getUnAllocatedOrderCount(@Param("orgId") Long orgId, @Param("orderType") Integer type);

+ 10 - 1
src/main/resources/mapper/TruckMapper.xml

@@ -115,7 +115,7 @@
                 and (two.id is null or two.order_status = 0)
             </if>
             <if test="param!=null and param.unExecuted == 1">
-                and two.order_status = 0
+                and truck.tms_status = 0 and two.order_status = 0
             </if>
             <if test="param!=null and param.unAllocated == 1">
                 and two.id is null
@@ -142,6 +142,15 @@
         WHERE truck.org_id = #{orgId} and wo.id is null
     </select>
 
+    <!-- 查询未执行派单车辆 -->
+    <select id="getUnExecutedOrderTruckCount" resultType="java.lang.Integer">
+        SELECT count(DISTINCT truck.truck_id)
+        FROM
+        truck left join tms_work_order wo on truck.truck_id = wo.truck_id and wo.order_status = 0
+        WHERE truck.org_id = #{orgId} and truck.tms_status = 0 and wo.id is not null
+        group by truck.truck_id
+    </select>
+
     <!-- 查询未派单车辆 -->
     <select id="getUnAllocatedTruckCount" resultType="java.lang.Integer">
         SELECT count(1)