Просмотр исходного кода

feat:运力实时调度列表查询bug

wangweiyu 4 лет назад
Родитель
Сommit
554a0f9e39

+ 2 - 2
src/main/java/com/aoyang/tms/controller/vo/AddWorkOrderVO.java

@@ -74,10 +74,10 @@ public class AddWorkOrderVO implements Serializable {
     @ApiModelProperty(value = "卸车作业地点具体地址")
     private String address;
 
-    @ApiModelProperty(value = "卸车作业'联系人")
+    @ApiModelProperty(value = "卸车作业联系人")
     private String contactName;
 
-    @ApiModelProperty(value = "卸车作业'联系人电话")
+    @ApiModelProperty(value = "卸车作业联系人电话")
     private String contactPhone;
 
     @ApiModelProperty(value = "计划到达时间")

+ 16 - 11
src/main/resources/mapper/TruckMapper.xml

@@ -67,9 +67,6 @@
         truck
         left join (
         select * from tms_work_order wo where 40 > wo.order_status
-        <if test="param!=null and param.shipperId!=null">
-            and wo.shipper_id = #{param.shipperId}
-        </if>
         <if test="param!=null and param.loadCount == 1">
             and wo.type = 1 and wo.order_status in (10, 20, 30)
         </if>
@@ -97,10 +94,7 @@
         order by order_status desc, plan_reach_time asc
         ) two on truck.truck_id = two.truck_id
         left join tms_work_cycle wc on truck.truck_id = wc.truck_id and wc.status = 1
-        <where>
-            <if test="param!=null and param.orgId!=null">
-                and truck.org_id = #{param.orgId}
-            </if>
+        where truck.org_id = #{param.orgId}
             <if test="param!=null and param.deptId!=null">
                 and truck.dept_id = #{param.deptId}
             </if>
@@ -108,6 +102,9 @@
                 and (truck.car_number like concat('%',#{param.carNumber},'%') or
                 truck.trailer_number like concat('%',#{param.carNumber},'%'))
             </if>
+            <if test="param!=null and param.shipperId!=null">
+                and two.shipper_id = #{param.shipperId}
+            </if>
             <if test="param!=null and param.surplusCount == 1">
                 and two.id is null
             </if>
@@ -117,8 +114,10 @@
             <if test="param!=null and param.unAllocated == 1">
                 and two.id is null
             </if>
-
-        </where>
+            <if test="param.loadCount == 1 or param.loadWait == 1 or param.loadGotoSpot == 1 or param.loadSubmit == 1 or
+            param.unloadCount == 1 or param.unloadGotoSpot == 1 or param.unloadWait == 1 or param.unloadSubmit == 1">
+                and two.id is not null
+            </if>
         group by truck.truck_id
     </select>
 
@@ -145,13 +144,19 @@
         FROM
         truck
         left join tms_work_order wo on truck.truck_id = wo.truck_id and 40 > wo.order_status
+        <if test="orderType != null and orderType == 1">
+            and wo.type = #{orderType}
+        </if>
+        <if test="orderType != null and orderType == 2">
+            and wo.type = #{orderType}
+        </if>
         left join tms_work_cycle wc on truck.truck_id = wc.truck_id and wc.status = 1
         WHERE truck.org_id = #{orgId} and wo.id is null
         <if test="orderType != null and orderType == 1">
-            and wc.jing_weight = 0 and wo.type = #{orderType}
+            and ( wc.jing_weight = 0 or wc.jing_weight is null )
         </if>
         <if test="orderType != null and orderType == 2">
-            and wc.jing_weight > 0 and wo.type = #{orderType}
+            and wc.jing_weight > 0
         </if>
     </select>