<iftest="query.salesmanId != null and query.creator != null ">
<iftest="query.salesmanId != null and query.creator != null ">
AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ) or o.`creator` = #{query.creator})
AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ) or o.`creator` = #{query.creator})
</if>
</if>
...
@@ -350,56 +545,251 @@
...
@@ -350,56 +545,251 @@
<iftest="query.status != null">
<iftest="query.status != null">
AND o.`status` = #{query.status}
AND o.`status` = #{query.status}
</if>
</if>
<iftest="query.salesmanId != null and query.creator">
<iftest="query.pickState != null">
AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ) or o.`creator` = #{query.creator})
AND o.`pick_state` = #{query.pickState}
</if>
<iftest="query.customsType != null">
AND o.`customs_type` = #{query.customsType}
</if>
<iftest="query.productRecord != null">
AND o.`product_record` = #{query.productRecord}
</if>
<iftest="query.transportId != null">
AND o.`transport_id` = #{query.transportId}
</if>
<iftest="query.warehouseType != null">
AND o.`warehouse_type` = #{query.warehouseType}
</if>
</if>
<iftest="query.warehouseTypes != null and query.warehouseTypes.size()>0">
<iftest="query.pickStateList != null and query.pickStateList.size()>0">
<iftest="query.warehouseTypes != null and query.warehouseTypes.size()==1 ">
<iftest="query.pickStateList != null and query.pickStateList.size()==1 ">
<iftest="query.salesmanId != null and query.creator">
AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ) or o.`creator` = #{query.creator})
</if>
<iftest="query.customsType != null">
AND o.`customs_type` = #{query.customsType}
</if>
<iftest="query.productRecord != null">
AND o.`product_record` = #{query.productRecord}
</if>
<iftest="query.transportId != null">
AND o.`transport_id` = #{query.transportId}
</if>
<iftest="query.warehouseType != null">
AND o.`warehouse_type` = #{query.warehouseType}
</if>
<iftest="query.warehouseTypes != null and query.warehouseTypes.size()>0">
<iftest="query.warehouseTypes != null and query.warehouseTypes.size()==1 ">
<iftest="query.startWarehouseIds !=null and query.startWarehouseIds.size() > 0 and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">
<iftest="query.startWarehouseIds !=null and query.startWarehouseIds.size() > 0 and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">
...
@@ -1677,6 +2067,9 @@
...
@@ -1677,6 +2067,9 @@
</otherwise>
</otherwise>
</choose>
</choose>
</if>
</if>
<iftest="query.inWarehouseState != null">
AND o.`in_warehouse_state` = #{query.inWarehouseState}
</if>
<iftest="query.inWarehouseStateList != null and query.inWarehouseStateList.size()>0">
<iftest="query.inWarehouseStateList != null and query.inWarehouseStateList.size()>0">
<iftest="query.inWarehouseStateList != null and query.inWarehouseStateList.size()==1 ">
<iftest="query.inWarehouseStateList != null and query.inWarehouseStateList.size()==1 ">
...
@@ -1693,8 +2086,8 @@
...
@@ -1693,8 +2086,8 @@
</foreach>
</foreach>
</if>
</if>
</if>
</if>
<iftest="query.inWarehouseState != null">
<iftest="query.shipmentState != null">
AND o.`in_warehouse_state` = #{query.inWarehouseState}
AND o.`shipment_State` = #{query.shipmentState}
</if>
</if>
<iftest="query.shipmentStateList != null and query.shipmentStateList.size()>0">
<iftest="query.shipmentStateList != null and query.shipmentStateList.size()>0">
...
@@ -1712,8 +2105,22 @@
...
@@ -1712,8 +2105,22 @@
</foreach>
</foreach>
</if>
</if>
</if>
</if>
<iftest="query.shipmentState != null">
<iftest="query.auditType != null">
AND o.`shipment_State` = #{query.shipmentState}
<choose>
<whentest="query.auditType != 0">
<choose>
<whentest="query.auditType != -1">
AND o.`audit_type` = #{query.auditType}
</when>
<otherwise>
AND o.`audit_type` != 0
</otherwise>
</choose>
</when>
<otherwise>
AND o.`audit_type` = 0
</otherwise>
</choose>
</if>
</if>
<iftest="query.auditTypeList != null and query.auditTypeList.size()>0">
<iftest="query.auditTypeList != null and query.auditTypeList.size()>0">
...
@@ -1760,24 +2167,6 @@
...
@@ -1760,24 +2167,6 @@
)
)
</if>
</if>
</if>
</if>
<iftest="query.auditType != null">
<choose>
<whentest="query.auditType != 0">
<choose>
<whentest="query.auditType != -1">
AND o.`audit_type` = #{query.auditType}
</when>
<otherwise>
AND o.`audit_type` != 0
</otherwise>
</choose>
</when>
<otherwise>
AND o.`audit_type` = 0
</otherwise>
</choose>
</if>
<iftest="query.salesmanId != null ">
<iftest="query.salesmanId != null ">
AND (o.`salesman_id` = #{query.salesmanId} or
AND (o.`salesman_id` = #{query.salesmanId} or
o.`customer_id` in(
o.`customer_id` in(
...
@@ -2374,21 +2763,84 @@
...
@@ -2374,21 +2763,84 @@
<iftest="query.status != null">
<iftest="query.status != null">
AND o.`status` = #{query.status}
AND o.`status` = #{query.status}
</if>
</if>
<iftest="query.warningOrder != null and query.warningOrder == 1 ">
<iftest="query.pickState != null">
AND (o.type is null or o.type = '' or NOT FIND_IN_SET(2, o.type))
AND o.`pick_state` = #{query.pickState}
AND o.`is_cargo_control` = 1
</if>
AND o.unload_time is not null
<iftest="query.pickStateList != null and query.pickStateList.size()>0">
AND ((select IFNULL(sum(p.pick_num), 0) from `ecw_order_cargo_control_pick` p where p.order_id = o.order_id and p.status = 3) < o.`sum_num`
or
<iftest="query.pickStateList != null and query.pickStateList.size()==1 ">
<iftest="query.auditTypeList != null and query.auditTypeList.size()>0">
<iftest="query.auditTypeList != null and query.auditTypeList.size()>0">
<iftest="query.auditTypeList != null and query.auditTypeList.size()==1 ">
<iftest="query.auditTypeList != null and query.auditTypeList.size()==1 ">
...
@@ -2489,23 +3012,6 @@
...
@@ -2489,23 +3012,6 @@
)
)
</if>
</if>
</if>
</if>
<iftest="query.auditType != null">
<choose>
<whentest="query.auditType != 0">
<choose>
<whentest="query.auditType != -1">
AND o.`audit_type` = #{query.auditType}
</when>
<otherwise>
AND o.`audit_type` != 0
</otherwise>
</choose>
</when>
<otherwise>
AND o.`audit_type` = 0
</otherwise>
</choose>
</if>
<iftest="query.salesmanId != null ">
<iftest="query.salesmanId != null ">
AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))
AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))
</if>
</if>
...
@@ -3243,9 +3749,41 @@
...
@@ -3243,9 +3749,41 @@
<iftest="query.inWarehouseState != null">
<iftest="query.inWarehouseState != null">
AND o.`in_warehouse_state` = #{query.inWarehouseState}
AND o.`in_warehouse_state` = #{query.inWarehouseState}
</if>
</if>
<iftest="query.inWarehouseStateList != null and query.inWarehouseStateList.size()>0">
<iftest="query.inWarehouseStateList != null and query.inWarehouseStateList.size()==1 ">
AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))
AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))
</if>
</if>
...
@@ -4589,7 +5172,85 @@
...
@@ -4589,7 +5172,85 @@
<iftest="query.status != null">
<iftest="query.status != null">
AND o.`status` = #{query.status}
AND o.`status` = #{query.status}
</if>
</if>
<iftest="query.abnormalState != null">
<iftest="query.pickState != null">
AND o.`pick_state` = #{query.pickState}
</if>
<iftest="query.pickStateList != null and query.pickStateList.size()>0">
<iftest="query.pickStateList != null and query.pickStateList.size()==1 ">
AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))
AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))
</if>
</if>
...
@@ -5146,37 +5884,232 @@
...
@@ -5146,37 +5884,232 @@
<iftest="query.status != null">
<iftest="query.status != null">
AND o.`status` = #{query.status}
AND o.`status` = #{query.status}
</if>
</if>
<iftest="query.beginRucangTime != null and query.endRucangTime != null ">
<iftest="query.pickState != null">
AND o.order_id in(select distinct wi.order_id from ecw_order_warehouse_in wi where wi.deleted = 0 and
AND o.`pick_state` = #{query.pickState}
wi.`in_time` between #{query.beginRucangTime} and #{query.endRucangTime})
</if>
<iftest="query.beginQingguanTime != null and query.endQingguanTime != null ">
AND o.`qingguan_time` between #{query.beginQingguanTime} and #{query.endQingguanTime}
</if>
<iftest="query.beginDaogangTime != null and query.endDaogangTime != null ">
AND o.`daogang_time` between #{query.beginDaogangTime} and #{query.endDaogangTime}
</if>
<iftest="query.beginPreLoadTime != null and query.endPreLoadTime != null ">
AND o.`status` > 5 AND o.`pre_load_time` between #{query.beginPreLoadTime} and #{query.endPreLoadTime}
</if>
<iftest="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
where b.deleted = 0 and bc.deleted = 0 and bc.`checkout_time` between #{query.beginOutboundTime} and #{query.endOutboundTime})
</if>
<iftest="query.beginLoadTime != null and query.endLoadTime != null ">
AND o.`load_time` between #{query.beginLoadTime} and #{query.endLoadTime}
</if>
</if>
<iftest="query.beginUnloadTime != null and query.endUnloadTime != null ">
<iftest="query.pickStateList != null and query.pickStateList.size()>0">
AND o.`unload_time` between #{query.beginUnloadTime} and #{query.endUnloadTime}
<iftest="query.pickStateList != null and query.pickStateList.size()==1 ">