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