|
@@ -25,10 +25,10 @@
|
|
|
e.ent_id targetEntId,
|
|
e.ent_id targetEntId,
|
|
|
e.firm_name targetEntName,
|
|
e.firm_name targetEntName,
|
|
|
a.performed_amount performedAmount,
|
|
a.performed_amount performedAmount,
|
|
|
- a.contract_pid contractPid
|
|
|
|
|
|
|
+ a.contract_pid contractPid,
|
|
|
|
|
+ f.name contractPname
|
|
|
from kwc_contract_logistics a
|
|
from kwc_contract_logistics a
|
|
|
- left join kwc_contract_logistics_unit b
|
|
|
|
|
- on a.id = b.contract_id
|
|
|
|
|
|
|
+ left join kwc_contract_logistics_unit b on a.id = b.contract_id
|
|
|
and b.unit_type = #{entType}
|
|
and b.unit_type = #{entType}
|
|
|
and case when a.status != 3 then b.ent_id in
|
|
and case when a.status != 3 then b.ent_id in
|
|
|
<foreach collection="allEnt" separator="," open="(" close=")" item="item">
|
|
<foreach collection="allEnt" separator="," open="(" close=")" item="item">
|
|
@@ -40,6 +40,7 @@
|
|
|
left join kwc_contract_logistics_track c on a.id = c.contract_id and c.del_flag = 0 and c.type = 1
|
|
left join kwc_contract_logistics_track c on a.id = c.contract_id and c.del_flag = 0 and c.type = 1
|
|
|
left join kwc_contract_logistics_track d on a.id = d.contract_id and d.del_flag = 0 and d.type = 0
|
|
left join kwc_contract_logistics_track d on a.id = d.contract_id and d.del_flag = 0 and d.type = 0
|
|
|
left join kwc_contract_logistics_unit e on a.id = e.contract_id and e.unit_type != #{entType} and e.del_flag = 0
|
|
left join kwc_contract_logistics_unit e on a.id = e.contract_id and e.unit_type != #{entType} and e.del_flag = 0
|
|
|
|
|
+ left join kwc_contract_logistics f on f.id = a.contract_pid
|
|
|
where a.del_flag = 0
|
|
where a.del_flag = 0
|
|
|
and case when a.status = 3 then a.ent_id = #{entId} and #{entType} = 3
|
|
and case when a.status = 3 then a.ent_id = #{entId} and #{entType} = 3
|
|
|
else (b.ent_id in
|
|
else (b.ent_id in
|
|
@@ -105,12 +106,14 @@
|
|
|
e.ent_id carrierEntId,
|
|
e.ent_id carrierEntId,
|
|
|
e.firm_name carrierEntName,
|
|
e.firm_name carrierEntName,
|
|
|
a.performed_amount performedAmount,
|
|
a.performed_amount performedAmount,
|
|
|
- a.contract_pid contractPid
|
|
|
|
|
|
|
+ a.contract_pid contractPid,
|
|
|
|
|
+ f.name contractPname,
|
|
|
from kwc_contract_logistics a
|
|
from kwc_contract_logistics a
|
|
|
left join kwc_contract_logistics_unit b on a.id = b.contract_id and b.del_flag = 0 and b.unit_type = 3
|
|
left join kwc_contract_logistics_unit b on a.id = b.contract_id and b.del_flag = 0 and b.unit_type = 3
|
|
|
left join kwc_contract_logistics_unit e on a.id = e.contract_id and e.del_flag = 0 and e.unit_type = 4
|
|
left join kwc_contract_logistics_unit e on a.id = e.contract_id and e.del_flag = 0 and e.unit_type = 4
|
|
|
left join kwc_contract_logistics_track c on a.id = c.contract_id and c.del_flag = 0 and c.type = 1
|
|
left join kwc_contract_logistics_track c on a.id = c.contract_id and c.del_flag = 0 and c.type = 1
|
|
|
left join kwc_contract_logistics_track d on a.id = d.contract_id and d.del_flag = 0 and d.type = 0
|
|
left join kwc_contract_logistics_track d on a.id = d.contract_id and d.del_flag = 0 and d.type = 0
|
|
|
|
|
+ left join kwc_contract_logistics f on f.id = a.contract_pid
|
|
|
where a.del_flag = 0
|
|
where a.del_flag = 0
|
|
|
and a.status != 3
|
|
and a.status != 3
|
|
|
<if test="startTime != null">
|
|
<if test="startTime != null">
|