Commit 7a17f668 authored by liuzeheng's avatar liuzeheng

我的订单、部门订单等列表支持订单类型多个筛选

parent a3f27548
...@@ -3440,385 +3440,385 @@ public interface OrderMapper extends AbstractMapper<OrderDO> { ...@@ -3440,385 +3440,385 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
"</script>" "</script>"
}) })
StatisticsOrderVO statisticsOrder(@Param("query") OrderQueryVO query); StatisticsOrderVO statisticsOrder(@Param("query") OrderQueryVO query);
@ResultType(StatisticsOrderVO.class) // @ResultType(StatisticsOrderVO.class)
@Select({ // @Select({
"<script>", // "<script>",
"select ", // "select ",
"SUM(IFNULL(IF(it.warehouse_in_info is null, 0, it.warehouse_in_info->>'$.cartonsNum'), 0)) as total_num, ", // "SUM(IFNULL(IF(it.warehouse_in_info is null, 0, it.warehouse_in_info->>'$.cartonsNum'), 0)) as total_num, ",
"SUM(IFNULL(IF(it.warehouse_in_info is null, 0, it.warehouse_in_info->>'$.volume'), 0)) as total_volume, ", // "SUM(IFNULL(IF(it.warehouse_in_info is null, 0, it.warehouse_in_info->>'$.volume'), 0)) as total_volume, ",
"SUM(IFNULL(IF(it.warehouse_in_info is null, 0, it.warehouse_in_info->>'$.weight'), 0)) as total_weight, ", // "SUM(IFNULL(IF(it.warehouse_in_info is null, 0, it.warehouse_in_info->>'$.weight'), 0)) as total_weight, ",
"SUM(IFNULL(IF(it.warehouse_in_info is null, 0, it.warehouse_in_info->>'$.quantityAll'), 0)) as order_quantity, ", // "SUM(IFNULL(IF(it.warehouse_in_info is null, 0, it.warehouse_in_info->>'$.quantityAll'), 0)) as order_quantity, ",
"SUM(IFNULL(it.w_volume,0)) as total_w_volume, ", // "SUM(IFNULL(it.w_volume,0)) as total_w_volume, ",
"SUM(IFNULL(it.v_weight,0)) as total_v_weight, ", // "SUM(IFNULL(it.v_weight,0)) as total_v_weight, ",
"SUM(IFNULL(IF(it.warehouse_in_info is null, 0, IF(it.charge_weight > it.min_metering_weight ,it.charge_weight,it.min_metering_weight)), 0)) as total_charge_weight, ", // "SUM(IFNULL(IF(it.warehouse_in_info is null, 0, IF(it.charge_weight > it.min_metering_weight ,it.charge_weight,it.min_metering_weight)), 0)) as total_charge_weight, ",
"SUM(IFNULL(IF(it.warehouse_in_info is null, 0, IF(it.charge_volume > it.min_metering_volume,it.charge_volume,it.min_metering_volume)), 0)) as total_charge_volume,", // "SUM(IFNULL(IF(it.warehouse_in_info is null, 0, IF(it.charge_volume > it.min_metering_volume,it.charge_volume,it.min_metering_volume)), 0)) as total_charge_volume,",
"SUM(IFNULL(IF(it.warehouse_in_info is null, 0, IF(it.charge_quantity > it.min_metering_quantity,it.charge_quantity,it.min_metering_quantity)), 0)) as total_charge_quantity", // "SUM(IFNULL(IF(it.warehouse_in_info is null, 0, IF(it.charge_quantity > it.min_metering_quantity,it.charge_quantity,it.min_metering_quantity)), 0)) as total_charge_quantity",
"from ecw_order_item it ", // "from ecw_order_item it ",
"left join ecw_order o ", // "left join ecw_order o ",
"ON it.order_id = o.order_id and it.deleted = 0", // "ON it.order_id = o.order_id and it.deleted = 0",
"left join ecw_order_departure de on de.order_id = o.order_id ", // "left join ecw_order_departure de on de.order_id = o.order_id ",
"left join ecw_order_objective ob on ob.order_id = o.order_id ", // "left join ecw_order_objective ob on ob.order_id = o.order_id ",
"left join ecw_order_consignor nor on nor.order_id = o.order_id ", // "left join ecw_order_consignor nor on nor.order_id = o.order_id ",
"left join ecw_order_consignee nee on nee.order_id = o.order_id ", // "left join ecw_order_consignee nee on nee.order_id = o.order_id ",
"left join ecw_channel channel on channel.channel_id = o.channel_id ", // "left join ecw_channel channel on channel.channel_id = o.channel_id ",
"where o.deleted = 0 and o.in_warehouse_state != 211 and o.in_warehouse_state != 208 and o.status != 10 ", // "where o.deleted = 0 and o.in_warehouse_state != 211 and o.in_warehouse_state != 208 and o.status != 10 ",
"<when test = 'query.deptId != null '>", // "<when test = 'query.deptId != null '>",
"AND o.dept_id = #{query.deptId} ", // "AND o.dept_id = #{query.deptId} ",
"</when>", // "</when>",
"<when test= 'query.deptIdList != null and query.deptIdList.size() > 0'>", // "<when test= 'query.deptIdList != null and query.deptIdList.size() > 0'>",
"AND (o.dept_id IN", // "AND (o.dept_id IN",
"<foreach item='deptId' collection='query.deptIdList' open='(' close=')' separator=','> #{deptId} </foreach>", // "<foreach item='deptId' collection='query.deptIdList' open='(' close=')' separator=','> #{deptId} </foreach>",
" or ", // " or ",
"(SELECT u.dept_id FROM system_user u WHERE u.id = o.creator) IN", // "(SELECT u.dept_id FROM system_user u WHERE u.id = o.creator) IN",
"<foreach item='deptId' collection='query.deptIdList' open='(' close=')' separator=','> #{deptId} </foreach>)", // "<foreach item='deptId' collection='query.deptIdList' open='(' close=')' separator=','> #{deptId} </foreach>)",
"</when>", // "</when>",
"<when test = 'query.pdaStartWareIds != null and query.pdaStartWareIds != \"\" '>", // "<when test = 'query.pdaStartWareIds != null and query.pdaStartWareIds != \"\" '>",
"AND FIND_IN_SET(ew_start.`id`, #{query.pdaStartWareIds})", // "AND FIND_IN_SET(ew_start.`id`, #{query.pdaStartWareIds})",
"</when>", // "</when>",
"<when test = 'query.pdaDestWareIds != null and query.pdaDestWareIds != \"\" '>", // "<when test = 'query.pdaDestWareIds != null and query.pdaDestWareIds != \"\" '>",
"AND FIND_IN_SET(ew_dest.`id`, #{query.pdaDestWareIds})", // "AND FIND_IN_SET(ew_dest.`id`, #{query.pdaDestWareIds})",
"</when>", // "</when>",
"<when test = 'query.packageType != null and query.packageType != \"\" '>", // "<when test = 'query.packageType != null and query.packageType != \"\" '>",
"AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')", // "AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')",
"</when>", // "</when>",
"<when test = 'query.isExternalWarehouse != null'>", // "<when test = 'query.isExternalWarehouse != null'>",
"AND o.`is_external_warehouse` = #{query.isExternalWarehouse}", // "AND o.`is_external_warehouse` = #{query.isExternalWarehouse}",
"</when>", // "</when>",
"<when test = 'query.status != null'>", // "<when test = 'query.status != null'>",
"AND o.`status` = #{query.status}", // "AND o.`status` = #{query.status}",
"</when>", // "</when>",
"<when test = 'query.abnormalState != null'>", // "<when test = 'query.abnormalState != null'>",
"<choose>", // "<choose>",
"<when test = 'query.abnormalState != 0'>", // "<when test = 'query.abnormalState != 0'>",
"<choose>", // "<choose>",
"<when test = 'query.abnormalState != -1'>", // "<when test = 'query.abnormalState != -1'>",
"AND o.`abnormal_state` = #{query.abnormalState}", // "AND o.`abnormal_state` = #{query.abnormalState}",
"</when>", // "</when>",
"<otherwise>", // "<otherwise>",
"AND o.`abnormal_state` != 0", // "AND o.`abnormal_state` != 0",
"</otherwise>", // "</otherwise>",
"</choose>", // "</choose>",
"</when>", // "</when>",
"<otherwise>", // "<otherwise>",
"AND o.`abnormal_state` = 0", // "AND o.`abnormal_state` = 0",
"</otherwise>", // "</otherwise>",
"</choose>", // "</choose>",
"</when>", // "</when>",
"<when test = 'query.inWarehouseState != null'>", // "<when test = 'query.inWarehouseState != null'>",
"AND o.`in_warehouse_state` = #{query.inWarehouseState}", // "AND o.`in_warehouse_state` = #{query.inWarehouseState}",
"</when>", // "</when>",
"<when test = 'query.shipmentState != null'>", // "<when test = 'query.shipmentState != null'>",
"AND o.`shipment_State` = #{query.shipmentState}", // "AND o.`shipment_State` = #{query.shipmentState}",
"</when>", // "</when>",
"<when test = 'query.auditType != null'>", // "<when test = 'query.auditType != null'>",
"<choose>", // "<choose>",
"<when test = 'query.auditType != 0'>", // "<when test = 'query.auditType != 0'>",
"<choose>", // "<choose>",
"<when test = 'query.auditType != -1'>", // "<when test = 'query.auditType != -1'>",
"AND o.`audit_type` = #{query.auditType}", // "AND o.`audit_type` = #{query.auditType}",
"</when>", // "</when>",
"<otherwise>", // "<otherwise>",
"AND o.`audit_type` != 0", // "AND o.`audit_type` != 0",
"</otherwise>", // "</otherwise>",
"</choose>", // "</choose>",
"</when>", // "</when>",
"<otherwise>", // "<otherwise>",
"AND o.`audit_type` = 0", // "AND o.`audit_type` = 0",
"</otherwise>", // "</otherwise>",
"</choose>", // "</choose>",
"</when>", // "</when>",
"<when test = 'query.salesmanId != null '>", // "<when test = '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} ))",
"</when>", // "</when>",
"<when test = 'query.customsType != null'>", // "<when test = 'query.customsType != null'>",
"AND o.`customs_type` = #{query.customsType}", // "AND o.`customs_type` = #{query.customsType}",
"</when>", // "</when>",
"<when test = 'query.productRecord != null'>", // "<when test = 'query.productRecord != null'>",
"AND o.`product_record` = #{query.productRecord}", // "AND o.`product_record` = #{query.productRecord}",
"</when>", // "</when>",
"<when test = 'query.transportId != null'>", // "<when test = 'query.transportId != null'>",
"AND o.`transport_id` = #{query.transportId}", // "AND o.`transport_id` = #{query.transportId}",
"</when>", // "</when>",
"<when test = 'query.channelId != null'>", // "<when test = 'query.channelId != null'>",
"AND o.`channel_id` = #{query.channelId}", // "AND o.`channel_id` = #{query.channelId}",
"</when>", // "</when>",
"<when test = 'query.warehouseType != null'>", // "<when test = 'query.warehouseType != null'>",
"AND o.`warehouse_type` = #{query.warehouseType}", // "AND o.`warehouse_type` = #{query.warehouseType}",
"</when>", // "</when>",
"<when test = 'query.number != null and query.number != \"\" '>", // "<when test = 'query.number != null and query.number != \"\" '>",
"AND (o.`number` like concat('%',concat(#{query.number},'%')) ", // "AND (o.`number` like concat('%',concat(#{query.number},'%')) ",
"or ", // "or ",
"o.order_id in ", // "o.order_id in ",
"(select distinct oi.order_id from ecw_order_item oi ", // "(select distinct oi.order_id from ecw_order_item oi ",
"where oi.deleted = 0 and", // "where oi.deleted = 0 and",
"((oi.warehouse_in_info is null and oi.express_no like concat('%',concat(#{query.number},'%')))", // "((oi.warehouse_in_info is null and oi.express_no like concat('%',concat(#{query.number},'%')))",
" or ", // " or ",
"(oi.warehouse_in_info is not null and oi.warehouse_in_info ->> '$.expressNo' like concat('%',concat(#{query.number},'%'))))))", // "(oi.warehouse_in_info is not null and oi.warehouse_in_info ->> '$.expressNo' like concat('%',concat(#{query.number},'%'))))))",
"</when>", // "</when>",
"<when test = 'query.notNumber != null and query.notNumber != \"\" '>", // "<when test = 'query.notNumber != null and query.notNumber != \"\" '>",
"AND o.`number` not like concat('%',concat(#{query.notNumber},'%')) ", // "AND o.`number` not like concat('%',concat(#{query.notNumber},'%')) ",
"AND ", // "AND ",
"o.order_id not in ", // "o.order_id not in ",
"(select distinct oi.order_id from ecw_order_item oi ", // "(select distinct oi.order_id from ecw_order_item oi ",
"where oi.deleted = 0 and", // "where oi.deleted = 0 and",
"((oi.warehouse_in_info is null and oi.express_no like concat('%',concat(#{query.notNumber},'%')))", // "((oi.warehouse_in_info is null and oi.express_no like concat('%',concat(#{query.notNumber},'%')))",
" or ", // " or ",
"(oi.warehouse_in_info is not null and oi.warehouse_in_info ->> '$.expressNo' like concat('%',concat(#{query.notNumber},'%')))))", // "(oi.warehouse_in_info is not null and oi.warehouse_in_info ->> '$.expressNo' like concat('%',concat(#{query.notNumber},'%')))))",
"</when>", // "</when>",
"<when test = 'query.marks != null and query.marks != \"\" '>", // "<when test = 'query.marks != null and query.marks != \"\" '>",
"AND o.`marks` like concat('%',concat(#{query.marks},'%'))", // "AND o.`marks` like concat('%',concat(#{query.marks},'%'))",
"</when>", // "</when>",
"<when test = 'query.departureId != null '>", // "<when test = 'query.departureId != null '>",
"AND de.`departure_id` = #{query.departureId}", // "AND de.`departure_id` = #{query.departureId}",
"</when>", // "</when>",
"<when test = 'query.objectiveId != null '>", // "<when test = 'query.objectiveId != null '>",
"AND ob.`objective_id` = #{query.objectiveId}", // "AND ob.`objective_id` = #{query.objectiveId}",
"</when>", // "</when>",
"<when test = 'query.consignorId != null '>", // "<when test = 'query.consignorId != null '>",
"AND nor.`customer_id` = #{query.consignorId} ", // "AND nor.`customer_id` = #{query.consignorId} ",
"</when>", // "</when>",
"<when test = 'query.consignorPhone != null and query.consignorPhone != \"\" '>", // "<when test = 'query.consignorPhone != null and query.consignorPhone != \"\" '>",
"AND nor.`phone` = #{query.consignorPhone} ", // "AND nor.`phone` = #{query.consignorPhone} ",
"</when>", // "</when>",
"<when test = 'query.consigneeId != null '>", // "<when test = 'query.consigneeId != null '>",
"AND nee.`customer_id` = #{query.consigneeId}", // "AND nee.`customer_id` = #{query.consigneeId}",
"</when>", // "</when>",
"<when test = 'query.consigneePhone != null and query.consigneePhone != \"\" '>", // "<when test = 'query.consigneePhone != null and query.consigneePhone != \"\" '>",
"AND nee.`phone` = #{query.consigneePhone} ", // "AND nee.`phone` = #{query.consigneePhone} ",
"</when>", // "</when>",
"<when test = 'query.isCargoControl != null '>", // "<when test = 'query.isCargoControl != null '>",
"AND o.`is_cargo_control` = #{query.isCargoControl}", // "AND o.`is_cargo_control` = #{query.isCargoControl}",
"</when>", // "</when>",
"<when test = 'query.orderNo != null and query.orderNo != \"\" '>", // "<when test = 'query.orderNo != null and query.orderNo != \"\" '>",
"AND o.`order_no` like concat('%',concat(#{query.orderNo},'%'))", // "AND o.`order_no` like concat('%',concat(#{query.orderNo},'%'))",
"</when>", // "</when>",
"<when test = 'query.orderIdList != null and query.orderIdList.size() != 0'>", // "<when test = 'query.orderIdList != null and query.orderIdList.size() != 0'>",
"AND o.`order_id` in ", // "AND o.`order_id` in ",
"<foreach item='orderId' index='index' collection='query.orderIdList' open='(' separator=',' close=')'>#{orderId}</foreach> ", // "<foreach item='orderId' index='index' collection='query.orderIdList' open='(' separator=',' close=')'>#{orderId}</foreach> ",
"</when>", // "</when>",
"<when test = 'query.tidanNo != null and query.tidanNo != \"\" '>", // "<when test = 'query.tidanNo != null and query.tidanNo != \"\" '>",
"AND o.`tidan_no` like concat('%',concat(#{query.tidanNo},'%'))", // "AND o.`tidan_no` like concat('%',concat(#{query.tidanNo},'%'))",
"</when>", // "</when>",
"<when test = 'query.customerId != null'>", // "<when test = 'query.customerId != null'>",
"AND o.`customer_id` = #{query.customerId}", // "AND o.`customer_id` = #{query.customerId}",
"</when>", // "</when>",
"<when test = 'query.beginRucangTime != null and query.endRucangTime != null '>", // "<when test = 'query.beginRucangTime != null and query.endRucangTime != null '>",
// "AND o.`rucang_time` between #{query.beginRucangTime} and #{query.endRucangTime}", // "AND o.order_id in(select distinct wi.order_id from ecw_order_warehouse_in wi where wi.deleted = 0 and wi.`in_time` between #{query.beginRucangTime} and #{query.endRucangTime})",
"AND o.order_id in(select distinct wi.order_id from ecw_order_warehouse_in wi where wi.deleted = 0 and wi.`in_time` between #{query.beginRucangTime} and #{query.endRucangTime})", // "</when>",
"</when>", // "<when test = 'query.beginQingguanTime != null and query.endQingguanTime != null '>",
"<when test = 'query.beginQingguanTime != null and query.endQingguanTime != null '>", // "AND o.`qingguan_time` between #{query.beginQingguanTime} and #{query.endQingguanTime}",
"AND o.`qingguan_time` between #{query.beginQingguanTime} and #{query.endQingguanTime}", // "</when>",
"</when>", // "<when test = 'query.beginDaogangTime != null and query.endDaogangTime != null '>",
"<when 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}", // "</when>",
"</when>", // "<when test = 'query.beginPreLoadTime != null and query.endPreLoadTime != null '>",
"<when test = 'query.beginPreLoadTime != null and query.endPreLoadTime != null '>", // "AND o.`status` > 5 AND o.`pre_load_time` between #{query.beginPreLoadTime} and #{query.endPreLoadTime}",
"AND o.`status` > 5 AND o.`pre_load_time` between #{query.beginPreLoadTime} and #{query.endPreLoadTime}", // "</when>",
"</when>", // "<when test = 'query.beginOutboundTime != null and query.endOutboundTime != null '>",
"<when 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 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})",
"where b.deleted = 0 and bc.deleted = 0 and bc.`checkout_time` between #{query.beginOutboundTime} and #{query.endOutboundTime})", // "</when>",
"</when>", // "<when test = 'query.beginLoadTime != null and query.endLoadTime != null '>",
"<when test = 'query.beginLoadTime != null and query.endLoadTime != null '>", // "AND o.`load_time` between #{query.beginLoadTime} and #{query.endLoadTime}",
"AND o.`load_time` between #{query.beginLoadTime} and #{query.endLoadTime}", // "</when>",
"</when>", // "<when test = 'query.beginUnloadTime != null and query.endUnloadTime != null '>",
"<when test = 'query.beginUnloadTime != null and query.endUnloadTime != null '>", // "AND o.`unload_time` between #{query.beginUnloadTime} and #{query.endUnloadTime}",
"AND o.`unload_time` between #{query.beginUnloadTime} and #{query.endUnloadTime}", // "</when>",
"</when>", // "<when test = 'query.beginTakeTime != null and query.endTakeTime != null '>",
"<when test = 'query.beginTakeTime != null and query.endTakeTime != null '>", // "AND o.`status` > 19 AND o.`take_time` between #{query.beginTakeTime} and #{query.endTakeTime}",
"AND o.`status` > 19 AND o.`take_time` between #{query.beginTakeTime} and #{query.endTakeTime}", // "</when>",
"</when>", // "<when test = 'query.beginSplitTime != null and query.endSplitTime != null '>",
"<when test = 'query.beginSplitTime != null and query.endSplitTime != null '>", // "AND o.`split_time` between #{query.beginSplitTime} and #{query.endSplitTime}",
"AND o.`split_time` between #{query.beginSplitTime} and #{query.endSplitTime}", // "</when>",
"</when>", // "<when test = 'query.beginCreateTime != null and query.endCreateTime != null '>",
"<when test = 'query.beginCreateTime != null and query.endCreateTime != null '>", // "AND o.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}",
"AND o.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}", // "</when>",
"</when>", // "<when test = 'query.beginPickTime != null and query.endPickTime != null '>",
"<when 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 op.status in(1,3) and op.`create_time` between #{query.beginPickTime} and #{query.endPickTime})",
"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})", // "</when>",
"</when>", // "<when test = 'query.beginPickUpTime != null and query.endPickUpTime != null '>",
"<when test = 'query.beginPickUpTime != null and query.endPickUpTime != null '>", // "AND o.order_no in(select distinct op.order_id from ecw_order_pickup op where op.deleted = 0 and op.`create_time` between #{query.beginPickUpTime} and #{query.endPickUpTime})",
"AND o.order_no in(select distinct op.order_id from ecw_order_pickup op where op.deleted = 0 and op.`create_time` between #{query.beginPickUpTime} and #{query.endPickUpTime})", // "</when>",
"</when>", // "<when test = 'query.beginWarehouseInTime != null and query.endWarehouseInTime != null '>",
"<when test = 'query.beginWarehouseInTime != null and query.endWarehouseInTime != null '>", // "AND o.order_id in(select distinct wi.order_id from ecw_order_warehouse_in wi where wi.deleted = 0 and wi.`update_time` between #{query.beginWarehouseInTime} and #{query.endWarehouseInTime})",
"AND o.order_id in(select distinct wi.order_id from ecw_order_warehouse_in wi where wi.deleted = 0 and wi.`update_time` between #{query.beginWarehouseInTime} and #{query.endWarehouseInTime})", // "</when>",
"</when>", // "<when test = 'query.creator != null and query.creator != \"\" '>",
"<when test = 'query.creator != null and query.creator != \"\" '>", // "AND o.`creator` = #{query.creator} and (o.user_id is null or o.user_id = 0)",
"AND o.`creator` = #{query.creator} and (o.user_id is null or o.user_id = 0)", // "</when>",
"</when>", // "<when test = 'query.searchKey != null and query.searchKey != \"\" '>",
"<when test = 'query.searchKey != null and query.searchKey != \"\" '>", // "AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'') ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like concat('%',concat(#{query.searchKey},'%'))",
"AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'') ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like concat('%',concat(#{query.searchKey},'%'))", // "</when>",
"</when>", // "<when test = 'query.consignorKey != null and query.consignorKey != \"\" '>",
"<when test = 'query.consignorKey != null and query.consignorKey != \"\" '>", // "AND (concat(IFNULL(nor.`name`,''),IFNULL(nor.`name_en`,''),IFNULL(nor.`phone`,'')) like concat('%',concat(#{query.consignorKey},'%'))",
"AND (concat(IFNULL(nor.`name`,''),IFNULL(nor.`name_en`,''),IFNULL(nor.`phone`,'')) like concat('%',concat(#{query.consignorKey},'%'))", // "OR nor.customer_id in (select c.id from ecw_customer c where c.number like concat('%',concat(#{query.consignorKey},'%'))))",
"OR nor.customer_id in (select c.id from ecw_customer c where c.number like concat('%',concat(#{query.consignorKey},'%'))))", // "</when>",
"</when>", // "<when test = 'query.notConsignorKey != null and query.notConsignorKey != \"\" '>",
"<when test = 'query.notConsignorKey != null and query.notConsignorKey != \"\" '>", // "AND (concat(IFNULL(nor.`name`,''),IFNULL(nor.`name_en`,''),IFNULL(nor.`phone`,'')) not like concat('%',concat(#{query.notConsignorKey},'%'))",
"AND (concat(IFNULL(nor.`name`,''),IFNULL(nor.`name_en`,''),IFNULL(nor.`phone`,'')) not like concat('%',concat(#{query.notConsignorKey},'%'))", // "AND nor.customer_id not in (select c.id from ecw_customer c where c.number like concat('%',concat(#{query.notConsignorKey},'%'))))",
"AND nor.customer_id not in (select c.id from ecw_customer c where c.number like concat('%',concat(#{query.notConsignorKey},'%'))))", // "</when>",
"</when>", // "<when test = 'query.consigneeKey != null and query.consigneeKey != \"\" '>",
"<when test = 'query.consigneeKey != null and query.consigneeKey != \"\" '>", // "AND (concat(IFNULL(nee.`name`,''),IFNULL(nee.`name_en`,''),IFNULL(nee.`phone`,'')) like concat('%',concat(#{query.consigneeKey},'%'))",
"AND (concat(IFNULL(nee.`name`,''),IFNULL(nee.`name_en`,''),IFNULL(nee.`phone`,'')) like concat('%',concat(#{query.consigneeKey},'%'))", // "OR nee.customer_id in (select c.id from ecw_customer c where c.number like concat('%',concat(#{query.consigneeKey},'%'))))",
"OR nee.customer_id in (select c.id from ecw_customer c where c.number like concat('%',concat(#{query.consigneeKey},'%'))))", // "</when>",
"</when>", // "<when test = 'query.notConsigneeKey != null and query.notConsigneeKey != \"\" '>",
"<when test = 'query.notConsigneeKey != null and query.notConsigneeKey != \"\" '>", // "AND (concat(IFNULL(nee.`name`,''),IFNULL(nee.`name_en`,''),IFNULL(nee.`phone`,'')) not like concat('%',concat(#{query.notConsigneeKey},'%'))",
"AND (concat(IFNULL(nee.`name`,''),IFNULL(nee.`name_en`,''),IFNULL(nee.`phone`,'')) not like concat('%',concat(#{query.notConsigneeKey},'%'))", // "AND nee.customer_id not in (select c.id from ecw_customer c where c.number like concat('%',concat(#{query.notConsigneeKey},'%'))))",
"AND nee.customer_id not in (select c.id from ecw_customer c where c.number like concat('%',concat(#{query.notConsigneeKey},'%'))))", // "</when>",
"</when>", // "<when test = 'query.numberKey != null and query.numberKey != \"\" '>",
"<when test = 'query.numberKey != null and query.numberKey != \"\" '>", // "AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,''), IFNULL(o.`parent_number`,''), IFNULL(o.`initial_parent_order_no`,'') ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(o.`no_charge_record`,'')) like concat('%',concat(#{query.numberKey},'%'))",
"AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,''), IFNULL(o.`parent_number`,''), IFNULL(o.`initial_parent_order_no`,'') ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(o.`no_charge_record`,'')) like concat('%',concat(#{query.numberKey},'%'))", // "</when>",
"</when>", // "<when test = 'query.notNumberKey != null and query.notNumberKey != \"\" '>",
"<when test = 'query.notNumberKey != null and query.notNumberKey != \"\" '>", // "AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,''), IFNULL(o.`parent_number`,''), IFNULL(o.`initial_parent_order_no`,'') ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(o.`no_charge_record`,'')) not like concat('%',concat(#{query.notNumberKey},'%'))",
"AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,''), IFNULL(o.`parent_number`,''), IFNULL(o.`initial_parent_order_no`,'') ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(o.`no_charge_record`,'')) not like concat('%',concat(#{query.notNumberKey},'%'))", // "</when>",
"</when>", // "<when test = 'query.eqNumberKey != null and query.eqNumberKey != \"\" '>",
"<when test = 'query.eqNumberKey != null and query.eqNumberKey != \"\" '>", // "AND (o.`order_no` = #{query.eqNumberKey}",
"AND (o.`order_no` = #{query.eqNumberKey}", // "or (o.`old_numbers` is not null and o.`old_numbers` != '' and o.`old_numbers` = #{query.eqNumberKey}) ",
"or (o.`old_numbers` is not null and o.`old_numbers` != '' and o.`old_numbers` = #{query.eqNumberKey}) ", // "or (o.`parent_number` is not null and o.`parent_number` != '' and o.`parent_number` = #{query.eqNumberKey}) ",
"or (o.`parent_number` is not null and o.`parent_number` != '' and o.`parent_number` = #{query.eqNumberKey}) ", // "or (o.`marks` is not null and o.`marks` != '' and o.`marks` = #{query.eqNumberKey}) ",
"or (o.`marks` is not null and o.`marks` != '' and o.`marks` = #{query.eqNumberKey}) ", // "or (o.`tidan_no` is not null and o.`tidan_no` != '' and o.`tidan_no` = #{query.eqNumberKey}) ",
"or (o.`tidan_no` is not null and o.`tidan_no` != '' and o.`tidan_no` = #{query.eqNumberKey}) ", // "or (o.`container_number` is not null and o.`container_number` != '' and o.`container_number` = #{query.eqNumberKey}) ",
"or (o.`container_number` is not null and o.`container_number` != '' and o.`container_number` = #{query.eqNumberKey}) ", // "or (o.`no_charge_record` is not null and o.`no_charge_record` != '' and o.`no_charge_record` = #{query.eqNumberKey})",
"or (o.`no_charge_record` is not null and o.`no_charge_record` != '' and o.`no_charge_record` = #{query.eqNumberKey})", // "or (o.`initial_parent_order_no` is not null and o.`initial_parent_order_no` != '' and o.`initial_parent_order_no` = #{query.eqNumberKey}))",
"or (o.`initial_parent_order_no` is not null and o.`initial_parent_order_no` != '' and o.`initial_parent_order_no` = #{query.eqNumberKey}))", // "</when>",
"</when>", // "<when test = 'query.notEqNumberKey != null and query.notEqNumberKey != \"\" '>",
"<when test = 'query.notEqNumberKey != null and query.notEqNumberKey != \"\" '>", // "AND o.`order_no` != #{query.notEqNumberKey}",
"AND o.`order_no` != #{query.notEqNumberKey}", // "AND (o.`old_numbers` is null or o.`old_numbers` = '' or o.`old_numbers` != #{query.notEqNumberKey})",
"AND (o.`old_numbers` is null or o.`old_numbers` = '' or o.`old_numbers` != #{query.notEqNumberKey})", // "AND (o.`parent_number` is null or o.`parent_number` = '' or o.`parent_number` != #{query.notEqNumberKey})",
"AND (o.`parent_number` is null or o.`parent_number` = '' or o.`parent_number` != #{query.notEqNumberKey})", // "AND (o.`marks` is null or o.`marks` = '' or o.`marks` != #{query.notEqNumberKey})",
"AND (o.`marks` is null or o.`marks` = '' or o.`marks` != #{query.notEqNumberKey})", // "AND (o.`tidan_no` is null or o.`tidan_no` = '' or o.`tidan_no` != #{query.notEqNumberKey})",
"AND (o.`tidan_no` is null or o.`tidan_no` = '' or o.`tidan_no` != #{query.notEqNumberKey})", // "AND (o.`container_number` is null or o.`container_number` = '' or o.`container_number` != #{query.notEqNumberKey})",
"AND (o.`container_number` is null or o.`container_number` = '' or o.`container_number` != #{query.notEqNumberKey})", // "AND (o.`no_charge_record` is null or o.`no_charge_record` = '' or o.`no_charge_record` != #{query.notEqNumberKey})",
"AND (o.`no_charge_record` is null or o.`no_charge_record` = '' or o.`no_charge_record` != #{query.notEqNumberKey})", // "AND (o.`initial_parent_order_no` is null or o.`initial_parent_order_no` = '' or o.`initial_parent_order_no` != #{query.notEqNumberKey})",
"AND (o.`initial_parent_order_no` is null or o.`initial_parent_order_no` = '' or o.`initial_parent_order_no` != #{query.notEqNumberKey})", // "</when>",
"</when>", // "<when test = 'query.prodKey != null and query.prodKey != \"\" '>",
"<when test = 'query.prodKey != null and query.prodKey != \"\" '>", // "and (o.order_id in(",
"and (o.order_id in(", // "select oi.order_id ",
"select oi.order_id ", // "from ecw_order_item oi ",
"from ecw_order_item oi ", // "left join ecw_product p ",
"left join ecw_product p ", // "on oi.prod_id = p.id ",
"on oi.prod_id = p.id ", // "left join ecw_product_type pt ",
"left join ecw_product_type pt ", // "on pt.id = oi.prod_type ",
"on pt.id = oi.prod_type ", // "left join ecw_product_brank pb",
"left join ecw_product_brank pb", // "on pb.id = oi.brand",
"on pb.id = oi.brand", // "where oi.deleted = 0 ",
"where oi.deleted = 0 ", // "and concat(IFNULL(oi.`prod_title_zh`,''),IFNULL(oi.`prod_title_en`,''),IFNULL(pt.`title_zh`,''),IFNULL(pt.`title_en`,''),IFNULL(pb.`title_zh`,''),IFNULL(pb.`title_en`,''))",
"and concat(IFNULL(oi.`prod_title_zh`,''),IFNULL(oi.`prod_title_en`,''),IFNULL(pt.`title_zh`,''),IFNULL(pt.`title_en`,''),IFNULL(pb.`title_zh`,''),IFNULL(pb.`title_en`,''))", // "like concat('%',concat(#{query.prodKey},'%'))",
"like concat('%',concat(#{query.prodKey},'%'))", // "))",
"))", // "</when>",
"</when>", // "<when test = 'query.notProdKey != null and query.notProdKey != \"\" '>",
"<when test = 'query.notProdKey != null and query.notProdKey != \"\" '>", // "and (o.order_id not in(",
"and (o.order_id not in(", // "select oi.order_id ",
"select oi.order_id ", // "from ecw_order_item oi ",
"from ecw_order_item oi ", // "left join ecw_product p ",
"left join ecw_product p ", // "on oi.prod_id = p.id ",
"on oi.prod_id = p.id ", // "left join ecw_product_type pt ",
"left join ecw_product_type pt ", // "on pt.id = oi.prod_type ",
"on pt.id = oi.prod_type ", // "left join ecw_product_brank pb",
"left join ecw_product_brank pb", // "on pb.id = oi.brand",
"on pb.id = oi.brand", // "where oi.deleted = 0 and concat(IFNULL(oi.`prod_title_zh`,''),IFNULL(oi.`prod_title_en`,''),IFNULL(pt.`title_zh`,''),IFNULL(pt.`title_en`,''),IFNULL(pb.`title_zh`,''),IFNULL(pb.`title_en`,'')) " ,
"where oi.deleted = 0 and concat(IFNULL(oi.`prod_title_zh`,''),IFNULL(oi.`prod_title_en`,''),IFNULL(pt.`title_zh`,''),IFNULL(pt.`title_en`,''),IFNULL(pb.`title_zh`,''),IFNULL(pb.`title_en`,'')) " , // "like concat('%',concat(#{query.notProdKey},'%'))",
"like concat('%',concat(#{query.notProdKey},'%'))", // "))",
"))", // "</when>",
"</when>", // "<when test = 'query.eqProdKey != null and query.eqProdKey != \"\" '>",
"<when test = 'query.eqProdKey != null and query.eqProdKey != \"\" '>", // "and (o.order_id in(",
"and (o.order_id in(", // "select oi.order_id ",
"select oi.order_id ", // "from ecw_order_item oi ",
"from ecw_order_item oi ", // "left join ecw_product p ",
"left join ecw_product p ", // "on oi.prod_id = p.id ",
"on oi.prod_id = p.id ", // "left join ecw_product_type pt ",
"left join ecw_product_type pt ", // "on pt.id = oi.prod_type ",
"on pt.id = oi.prod_type ", // "left join ecw_product_brank pb",
"left join ecw_product_brank pb", // "on pb.id = oi.brand",
"on pb.id = oi.brand", // "where oi.deleted = 0 " ,
"where oi.deleted = 0 " , // "and (oi.`prod_title_zh` = #{query.eqProdKey} or oi.`prod_title_en` = #{query.eqProdKey} " ,
"and (oi.`prod_title_zh` = #{query.eqProdKey} or oi.`prod_title_en` = #{query.eqProdKey} " , // "or pt.`title_zh` = #{query.eqProdKey} or pt.`title_en` = #{query.eqProdKey}",
"or pt.`title_zh` = #{query.eqProdKey} or pt.`title_en` = #{query.eqProdKey}", // "or pb.`title_zh` = #{query.eqProdKey} or pb.`title_en` = #{query.eqProdKey})",
"or pb.`title_zh` = #{query.eqProdKey} or pb.`title_en` = #{query.eqProdKey})", // "))",
"))", // "</when>",
"</when>", // "<when test = 'query.notEqProdKey != null and query.notEqProdKey != \"\" '>",
"<when test = 'query.notEqProdKey != null and query.notEqProdKey != \"\" '>", // "and (o.order_id not in(",
"and (o.order_id not in(", // "select oi.order_id ",
"select oi.order_id ", // "from ecw_order_item oi ",
"from ecw_order_item oi ", // "left join ecw_product p ",
"left join ecw_product p ", // "on oi.prod_id = p.id ",
"on oi.prod_id = p.id ", // "left join ecw_product_type pt ",
"left join ecw_product_type pt ", // "on pt.id = oi.prod_type ",
"on pt.id = oi.prod_type ", // "left join ecw_product_brank pb",
"left join ecw_product_brank pb", // "on pb.id = oi.brand",
"on pb.id = oi.brand", // "where oi.deleted = 0" ,
"where oi.deleted = 0" , // "and (oi.`prod_title_zh` = #{query.notEqProdKey} or oi.`prod_title_en` = #{query.notEqProdKey} " ,
"and (oi.`prod_title_zh` = #{query.notEqProdKey} or oi.`prod_title_en` = #{query.notEqProdKey} " , // "or pt.`title_zh` = #{query.notEqProdKey} or pt.`title_en` = #{query.notEqProdKey}",
"or pt.`title_zh` = #{query.notEqProdKey} or pt.`title_en` = #{query.notEqProdKey}", // "or pb.`title_zh` = #{query.notEqProdKey} or pb.`title_en` = #{query.notEqProdKey})",
"or pb.`title_zh` = #{query.notEqProdKey} or pb.`title_en` = #{query.notEqProdKey})", // "))",
"))", // "</when>",
"</when>", // "<when test = 'query.startWarehouseId != null and query.destWarehouseId != null '>",
"<when test = 'query.startWarehouseId != null and query.destWarehouseId != null '>", // "and (o.line_id in(",
"and (o.line_id in(", // "select whl.id ",
"select whl.id ", // "from ecw_warehouse_line whl ",
"from ecw_warehouse_line whl ", // "where whl.start_warehouse_id = #{query.startWarehouseId} and whl.dest_warehouse_id = #{query.destWarehouseId} ",
"where whl.start_warehouse_id = #{query.startWarehouseId} and whl.dest_warehouse_id = #{query.destWarehouseId} ", // "))",
"))", // "</when>",
"</when>", // "<when test = 'query.startWarehouseId != null and query.destWarehouseId == null '>",
"<when test = 'query.startWarehouseId != null and query.destWarehouseId == null '>", // "and (o.line_id in(",
"and (o.line_id in(", // "select whl.id ",
"select whl.id ", // "from ecw_warehouse_line whl ",
"from ecw_warehouse_line whl ", // "where whl.start_warehouse_id = #{query.startWarehouseId} ",
"where whl.start_warehouse_id = #{query.startWarehouseId} ", // "))",
"))", // "</when>",
"</when>", // "<when test = 'query.startWarehouseId == null and query.destWarehouseId != null '>",
"<when test = 'query.startWarehouseId == null and query.destWarehouseId != null '>", // "and (o.line_id in(",
"and (o.line_id in(", // "select whl.id ",
"select whl.id ", // "from ecw_warehouse_line whl ",
"from ecw_warehouse_line whl ", // "where whl.dest_warehouse_id = #{query.destWarehouseId} ",
"where whl.dest_warehouse_id = #{query.destWarehouseId} ", // "))",
"))", // "</when>",
"</when>", // "<when test = 'query.airShipment != null and query.airShipment == 1'>",
"<when test = 'query.airShipment != null and query.airShipment == 1'>", // "AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0 ",
"AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0 ", // "</when>",
"</when>", // "<when test = 'query.airShipment != null and query.airShipment == 2'>",
"<when test = 'query.airShipment != null and query.airShipment == 2'>", // "AND o.`status` = 5 AND o.air_shipment = 2",
"AND o.`status` = 5 AND o.air_shipment = 2", // "</when>",
"</when>", // "<when test = 'query.airShipment != null and query.airShipment == 3'>",
"<when test = 'query.airShipment != null and query.airShipment == 3'>", // "AND o.`status` = 5 AND o.air_shipment = 3",
"AND o.`status` = 5 AND o.air_shipment = 3", // "</when>",
"</when>", // "<when test = 'query.airShipment != null and query.airShipment == 4'>",
"<when test = 'query.airShipment != null and query.airShipment == 4'>", // "AND o.`status` = 5 AND o.air_shipment = 4",
"AND o.`status` = 5 AND o.air_shipment = 4", // "</when>",
"</when>", // "<when test = 'query.airShipment != null and query.airShipment == 10'>",
"<when test = 'query.airShipment != null and query.airShipment == 10'>", // "AND o.`status` = 5 AND o.air_shipment in(2,3,4)",
"AND o.`status` = 5 AND o.air_shipment in(2,3,4)", // "</when>",
"</when>", // "<when test = 'query.airShipment != null and query.airShipment == 11'>",
"<when test = 'query.airShipment != null and query.airShipment == 11'>", // "AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0 ",
"AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0 ", // "</when>",
"</when>", // "<when test = 'query.airShipment != null and query.airShipment == 12'>",
"<when test = 'query.airShipment != null and query.airShipment == 12'>", // "AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0 ",
"AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0 ", // "</when>",
"</when>", // "<when test = 'query.airShipment != null and query.airShipment == 20'>",
"<when test = 'query.airShipment != null and query.airShipment == 20'>", // "AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0 ",
"AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0 ", // "</when>",
"</when>", // "<when test = 'query.isNeat == false '>",
"<when test = 'query.isNeat == false '>", // " AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum' ",
" AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum' ", // "</when>",
"</when>", // "<when test = 'query.isNeat == true '>",
"<when test = 'query.isNeat == true '>", // " AND o.sum_num = o.cost->>'$.totalNum' ",
" AND o.sum_num = o.cost->>'$.totalNum' ", // "</when>",
"</when>", // "<when test = 'query.type != null and query.type != \"\" and query.type == 0 '>",
"<when test = 'query.type != null and query.type != \"\" and query.type == 0 '>", // "AND (o.type is null or o.type = '' or o.type = '0')",
"AND (o.type is null or o.type = '' or o.type = '0')", // "</when>",
"</when>", //
"<when test = 'query.type == 1 '>", // "<when test = 'query.type == 1 '>",
"AND FIND_IN_SET(1, o.type)", // "AND FIND_IN_SET(1, o.type)",
"</when>", // "</when>",
"<when test = 'query.type == 2 '>", // "<when test = 'query.type == 2 '>",
"AND FIND_IN_SET(2, o.type)", // "AND FIND_IN_SET(2, o.type)",
"</when>", // "</when>",
"<when test = 'query.customerDetailId != null'>", // "<when test = 'query.customerDetailId != null'>",
"AND (o.`customer_id` = #{query.customerDetailId} or nor.`customer_id` = #{query.customerDetailId} or nee.`customer_id` = #{query.customerDetailId})", // "AND (o.`customer_id` = #{query.customerDetailId} or nor.`customer_id` = #{query.customerDetailId} or nee.`customer_id` = #{query.customerDetailId})",
"</when>", // "</when>",
"<when test = 'query.userType == 2 '>", // "<when test = 'query.userType == 2 '>",
"</when>", // "</when>",
"</script>" // "</script>"
}) // })
StatisticsOrderVO statisticsMyOrder(@Param("query") OrderQueryDTO query); StatisticsOrderVO statisticsMyOrder(@Param("query") OrderQueryDTO query);
...@@ -4397,12 +4397,31 @@ public interface OrderMapper extends AbstractMapper<OrderDO> { ...@@ -4397,12 +4397,31 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
"<when test = 'query.type != null and query.type != \"\" and query.type == 0 '>", "<when test = 'query.type != null and query.type != \"\" and query.type == 0 '>",
"AND (o.type is null or o.type = '' or o.type = '0')", "AND (o.type is null or o.type = '' or o.type = '0')",
"</when>", "</when>",
"<when test = 'query.type == 1 '>", // "<when test = 'query.type == 1 '>",
"AND FIND_IN_SET(1, o.type)", // "AND FIND_IN_SET(1, o.type)",
"</when>", // "</when>",
"<when test = 'query.type == 2 '>", // "<when test = 'query.type == 2 '>",
"AND FIND_IN_SET(2, o.type)", // "AND FIND_IN_SET(2, o.type)",
"</when>", // "</when>",
// "<when test='query.type != null and query.type != '' and query.type.size()>0 '>" ,
// "<if test='query.type != null and query.type != '' and query.type.size()>1 '>" ,
// "AND o.type in" ,
// "<foreach item='type' collection='query.type' open='(' separator=',' close=')'>" ,
// "${type}" ,
// "</foreach>" ,
// "</if>" ,
// "<if test='query.type != null and query.type != '' and query.type.size()==1 '>" ,
// "<if test='query.type != null and query.type != '' and query.type == 0 '>" ,
// "AND (o.type is null or o.type = '' or o.type = '0')" ,
// "</if>" ,
// "<if test='query.type == 1 '>" ,
// "AND FIND_IN_SET(1, o.type)" ,
// "</if>" ,
// "<if test='query.type == 2 '>" ,
// "AND FIND_IN_SET(2, o.type)" ,
// "</if>" ,
// "</if>" ,
// "</when>",
"<when test = 'query.objectiveId != null '>", "<when test = 'query.objectiveId != null '>",
"AND ob.`objective_id` = #{query.objectiveId}", "AND ob.`objective_id` = #{query.objectiveId}",
"</when>", "</when>",
......
...@@ -65,7 +65,7 @@ public class OrderQueryDTO { ...@@ -65,7 +65,7 @@ public class OrderQueryDTO {
private Long channelId; private Long channelId;
@ApiModelProperty(value = "订单类型筛选条件:0 普通订单 1 集运服务 2 海外仓") @ApiModelProperty(value = "订单类型筛选条件:0 普通订单 1 集运服务 2 海外仓")
private String type; private List<String> type;
@ApiModelProperty(value = "订单类型:1 普货 2 重货 3 泡货") @ApiModelProperty(value = "订单类型:1 普货 2 重货 3 泡货")
private Integer orderType; private Integer orderType;
......
...@@ -943,15 +943,53 @@ ...@@ -943,15 +943,53 @@
</select> </select>
<sql id="myOrderQuery"> <sql id="myOrderQuery">
<if test="query.type != null and query.type != '' and query.type == 0 "> <if test="query.type != null and query.type != '' and query.type.size()>0 ">
AND (o.type is null or o.type = '' or o.type = '0') <if test="query.type != null and query.type != '' and query.type.size()>1 ">
</if> <!-- AND o.type in-->
<if test="query.type == 1 "> <!-- <foreach item='type' collection='query.type' open='(' separator=',' close=')'>-->
AND FIND_IN_SET(1, o.type) <!-- ${type}-->
</if> <!-- </foreach>-->
<if test="query.type == 2 "> AND (1 !=1
AND FIND_IN_SET(2, o.type) <foreach item='type' index="index" collection='query.type' >
<if test="type == 0 ">
OR (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
OR FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
OR FIND_IN_SET(2, o.type)
</if>
</foreach>
)
</if>
<if test="query.type != null and query.type != '' and query.type.size()==1 ">
<foreach item='type' index="index" collection='query.type' >
<if test="type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
AND FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
</foreach>
</if>
</if> </if>
<!-- <if test="query.type != null and query.type != '' and query.type == 0 ">-->
<!-- AND (o.type is null or o.type = '' or o.type = '0')-->
<!-- </if>-->
<!-- <if test="query.type == 1 ">-->
<!-- AND FIND_IN_SET(1, o.type)-->
<!-- </if>-->
<!-- <if test="query.type == 2 ">-->
<!-- AND FIND_IN_SET(2, o.type)-->
<!-- </if>-->
<if test="query.pdaStartWareIds != null and query.pdaStartWareIds != '' "> <if test="query.pdaStartWareIds != null and query.pdaStartWareIds != '' ">
AND FIND_IN_SET(ew_start.`id`, #{query.pdaStartWareIds}) AND FIND_IN_SET(ew_start.`id`, #{query.pdaStartWareIds})
</if> </if>
...@@ -3570,4 +3608,431 @@ ...@@ -3570,4 +3608,431 @@
#{transportId} #{transportId}
</foreach> </foreach>
</select> </select>
<select id="statisticsMyOrder" resultType="cn.iocoder.yudao.module.order.vo.order.StatisticsOrderVO">
select
SUM(IFNULL(IF(it.warehouse_in_info is null, 0, it.warehouse_in_info->>'$.cartonsNum'), 0)) as total_num,
SUM(IFNULL(IF(it.warehouse_in_info is null, 0, it.warehouse_in_info->>'$.volume'), 0)) as total_volume,
SUM(IFNULL(IF(it.warehouse_in_info is null, 0, it.warehouse_in_info->>'$.weight'), 0)) as total_weight,
SUM(IFNULL(IF(it.warehouse_in_info is null, 0, it.warehouse_in_info->>'$.quantityAll'), 0)) as order_quantity,
SUM(IFNULL(it.w_volume,0)) as total_w_volume,
SUM(IFNULL(it.v_weight,0)) as total_v_weight,
SUM(IFNULL(IF(it.warehouse_in_info is null, 0, IF(it.charge_weight > it.min_metering_weight ,it.charge_weight,it.min_metering_weight)), 0)) as total_charge_weight,
SUM(IFNULL(IF(it.warehouse_in_info is null, 0, IF(it.charge_volume > it.min_metering_volume,it.charge_volume,it.min_metering_volume)), 0)) as total_charge_volume,
SUM(IFNULL(IF(it.warehouse_in_info is null, 0, IF(it.charge_quantity > it.min_metering_quantity,it.charge_quantity,it.min_metering_quantity)), 0)) as total_charge_quantity
from ecw_order_item it
left join ecw_order o
ON it.order_id = o.order_id and it.deleted = 0
left join ecw_order_departure de on de.order_id = o.order_id
left join ecw_order_objective ob on ob.order_id = o.order_id
left join ecw_order_consignor nor on nor.order_id = o.order_id
left join ecw_order_consignee nee on nee.order_id = o.order_id
left join ecw_channel channel on channel.channel_id = o.channel_id
where o.deleted = 0 and o.in_warehouse_state != 211 and o.in_warehouse_state != 208 and o.status != 10
<if test = "query.deptId != null ">
AND o.dept_id = #{query.deptId}
</if>
<if test = "query.deptIdList != null and query.deptIdList.size() > 0">
AND (o.dept_id IN
<foreach item='deptId' collection='query.deptIdList' open='(' close=')' separator=','> #{deptId} </foreach>
or
(SELECT u.dept_id FROM system_user u WHERE u.id = o.creator) IN
<foreach item='deptId' collection='query.deptIdList' open='(' close=')' separator=','> #{deptId} </foreach>)
</if>
<if test = "query.pdaStartWareIds != null and query.pdaStartWareIds != '' ">
AND FIND_IN_SET(ew_start.`id`, #{query.pdaStartWareIds})
</if>
<if test = "query.pdaDestWareIds != null and query.pdaDestWareIds != '' ">
AND FIND_IN_SET(ew_dest.`id`, #{query.pdaDestWareIds})
</if>
<if test = "query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test = "query.isExternalWarehouse != null">
AND o.`is_external_warehouse` = #{query.isExternalWarehouse}
</if>
<if test = "query.status != null">
AND o.`status` = #{query.status}
</if>
<if test = "query.abnormalState != null">
<choose>
<when test = "query.abnormalState != 0">
<choose>
<when test = "query.abnormalState != -1">
AND o.`abnormal_state` = #{query.abnormalState}
</when>
<otherwise>
AND o.`abnormal_state` != 0
</otherwise>
</choose>
</when>
<otherwise>
AND o.`abnormal_state` = 0
</otherwise>
</choose>
</if>
<if test = "query.inWarehouseState != null">
AND o.`in_warehouse_state` = #{query.inWarehouseState}
</if>
<if test = "query.shipmentState != null">
AND o.`shipment_State` = #{query.shipmentState}
</if>
<if test = "query.auditType != null">
<choose>
<when test = 'query.auditType != 0'>
<choose>
<when test = '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 test = "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} ))
</if>
<if test = "query.customsType != null">
AND o.`customs_type` = #{query.customsType}
</if>
<if test = "query.productRecord != null">
AND o.`product_record` = #{query.productRecord}
</if>
<if test = "query.transportId != null">
AND o.`transport_id` = #{query.transportId}
</if>
<if test = "query.channelId != null">
AND o.`channel_id` = #{query.channelId}
</if>
<if test = "query.warehouseType != null">
AND o.`warehouse_type` = #{query.warehouseType}
</if>
<if test = "query.number != null and query.number != '' ">
AND (o.`number` like concat('%',concat(#{query.number},'%'))
or
o.order_id in
(select distinct oi.order_id from ecw_order_item oi
where oi.deleted = 0 and
((oi.warehouse_in_info is null and oi.express_no like concat('%',concat(#{query.number},'%')))
or
(oi.warehouse_in_info is not null and oi.warehouse_in_info ->> '$.expressNo' like concat('%',concat(#{query.number},'%'))))))
</if>
<if test = "query.notNumber != null and query.notNumber != '' ">
AND o.`number` not like concat('%',concat(#{query.notNumber},'%'))
AND
o.order_id not in
(select distinct oi.order_id from ecw_order_item oi
where oi.deleted = 0 and
((oi.warehouse_in_info is null and oi.express_no like concat('%',concat(#{query.notNumber},'%')))
or
(oi.warehouse_in_info is not null and oi.warehouse_in_info ->> '$.expressNo' like concat('%',concat(#{query.notNumber},'%')))))
</if>
<if test = "query.marks != null and query.marks != '' ">
AND o.`marks` like concat('%',concat(#{query.marks},'%'))
</if>
<if test = "query.departureId != null ">
AND de.`departure_id` = #{query.departureId}
</if>
<if test = "query.objectiveId != null ">
AND ob.`objective_id` = #{query.objectiveId}
</if>
<if test = "query.consignorId != null ">
AND nor.`customer_id` = #{query.consignorId}
</if>
<if test = "query.consignorPhone != null and query.consignorPhone != '' ">
AND nor.`phone` = #{query.consignorPhone}
</if>
<if test = "query.consigneeId != null ">
AND nee.`customer_id` = #{query.consigneeId}
</if>
<if test = "query.consigneePhone != null and query.consigneePhone != '' ">
AND nee.`phone` = #{query.consigneePhone}
</if>
<if test = "query.isCargoControl != null ">
AND o.`is_cargo_control` = #{query.isCargoControl}
</if>
<if test = "query.orderNo != null and query.orderNo != '' ">
AND o.`order_no` like concat('%',concat(#{query.orderNo},'%'))
</if>
<if test = "query.orderIdList != null and query.orderIdList.size() != 0">
AND o.`order_id` in
<foreach item='orderId' index='index' collection='query.orderIdList' open='(' separator=',' close=')'>#{orderId}</foreach>
</if>
<if test = "query.tidanNo != null and query.tidanNo != '' ">
AND o.`tidan_no` like concat('%',concat(#{query.tidanNo},'%'))
</if>
<if test = "query.customerId != null">
AND o.`customer_id` = #{query.customerId}
</if>
<if test = "query.beginRucangTime != null and query.endRucangTime != null ">
AND o.order_id in(select distinct wi.order_id from ecw_order_warehouse_in wi where wi.deleted = 0 and wi.`in_time` between #{query.beginRucangTime} and #{query.endRucangTime})
</if>
<if test = "query.beginQingguanTime != null and query.endQingguanTime != null ">
AND o.`qingguan_time` between #{query.beginQingguanTime} and #{query.endQingguanTime}
</if>
<if test = "query.beginDaogangTime != null and query.endDaogangTime != null ">
AND o.`daogang_time` between #{query.beginDaogangTime} and #{query.endDaogangTime}
</if>
<if test = "query.beginPreLoadTime != null and query.endPreLoadTime != null ">
AND o.`status` > 5 AND o.`pre_load_time` between #{query.beginPreLoadTime} and #{query.endPreLoadTime}
</if>
<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
where b.deleted = 0 and bc.deleted = 0 and bc.`checkout_time` between #{query.beginOutboundTime} and #{query.endOutboundTime})
</if>
<if test = "query.beginLoadTime != null and query.endLoadTime != null ">
AND o.`load_time` between #{query.beginLoadTime} and #{query.endLoadTime}
</if>
<if test = "query.beginUnloadTime != null and query.endUnloadTime != null ">
AND o.`unload_time` between #{query.beginUnloadTime} and #{query.endUnloadTime}
</if>
<if test = "query.beginTakeTime != null and query.endTakeTime != null ">
AND o.`status` > 19 AND o.`take_time` between #{query.beginTakeTime} and #{query.endTakeTime}
</if>
<if test = "query.beginSplitTime != null and query.endSplitTime != null ">
AND o.`split_time` between #{query.beginSplitTime} and #{query.endSplitTime}
</if>
<if test = "query.beginCreateTime != null and query.endCreateTime != null ">
AND o.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}
</if>
<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 op.status in(1,3) and op.`create_time` between #{query.beginPickTime} and #{query.endPickTime})
</if>
<if test = "query.beginPickUpTime != null and query.endPickUpTime != null ">
AND o.order_no in(select distinct op.order_id from ecw_order_pickup op where op.deleted = 0 and op.`create_time` between #{query.beginPickUpTime} and #{query.endPickUpTime})
</if>
<if test = "query.beginWarehouseInTime != null and query.endWarehouseInTime != null ">
AND o.order_id in(select distinct wi.order_id from ecw_order_warehouse_in wi where wi.deleted = 0 and wi.`update_time` between #{query.beginWarehouseInTime} and #{query.endWarehouseInTime})
</if>
<if test = "query.creator != null and query.creator != '' ">
AND o.`creator` = #{query.creator} and (o.user_id is null or o.user_id = 0)
</if>
<if test = "query.searchKey != null and query.searchKey != '' ">
AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'') ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like concat('%',concat(#{query.searchKey},'%'))
</if>
<if test = "query.consignorKey != null and query.consignorKey != '' ">
AND (concat(IFNULL(nor.`name`,''),IFNULL(nor.`name_en`,''),IFNULL(nor.`phone`,'')) like concat('%',concat(#{query.consignorKey},'%'))
OR nor.customer_id in (select c.id from ecw_customer c where c.number like concat('%',concat(#{query.consignorKey},'%'))))
</if>
<if test = "query.notConsignorKey != null and query.notConsignorKey != '' ">
AND (concat(IFNULL(nor.`name`,''),IFNULL(nor.`name_en`,''),IFNULL(nor.`phone`,'')) not like concat('%',concat(#{query.notConsignorKey},'%'))
AND nor.customer_id not in (select c.id from ecw_customer c where c.number like concat('%',concat(#{query.notConsignorKey},'%'))))
</if>
<if test = "query.consigneeKey != null and query.consigneeKey != '' ">
AND (concat(IFNULL(nee.`name`,''),IFNULL(nee.`name_en`,''),IFNULL(nee.`phone`,'')) like concat('%',concat(#{query.consigneeKey},'%'))
OR nee.customer_id in (select c.id from ecw_customer c where c.number like concat('%',concat(#{query.consigneeKey},'%'))))
</if>
<if test = "query.notConsigneeKey != null and query.notConsigneeKey != '' ">
AND (concat(IFNULL(nee.`name`,''),IFNULL(nee.`name_en`,''),IFNULL(nee.`phone`,'')) not like concat('%',concat(#{query.notConsigneeKey},'%'))
AND nee.customer_id not in (select c.id from ecw_customer c where c.number like concat('%',concat(#{query.notConsigneeKey},'%'))))
</if>
<if test = "query.numberKey != null and query.numberKey != '' ">
AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,''), IFNULL(o.`parent_number`,''), IFNULL(o.`initial_parent_order_no`,'') ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(o.`no_charge_record`,'')) like concat('%',concat(#{query.numberKey},'%'))
</if>
<if test = "query.notNumberKey != null and query.notNumberKey != '' ">
AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,''), IFNULL(o.`parent_number`,''), IFNULL(o.`initial_parent_order_no`,'') ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(o.`no_charge_record`,'')) not like concat('%',concat(#{query.notNumberKey},'%'))
</if>
<if test = "query.eqNumberKey != null and query.eqNumberKey != '' ">
AND (o.`order_no` = #{query.eqNumberKey}
or (o.`old_numbers` is not null and o.`old_numbers` != '' and o.`old_numbers` = #{query.eqNumberKey})
or (o.`parent_number` is not null and o.`parent_number` != '' and o.`parent_number` = #{query.eqNumberKey})
or (o.`marks` is not null and o.`marks` != '' and o.`marks` = #{query.eqNumberKey})
or (o.`tidan_no` is not null and o.`tidan_no` != '' and o.`tidan_no` = #{query.eqNumberKey})
or (o.`container_number` is not null and o.`container_number` != '' and o.`container_number` = #{query.eqNumberKey})
or (o.`no_charge_record` is not null and o.`no_charge_record` != '' and o.`no_charge_record` = #{query.eqNumberKey})
or (o.`initial_parent_order_no` is not null and o.`initial_parent_order_no` != '' and o.`initial_parent_order_no` = #{query.eqNumberKey}))
</if>
<if test = "query.notEqNumberKey != null and query.notEqNumberKey != '' ">
AND o.`order_no` != #{query.notEqNumberKey}
AND (o.`old_numbers` is null or o.`old_numbers` = '' or o.`old_numbers` != #{query.notEqNumberKey})
AND (o.`parent_number` is null or o.`parent_number` = '' or o.`parent_number` != #{query.notEqNumberKey})
AND (o.`marks` is null or o.`marks` = '' or o.`marks` != #{query.notEqNumberKey})
AND (o.`tidan_no` is null or o.`tidan_no` = '' or o.`tidan_no` != #{query.notEqNumberKey})
AND (o.`container_number` is null or o.`container_number` = '' or o.`container_number` != #{query.notEqNumberKey})
AND (o.`no_charge_record` is null or o.`no_charge_record` = '' or o.`no_charge_record` != #{query.notEqNumberKey})
AND (o.`initial_parent_order_no` is null or o.`initial_parent_order_no` = '' or o.`initial_parent_order_no` != #{query.notEqNumberKey})
</if>
<if test = "query.prodKey != null and query.prodKey != '' ">
and (o.order_id in(
select oi.order_id
from ecw_order_item oi
left join ecw_product p
on oi.prod_id = p.id
left join ecw_product_type pt
on pt.id = oi.prod_type
left join ecw_product_brank pb
on pb.id = oi.brand
where oi.deleted = 0
and concat(IFNULL(oi.`prod_title_zh`,''),IFNULL(oi.`prod_title_en`,''),IFNULL(pt.`title_zh`,''),IFNULL(pt.`title_en`,''),IFNULL(pb.`title_zh`,''),IFNULL(pb.`title_en`,''))
like concat('%',concat(#{query.prodKey},'%'))
))
</if>
<if test = "query.notProdKey != null and query.notProdKey != '' ">
and (o.order_id not in(
select oi.order_id
from ecw_order_item oi
left join ecw_product p
on oi.prod_id = p.id
left join ecw_product_type pt
on pt.id = oi.prod_type
left join ecw_product_brank pb
on pb.id = oi.brand
where oi.deleted = 0 and concat(IFNULL(oi.`prod_title_zh`,''),IFNULL(oi.`prod_title_en`,''),IFNULL(pt.`title_zh`,''),IFNULL(pt.`title_en`,''),IFNULL(pb.`title_zh`,''),IFNULL(pb.`title_en`,'')) ,
like concat('%',concat(#{query.notProdKey},'%'))
))
</if>
<if test = "query.eqProdKey != null and query.eqProdKey != '' ">
and (o.order_id in(
select oi.order_id
from ecw_order_item oi
left join ecw_product p
on oi.prod_id = p.id
left join ecw_product_type pt
on pt.id = oi.prod_type
left join ecw_product_brank pb
on pb.id = oi.brand
where oi.deleted = 0 ,
and (oi.`prod_title_zh` = #{query.eqProdKey} or oi.`prod_title_en` = #{query.eqProdKey} ,
or pt.`title_zh` = #{query.eqProdKey} or pt.`title_en` = #{query.eqProdKey}
or pb.`title_zh` = #{query.eqProdKey} or pb.`title_en` = #{query.eqProdKey})
))
</if>
<if test = "query.notEqProdKey != null and query.notEqProdKey != '' ">
and (o.order_id not in(
select oi.order_id
from ecw_order_item oi
left join ecw_product p
on oi.prod_id = p.id
left join ecw_product_type pt
on pt.id = oi.prod_type
left join ecw_product_brank pb
on pb.id = oi.brand
where oi.deleted = 0
and (oi.`prod_title_zh` = #{query.notEqProdKey} or oi.`prod_title_en` = #{query.notEqProdKey} ,
or pt.`title_zh` = #{query.notEqProdKey} or pt.`title_en` = #{query.notEqProdKey}
or pb.`title_zh` = #{query.notEqProdKey} or pb.`title_en` = #{query.notEqProdKey})
))
</if>
<if test = "query.startWarehouseId != null and query.destWarehouseId != null ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id = #{query.startWarehouseId} and whl.dest_warehouse_id = #{query.destWarehouseId}
))
</if>
<if test = "query.startWarehouseId != null and query.destWarehouseId == null ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id = #{query.startWarehouseId}
))
</if>
<if test = "query.startWarehouseId == null and query.destWarehouseId != null ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.dest_warehouse_id = #{query.destWarehouseId}
))
</if>
<if test = "query.airShipment != null and query.airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</if>
<if test = "query.airShipment != null and query.airShipment == 2">
AND o.`status` = 5 AND o.air_shipment = 2
</if>
<if test = "query.airShipment != null and query.airShipment == 3">
AND o.`status` = 5 AND o.air_shipment = 3
</if>
<if test = "query.airShipment != null and query.airShipment == 4">
AND o.`status` = 5 AND o.air_shipment = 4
</if>
<if test = "query.airShipment != null and query.airShipment == 10">
AND o.`status` = 5 AND o.air_shipment in(2,3,4)
</if>
<if test = "query.airShipment != null and query.airShipment == 11">
AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</if>
<if test = "query.airShipment != null and query.airShipment == 12">
AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</if>
<if test = "query.airShipment != null and query.airShipment == 20">
AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</if>
<if test = "query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
<if test = "query.isNeat == true ">
AND o.sum_num = o.cost->>'$.totalNum'
</if>
<!-- <if test = "query.type != null and query.type != '' and query.type == 0 ">-->
<!-- AND (o.type is null or o.type = '' or o.type = '0')-->
<!-- </if>-->
<!-- <if test = "query.type == 1 ">-->
<!-- AND FIND_IN_SET(1, o.type)-->
<!-- </if>-->
<!-- <if test = "query.type == 2 ">-->
<!-- AND FIND_IN_SET(2, o.type)-->
<!-- </if>-->
<if test="query.type != null and query.type != '' and query.type.size()>0 ">
<if test="query.type != null and query.type != '' and query.type.size()>1 ">
<!-- AND o.type in-->
<!-- <foreach item='type' collection='query.type' open='(' separator=',' close=')'>-->
<!-- ${type}-->
<!-- -->
<!-- </foreach>-->
AND (1!=1
<foreach item='type' index="index" collection='query.type' >
<if test="type == 0 ">
OR (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
OR FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
OR FIND_IN_SET(2, o.type)
</if>
</foreach>
)
</if>
<if test="query.type != null and query.type != '' and query.type.size()==1 ">
<foreach item='type' index="index" collection='query.type' >
<if test="type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
AND FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
</foreach>
<!-- <if test="query.type != null and query.type != '' and query.type == 0 ">-->
<!-- AND (o.type is null or o.type = '' or o.type = '0')-->
<!-- -->
<!-- </if>-->
<!-- <if test="query.type == 1 ">-->
<!-- AND FIND_IN_SET(1, o.type)-->
<!-- </if>-->
<!-- <if test="query.type == 2 ">-->
<!-- AND FIND_IN_SET(2, o.type)-->
<!-- </if>-->
</if>
</if>
<if test = "query.customerDetailId != null">
AND (o.`customer_id` = #{query.customerDetailId} or nor.`customer_id` = #{query.customerDetailId} or nee.`customer_id` = #{query.customerDetailId})
</if>
<if test = "query.userType == 2 ">
</if>
</select>
</mapper> </mapper>
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