Commit c29db821 authored by honghy's avatar honghy

控货详情收货人查询调整

parent 4e67e336
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
FROM ecw_order_cargo_control_pick occ FROM ecw_order_cargo_control_pick occ
JOIN ecw_order o on o.order_id = occ.order_id JOIN ecw_order o on o.order_id = occ.order_id
LEFT JOIN ecw_order_consignor nor ON nor.order_id = o.order_id AND nor.deleted = 0 LEFT JOIN ecw_order_consignor nor ON nor.order_id = o.order_id AND nor.deleted = 0
LEFT JOIN ecw_order_consignee nee ON nee.order_id = o.order_id AND nee.deleted = 0 LEFT JOIN ecw_customer_contacts ecc on ecc.phone_new = occ.consignee_phone AND ecc.deleted = 0
LEFT JOIN ecw_order_consignor nee ON nee.customer_id = ecc.customer_id AND nee.deleted = 0
LEFT JOIN ecw_warehouse_line ewl on ewl.id = o.line_id LEFT JOIN ecw_warehouse_line ewl on ewl.id = o.line_id
LEFT JOIN ecw_warehouse ew_start ON ew_start.id = ewl.start_warehouse_id LEFT JOIN ecw_warehouse ew_start ON ew_start.id = ewl.start_warehouse_id
LEFT JOIN ecw_warehouse ew_dest ON ew_dest.id = ewl.dest_warehouse_id LEFT JOIN ecw_warehouse ew_dest ON ew_dest.id = ewl.dest_warehouse_id
...@@ -51,7 +52,8 @@ ...@@ -51,7 +52,8 @@
FROM ecw_order_cargo_control_pick occ FROM ecw_order_cargo_control_pick occ
JOIN ecw_order o on o.order_id = occ.order_id JOIN ecw_order o on o.order_id = occ.order_id
LEFT JOIN ecw_order_consignor nor ON nor.order_id = o.order_id AND nor.deleted = 0 LEFT JOIN ecw_order_consignor nor ON nor.order_id = o.order_id AND nor.deleted = 0
LEFT JOIN ecw_order_consignor nee ON nee.phone = occ.consignee_phone AND nee.deleted = 0 LEFT JOIN ecw_customer_contacts ecc on ecc.phone_new = occ.consignee_phone AND ecc.deleted = 0
LEFT JOIN ecw_order_consignor nee ON nee.customer_id = ecc.customer_id AND nee.deleted = 0
LEFT JOIN ecw_warehouse_line ewl on ewl.id = o.line_id LEFT JOIN ecw_warehouse_line ewl on ewl.id = o.line_id
LEFT JOIN ecw_warehouse ew_start ON ew_start.id = ewl.start_warehouse_id LEFT JOIN ecw_warehouse ew_start ON ew_start.id = ewl.start_warehouse_id
LEFT JOIN ecw_warehouse ew_dest ON ew_dest.id = ewl.dest_warehouse_id LEFT JOIN ecw_warehouse ew_dest ON ew_dest.id = ewl.dest_warehouse_id
...@@ -77,7 +79,8 @@ ...@@ -77,7 +79,8 @@
FROM ecw_order_cargo_control_pick occ FROM ecw_order_cargo_control_pick occ
JOIN ecw_order o on o.order_id = occ.order_id JOIN ecw_order o on o.order_id = occ.order_id
LEFT JOIN ecw_order_consignor nor ON nor.order_id = o.order_id AND nor.deleted = 0 LEFT JOIN ecw_order_consignor nor ON nor.order_id = o.order_id AND nor.deleted = 0
LEFT JOIN ecw_order_consignee nee ON nee.order_id = o.order_id AND nee.deleted = 0 LEFT JOIN ecw_customer_contacts ecc on ecc.phone_new = occ.consignee_phone AND ecc.deleted = 0
LEFT JOIN ecw_order_consignor nee ON nee.customer_id = ecc.customer_id AND nee.deleted = 0
LEFT JOIN ecw_warehouse_line ewl on ewl.id = o.line_id LEFT JOIN ecw_warehouse_line ewl on ewl.id = o.line_id
LEFT JOIN ecw_warehouse ew_start ON ew_start.id = ewl.start_warehouse_id LEFT JOIN ecw_warehouse ew_start ON ew_start.id = ewl.start_warehouse_id
LEFT JOIN ecw_warehouse ew_dest ON ew_dest.id = ewl.dest_warehouse_id LEFT JOIN ecw_warehouse ew_dest ON ew_dest.id = ewl.dest_warehouse_id
...@@ -149,12 +152,13 @@ ...@@ -149,12 +152,13 @@
AND occ.check_time between #{query.beginCheckTime} and #{query.endCheckTime} AND occ.check_time between #{query.beginCheckTime} and #{query.endCheckTime}
</if> </if>
<!--控货状态--> <!--控货状态-->
<if test = 'query.cargoControlStatusList != null and query.cargoControlStatusList.size() > 0 '> <if test='query.cargoControlStatusList != null and query.cargoControlStatusList.size() > 0 '>
AND (1!=1 AND (1!=1
<foreach item='cargoControlStatus' index="index" collection='query.cargoControlStatusList'> <foreach item='cargoControlStatus' index="index" collection='query.cargoControlStatusList'>
<choose> <choose>
<when test="cargoControlStatus == 3"> <when test="cargoControlStatus == 3">
or o.`cargo_control_status` = 1 AND (select count(1) from ecw_order_cargo_control_pick ccp2 where ccp2.order_id = o.order_id and ccp2.status = 1) > 0 or o.`cargo_control_status` = 1 AND (select count(1) from ecw_order_cargo_control_pick ccp2
where ccp2.order_id = o.order_id and ccp2.status = 1) > 0
</when> </when>
<otherwise> <otherwise>
or o.`cargo_control_status` = #{cargoControlStatus} or o.`cargo_control_status` = #{cargoControlStatus}
...@@ -187,7 +191,8 @@ ...@@ -187,7 +191,8 @@
<!--目的国--> <!--目的国-->
<if test="query.destCountryIds != null and query.destCountryIds.size()>0 "> <if test="query.destCountryIds != null and query.destCountryIds.size()>0 ">
and ew_dest.`guojia` in and ew_dest.`guojia` in
<foreach item='destCountry' index='index' collection='query.destCountryIds' open='(' separator=',' close=')'> <foreach item='destCountry' index='index' collection='query.destCountryIds' open='(' separator=','
close=')'>
#{destCountry} #{destCountry}
</foreach> </foreach>
</if> </if>
...@@ -201,7 +206,8 @@ ...@@ -201,7 +206,8 @@
<!--出货渠道--> <!--出货渠道-->
<if test="query.shippingChannelIdList != null and query.shippingChannelIdList.size()>0 "> <if test="query.shippingChannelIdList != null and query.shippingChannelIdList.size()>0 ">
and ec.channel_id in and ec.channel_id in
<foreach item='id' index='index' collection='query.shippingChannelIdList' open='(' separator=',' close=')'> <foreach item='id' index='index' collection='query.shippingChannelIdList' open='(' separator=','
close=')'>
#{id} #{id}
</foreach> </foreach>
</if> </if>
...@@ -229,8 +235,10 @@ ...@@ -229,8 +235,10 @@
AND o.`status` > 5 AND o.`load_time` between #{query.beginLoadTime} and #{query.endLoadTime} AND o.`status` > 5 AND o.`load_time` between #{query.beginLoadTime} and #{query.endLoadTime}
</if> </if>
<if test="query.beginOutboundTime != null and query.endOutboundTime != null "> <if test="query.beginOutboundTime != null and query.endOutboundTime != null ">
AND o.`status` > 5 AND o.container_number in(select distinct b.self_no from ecw_box_air_checkout bc join ecw_box b ON bc.shipment_id = b.id AND o.`status` > 5 AND o.container_number in(select distinct b.self_no from ecw_box_air_checkout bc join
where b.deleted = 0 and bc.deleted = 0 and bc.`checkout_time` between #{query.beginOutboundTime} and #{query.endOutboundTime}) ecw_box b ON bc.shipment_id = b.id
where b.deleted = 0 and bc.deleted = 0 and bc.`checkout_time` between #{query.beginOutboundTime} and
#{query.endOutboundTime})
</if> </if>
<if test="query.beginDaogangTime != null and query.endDaogangTime != null "> <if test="query.beginDaogangTime != null and query.endDaogangTime != null ">
AND o.`daogang_time` between #{query.beginDaogangTime} and #{query.endDaogangTime} AND o.`daogang_time` between #{query.beginDaogangTime} and #{query.endDaogangTime}
...@@ -249,7 +257,8 @@ ...@@ -249,7 +257,8 @@
AND o.`take_time` between #{query.beginTakeTime} and #{query.endTakeTime} AND o.`take_time` between #{query.beginTakeTime} and #{query.endTakeTime}
</if> </if>
<if test="query.beginPickTime != null and query.endPickTime != null "> <if test="query.beginPickTime != null and query.endPickTime != null ">
AND o.order_id in(select distinct op.order_id from ecw_order_cargo_control_pick op where op.deleted = 0 and AND o.order_id in(select distinct op.order_id from ecw_order_cargo_control_pick op where op.deleted = 0
and
op.status in(1,3) and op.`create_time` between #{query.beginPickTime} and #{query.endPickTime}) op.status in(1,3) and op.`create_time` between #{query.beginPickTime} and #{query.endPickTime})
</if> </if>
AND occ.deleted = 0 AND occ.deleted = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment