@@ -65,6 +65,7 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
"ebpg.order_id, ",
"ebpg.order_item_id, ",
"ebpg.tidan_num, ",
"eo.order_id, ",
"eo.order_no, ",
"eo.transport_id, ",
"(select min(owi.`in_time`) from ecw_order_warehouse_in owi where owi.deleted = 0 and owi.order_id = eo.order_id ) as rucang_time,",
...
...
@@ -83,6 +84,7 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
"eo.audit_type, ",
"eo.audit_result, ",
"eo.guan_lian_order_status, ",
"eo.container_number, ",
"eo.exception_reason, ",
"eo.package_type as advance_type, ",
"eoi.prod_title_zh, ",
...
...
@@ -113,7 +115,8 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
"IF(#{query.lang} = 0, pd.title_zh, pd.title_en) as brand_name, ",
"ewl.dest_warehouse_id, ",
"IFNULL((select a.pkg_id from ecw_box_pkg_order a where a.deleted=0 and a.order_item_id=ebpg.order_item_id limit 1),0) as pkgId, ",
"(select t1.pkg_num from ecw_box_pkg_order t INNER JOIN ecw_box_merge_pkg t1 on t.pkg_id=t1.id where t.deleted=0 and t1.deleted=0 and t.order_id=ebpg.order_id limit 1) as pkgNum ",
"(select t1.pkg_num from ecw_box_pkg_order t INNER JOIN ecw_box_merge_pkg t1 on t.pkg_id=t1.id where t.deleted=0 and t1.deleted=0 and t.order_id=ebpg.order_id limit 1) as pkgNum, ",
"(select count(0) from ecw_order_guanlian t LEFT JOIN ecw_order t1 on t.order_id=t1.order_id LEFT JOIN ecw_order t2 on t.relate_order_id=t2.order_id where (t.order_id=3398 or t.relate_order_id = 3398) and t1.deleted=0 and t2.deleted=0 and t.deleted=0 ) as guanLianOrderCount ",
"FROM ecw_box_preload_goods ebpg ",
"INNER JOIN ecw_box_preload_section ebps ON ebpg.sec_id = ebps.id ",
"INNER JOIN ecw_order eo ON eo.order_id = ebpg.order_id ",
...
...
@@ -182,6 +185,126 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
"(select min(owi.`in_time`) from ecw_order_warehouse_in owi where owi.deleted = 0 and owi.order_id = eo.order_id ) as rucang_time,",
"eo.product_record, ",
"eo.customs_type, ",
"eo.adjust_to_dest_warehouse_id, ",
"eo.warehouse_type, ",
"eo.line_id, ",
"eo.is_external_warehouse, ",
"eo.cost ->> '$.totalWorth' as total_worth, ",
"eo.air_shipment, ",
"eo.status, ",
"eo.abnormal_state, ",
"eo.in_warehouse_state, ",
"eo.shipment_state, ",
"eo.audit_type, ",
"eo.audit_result, ",
"eo.guan_lian_order_status, ",
"eo.container_number, ",
"eo.exception_reason, ",
"eo.package_type as advance_type, ",
"eoi.prod_title_zh, ",
"eoi.prod_title_en, ",
"eoi.box_gauge, ",
"eoi.num, ",
"eoi.quantity, ",
"eoi.worth, ",
"eoi.brand_type, ",
"eoi.brand, ",
"eoi.sea_freight_currency, ",
"eoi.clearance_freight_currency, ",
"eoi.prod_attr_ids, ",
"eoi.warehouse_in_prod_attr_ids, ",
"eoi.fee_type, ",
"if(#{query.lang} = 0, ew_start.title_zh, ew_start.title_en) as start_warehouse_name, ",
"if(#{query.lang} = 0, ew_dest.title_zh, ew_dest.title_en) as dest_warehouse_name, ",
"eoi.unit, ",
"eoi.volume, ",
"eoi.warehouse_in_info, ",
"eoi.weight,",
"eoi.charge_weight, ",
"eoi.charge_volume, ",
"eoi.charge_quantity, ",
"eoi.material,",
"eoi.sea_freight_volume, ",
"eoi.clearance_freight_volume, ",
"IF(#{query.lang} = 0, pd.title_zh, pd.title_en) as brand_name, ",
"ewl.dest_warehouse_id, ",
// "IFNULL((select a.pkg_id from ecw_box_pkg_order a where a.deleted=0 and a.order_item_id=ebpg.order_item_id limit 1),0) as pkgId, ",
// "(select t1.pkg_num from ecw_box_pkg_order t INNER JOIN ecw_box_merge_pkg t1 on t.pkg_id=t1.id where t.deleted=0 and t1.deleted=0 and t.order_id=ebpg.order_id limit 1) as pkgNum, ",
"(select count(0) from ecw_order_guanlian t LEFT JOIN ecw_order t1 on t.order_id=t1.order_id LEFT JOIN ecw_order t2 on t.relate_order_id=t2.order_id where (t.order_id=3398 or t.relate_order_id = 3398) and t1.deleted=0 and t2.deleted=0 and t.deleted=0 ) as guanLianOrderCount ",
// "FROM ecw_box_preload_goods ebpg ",
// "INNER JOIN ecw_box_preload_section ebps ON ebpg.sec_id = ebps.id ",
// "INNER JOIN ecw_order eo ON eo.order_id = ebpg.order_id ",
"FROM ecw_order eo ",
// "INNER JOIN ecw_order_item eoi ON ebpg.order_item_id = eoi.order_item_id ",
"INNER JOIN ecw_order_item eoi ON eoi.order_id = eo.order_id ",
"INNER JOIN ecw_warehouse_line ewl ON eo.line_id = ewl.id ",
"INNER JOIN ecw_warehouse ew_start ON ewl.start_warehouse_id = ew_start.id ",
"INNER JOIN ecw_warehouse ew_dest ON ewl.dest_warehouse_id = ew_dest.id ",
"LEFT JOIN ecw_product_brank pd on eoi.brand = pd.id ",
@Select("SELECT GROUP_CONCAT(DISTINCT customs_type) customs_type from ecw_order eo where EXISTS (SELECT order_id from ecw_box_preload_goods ebpg where shipment_id=#{shipmentId} and deleted=0 and is_remove=0 and eo.order_id=ebpg.order_id)")