Commit a3acd705 authored by Smile's avatar Smile
parents 49a083e1 3cc04422
...@@ -5,57 +5,59 @@ ...@@ -5,57 +5,59 @@
<select id="orderCargoControlDetailListCount" resultType="java.lang.Long"> <select id="orderCargoControlDetailListCount" resultType="java.lang.Long">
SELECT count(1) SELECT count(1)
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_warehouse_line ewl on ewl.id = o.line_id LEFT JOIN ecw_customer nee ON nee.id = ecc.customer_id AND nee.deleted = 0
LEFT JOIN ecw_warehouse ew_start ON ew_start.id = ewl.start_warehouse_id LEFT JOIN ecw_warehouse_line ewl on ewl.id = o.line_id
LEFT JOIN ecw_warehouse ew_dest ON ew_dest.id = ewl.dest_warehouse_id LEFT JOIN ecw_warehouse ew_start ON ew_start.id = ewl.start_warehouse_id
LEFT JOIN ecw_channel ec on ec.channel_id = o.channel_id LEFT JOIN ecw_warehouse ew_dest ON ew_dest.id = ewl.dest_warehouse_id
LEFT JOIN ecw_channel ec on ec.channel_id = o.channel_id
<include refid="query"/> <include refid="query"/>
</select> </select>
<select id="orderCargoControlDetailList" <select id="orderCargoControlDetailList"
resultType="cn.iocoder.yudao.module.order.dto.OrderCargoControlReleaseInfoDto"> resultType="cn.iocoder.yudao.module.order.dto.OrderCargoControlReleaseInfoDto">
SELECT o.order_no, SELECT o.order_no,
o.order_id, o.order_id,
nor.customer_number as consignerNumber, nor.customer_number as consignerNumber,
nor.customer_id as consignerId, nor.customer_id as consignerId,
nee.customer_number as consigneeNumber, nee.number as consigneeNumber,
nee.customer_id as consigneeId, nee.id as consigneeId,
nee.NAME as consigneeName, nee.NAME as consigneeName,
nee.phone as consigneePhone, occ.consignee_phone as consigneePhone,
nee.country_code as consigneeCountryCode, occ.consignee_country_code as consigneeCountryCode,
o.sum_num, o.sum_num,
occ.pick_num, occ.pick_num,
occ.pick_volume, occ.pick_volume,
truncate(ceil((round((occ.pick_num/o.sum_num)*occ.pick_volume,5))*100)/100,2) as chargeVolume, truncate(ceil((round((occ.pick_num/o.sum_num)*occ.pick_volume,5))*100)/100,2) as chargeVolume,
occ.pick_weight, occ.pick_weight,
truncate(ceil((round((occ.pick_num/o.sum_num)*occ.pick_weight,5))*100)/100,2) as chargeWeight, truncate(ceil((round((occ.pick_num/o.sum_num)*occ.pick_weight,5))*100)/100,2) as chargeWeight,
occ.status, occ.status,
occ.remarks, occ.remarks,
occ.operator, occ.operator,
occ.create_time, occ.create_time,
occ.check_time, occ.check_time,
o.cargo_control_status as cargoControlStatus, o.cargo_control_status as cargoControlStatus,
ew_start.title_zh as startTitleZh, ew_start.title_zh as startTitleZh,
ew_start.title_en as startTitleEn, ew_start.title_en as startTitleEn,
ew_start.title_fr as startTitleFr, ew_start.title_fr as startTitleFr,
o.transport_id, o.transport_id,
ew_dest.address_zh as destCityTitleZh, ew_dest.address_zh as destCityTitleZh,
ew_dest.address_en as destCityTitleEn, ew_dest.address_en as destCityTitleEn,
ew_dest.address_fr as destCityTitleFr, ew_dest.address_fr as destCityTitleFr,
o.create_time as unloadTime, o.create_time as unloadTime,
ec.name_zh as channelName, ec.name_zh as channelName,
occ.id occ.id
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_warehouse_line ewl on ewl.id = o.line_id LEFT JOIN ecw_customer nee ON nee.id = ecc.customer_id AND nee.deleted = 0
LEFT JOIN ecw_warehouse ew_start ON ew_start.id = ewl.start_warehouse_id LEFT JOIN ecw_warehouse_line ewl on ewl.id = o.line_id
LEFT JOIN ecw_warehouse ew_dest ON ew_dest.id = ewl.dest_warehouse_id LEFT JOIN ecw_warehouse ew_start ON ew_start.id = ewl.start_warehouse_id
LEFT JOIN ecw_channel ec on ec.channel_id = o.channel_id LEFT JOIN ecw_warehouse ew_dest ON ew_dest.id = ewl.dest_warehouse_id
LEFT JOIN ecw_channel ec on ec.channel_id = o.channel_id
<include refid="query"/> <include refid="query"/>
<choose> <choose>
<when test="sort != null"> <when test="sort != null">
...@@ -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_customer nee ON nee.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
...@@ -102,16 +105,16 @@ ...@@ -102,16 +105,16 @@
</if> </if>
<!--提单号--> <!--提单号-->
<if test="query.prodKey != null and query.prodKey != '' "> <if test="query.prodKey != null and query.prodKey != '' ">
AND occ.tidan_No like concat("%",#{query.prodKey},"%") AND o.tidan_No like concat("%",#{query.prodKey},"%")
</if> </if>
<if test="query.eqProdKey != null and query.eqProdKey != '' "> <if test="query.eqProdKey != null and query.eqProdKey != '' ">
AND occ.tidan_No = #{query.eqProdKey} AND o.tidan_No = #{query.eqProdKey}
</if> </if>
<if test="query.notEqProdKey != null and query.notEqProdKey != '' "> <if test="query.notEqProdKey != null and query.notEqProdKey != '' ">
AND occ.tidan_No != #{query.notEqProdKey} AND o.tidan_No != #{query.notEqProdKey}
</if> </if>
<if test="query.notProdKey != null and query.notProdKey != '' "> <if test="query.notProdKey != null and query.notProdKey != '' ">
AND occ.tidan_No not like concat("%",#{query.notProdKey},"%") AND o.tidan_No not like concat("%",#{query.notProdKey},"%")
</if> </if>
<!--发货人--> <!--发货人-->
<if test="query.consignorKey != null and query.consignorKey != '' "> <if test="query.consignorKey != null and query.consignorKey != '' ">
...@@ -122,8 +125,9 @@ ...@@ -122,8 +125,9 @@
<!--收货人--> <!--收货人-->
<if test="query.consigneeKey != null and query.consigneeKey != '' "> <if test="query.consigneeKey != null and query.consigneeKey != '' ">
AND (nee.name like concat("%",#{query.consigneeKey},"%") or AND (nee.name like concat("%",#{query.consigneeKey},"%") or
nee.phone like concat("%",#{query.consigneeKey},"%") or occ.consignee_phone like concat("%",#{query.consigneeKey},"%") or
nee.customer_number like concat("%",#{query.consigneeKey},"%") ) nee.number like concat("%",#{query.consigneeKey},"%") or
occ.consignee_name like concat("%",#{query.consigneeKey},"%") )
</if> </if>
<!--状态--> <!--状态-->
<if test="query.pickStateList != null and query.pickStateList.size >0"> <if test="query.pickStateList != null and query.pickStateList.size >0">
...@@ -149,12 +153,13 @@ ...@@ -149,12 +153,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 +192,8 @@ ...@@ -187,7 +192,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 +207,8 @@ ...@@ -201,7 +207,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 +236,10 @@ ...@@ -229,8 +236,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 +258,8 @@ ...@@ -249,7 +258,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