sm t_product_stock 表 ⌘ + J 脚本 代码片段 暂无数据 可上传多个本地脚本文件 (.sql 文件) , 或将 SQL 窗口保存为脚本 工单 数据导出 导出 导出结果集 数据变更 导入 模拟数据 数据库变更 影子表同步 结构比对 开发 small_oa_169 数据源:sm 属性数据 导出 基本信息 列 索引 约束 DDL 706667686960616263646550515253545556575859 `counts` bigint(20) NOT NULL DEFAULT '1' COMMENT '数量', `parent_id` bigint(20) DEFAULT NULL COMMENT '父级id', `priority_flag` bit(1) NOT NULL DEFAULT b'0' COMMENT '优出标记:0.否 1.是', PRIMARY KEY (`id`), UNIQUE KEY `un_idx_mkc_id` (`mkc_id`) BLOCK_SIZE 16384 LOCAL COMMENT '库存详细id索引', KEY `productstockdetail_ppid` (`ppid`) BLOCK_SIZE 16384 LOCAL, KEY `productstockdetail_instock_detail_id` (`instock_detail_id`) BLOCK_SIZE 16384 LOCAL, KEY `index_area_id` (`area_id`) BLOCK_SIZE 16384 LOCAL, KEY `tproductstockdetail_ix_related_id_related_type` (`related_id`, `related_type`) BLOCK_SIZE 16384 LOCAL, KEY `tproductstockdetail_ix_order_detail_id` (`order_detail_id`, `order_detail_type`) BLOC 开发 small_oa_169 数据源:sm 12345678910111213141516171819202122232425262728293031323334353637 # 销售统计 SELECT t.in_user_id, t.in_user_name, concat(t.in_user_id) AS sort_value, sum(CASE WHEN t.data_mark = 'A' THEN t.counts ELSE 0 END) AS counts, sum(CASE WHEN t.data_mark = 'A' THEN t.price ELSE 0 END) AS price, sum(CASE WHEN t.data_mark = 'A' THEN t.sell_price ELSE 0 END) AS sell_price, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_price ELSE 0 END) AS avg_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gift_price ELSE 0 END) AS gift_price, sum(CASE WHEN t.data_mark = 'A' THEN t.discount_price ELSE 0 END) AS mapp No results 执行记录 日志 结果1 状态 时间 SQL 语句 结果 TRACE ID DB 耗时 15:42:08 # 销售统计 SELECT /*+PARALLEL( 12)*/ t.in_user_id, t.in_user_name, concat(t.in_user_id) AS sort_value, sum(CASE WHEN t.data_mark = 'A' THEN t.counts ELSE 0 END) AS counts, sum(CASE WHEN t.data_mark = 'A' THEN t.price ELSE 0 END) AS price, sum(CASE WHEN t.data_mark = 'A' THEN t.sell_price ELSE 0 END) AS sell_price, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_price ELSE 0 END) AS avg_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gift_price ELSE 0 END) AS gift_price, sum(CASE WHEN t.data_mark = 'A' THEN t.discount_price ELSE 0 END) AS discount_price, sum(CASE WHEN t.data_mark = 'A' THEN t.point_price ELSE 0 END) AS point_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_price ELSE 0 END) AS statistics_price, sum(CASE WHEN t.data_mark = 'A' THEN t.self_modify_price ELSE 0 END) AS self_modify_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.in_price ELSE 0 END) AS in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gross_profit ELSE 0 END) AS gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_price ELSE 0 END) AS examine_price, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit, sum(CASE WHEN t.data_mark = 'B' THEN t.counts ELSE 0 END) AS counts_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.price ELSE 0 END) AS price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.sell_price ELSE 0 END) AS sell_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_price ELSE 0 END) AS avg_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gift_price ELSE 0 END) AS gift_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.discount_price ELSE 0 END) AS discount_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.point_price ELSE 0 END) AS point_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_price ELSE 0 END) AS statistics_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.self_modify_price ELSE 0 END) AS self_modify_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.in_price ELSE 0 END) AS in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gross_profit ELSE 0 END) AS gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_price ELSE 0 END) AS examine_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit_chain FROM (SELECT *, 'A' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) a UNION SELECT *, 'B' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) b) t GROUP BY t.in_user_id, t.in_user_name ORDER BY counts DESC, sort_value DESC LIMIT 0,10 3 row(s) affected - 4.21 s 15:17:38 # 销售统计 SELECT /*+PARALLEL( 12)*/ t.in_user_id, t.in_user_name, concat(t.in_user_id) AS sort_value, sum(CASE WHEN t.data_mark = 'A' THEN t.counts ELSE 0 END) AS counts, sum(CASE WHEN t.data_mark = 'A' THEN t.price ELSE 0 END) AS price, sum(CASE WHEN t.data_mark = 'A' THEN t.sell_price ELSE 0 END) AS sell_price, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_price ELSE 0 END) AS avg_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gift_price ELSE 0 END) AS gift_price, sum(CASE WHEN t.data_mark = 'A' THEN t.discount_price ELSE 0 END) AS discount_price, sum(CASE WHEN t.data_mark = 'A' THEN t.point_price ELSE 0 END) AS point_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_price ELSE 0 END) AS statistics_price, sum(CASE WHEN t.data_mark = 'A' THEN t.self_modify_price ELSE 0 END) AS self_modify_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.in_price ELSE 0 END) AS in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gross_profit ELSE 0 END) AS gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_price ELSE 0 END) AS examine_price, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit, sum(CASE WHEN t.data_mark = 'B' THEN t.counts ELSE 0 END) AS counts_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.price ELSE 0 END) AS price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.sell_price ELSE 0 END) AS sell_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_price ELSE 0 END) AS avg_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gift_price ELSE 0 END) AS gift_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.discount_price ELSE 0 END) AS discount_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.point_price ELSE 0 END) AS point_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_price ELSE 0 END) AS statistics_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.self_modify_price ELSE 0 END) AS self_modify_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.in_price ELSE 0 END) AS in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gross_profit ELSE 0 END) AS gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_price ELSE 0 END) AS examine_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit_chain FROM (SELECT *, 'A' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) a UNION SELECT *, 'B' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) b) t GROUP BY t.in_user_id, t.in_user_name ORDER BY counts DESC, sort_value DESC LIMIT 0,10 3 row(s) affected YB420A01FAA1-000626C2D4CA3A78-0-0 4.18 s 15:15:10 # 销售统计 SELECT /*+PARALLEL(t1 8)*/ t.in_user_id, t.in_user_name, concat(t.in_user_id) AS sort_value, sum(CASE WHEN t.data_mark = 'A' THEN t.counts ELSE 0 END) AS counts, sum(CASE WHEN t.data_mark = 'A' THEN t.price ELSE 0 END) AS price, sum(CASE WHEN t.data_mark = 'A' THEN t.sell_price ELSE 0 END) AS sell_price, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_price ELSE 0 END) AS avg_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gift_price ELSE 0 END) AS gift_price, sum(CASE WHEN t.data_mark = 'A' THEN t.discount_price ELSE 0 END) AS discount_price, sum(CASE WHEN t.data_mark = 'A' THEN t.point_price ELSE 0 END) AS point_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_price ELSE 0 END) AS statistics_price, sum(CASE WHEN t.data_mark = 'A' THEN t.self_modify_price ELSE 0 END) AS self_modify_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.in_price ELSE 0 END) AS in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gross_profit ELSE 0 END) AS gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_price ELSE 0 END) AS examine_price, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit, sum(CASE WHEN t.data_mark = 'B' THEN t.counts ELSE 0 END) AS counts_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.price ELSE 0 END) AS price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.sell_price ELSE 0 END) AS sell_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_price ELSE 0 END) AS avg_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gift_price ELSE 0 END) AS gift_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.discount_price ELSE 0 END) AS discount_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.point_price ELSE 0 END) AS point_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_price ELSE 0 END) AS statistics_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.self_modify_price ELSE 0 END) AS self_modify_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.in_price ELSE 0 END) AS in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gross_profit ELSE 0 END) AS gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_price ELSE 0 END) AS examine_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit_chain FROM (SELECT *, 'A' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) a UNION SELECT *, 'B' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) b) t GROUP BY t.in_user_id, t.in_user_name ORDER BY counts DESC, sort_value DESC LIMIT 0,10 3 row(s) affected YB420A01FAA1-000626D0EB3A0933-0-0 147.17 ms 15:08:30 # 销售统计 SELECT t.in_user_id, t.in_user_name, concat(t.in_user_id) AS sort_value, sum(CASE WHEN t.data_mark = 'A' THEN t.counts ELSE 0 END) AS counts, sum(CASE WHEN t.data_mark = 'A' THEN t.price ELSE 0 END) AS price, sum(CASE WHEN t.data_mark = 'A' THEN t.sell_price ELSE 0 END) AS sell_price, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_price ELSE 0 END) AS avg_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gift_price ELSE 0 END) AS gift_price, sum(CASE WHEN t.data_mark = 'A' THEN t.discount_price ELSE 0 END) AS discount_price, sum(CASE WHEN t.data_mark = 'A' THEN t.point_price ELSE 0 END) AS point_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_price ELSE 0 END) AS statistics_price, sum(CASE WHEN t.data_mark = 'A' THEN t.self_modify_price ELSE 0 END) AS self_modify_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.in_price ELSE 0 END) AS in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gross_profit ELSE 0 END) AS gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_price ELSE 0 END) AS examine_price, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit, sum(CASE WHEN t.data_mark = 'B' THEN t.counts ELSE 0 END) AS counts_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.price ELSE 0 END) AS price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.sell_price ELSE 0 END) AS sell_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_price ELSE 0 END) AS avg_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gift_price ELSE 0 END) AS gift_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.discount_price ELSE 0 END) AS discount_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.point_price ELSE 0 END) AS point_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_price ELSE 0 END) AS statistics_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.self_modify_price ELSE 0 END) AS self_modify_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.in_price ELSE 0 END) AS in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gross_profit ELSE 0 END) AS gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_price ELSE 0 END) AS examine_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit_chain FROM (SELECT *, 'A' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) a UNION SELECT *, 'B' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) b) t GROUP BY t.in_user_id, t.in_user_name ORDER BY counts DESC, sort_value DESC LIMIT 0,10 3 row(s) affected YB420A01FAA1-000626C2D4CA3A32-0-0 153 ms 15:08:06 # 销售统计 SELECT /*+PARALLEL(t1 8)*/ t.in_user_id, t.in_user_name, concat(t.in_user_id) AS sort_value, sum(CASE WHEN t.data_mark = 'A' THEN t.counts ELSE 0 END) AS counts, sum(CASE WHEN t.data_mark = 'A' THEN t.price ELSE 0 END) AS price, sum(CASE WHEN t.data_mark = 'A' THEN t.sell_price ELSE 0 END) AS sell_price, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_price ELSE 0 END) AS avg_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gift_price ELSE 0 END) AS gift_price, sum(CASE WHEN t.data_mark = 'A' THEN t.discount_price ELSE 0 END) AS discount_price, sum(CASE WHEN t.data_mark = 'A' THEN t.point_price ELSE 0 END) AS point_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_price ELSE 0 END) AS statistics_price, sum(CASE WHEN t.data_mark = 'A' THEN t.self_modify_price ELSE 0 END) AS self_modify_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.in_price ELSE 0 END) AS in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gross_profit ELSE 0 END) AS gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_price ELSE 0 END) AS examine_price, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit, sum(CASE WHEN t.data_mark = 'B' THEN t.counts ELSE 0 END) AS counts_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.price ELSE 0 END) AS price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.sell_price ELSE 0 END) AS sell_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_price ELSE 0 END) AS avg_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gift_price ELSE 0 END) AS gift_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.discount_price ELSE 0 END) AS discount_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.point_price ELSE 0 END) AS point_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_price ELSE 0 END) AS statistics_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.self_modify_price ELSE 0 END) AS self_modify_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.in_price ELSE 0 END) AS in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gross_profit ELSE 0 END) AS gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_price ELSE 0 END) AS examine_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit_chain FROM (SELECT *, 'A' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) a UNION SELECT *, 'B' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) b) t GROUP BY t.in_user_id, t.in_user_name ORDER BY counts DESC, sort_value DESC LIMIT 0,10 3 row(s) affected YB420A01FAA1-000626C2D4EB1EA1-0-0 170.63 ms 14:28:29 # 销售统计 SELECT /*+PARALLEL(t1 8)*/ t.in_user_id, t.in_user_name, concat(t.in_user_id) AS sort_value, sum(CASE WHEN t.data_mark = 'A' THEN t.counts ELSE 0 END) AS counts, sum(CASE WHEN t.data_mark = 'A' THEN t.price ELSE 0 END) AS price, sum(CASE WHEN t.data_mark = 'A' THEN t.sell_price ELSE 0 END) AS sell_price, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_price ELSE 0 END) AS avg_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gift_price ELSE 0 END) AS gift_price, sum(CASE WHEN t.data_mark = 'A' THEN t.discount_price ELSE 0 END) AS discount_price, sum(CASE WHEN t.data_mark = 'A' THEN t.point_price ELSE 0 END) AS point_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_price ELSE 0 END) AS statistics_price, sum(CASE WHEN t.data_mark = 'A' THEN t.self_modify_price ELSE 0 END) AS self_modify_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.in_price ELSE 0 END) AS in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gross_profit ELSE 0 END) AS gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_price ELSE 0 END) AS examine_price, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit, sum(CASE WHEN t.data_mark = 'B' THEN t.counts ELSE 0 END) AS counts_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.price ELSE 0 END) AS price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.sell_price ELSE 0 END) AS sell_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_price ELSE 0 END) AS avg_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gift_price ELSE 0 END) AS gift_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.discount_price ELSE 0 END) AS discount_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.point_price ELSE 0 END) AS point_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_price ELSE 0 END) AS statistics_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.self_modify_price ELSE 0 END) AS self_modify_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.in_price ELSE 0 END) AS in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gross_profit ELSE 0 END) AS gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_price ELSE 0 END) AS examine_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit_chain FROM (SELECT *, 'A' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) a UNION SELECT *, 'B' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) b) t GROUP BY t.in_user_id, t.in_user_name ORDER BY counts DESC, sort_value DESC LIMIT 0,10 3 row(s) affected YB420A01FAA1-000626C2D4CA38F0-0-0 157.21 ms 14:28:18 # 销售统计 SELECT t.in_user_id, t.in_user_name, concat(t.in_user_id) AS sort_value, sum(CASE WHEN t.data_mark = 'A' THEN t.counts ELSE 0 END) AS counts, sum(CASE WHEN t.data_mark = 'A' THEN t.price ELSE 0 END) AS price, sum(CASE WHEN t.data_mark = 'A' THEN t.sell_price ELSE 0 END) AS sell_price, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_price ELSE 0 END) AS avg_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gift_price ELSE 0 END) AS gift_price, sum(CASE WHEN t.data_mark = 'A' THEN t.discount_price ELSE 0 END) AS discount_price, sum(CASE WHEN t.data_mark = 'A' THEN t.point_price ELSE 0 END) AS point_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_price ELSE 0 END) AS statistics_price, sum(CASE WHEN t.data_mark = 'A' THEN t.self_modify_price ELSE 0 END) AS self_modify_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.in_price ELSE 0 END) AS in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gross_profit ELSE 0 END) AS gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_price ELSE 0 END) AS examine_price, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit, sum(CASE WHEN t.data_mark = 'B' THEN t.counts ELSE 0 END) AS counts_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.price ELSE 0 END) AS price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.sell_price ELSE 0 END) AS sell_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_price ELSE 0 END) AS avg_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gift_price ELSE 0 END) AS gift_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.discount_price ELSE 0 END) AS discount_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.point_price ELSE 0 END) AS point_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_price ELSE 0 END) AS statistics_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.self_modify_price ELSE 0 END) AS self_modify_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.in_price ELSE 0 END) AS in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gross_profit ELSE 0 END) AS gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_price ELSE 0 END) AS examine_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit_chain FROM (SELECT *, 'A' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) a UNION SELECT *, 'B' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) b) t GROUP BY t.in_user_id, t.in_user_name ORDER BY counts DESC, sort_value DESC LIMIT 0,10 3 row(s) affected YB420A01FAA1-000626C2D4CA38E9-0-0 147.96 ms 执行以下 SQL 成功 # 销售统计 SELECT /*+PARALLEL( 12)*/ t.in_user_id, t.in_user_name, concat(t.in_user_id) AS sort_value, sum(CASE WHEN t.data_mark = 'A' THEN t.counts ELSE 0 END) AS counts, sum(CASE WHEN t.data_mark = 'A' THEN t.price ELSE 0 END) AS price, sum(CASE WHEN t.data_mark = 'A' THEN t.sell_price ELSE 0 END) AS sell_price, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_price ELSE 0 END) AS avg_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gift_price ELSE 0 END) AS gift_price, sum(CASE WHEN t.data_mark = 'A' THEN t.discount_price ELSE 0 END) AS discount_price, sum(CASE WHEN t.data_mark = 'A' THEN t.point_price ELSE 0 END) AS point_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_price ELSE 0 END) AS statistics_price, sum(CASE WHEN t.data_mark = 'A' THEN t.self_modify_price ELSE 0 END) AS self_modify_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.in_price ELSE 0 END) AS in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gross_profit ELSE 0 END) AS gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_price ELSE 0 END) AS examine_price, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit, sum(CASE WHEN t.data_mark = 'B' THEN t.counts ELSE 0 END) AS counts_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.price ELSE 0 END) AS price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.sell_price ELSE 0 END) AS sell_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_price ELSE 0 END) AS avg_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gift_price ELSE 0 END) AS gift_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.discount_price ELSE 0 END) AS discount_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.point_price ELSE 0 END) AS point_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_price ELSE 0 END) AS statistics_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.self_modify_price ELSE 0 END) AS self_modify_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.in_price ELSE 0 END) AS in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gross_profit ELSE 0 END) AS gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_price ELSE 0 END) AS examine_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit_chain FROM (SELECT *, 'A' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) a UNION SELECT *, 'B' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) b) t GROUP BY t.in_user_id, t.in_user_name ORDER BY counts DESC, sort_value DESC LIMIT 0,10 DB 耗时:4.21 s 总条数:3 条 No results found for 'mapp' 执行计划详情 SQL: # 销售统计 SELECT t.in_user_id, t.in_user_name, concat(t.in_user_id) AS sort_value, sum(CASE WHEN t.data_mark = 'A' THEN t.counts ELSE 0 END) AS counts, sum(CASE WHEN t.data_mark = 'A' THEN t.price ELSE 0 END) AS price, sum(CASE WHEN t.data_mark = 'A' THEN t.sell_price ELSE 0 END) AS sell_price, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_price ELSE 0 END) AS avg_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gift_price ELSE 0 END) AS gift_price, sum(CASE WHEN t.data_mark = 'A' THEN t.discount_price ELSE 0 END) AS discount_price, sum(CASE WHEN t.data_mark = 'A' THEN t.point_price ELSE 0 END) AS point_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_price ELSE 0 END) AS statistics_price, sum(CASE WHEN t.data_mark = 'A' THEN t.self_modify_price ELSE 0 END) AS self_modify_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.in_price ELSE 0 END) AS in_price, sum(CASE WHEN t.data_mark = 'A' THEN t.gross_profit ELSE 0 END) AS gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_price ELSE 0 END) AS examine_price, sum(CASE WHEN t.data_mark = 'A' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit, sum(CASE WHEN t.data_mark = 'A' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit, sum(CASE WHEN t.data_mark = 'B' THEN t.counts ELSE 0 END) AS counts_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.price ELSE 0 END) AS price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.sell_price ELSE 0 END) AS sell_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_price ELSE 0 END) AS avg_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gift_price ELSE 0 END) AS gift_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.discount_price ELSE 0 END) AS discount_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.point_price ELSE 0 END) AS point_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_price ELSE 0 END) AS statistics_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.self_modify_price ELSE 0 END) AS self_modify_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_in_price ELSE 0 END) AS statistics_in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.statistics_gross_profit ELSE 0 END) AS statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.in_price ELSE 0 END) AS in_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.gross_profit ELSE 0 END) AS gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_statistics_gross_profit ELSE 0 END) AS avg_statistics_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_price ELSE 0 END) AS examine_price_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.examine_gross_profit ELSE 0 END) AS examine_gross_profit_chain, sum(CASE WHEN t.data_mark = 'B' THEN t.avg_examine_gross_profit ELSE 0 END) AS avg_examine_gross_profit_chain FROM (SELECT *, 'A' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-11-01 00:00:00' AND '2024-11-18 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) a UNION SELECT *, 'B' AS data_mark FROM (SELECT t.in_user_id, t.in_user_name, IFNULL(sum(t.count), 0) counts, IFNULL(sum(t.price), 0) price, IFNULL(sum(t.sell_price), 0) sell_price, ROUND(sum(t.price) / sum(t.count), 2) avg_price, IFNULL(SUM(t.gift_price), 0) gift_price, IFNULL(sum(t.discount_price), 0) discount_price, IFNULL(sum(t.point_price), 0) point_price, IFNULL(sum(t.self_modify_price), 0) self_modify_price, sum(t.actualPaymentPrice) statistics_price, sum(IFNULL(t.statistics_in_price, 0)) statistics_in_price, sum(t.statistics_gross_profit) statistics_gross_profit, sum(IFNULL(t.in_price, 0)) in_price, sum(t.gross_profit) gross_profit, ROUND(sum(t.statistics_gross_profit) / sum(t.count), 2) avg_statistics_gross_profit, SUM(IFNULL(t.examine_price, 0)) examine_price, SUM(t.examine_gross_profit) examine_gross_profit, ROUND(sum(t.examine_gross_profit) / sum(t.count), 2) avg_examine_gross_profit FROM (WITH adjustPriceTemp AS (SELECT t1.mkc_id AS mkc_id, sum(if(t17.type = 3, t16.adjust_price, 0.00)) AS self_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = false, t16.adjust_price, 0.00)) AS before_in_source_modify_price, sum(if(t17.type = 2 AND t16.is_adjust_after_trade = true, t16.adjust_price, 0.00)) AS after_in_source_modify_price, sum(if(t17.type = 2, t16.adjust_price, 0.00)) AS in_source_modify_price FROM t_product_stock_detail t1 LEFT JOIN t_order_detail t2 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id AND t17.status = 3 WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t16.is_delete = 0 AND t2.is_mobile = TRUE AND t17.type IN (2, 3) AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t1.mkc_id) SELECT t2.id AS orderDetailId, 0 - (IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0)) statistics_in_price, 0 - t1.inprice in_price, 0 - t6.return_price + IFNULL(t1.inprice, 0) - IFNULL(t16.self_modify_price, 0.00) - IFNULL(t16.in_source_modify_price, 0.00) + IFNULL(t1.transfer_price, 0) statistics_gross_profit, 0 - t6.return_price + IFNULL(t1.inprice, 0) gross_profit, 0 - t1.examine_price examine_price, 0 - (t6.return_price - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei i_mei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '-1' AS count, 0 - t2.price price, 0 - t2.price price2, 0 - t2.sell_price sell_price, 0 - t2.gift_price gift_price, 0 - t2.discount_price discount_price, 0 - t2.point_price point_price, 0 - t6.return_price statistics_price, 0 - t6.return_price actualPaymentPrice, 0 - IFNULL(t16.self_modify_price, 0.00) self_modify_price, 0 - IFNULL(t16.after_in_source_modify_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid AS product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) AS customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t1.mkc_id = t6.mkc_id AND t6.product_stock_type != 3 AND t6.is_delete = 0 LEFT JOIN t_return t7 ON t6.return_id = t7.id AND t7.is_delete = 0 LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN adjustPriceTemp t16 ON t16.mkc_id = t1.mkc_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t7.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, t1.statistics_price statistics_in_price, t1.inprice in_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.statistics_price, 0)) statistics_gross_profit, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.inprice, 0)) gross_profit, t1.examine_price examine_price, (t2.statictisc_price + IFNULL(t2.gift_price, 0) - IFNULL(t1.examine_price, 0)) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 i_mei2, t1.imei_3 i_mei3, t1.imei_4 i_mei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, '1' AS count, t2.price price, t2.price price2, t2.sell_price sell_price, t2.gift_price gift_price, t2.discount_price discount_price, t2.point_price point_price, t2.statictisc_price statistics_price, (t2.price - t2.discount_price - t2.point_price) actualPaymentPrice, t1.modify_price self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 - t16.adjust_price statistics_in_price, 0 in_price, t16.adjust_price statistics_gross_profit, 0 gross_profit, 0 examine_price, 0 examine_gross_profit, t2.is_mobile is_mobile, t17.handle_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成价保' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, NULL insourceId2, t1.imei imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, t1.mkc_id, t1.instock_time in_stock_time, t1.invoice_type invoice_flag, 0 AS count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 statistics_price, 0 actualPaymentPrice, if(t17.type = 3, t16.adjust_price, 0.00) self_modify_price, if(t17.type = 2, t16.adjust_price, 0.00) in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1 AND t2.product_stock_type != 3) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t1.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id LEFT JOIN t_product_adjust_price_detail t16 ON t16.mkc_id = t1.mkc_id LEFT JOIN t_product_adjust_price t17 ON t17.id = t16.adjust_price_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = TRUE AND t2.product_stock_type != 3 AND t17.status = 3 AND t17.type IN (2, 3) AND t16.is_adjust_after_trade = true AND t17.handle_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT max(t10.id) AS orderDetailId, SUM(t10.statistics_in_price) statistics_in_price, SUM(t10.in_price) in_price, SUM(t10.statistics_gross_profit) statistics_gross_profit, sum(t10.gross_profit) gross_profit, SUM(t10.examine_price) examine_price, SUM(t10.examine_gross_profit) examine_gross_profit, t10.is_mobile is_mobile, t10.date date, t10.order_complete_time, t10.area_id area_id, t10.accountingBodyId, t10.accountingBodyName, t10.order_id order_id, t10.business_type business_type, t10.order_type order_type, t10.user_id user_id, t10.ppid sku_id, t10.detail_type, t10.insource_id insource_id, t10.inSourceId2 inSourceId2, t10.i_mei_or_barcode i_mei, t10.imei2 imei2, t10.imei3 imei3, t10.imei4 imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, SUM(t10.count) count, SUM(t10.price) price, SUM(t10.price) price2, SUM(t10.sell_price) sell_price, SUM(t10.gift_price) gift_price, SUM(t10.discount_price) discount_price, SUM(t10.point_price) point_price, SUM(t10.statistics_price) statistics_price, SUM(t10.actualPaymentPrice) actualPaymentPrice, SUM(t10.self_modify_price) self_modify_price, 0 in_source_modify_price, t10.in_user_id in_user_id, t10.in_user_name in_user_name, t10.product_color product_color, t10.product_id product_id, t10.cid cid, t10.brand_id brand_id, t10.product_name product_name, t10.customer_type customer_type, t10.order_customer_type order_customer_type, t10.customer_name customer_name, t10.customer_phone customer_phone, t10.contract_name contract_name, t10.contract_mobile contract_mobile, t10.trader_name trader_name, t10.comment comment, t10.product_comment product_comment, t10.label_id label_id, t10.label_name label_name, t10.detail_parent_id, t10.serial_number_mark_name serial_number_mark_name, t10.serial_number_mark_color serial_number_mark_color, t10.serial_number_mark serial_number_mark, t10.aux_sale_man_names, t10.sample_product FROM (SELECT t2.id, SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, (((t2.statictisc_price + IFNULL(t2.gift_price, 0)) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t3.order_complete_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '销售' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, if(t2.virtual_product = 0, sum(t1.counts), t2.counts) count, t2.price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) price, t2.sell_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) sell_price, t2.gift_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) gift_price, t2.discount_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) discount_price, t2.point_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) point_price, t2.statictisc_price * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) statistics_price, (t2.price - t2.discount_price - t2.point_price) * if(t2.virtual_product = 0, sum(t1.counts), t2.counts) actualPaymentPrice, SUM(IFNULL(t1.modify_price * t1.counts, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t2.is_mobile = FALSE AND t3.order_complete_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t3.trader_name, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name UNION ALL SELECT t2.id, 0 - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) statistics_in_price, 0 - SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)) in_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - SUM(IFNULL(IFNULL(t1.statistics_price * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0))) statistics_gross_profit, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.inprice * t1.counts, if(null = 1 AND t2.jiuxun_service_flag = 1, t2.jiuxun_service_cost_price, t2.in_price)), 0)))) gross_profit, 0 - SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)) examine_price, 0 - ((t6.return_price * t6.return_count * count(t2.id)) - (SUM(IFNULL(IFNULL(t1.examine_price * t1.counts, t2.examine_price), 0)))) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '退款' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, t4.bar_code i_mei_or_barcode, '' imei2, '' imei3, '' imei4, NULL AS mkc_id, NULL in_stock_time, NULL invoice_flag, 0 - count(t2.id) * t6.return_count count, 0 - (t2.price * count(t2.id)) * t6.return_count price, 0 - (t2.sell_price * count(t2.id)) * t6.return_count sell_price, 0 - (t2.gift_price * count(t2.id)) * t6.return_count gift_price, 0 - (t2.discount_price * count(t2.id)) * t6.return_count discount_price, 0 - (t2.point_price * count(t2.id)) * t6.return_count point_price, 0 - (t6.return_price * count(t2.id)) * t6.return_count actualPaymentPrice, 0 - (t6.return_price * count(t2.id)) * t6.return_count statistics_price, 0 - SUM(IFNULL(t1.modify_price, 0)) self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product, t3.invoice_status FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN (SELECT order_detail_id, avg(return_price) return_price, is_delete, return_id, return_count FROM t_return_detail WHERE is_delete = 0 AND order_detail_type = 1 GROUP BY order_detail_id, return_id, is_delete, return_count) t6 ON t2.id = t6.order_detail_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state = 9 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type NOT IN (7, 8) AND t2.is_mobile = FALSE AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) GROUP BY t2.id, t1.insource_id, t4.bar_code, t4.product_color, t4.cid, t4.brand_id, t4.product_name, t6.return_price, t6.return_count, t7.check2_time, t7.check2_user_name, t7.comment, la.id, la.label_name, sysc.name, sysc.value, sysc.id, t36.aux_sale_man_names, t1.sample_product, t40.id, t40.name) t10 WHERE is_mobile IS NOT NULL AND area_id IS NOT NULL AND order_id IS NOT NULL GROUP BY t10.business_type, t10.is_mobile, t10.date, t10.order_complete_time, t10.area_id, t10.order_id, t10.order_type, t10.user_id, t10.ppid, t10.insource_id, t10.i_mei_or_barcode, t10.in_user_id, t10.in_user_name, t10.product_color, t10.product_id, t10.cid, t10.brand_id, t10.product_name, t10.customer_type, t10.order_customer_type, t10.customer_name, t10.customer_phone, t10.contract_name, t10.contract_mobile, t10.trader_name, t10.inSourceId2, t10.detail_type, t10.comment, t10.product_comment, t10.label_id, t10.label_name, t10.detail_parent_id, t10.imei2, t10.imei3, t10.imei4, t10.mkc_id, t10.in_stock_time, t10.invoice_flag, t10.serial_number_mark_name, t10.serial_number_mark_color, t10.serial_number_mark, t10.aux_sale_man_names, t10.sample_product, t10.accountingBodyId, t10.accountingBodyName UNION ALL SELECT a.id AS orderDetailId, 0 AS statistics_in_price, 0 AS in_price, 0 - IFNULL(b.deduction_price, 0) AS statistics_gross_profit, 0 - IFNULL(b.deduction_price, 0) AS gross_profit, 0 AS examine_price, 0 - IFNULL(b.deduction_price, 0) AS examine_gross_profit, t2.is_mobile is_mobile, b.return_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, CASE WHEN t3.order_state = 9 THEN ifnull(t3.order_parent_id, t3.order_id) ELSE t3.order_id END order_id, '交易完成返销' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid sku_id, t2.detail_type, t1.insource_id insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, if(t4.is_mobile = true, t1.imei_2, '') imei2, if(t4.is_mobile = true, t1.imei_3, '') imei3, if(t4.is_mobile = true, t1.imei_4, '') imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 AS count, 0 AS price, t2.price AS price2, 0 AS sell_price, 0 AS gift_price, 0 AS discount_price, 0 AS point_price, 0 AS statistics_price, 0 - IFNULL(b.deduction_price, 0) AS actualPaymentPrice, 0 AS self_modify_price, 0 AS in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t3.COMMENT COMMENT, t2.COMMENT product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail a INNER JOIN t_operator_business b ON a.id = b.order_detail_id INNER JOIN t_order_detail t2 ON a.detail_parent_id = t2.id LEFT JOIN t_order c FORCE INDEX (torder_ix_order_id) ON a.order_id = c.order_id LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND c.order_complete_time <= b.return_time AND b.`status` = 2 AND b.is_delete = 0 AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND b.version = 0 AND b.return_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t2.id = t6.order_detail_id AND t6.mkc_id IS NULL LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) UNION ALL SELECT t2.id AS orderDetailId, 0 statistics_in_price, 0 in_price, 0 - (t6.return_price * t6.return_count) statistics_gross_profit, 0 - (t6.return_price * t6.return_count) gross_profit, 0 examine_price, 0 - (t6.return_price * t6.return_count) examine_gross_profit, t2.is_mobile is_mobile, t7.check2_time date, t3.order_complete_time, t3.area_id area_id, t40.id AS accountingBodyId, t40.name AS accountingBodyName, ifnull(t3.order_parent_id, t3.order_id) order_id, '价格保障' AS business_type, t3.order_type order_type, t3.user_id user_id, t2.ppid ppid, t2.detail_type, IFNULL(t1.insource_id, vpcc.in_source_id) insource_id, t16.channel inSourceId2, if(t4.is_mobile = true, t1.imei, t4.bar_code) imei, t1.imei_2 imei2, t1.imei_3 imei3, t1.imei_4 imei4, if(t4.is_mobile = true, t1.mkc_id, NULL) mkc_id, NULL in_stock_time, NULL invoice_flag, 0 count, 0 price, 0 price2, 0 sell_price, 0 gift_price, 0 discount_price, 0 point_price, 0 - t6.return_price * t6.return_count actualPaymentPrice, 0 - t6.return_price * t6.return_count statistics_price, 0 self_modify_price, 0 in_source_modify_price, t2.in_user_id in_user_id, t2.in_user_name in_user_name, t4.product_color product_color, t4.productid product_id, t4.cid cid, t4.brand_id brand_id, t4.product_name, t5.user_type customer_type, t3.customer_type AS order_customer_type, if(t3.order_type = 3 OR t3.order_type = 4, t11.special_username, t5.real_name) customer_name, t5.user_mobile AS customer_phone, t3.contract_name AS contract_name, t3.contract_mobile AS contract_mobile, t3.trader_name trader_name, t7.comment comment, t2.comment product_comment, la.id AS label_id, la.label_name label_name, t2.detail_parent_id, sysc.name serial_number_mark_name, sysc.value serial_number_mark_color, sysc.id serial_number_mark, t36.aux_sale_man_names, t1.sample_product FROM t_order_detail t2 LEFT JOIN t_product_stock_detail t1 ON (t1.order_detail_id = t2.id AND t1.order_detail_type = 1) LEFT JOIN t_order t3 ON t2.order_id = t3.order_id LEFT JOIN t_product_info t4 ON t2.ppid = t4.ppriceid LEFT JOIN t_user t5 ON t5.id = t3.user_id LEFT JOIN t_return_detail t6 ON t6.mkc_id = t1.mkc_id LEFT JOIN t_return t7 ON t6.return_id = t7.id LEFT JOIN t_depart_info t8 ON t3.area_id = t8.id LEFT JOIN t_operator_business t16 ON (t2.id = t16.order_detail_id) LEFT JOIN t_after_services_buy t17 ON t2.id = t17.bind_order_detail_id AND t17.is_delete = 0 LEFT JOIN t_special_user t11 ON t11.user_id = t3.user_id LEFT JOIN t_product_label pl ON t4.productid = pl.product_id AND pl.is_delete = 0 LEFT JOIN t_label la ON pl.label_id = la.id AND la.is_delete = 0 LEFT JOIN t_sys_config sysc ON t1.serial_number_mark = sysc.id AND sysc.is_delete = 0 LEFT JOIN t_order_detail_extend vpcc ON t2.id = vpcc.id LEFT JOIN t_finance_accounting_body t40 ON t40.id = t8.accounting_body_id LEFT JOIN t_order_extend t36 ON t3.order_id = t36.order_id WHERE t3.order_state IN (3, 9) AND t2.is_delete = 0 AND t3.is_delete = 0 AND t5.is_delete = 0 AND t6.is_delete = 0 AND t7.is_delete = 0 AND t7.return_type = 8 AND t7.check2_time BETWEEN '2024-10-14 00:00:00' AND '2024-10-31 23:59:59' AND t3.area_id IN (216) AND t3.area_id IN (216) AND t2.product_stock_type IN (0, 1, 2, 6) ORDER BY date DESC, orderDetailId DESC) t LEFT JOIN t_category category ON t.cid = category.id LEFT JOIN t_depart_info t8 ON t.area_id = t8.id GROUP BY t.in_user_id, t.in_user_name) b) t GROUP BY t.in_user_id, t.in_user_name ORDER BY counts DESC, sort_value DESC LIMIT 0,10 计划统计 ============================================================================================================================================================ |ID |OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------------------------------------------------------------------------------------------------------------------ |0 |LIMIT | |10 |7884442 | |1 |└─TOP-N SORT | |10 |7884442 | |2 | └─HASH GROUP BY | |1078 |7884365 | |3 | └─SUBPLAN SCAN |t |1079 |7881838 | |4 | └─HASH UNION DISTINCT | |1079 |7881836 | |5 | ├─HASH GROUP BY | |468 |3800274 | |6 | │ └─SUBPLAN SCAN |t |468 |3799430 | |7 | │ └─UNION ALL | |468 |3799429 | |8 | │ ├─NESTED-LOOP OUTER JOIN | |1 |3397073 | |9 | │ │ ├─HASH OUTER JOIN | |1 |3396669 | |10 | │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |3396667 | |11 | │ │ │ │ ├─HASH JOIN | |1 |3396651 | |12 | │ │ │ │ │ ├─HASH JOIN | |54975 |3294834 | |13 | │ │ │ │ │ │ ├─HASH JOIN | |60154 |12649 | |14 | │ │ │ │ │ │ │ ├─TABLE FULL SCAN |t6 |6350 |1700 | |15 | │ │ │ │ │ │ │ └─NESTED-LOOP JOIN CARTESIAN | |53695 |2520 | |16 | │ │ │ │ │ │ │ ├─TABLE RANGE SCAN |t7(treturn_ix_check2_time) |233 |1173 | |17 | │ │ │ │ │ │ │ └─MATERIAL | |231 |9041 | |18 | │ │ │ │ │ │ │ └─MERGE OUTER JOIN | |231 |9032 | |19 | │ │ │ │ │ │ │ ├─SORT | |228 |8976 | |20 | │ │ │ │ │ │ │ │ └─NESTED-LOOP JOIN | |228 |8946 | |21 | │ │ │ │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN CARTESIAN | |228 |5274 | |22 | │ │ │ │ │ │ │ │ │ ├─TABLE RANGE SCAN |t3(torder_ix_area_id) |228 |5268 | |23 | │ │ │ │ │ │ │ │ │ └─MATERIAL | |1 |7 | |24 | │ │ │ │ │ │ │ │ │ └─TABLE GET |t8 |1 |7 | |25 | │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |26 | │ │ │ │ │ │ │ └─TABLE FULL SCAN |t36(idx_order_id) |1268 |35 | |27 | │ │ │ │ │ │ └─PX COORDINATOR | |743749 |3203291 | |28 | │ │ │ │ │ │ └─EXCHANGE OUT DISTR |:EX10000 |743749 |2230995 | |29 | │ │ │ │ │ │ └─PX PARTITION ITERATOR | |743749 |44242 | |30 | │ │ │ │ │ │ └─COLUMN TABLE FULL SCAN |t1 |743749 |44242 | |31 | │ │ │ │ │ └─COLUMN TABLE FULL SCAN |t2 |364612 |43448 | |32 | │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |33 | │ │ │ └─TABLE FULL SCAN |pl |2 |3 | |34 | │ │ └─SUBPLAN SCAN |adjustPriceTemp |1 |404 | |35 | │ │ └─MERGE GROUP BY | |1 |404 | |36 | │ │ └─NESTED-LOOP JOIN | |1 |404 | |37 | │ │ ├─NESTED-LOOP JOIN | |1 |388 | |38 | │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |358 | |39 | │ │ │ │ ├─NESTED-LOOP JOIN | |1 |341 | |40 | │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |325 | |41 | │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |298 | |42 | │ │ │ │ │ │ │ ├─HASH OUTER JOIN | |1 |282 | |43 | │ │ │ │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |280 | |44 | │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |264 | |45 | │ │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |236 | |46 | │ │ │ │ │ │ │ │ │ │ │ ├─DISTRIBUTED TABLE RANGE SCAN |t1(index_mck_id) |1 |220 | |47 | │ │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t2 |1 |16 | |48 | │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t3(torder_ix_order_id) |1 |27 | |49 | │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |50 | │ │ │ │ │ │ │ │ └─TABLE FULL SCAN |pl |2 |3 | |51 | │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |52 | │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t6(idx_mkc_id) |1 |27 | |53 | │ │ │ │ │ └─DISTRIBUTED TABLE GET |t7 |1 |16 | |54 | │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t36(idx_order_id) |2 |16 | |55 | │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t16(trebate_detail_mkc_id) |2 |30 | |56 | │ │ └─DISTRIBUTED TABLE GET |t17 |1 |16 | |57 | │ ├─MERGE RIGHT OUTER JOIN | |310 |75840 | |58 | │ │ ├─TABLE FULL SCAN |t36(idx_order_id) |1268 |35 | |59 | │ │ └─SORT | |307 |75738 | |60 | │ │ └─HASH RIGHT OUTER JOIN | |307 |75550 | |61 | │ │ ├─TABLE FULL SCAN |pl |2 |3 | |62 | │ │ └─NESTED-LOOP OUTER JOIN | |307 |75522 | |63 | │ │ ├─NESTED-LOOP OUTER JOIN | |307 |70591 | |64 | │ │ │ ├─NESTED-LOOP JOIN | |232 |14231 | |65 | │ │ │ │ ├─NESTED-LOOP JOIN | |182 |8323 | |66 | │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN CARTESIAN | |182 |5400 | |67 | │ │ │ │ │ │ ├─TABLE RANGE SCAN |t3(torder_ix_area_id) |182 |5395 | |68 | │ │ │ │ │ │ └─MATERIAL | |1 |7 | |69 | │ │ │ │ │ │ └─TABLE GET |t8 |1 |7 | |70 | │ │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |71 | │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t2(index_orderId) |2 |32 | |72 | │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(tproductstockdetail_ix_order_detail_id)|2 |243 | |73 | │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |74 | │ ├─NESTED-LOOP JOIN | |3 |206125 | |75 | │ │ ├─NESTED-LOOP OUTER JOIN | |3 |206086 | |76 | │ │ │ ├─HASH RIGHT OUTER JOIN | |3 |206047 | |77 | │ │ │ │ ├─TABLE FULL SCAN |pl |2 |3 | |78 | │ │ │ │ └─NESTED-LOOP OUTER JOIN CARTESIAN | |3 |206044 | |79 | │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |3 |206044 | |80 | │ │ │ │ │ ├─HASH JOIN | |3 |206004 | |81 | │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |476 |199939 | |82 | │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |735 |188110 | |83 | │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |744 |8204 | |84 | │ │ │ │ │ │ │ │ │ ├─TABLE RANGE SCAN |t17(table_index) |78 |12 | |85 | │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t16(idx_adjust_price_id) |14 |104 | |86 | │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(index_mck_id) |1 |242 | |87 | │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t2 |1 |16 | |88 | │ │ │ │ │ │ └─TABLE RANGE SCAN |t3(torder_ix_area_id) |1465 |5766 | |89 | │ │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |90 | │ │ │ │ └─MATERIAL | |1 |7 | |91 | │ │ │ │ └─TABLE GET |t8 |1 |7 | |92 | │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t36(idx_order_id) |2 |16 | |93 | │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |94 | │ ├─HASH GROUP BY | |156 |115146 | |95 | │ │ └─SUBPLAN SCAN |t10 |156 |114449 | |96 | │ │ └─UNION ALL | |156 |114448 | |97 | │ │ ├─HASH GROUP BY | |155 |90610 | |98 | │ │ │ └─HASH RIGHT OUTER JOIN | |310 |89697 | |99 | │ │ │ ├─TABLE FULL SCAN |sysc |328 |56 | |100| │ │ │ └─NESTED-LOOP OUTER JOIN | |310 |89502 | |101| │ │ │ ├─NESTED-LOOP OUTER JOIN | |235 |32394 | |102| │ │ │ │ ├─HASH RIGHT OUTER JOIN | |235 |28615 | |103| │ │ │ │ │ ├─TABLE FULL SCAN |la |2 |3 | |104| │ │ │ │ │ └─HASH RIGHT OUTER JOIN | |235 |28585 | |105| │ │ │ │ │ ├─TABLE FULL SCAN |pl |2 |3 | |106| │ │ │ │ │ └─NESTED-LOOP OUTER JOIN | |235 |28563 | |107| │ │ │ │ │ ├─HASH OUTER JOIN | |235 |24783 | |108| │ │ │ │ │ │ ├─HASH OUTER JOIN | |235 |19410 | |109| │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |235 |15100 | |110| │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |184 |8901 | |111| │ │ │ │ │ │ │ │ │ ├─HASH RIGHT OUTER JOIN | |184 |5943 | |112| │ │ │ │ │ │ │ │ │ │ ├─TABLE FULL SCAN |t11 |320 |17 | |113| │ │ │ │ │ │ │ │ │ │ └─HASH OUTER JOIN | |184 |5828 | |114| │ │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN CARTESIAN | |182 |5532 | |115| │ │ │ │ │ │ │ │ │ │ │ ├─TABLE RANGE SCAN |t3(torder_ix_area_id) |182 |5527 | |116| │ │ │ │ │ │ │ │ │ │ │ └─MATERIAL | |1 |9 | |117| │ │ │ │ │ │ │ │ │ │ │ └─MERGE OUTER JOIN | |1 |9 | |118| │ │ │ │ │ │ │ │ │ │ │ ├─TABLE GET |t8 |1 |7 | |119| │ │ │ │ │ │ │ │ │ │ │ └─TABLE FULL SCAN |t40 |1 |3 | |120| │ │ │ │ │ │ │ │ │ │ └─TABLE FULL SCAN |t36 |1268 |58 | |121| │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |122| │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t2(index_orderId) |2 |33 | |123| │ │ │ │ │ │ │ └─TABLE FULL SCAN |t17 |18492 |2345 | |124| │ │ │ │ │ │ └─TABLE FULL SCAN |t16 |37334 |1829 | |125| │ │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |126| │ │ │ │ └─DISTRIBUTED TABLE GET |vpcc |1 |16 | |127| │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(tproductstockdetail_ix_order_detail_id)|2 |243 | |128| │ │ └─HASH GROUP BY | |1 |23838 | |129| │ │ └─NESTED-LOOP OUTER JOIN | |1 |23838 | |130| │ │ ├─NESTED-LOOP OUTER JOIN | |1 |23810 | |131| │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |23794 | |132| │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |23765 | |133| │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |23738 | |134| │ │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |23495 | |135| │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |23479 | |136| │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |23463 | |137| │ │ │ │ │ │ │ │ │ ├─HASH JOIN | |5 |23392 | |138| │ │ │ │ │ │ │ │ │ │ ├─HASH RIGHT OUTER JOIN | |292 |17921 | |139| │ │ │ │ │ │ │ │ │ │ │ ├─TABLE FULL SCAN |la |2 |3 | |140| │ │ │ │ │ │ │ │ │ │ │ └─HASH RIGHT OUTER JOIN | |292 |17885 | |141| │ │ │ │ │ │ │ │ │ │ │ ├─TABLE FULL SCAN |pl |2 |3 | |142| │ │ │ │ │ │ │ │ │ │ │ └─NESTED-LOOP OUTER JOIN | |292 |17858 | |143| │ │ │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |292 |13165 | |144| │ │ │ │ │ │ │ │ │ │ │ │ ├─HASH RIGHT OUTER JOIN | |228 |5543 | |145| │ │ │ │ │ │ │ │ │ │ │ │ │ ├─TABLE FULL SCAN |t11 |320 |17 | |146| │ │ │ │ │ │ │ │ │ │ │ │ │ └─NESTED-LOOP OUTER JOIN CARTESIAN | |228 |5423 | |147| │ │ │ │ │ │ │ │ │ │ │ │ │ ├─TABLE RANGE SCAN |t3(torder_ix_area_id) |228 |5416 | |148| │ │ │ │ │ │ │ │ │ │ │ │ │ └─MATERIAL | |1 |9 | |149| │ │ │ │ │ │ │ │ │ │ │ │ │ └─MERGE OUTER JOIN | |1 |9 | |150| │ │ │ │ │ │ │ │ │ │ │ │ │ ├─TABLE GET |t8 |1 |7 | |151| │ │ │ │ │ │ │ │ │ │ │ │ │ └─TABLE FULL SCAN |t40 |1 |3 | |152| │ │ │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t2(index_orderId) |2 |33 | |153| │ │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |154| │ │ │ │ │ │ │ │ │ │ └─SUBPLAN SCAN |t6 |5499 |4463 | |155| │ │ │ │ │ │ │ │ │ │ └─HASH GROUP BY | |5499 |4448 | |156| │ │ │ │ │ │ │ │ │ │ └─TABLE FULL SCAN |t_return_detail |5499 |1734 | |157| │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t7 |1 |16 | |158| │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |159| │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |vpcc |1 |16 | |160| │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(tproductstockdetail_ix_order_detail_id)|2 |243 | |161| │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t16(index_orderDetailId) |1 |27 | |162| │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t17(IDX_BIND_DETAIL_ID) |1 |29 | |163| │ │ │ └─DISTRIBUTED TABLE GET |sysc |1 |16 | |164| │ │ └─DISTRIBUTED TABLE RANGE SCAN |t36(idx_order_id) |2 |27 | |165| │ ├─NESTED-LOOP OUTER JOIN | |1 |4527 | |166| │ │ ├─NESTED-LOOP OUTER JOIN | |1 |4511 | |167| │ │ │ ├─NESTED-LOOP OUTER JOIN CARTESIAN | |1 |4482 | |168| │ │ │ │ ├─NESTED-LOOP JOIN | |1 |4482 | |169| │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |4466 | |170| │ │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |4438 | |171| │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |4284 | |172| │ │ │ │ │ │ │ │ ├─HASH RIGHT OUTER JOIN | |2 |4248 | |173| │ │ │ │ │ │ │ │ │ ├─TABLE FULL SCAN |pl |2 |3 | |174| │ │ │ │ │ │ │ │ │ └─NESTED-LOOP OUTER JOIN | |2 |4245 | |175| │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |2 |4223 | |176| │ │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |18 |3934 | |177| │ │ │ │ │ │ │ │ │ │ │ ├─TABLE FULL SCAN |b |18 |3646 | |178| │ │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |a |1 |16 | |179| │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t2 |1 |16 | |180| │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |181| │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |c(torder_ix_order_id) |1 |27 | |182| │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(tproductstockdetail_ix_order_detail_id)|2 |154 | |183| │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t3(torder_ix_order_id) |1 |27 | |184| │ │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |185| │ │ │ │ └─MATERIAL | |1 |7 | |186| │ │ │ │ └─TABLE GET |t8 |1 |7 | |187| │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t17(IDX_BIND_DETAIL_ID) |1 |29 | |188| │ │ └─DISTRIBUTED TABLE RANGE SCAN |t36(idx_order_id) |2 |16 | |189| │ ├─NESTED-LOOP OUTER JOIN | |1 |316 | |190| │ │ ├─NESTED-LOOP OUTER JOIN | |1 |300 | |191| │ │ │ ├─NESTED-LOOP OUTER JOIN CARTESIAN | |1 |271 | |192| │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |271 | |193| │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |117 | |194| │ │ │ │ │ │ ├─HASH OUTER JOIN | |1 |101 | |195| │ │ │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |99 | |196| │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |82 | |197| │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |55 | |198| │ │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |39 | |199| │ │ │ │ │ │ │ │ │ │ │ ├─TABLE RANGE SCAN |t7(treturn_ix_return_type) |1 |9 | |200| │ │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t6(idx_return_detail_return_id) |1 |30 | |201| │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t2 |1 |16 | |202| │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t3(torder_ix_order_id) |1 |27 | |203| │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |204| │ │ │ │ │ │ │ └─TABLE FULL SCAN |pl |2 |3 | |205| │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |206| │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(tproductstockdetail_ix_order_detail_id)|2 |154 | |207| │ │ │ │ └─MATERIAL | |1 |7 | |208| │ │ │ │ └─TABLE GET |t8 |1 |7 | |209| │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t17(IDX_BIND_DETAIL_ID) |1 |29 | |210| │ │ └─DISTRIBUTED TABLE RANGE SCAN |t36(idx_order_id) |2 |16 | |211| │ └─HASH OUTER JOIN | |1 |404 | |212| │ ├─NESTED-LOOP OUTER JOIN | |1 |401 | |213| │ │ ├─NESTED-LOOP OUTER JOIN | |1 |385 | |214| │ │ │ ├─NESTED-LOOP OUTER JOIN CARTESIAN | |1 |356 | |215| │ │ │ │ ├─NESTED-LOOP JOIN | |1 |356 | |216| │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |340 | |217| │ │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |313 | |218| │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |297 | |219| │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |281 | |220| │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |39 | |221| │ │ │ │ │ │ │ │ │ │ ├─TABLE RANGE SCAN |t7(treturn_ix_return_type) |1 |9 | |222| │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t6(idx_return_detail_return_id) |2 |30 | |223| │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(index_mck_id) |1 |241 | |224| │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t2 |1 |16 | |225| │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |226| │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t3(torder_ix_order_id) |1 |27 | |227| │ │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |228| │ │ │ │ └─MATERIAL | |1 |7 | |229| │ │ │ │ └─TABLE GET |t8 |1 |7 | |230| │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t17(IDX_BIND_DETAIL_ID) |1 |29 | |231| │ │ └─DISTRIBUTED TABLE RANGE SCAN |t36(idx_order_id) |2 |16 | |232| │ └─TABLE FULL SCAN |pl |2 |3 | |233| └─HASH GROUP BY | |612 |4079606 | |234| └─SUBPLAN SCAN |t |612 |4078502 | |235| └─UNION ALL | |612 |4078501 | |236| ├─NESTED-LOOP OUTER JOIN | |1 |3420430 | |237| │ ├─HASH OUTER JOIN | |1 |3420025 | |238| │ │ ├─NESTED-LOOP OUTER JOIN | |1 |3420023 | |239| │ │ │ ├─HASH JOIN | |1 |3420007 | |240| │ │ │ │ ├─HASH JOIN | |80405 |3306561 | |241| │ │ │ │ │ ├─HASH JOIN | |87979 |16680 | |242| │ │ │ │ │ │ ├─TABLE FULL SCAN |t6 |6350 |1700 | |243| │ │ │ │ │ │ └─NESTED-LOOP JOIN CARTESIAN | |78532 |3616 | |244| │ │ │ │ │ │ ├─TABLE RANGE SCAN |t7(treturn_ix_check2_time) |341 |1645 | |245| │ │ │ │ │ │ └─MATERIAL | |231 |9041 | |246| │ │ │ │ │ │ └─MERGE OUTER JOIN | |231 |9032 | |247| │ │ │ │ │ │ ├─SORT | |228 |8976 | |248| │ │ │ │ │ │ │ └─NESTED-LOOP JOIN | |228 |8946 | |249| │ │ │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN CARTESIAN | |228 |5274 | |250| │ │ │ │ │ │ │ │ ├─TABLE RANGE SCAN |t3(torder_ix_area_id) |228 |5268 | |251| │ │ │ │ │ │ │ │ └─MATERIAL | |1 |7 | |252| │ │ │ │ │ │ │ │ └─TABLE GET |t8 |1 |7 | |253| │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |254| │ │ │ │ │ │ └─TABLE FULL SCAN |t36(idx_order_id) |1268 |35 | |255| │ │ │ │ │ └─PX COORDINATOR | |743749 |3203291 | |256| │ │ │ │ │ └─EXCHANGE OUT DISTR |:EX20000 |743749 |2230995 | |257| │ │ │ │ │ └─PX PARTITION ITERATOR | |743749 |44242 | |258| │ │ │ │ │ └─COLUMN TABLE FULL SCAN |t1 |743749 |44242 | |259| │ │ │ │ └─COLUMN TABLE FULL SCAN |t2 |364612 |43448 | |260| │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |261| │ │ └─TABLE FULL SCAN |pl |2 |3 | |262| │ └─SUBPLAN SCAN |adjustPriceTemp |1 |404 | |263| │ └─MERGE GROUP BY | |1 |404 | |264| │ └─NESTED-LOOP JOIN | |1 |404 | |265| │ ├─NESTED-LOOP JOIN | |1 |388 | |266| │ │ ├─NESTED-LOOP OUTER JOIN | |1 |358 | |267| │ │ │ ├─NESTED-LOOP JOIN | |1 |341 | |268| │ │ │ │ ├─NESTED-LOOP JOIN | |1 |325 | |269| │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |298 | |270| │ │ │ │ │ │ ├─HASH OUTER JOIN | |1 |282 | |271| │ │ │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |280 | |272| │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |264 | |273| │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |236 | |274| │ │ │ │ │ │ │ │ │ │ ├─DISTRIBUTED TABLE RANGE SCAN |t1(index_mck_id) |1 |220 | |275| │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t2 |1 |16 | |276| │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t3(torder_ix_order_id) |1 |27 | |277| │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |278| │ │ │ │ │ │ │ └─TABLE FULL SCAN |pl |2 |3 | |279| │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |280| │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t6(idx_mkc_id) |1 |27 | |281| │ │ │ │ └─DISTRIBUTED TABLE GET |t7 |1 |16 | |282| │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t36(idx_order_id) |2 |16 | |283| │ │ └─DISTRIBUTED TABLE RANGE SCAN |t16(trebate_detail_mkc_id) |2 |30 | |284| │ └─DISTRIBUTED TABLE GET |t17 |1 |16 | |285| ├─HASH RIGHT OUTER JOIN | |405 |97241 | |286| │ ├─TABLE FULL SCAN |t36(idx_order_id) |1268 |35 | |287| │ └─HASH RIGHT OUTER JOIN | |400 |96939 | |288| │ ├─TABLE FULL SCAN |pl |2 |3 | |289| │ └─NESTED-LOOP OUTER JOIN | |400 |96903 | |290| │ ├─NESTED-LOOP OUTER JOIN | |400 |90470 | |291| │ │ ├─NESTED-LOOP JOIN | |303 |16949 | |292| │ │ │ ├─NESTED-LOOP JOIN | |237 |9241 | |293| │ │ │ │ ├─NESTED-LOOP OUTER JOIN CARTESIAN | |237 |5429 | |294| │ │ │ │ │ ├─TABLE RANGE SCAN |t3(torder_ix_area_id) |237 |5422 | |295| │ │ │ │ │ └─MATERIAL | |1 |7 | |296| │ │ │ │ │ └─TABLE GET |t8 |1 |7 | |297| │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |298| │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t2(index_orderId) |2 |32 | |299| │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(tproductstockdetail_ix_order_detail_id)|2 |243 | |300| │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |301| ├─NESTED-LOOP JOIN | |6 |416624 | |302| │ ├─NESTED-LOOP OUTER JOIN | |6 |416543 | |303| │ │ ├─HASH RIGHT OUTER JOIN | |6 |416462 | |304| │ │ │ ├─TABLE FULL SCAN |pl |2 |3 | |305| │ │ │ └─NESTED-LOOP OUTER JOIN CARTESIAN | |6 |416459 | |306| │ │ │ ├─NESTED-LOOP OUTER JOIN | |6 |416459 | |307| │ │ │ │ ├─HASH JOIN | |6 |416378 | |308| │ │ │ │ │ ├─NESTED-LOOP JOIN | |976 |410126 | |309| │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1507 |385862 | |310| │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1527 |16823 | |311| │ │ │ │ │ │ │ │ ├─TABLE RANGE SCAN |t17(table_index) |160 |19 | |312| │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t16(idx_adjust_price_id) |14 |104 | |313| │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(index_mck_id) |1 |242 | |314| │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t2 |1 |16 | |315| │ │ │ │ │ └─TABLE RANGE SCAN |t3(torder_ix_area_id) |1465 |5766 | |316| │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |317| │ │ │ └─MATERIAL | |1 |7 | |318| │ │ │ └─TABLE GET |t8 |1 |7 | |319| │ │ └─DISTRIBUTED TABLE RANGE SCAN |t36(idx_order_id) |2 |16 | |320| │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |321| ├─HASH GROUP BY | |203 |138509 | |322| │ └─SUBPLAN SCAN |t10 |203 |137599 | |323| │ └─UNION ALL | |203 |137599 | |324| │ ├─HASH GROUP BY | |203 |113760 | |325| │ │ └─HASH RIGHT OUTER JOIN | |405 |112569 | |326| │ │ ├─TABLE FULL SCAN |sysc |328 |56 | |327| │ │ └─NESTED-LOOP OUTER JOIN | |405 |112366 | |328| │ │ ├─NESTED-LOOP OUTER JOIN | |307 |37868 | |329| │ │ │ ├─HASH RIGHT OUTER JOIN | |307 |32938 | |330| │ │ │ │ ├─TABLE FULL SCAN |la |2 |3 | |331| │ │ │ │ └─HASH RIGHT OUTER JOIN | |307 |32900 | |332| │ │ │ │ ├─TABLE FULL SCAN |pl |2 |3 | |333| │ │ │ │ └─NESTED-LOOP OUTER JOIN | |307 |32872 | |334| │ │ │ │ ├─HASH OUTER JOIN | |307 |27942 | |335| │ │ │ │ │ ├─HASH OUTER JOIN | |307 |22441 | |336| │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |307 |18003 | |337| │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |240 |9917 | |338| │ │ │ │ │ │ │ │ ├─HASH RIGHT OUTER JOIN | |240 |6058 | |339| │ │ │ │ │ │ │ │ │ ├─TABLE FULL SCAN |t11 |320 |17 | |340| │ │ │ │ │ │ │ │ │ └─HASH OUTER JOIN | |240 |5937 | |341| │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN CARTESIAN | |237 |5601 | |342| │ │ │ │ │ │ │ │ │ │ ├─TABLE RANGE SCAN |t3(torder_ix_area_id) |237 |5595 | |343| │ │ │ │ │ │ │ │ │ │ └─MATERIAL | |1 |9 | |344| │ │ │ │ │ │ │ │ │ │ └─MERGE OUTER JOIN | |1 |9 | |345| │ │ │ │ │ │ │ │ │ │ ├─TABLE GET |t8 |1 |7 | |346| │ │ │ │ │ │ │ │ │ │ └─TABLE FULL SCAN |t40 |1 |3 | |347| │ │ │ │ │ │ │ │ │ └─TABLE FULL SCAN |t36 |1268 |58 | |348| │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |349| │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t2(index_orderId) |2 |33 | |350| │ │ │ │ │ │ └─TABLE FULL SCAN |t17 |18492 |2345 | |351| │ │ │ │ │ └─TABLE FULL SCAN |t16 |37334 |1829 | |352| │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |353| │ │ │ └─DISTRIBUTED TABLE GET |vpcc |1 |16 | |354| │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(tproductstockdetail_ix_order_detail_id)|2 |243 | |355| │ └─HASH GROUP BY | |1 |23839 | |356| │ └─NESTED-LOOP OUTER JOIN | |1 |23838 | |357| │ ├─NESTED-LOOP OUTER JOIN | |1 |23810 | |358| │ │ ├─NESTED-LOOP OUTER JOIN | |1 |23794 | |359| │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |23765 | |360| │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |23738 | |361| │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |23495 | |362| │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |23479 | |363| │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |23463 | |364| │ │ │ │ │ │ │ │ ├─HASH JOIN | |5 |23392 | |365| │ │ │ │ │ │ │ │ │ ├─HASH RIGHT OUTER JOIN | |292 |17921 | |366| │ │ │ │ │ │ │ │ │ │ ├─TABLE FULL SCAN |la |2 |3 | |367| │ │ │ │ │ │ │ │ │ │ └─HASH RIGHT OUTER JOIN | |292 |17885 | |368| │ │ │ │ │ │ │ │ │ │ ├─TABLE FULL SCAN |pl |2 |3 | |369| │ │ │ │ │ │ │ │ │ │ └─NESTED-LOOP OUTER JOIN | |292 |17858 | |370| │ │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |292 |13165 | |371| │ │ │ │ │ │ │ │ │ │ │ ├─HASH RIGHT OUTER JOIN | |228 |5543 | |372| │ │ │ │ │ │ │ │ │ │ │ │ ├─TABLE FULL SCAN |t11 |320 |17 | |373| │ │ │ │ │ │ │ │ │ │ │ │ └─NESTED-LOOP OUTER JOIN CARTESIAN | |228 |5423 | |374| │ │ │ │ │ │ │ │ │ │ │ │ ├─TABLE RANGE SCAN |t3(torder_ix_area_id) |228 |5416 | |375| │ │ │ │ │ │ │ │ │ │ │ │ └─MATERIAL | |1 |9 | |376| │ │ │ │ │ │ │ │ │ │ │ │ └─MERGE OUTER JOIN | |1 |9 | |377| │ │ │ │ │ │ │ │ │ │ │ │ ├─TABLE GET |t8 |1 |7 | |378| │ │ │ │ │ │ │ │ │ │ │ │ └─TABLE FULL SCAN |t40 |1 |3 | |379| │ │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t2(index_orderId) |2 |33 | |380| │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |381| │ │ │ │ │ │ │ │ │ └─SUBPLAN SCAN |t6 |5499 |4463 | |382| │ │ │ │ │ │ │ │ │ └─HASH GROUP BY | |5499 |4448 | |383| │ │ │ │ │ │ │ │ │ └─TABLE FULL SCAN |t_return_detail |5499 |1734 | |384| │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t7 |1 |16 | |385| │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |386| │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |vpcc |1 |16 | |387| │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(tproductstockdetail_ix_order_detail_id)|2 |243 | |388| │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t16(index_orderDetailId) |1 |27 | |389| │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t17(IDX_BIND_DETAIL_ID) |1 |29 | |390| │ │ └─DISTRIBUTED TABLE GET |sysc |1 |16 | |391| │ └─DISTRIBUTED TABLE RANGE SCAN |t36(idx_order_id) |2 |27 | |392| ├─NESTED-LOOP OUTER JOIN | |1 |4979 | |393| │ ├─NESTED-LOOP OUTER JOIN | |1 |4963 | |394| │ │ ├─NESTED-LOOP OUTER JOIN CARTESIAN | |1 |4934 | |395| │ │ │ ├─NESTED-LOOP JOIN | |1 |4934 | |396| │ │ │ │ ├─NESTED-LOOP JOIN | |1 |4918 | |397| │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |4891 | |398| │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |4737 | |399| │ │ │ │ │ │ │ ├─HASH RIGHT OUTER JOIN | |3 |4674 | |400| │ │ │ │ │ │ │ │ ├─TABLE FULL SCAN |pl |2 |3 | |401| │ │ │ │ │ │ │ │ └─NESTED-LOOP OUTER JOIN | |3 |4671 | |402| │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |3 |4634 | |403| │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |31 |4141 | |404| │ │ │ │ │ │ │ │ │ │ ├─TABLE FULL SCAN |b |31 |3647 | |405| │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |a |1 |16 | |406| │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t2 |1 |16 | |407| │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |408| │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |c(torder_ix_order_id) |1 |27 | |409| │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(tproductstockdetail_ix_order_detail_id)|2 |154 | |410| │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t3(torder_ix_order_id) |1 |27 | |411| │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |412| │ │ │ └─MATERIAL | |1 |7 | |413| │ │ │ └─TABLE GET |t8 |1 |7 | |414| │ │ └─DISTRIBUTED TABLE RANGE SCAN |t17(IDX_BIND_DETAIL_ID) |1 |29 | |415| │ └─DISTRIBUTED TABLE RANGE SCAN |t36(idx_order_id) |2 |16 | |416| ├─NESTED-LOOP OUTER JOIN | |1 |316 | |417| │ ├─NESTED-LOOP OUTER JOIN CARTESIAN | |1 |300 | |418| │ │ ├─NESTED-LOOP OUTER JOIN | |1 |300 | |419| │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |146 | |420| │ │ │ │ ├─NESTED-LOOP JOIN | |1 |117 | |421| │ │ │ │ │ ├─HASH OUTER JOIN | |1 |101 | |422| │ │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |99 | |423| │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |82 | |424| │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |55 | |425| │ │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |39 | |426| │ │ │ │ │ │ │ │ │ │ ├─TABLE RANGE SCAN |t7(treturn_ix_return_type) |1 |9 | |427| │ │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t6(idx_return_detail_return_id) |1 |30 | |428| │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t2 |1 |16 | |429| │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t3(torder_ix_order_id) |1 |27 | |430| │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |431| │ │ │ │ │ │ └─TABLE FULL SCAN |pl |2 |3 | |432| │ │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |433| │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t17(IDX_BIND_DETAIL_ID) |1 |29 | |434| │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(tproductstockdetail_ix_order_detail_id)|2 |154 | |435| │ │ └─MATERIAL | |1 |7 | |436| │ │ └─TABLE GET |t8 |1 |7 | |437| │ └─DISTRIBUTED TABLE RANGE SCAN |t36(idx_order_id) |2 |16 | |438| └─HASH OUTER JOIN | |1 |404 | |439| ├─NESTED-LOOP OUTER JOIN | |1 |401 | |440| │ ├─NESTED-LOOP OUTER JOIN | |1 |385 | |441| │ │ ├─NESTED-LOOP OUTER JOIN CARTESIAN | |1 |356 | |442| │ │ │ ├─NESTED-LOOP JOIN | |1 |356 | |443| │ │ │ │ ├─NESTED-LOOP JOIN | |1 |340 | |444| │ │ │ │ │ ├─NESTED-LOOP OUTER JOIN | |1 |313 | |445| │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |297 | |446| │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |281 | |447| │ │ │ │ │ │ │ │ ├─NESTED-LOOP JOIN | |1 |39 | |448| │ │ │ │ │ │ │ │ │ ├─TABLE RANGE SCAN |t7(treturn_ix_return_type) |1 |9 | |449| │ │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t6(idx_return_detail_return_id) |2 |30 | |450| │ │ │ │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t1(index_mck_id) |1 |241 | |451| │ │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t2 |1 |16 | |452| │ │ │ │ │ │ └─DISTRIBUTED TABLE GET |t4 |1 |16 | |453| │ │ │ │ │ └─DISTRIBUTED TABLE RANGE SCAN |t3(torder_ix_order_id) |1 |27 | |454| │ │ │ │ └─DISTRIBUTED TABLE GET |t5 |1 |16 | |455| │ │ │ └─MATERIAL | |1 |7 | |456| │ │ │ └─TABLE GET |t8 |1 |7 | |457| │ │ └─DISTRIBUTED TABLE RANGE SCAN |t17(IDX_BIND_DETAIL_ID) |1 |29 | |458| │ └─DISTRIBUTED TABLE RANGE SCAN |t36(idx_order_id) |2 |16 | |459| └─TABLE FULL SCAN |pl |2 |3 | ============================================================================================================================================================ Outputs & filters: ------------------------------------- 0 - output([t.in_user_id(0x7f1176711200)], [t.in_user_name(0x7f1176711ab0)], [concat(cast(t.in_user_id(0x7f1176711200), VARCHAR(1048576))(0x7f11767a9820))(0x7f1176711f00)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176714580) THEN t.counts(0x7f1176715bf0) ELSE cast(0, DOUBLE(-1, -1))(0x7f11767a8790) END(0x7f11767132f0))(0x7f1176712de0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176717a20) THEN t.price(0x7f1176718c50) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767aab50) END(0x7f1176716790))(0x7f1176716280)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117671aa80) THEN t.sell_price(0x7f117671bcb0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767abf60) END(0x7f11767197f0))(0x7f11767192e0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117671dae0) THEN t.avg_price(0x7f117671ed10) ELSE cast(0, DOUBLE(17, 2))(0x7f11767ad370) END(0x7f117671c850))(0x7f117671c340)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176720b40) THEN t.gift_price(0x7f1176721d70) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767ae780) END(0x7f117671f8b0))(0x7f117671f3a0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176723ba0) THEN t.discount_price(0x7f1176724dd0) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767afb90) END(0x7f1176722910))(0x7f1176722400)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176726c00) THEN t.point_price(0x7f1176727e30) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767b0fa0) END(0x7f1176725970))(0x7f1176725460)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176729c60) THEN t.statistics_price(0x7f117672ae90) ELSE cast(0, DECIMAL(65, 6))(0x7f11767b23b0) END(0x7f11767289d0))(0x7f11767284c0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117672ccc0) THEN t.self_modify_price(0x7f117672def0) ELSE cast(0, DECIMAL_INT(61, 4))(0x7f11767b37c0) END(0x7f117672ba30))(0x7f117672b520)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176731c30) THEN t.statistics_in_price(0x7f1176732e60) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767b6bf0) END(0x7f11767309a0))(0x7f1176730490)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176734c90) THEN t.statistics_gross_profit(0x7f1176735ec0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767b8000) END(0x7f1176733a00))(0x7f11767334f0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117673a050) THEN t.in_price(0x7f117673b280) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767b9410) END(0x7f1176736a60))(0x7f1176736550)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117673d0b0) THEN t.gross_profit(0x7f117673e2e0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767ba820) END(0x7f117673be20))(0x7f117673b910)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176740110) THEN t.avg_statistics_gross_profit(0x7f1176741340) ELSE cast(0, DOUBLE(17, 2))(0x7f11767bbc30) END(0x7f117673ee80))(0x7f117673e970)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176752990) THEN t.examine_price(0x7f1176753bc0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767bd040) END(0x7f1176751700))(0x7f11767511f0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f11767559f0) THEN t.examine_gross_profit(0x7f1176756c20) ELSE cast(0, DECIMAL(65, 6))(0x7f11767be450) END(0x7f1176754760))(0x7f1176754250)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176758a50) THEN t.avg_examine_gross_profit(0x7f1176759c80) ELSE cast(0, DOUBLE(17, 2))(0x7f11767bf860) END(0x7f11767577c0))(0x7f11767572b0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117675bab0) THEN t.counts(0x7f1176715bf0) ELSE cast(0, DOUBLE(-1, -1))(0x7f11767c0c70) END(0x7f117675a820))(0x7f117675a310)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117675e6d0) THEN t.price(0x7f1176718c50) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767c2080) END(0x7f117675d440))(0x7f117675cf30)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767612f0) THEN t.sell_price(0x7f117671bcb0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767c3490) END(0x7f1176760060))(0x7f117675fb50)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176763f10) THEN t.avg_price(0x7f117671ed10) ELSE cast(0, DOUBLE(17, 2))(0x7f11767c48a0) END(0x7f1176762c80))(0x7f1176762770)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176766b30) THEN t.gift_price(0x7f1176721d70) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767c5cb0) END(0x7f11767658a0))(0x7f1176765390)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176769750) THEN t.discount_price(0x7f1176724dd0) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767c70c0) END(0x7f11767684c0))(0x7f1176767fb0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117676c370) THEN t.point_price(0x7f1176727e30) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767c84d0) END(0x7f117676b0e0))(0x7f117676abd0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117676ef90) THEN t.statistics_price(0x7f117672ae90) ELSE cast(0, DECIMAL(65, 6))(0x7f11767c98e0) END(0x7f117676dd00))(0x7f117676d7f0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176771bb0) THEN t.self_modify_price(0x7f117672def0) ELSE cast(0, DECIMAL_INT(61, 4))(0x7f11767cacf0) END(0x7f1176770920))(0x7f1176770410)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767747d0) THEN t.statistics_in_price(0x7f1176732e60) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767cc100) END(0x7f1176773540))(0x7f1176773030)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767797f0) THEN t.statistics_gross_profit(0x7f1176735ec0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767cd510) END(0x7f1176778560))(0x7f1176778050)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117677c410) THEN t.in_price(0x7f117673b280) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767ce920) END(0x7f117677b180))(0x7f117677ac70)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117677f030) THEN t.gross_profit(0x7f117673e2e0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767cfd30) END(0x7f117677dda0))(0x7f117677d890)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176781c50) THEN t.avg_statistics_gross_profit(0x7f1176741340) ELSE cast(0, DOUBLE(17, 2))(0x7f11767d1140) END(0x7f11767809c0))(0x7f11767804b0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176784870) THEN t.examine_price(0x7f1176753bc0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767d2550) END(0x7f11767835e0))(0x7f11767830d0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176787490) THEN t.examine_gross_profit(0x7f1176756c20) ELSE cast(0, DECIMAL(65, 6))(0x7f11767d3960) END(0x7f1176786200))(0x7f1176785cf0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767a52c0) THEN t.avg_examine_gross_profit(0x7f1176759c80) ELSE cast(0, DOUBLE(17, 2))(0x7f11767d4d70) END(0x7f11767a4030))(0x7f11767a3b20)]), filter(nil), rowset=256 limit(10), offset(0) 1 - output([t.in_user_id(0x7f1176711200)], [t.in_user_name(0x7f1176711ab0)], [concat(cast(t.in_user_id(0x7f1176711200), VARCHAR(1048576))(0x7f11767a9820))(0x7f1176711f00)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176714580) THEN t.counts(0x7f1176715bf0) ELSE cast(0, DOUBLE(-1, -1))(0x7f11767a8790) END(0x7f11767132f0))(0x7f1176712de0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176717a20) THEN t.price(0x7f1176718c50) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767aab50) END(0x7f1176716790))(0x7f1176716280)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117671aa80) THEN t.sell_price(0x7f117671bcb0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767abf60) END(0x7f11767197f0))(0x7f11767192e0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117671dae0) THEN t.avg_price(0x7f117671ed10) ELSE cast(0, DOUBLE(17, 2))(0x7f11767ad370) END(0x7f117671c850))(0x7f117671c340)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176720b40) THEN t.gift_price(0x7f1176721d70) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767ae780) END(0x7f117671f8b0))(0x7f117671f3a0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176723ba0) THEN t.discount_price(0x7f1176724dd0) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767afb90) END(0x7f1176722910))(0x7f1176722400)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176726c00) THEN t.point_price(0x7f1176727e30) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767b0fa0) END(0x7f1176725970))(0x7f1176725460)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176729c60) THEN t.statistics_price(0x7f117672ae90) ELSE cast(0, DECIMAL(65, 6))(0x7f11767b23b0) END(0x7f11767289d0))(0x7f11767284c0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117672ccc0) THEN t.self_modify_price(0x7f117672def0) ELSE cast(0, DECIMAL_INT(61, 4))(0x7f11767b37c0) END(0x7f117672ba30))(0x7f117672b520)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176731c30) THEN t.statistics_in_price(0x7f1176732e60) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767b6bf0) END(0x7f11767309a0))(0x7f1176730490)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176734c90) THEN t.statistics_gross_profit(0x7f1176735ec0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767b8000) END(0x7f1176733a00))(0x7f11767334f0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117673a050) THEN t.in_price(0x7f117673b280) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767b9410) END(0x7f1176736a60))(0x7f1176736550)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117673d0b0) THEN t.gross_profit(0x7f117673e2e0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767ba820) END(0x7f117673be20))(0x7f117673b910)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176740110) THEN t.avg_statistics_gross_profit(0x7f1176741340) ELSE cast(0, DOUBLE(17, 2))(0x7f11767bbc30) END(0x7f117673ee80))(0x7f117673e970)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176752990) THEN t.examine_price(0x7f1176753bc0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767bd040) END(0x7f1176751700))(0x7f11767511f0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f11767559f0) THEN t.examine_gross_profit(0x7f1176756c20) ELSE cast(0, DECIMAL(65, 6))(0x7f11767be450) END(0x7f1176754760))(0x7f1176754250)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176758a50) THEN t.avg_examine_gross_profit(0x7f1176759c80) ELSE cast(0, DOUBLE(17, 2))(0x7f11767bf860) END(0x7f11767577c0))(0x7f11767572b0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117675bab0) THEN t.counts(0x7f1176715bf0) ELSE cast(0, DOUBLE(-1, -1))(0x7f11767c0c70) END(0x7f117675a820))(0x7f117675a310)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117675e6d0) THEN t.price(0x7f1176718c50) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767c2080) END(0x7f117675d440))(0x7f117675cf30)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767612f0) THEN t.sell_price(0x7f117671bcb0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767c3490) END(0x7f1176760060))(0x7f117675fb50)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176763f10) THEN t.avg_price(0x7f117671ed10) ELSE cast(0, DOUBLE(17, 2))(0x7f11767c48a0) END(0x7f1176762c80))(0x7f1176762770)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176766b30) THEN t.gift_price(0x7f1176721d70) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767c5cb0) END(0x7f11767658a0))(0x7f1176765390)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176769750) THEN t.discount_price(0x7f1176724dd0) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767c70c0) END(0x7f11767684c0))(0x7f1176767fb0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117676c370) THEN t.point_price(0x7f1176727e30) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767c84d0) END(0x7f117676b0e0))(0x7f117676abd0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117676ef90) THEN t.statistics_price(0x7f117672ae90) ELSE cast(0, DECIMAL(65, 6))(0x7f11767c98e0) END(0x7f117676dd00))(0x7f117676d7f0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176771bb0) THEN t.self_modify_price(0x7f117672def0) ELSE cast(0, DECIMAL_INT(61, 4))(0x7f11767cacf0) END(0x7f1176770920))(0x7f1176770410)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767747d0) THEN t.statistics_in_price(0x7f1176732e60) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767cc100) END(0x7f1176773540))(0x7f1176773030)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767797f0) THEN t.statistics_gross_profit(0x7f1176735ec0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767cd510) END(0x7f1176778560))(0x7f1176778050)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117677c410) THEN t.in_price(0x7f117673b280) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767ce920) END(0x7f117677b180))(0x7f117677ac70)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117677f030) THEN t.gross_profit(0x7f117673e2e0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767cfd30) END(0x7f117677dda0))(0x7f117677d890)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176781c50) THEN t.avg_statistics_gross_profit(0x7f1176741340) ELSE cast(0, DOUBLE(17, 2))(0x7f11767d1140) END(0x7f11767809c0))(0x7f11767804b0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176784870) THEN t.examine_price(0x7f1176753bc0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767d2550) END(0x7f11767835e0))(0x7f11767830d0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176787490) THEN t.examine_gross_profit(0x7f1176756c20) ELSE cast(0, DECIMAL(65, 6))(0x7f11767d3960) END(0x7f1176786200))(0x7f1176785cf0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767a52c0) THEN t.avg_examine_gross_profit(0x7f1176759c80) ELSE cast(0, DOUBLE(17, 2))(0x7f11767d4d70) END(0x7f11767a4030))(0x7f11767a3b20)]), filter(nil), rowset=256 sort_keys([T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176714580) THEN t.counts(0x7f1176715bf0) ELSE cast(0, DOUBLE(-1, -1))(0x7f11767a8790) END(0x7f11767132f0))(0x7f1176712de0), DESC], [concat(cast(t.in_user_id(0x7f1176711200), VARCHAR(1048576))(0x7f11767a9820))(0x7f1176711f00), DESC]), topn(10 + 0(0x7f11692f2190)) 2 - output([t.in_user_id(0x7f1176711200)], [t.in_user_name(0x7f1176711ab0)], [concat(cast(t.in_user_id(0x7f1176711200), VARCHAR(1048576))(0x7f11767a9820))(0x7f1176711f00)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176714580) THEN t.counts(0x7f1176715bf0) ELSE cast(0, DOUBLE(-1, -1))(0x7f11767a8790) END(0x7f11767132f0))(0x7f1176712de0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176717a20) THEN t.price(0x7f1176718c50) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767aab50) END(0x7f1176716790))(0x7f1176716280)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117671aa80) THEN t.sell_price(0x7f117671bcb0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767abf60) END(0x7f11767197f0))(0x7f11767192e0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117671dae0) THEN t.avg_price(0x7f117671ed10) ELSE cast(0, DOUBLE(17, 2))(0x7f11767ad370) END(0x7f117671c850))(0x7f117671c340)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176720b40) THEN t.gift_price(0x7f1176721d70) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767ae780) END(0x7f117671f8b0))(0x7f117671f3a0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176723ba0) THEN t.discount_price(0x7f1176724dd0) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767afb90) END(0x7f1176722910))(0x7f1176722400)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176726c00) THEN t.point_price(0x7f1176727e30) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767b0fa0) END(0x7f1176725970))(0x7f1176725460)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176729c60) THEN t.statistics_price(0x7f117672ae90) ELSE cast(0, DECIMAL(65, 6))(0x7f11767b23b0) END(0x7f11767289d0))(0x7f11767284c0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117672ccc0) THEN t.self_modify_price(0x7f117672def0) ELSE cast(0, DECIMAL_INT(61, 4))(0x7f11767b37c0) END(0x7f117672ba30))(0x7f117672b520)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176731c30) THEN t.statistics_in_price(0x7f1176732e60) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767b6bf0) END(0x7f11767309a0))(0x7f1176730490)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176734c90) THEN t.statistics_gross_profit(0x7f1176735ec0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767b8000) END(0x7f1176733a00))(0x7f11767334f0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117673a050) THEN t.in_price(0x7f117673b280) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767b9410) END(0x7f1176736a60))(0x7f1176736550)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117673d0b0) THEN t.gross_profit(0x7f117673e2e0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767ba820) END(0x7f117673be20))(0x7f117673b910)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176740110) THEN t.avg_statistics_gross_profit(0x7f1176741340) ELSE cast(0, DOUBLE(17, 2))(0x7f11767bbc30) END(0x7f117673ee80))(0x7f117673e970)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176752990) THEN t.examine_price(0x7f1176753bc0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767bd040) END(0x7f1176751700))(0x7f11767511f0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f11767559f0) THEN t.examine_gross_profit(0x7f1176756c20) ELSE cast(0, DECIMAL(65, 6))(0x7f11767be450) END(0x7f1176754760))(0x7f1176754250)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176758a50) THEN t.avg_examine_gross_profit(0x7f1176759c80) ELSE cast(0, DOUBLE(17, 2))(0x7f11767bf860) END(0x7f11767577c0))(0x7f11767572b0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117675bab0) THEN t.counts(0x7f1176715bf0) ELSE cast(0, DOUBLE(-1, -1))(0x7f11767c0c70) END(0x7f117675a820))(0x7f117675a310)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117675e6d0) THEN t.price(0x7f1176718c50) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767c2080) END(0x7f117675d440))(0x7f117675cf30)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767612f0) THEN t.sell_price(0x7f117671bcb0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767c3490) END(0x7f1176760060))(0x7f117675fb50)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176763f10) THEN t.avg_price(0x7f117671ed10) ELSE cast(0, DOUBLE(17, 2))(0x7f11767c48a0) END(0x7f1176762c80))(0x7f1176762770)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176766b30) THEN t.gift_price(0x7f1176721d70) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767c5cb0) END(0x7f11767658a0))(0x7f1176765390)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176769750) THEN t.discount_price(0x7f1176724dd0) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767c70c0) END(0x7f11767684c0))(0x7f1176767fb0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117676c370) THEN t.point_price(0x7f1176727e30) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767c84d0) END(0x7f117676b0e0))(0x7f117676abd0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117676ef90) THEN t.statistics_price(0x7f117672ae90) ELSE cast(0, DECIMAL(65, 6))(0x7f11767c98e0) END(0x7f117676dd00))(0x7f117676d7f0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176771bb0) THEN t.self_modify_price(0x7f117672def0) ELSE cast(0, DECIMAL_INT(61, 4))(0x7f11767cacf0) END(0x7f1176770920))(0x7f1176770410)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767747d0) THEN t.statistics_in_price(0x7f1176732e60) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767cc100) END(0x7f1176773540))(0x7f1176773030)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767797f0) THEN t.statistics_gross_profit(0x7f1176735ec0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767cd510) END(0x7f1176778560))(0x7f1176778050)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117677c410) THEN t.in_price(0x7f117673b280) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767ce920) END(0x7f117677b180))(0x7f117677ac70)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117677f030) THEN t.gross_profit(0x7f117673e2e0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767cfd30) END(0x7f117677dda0))(0x7f117677d890)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176781c50) THEN t.avg_statistics_gross_profit(0x7f1176741340) ELSE cast(0, DOUBLE(17, 2))(0x7f11767d1140) END(0x7f11767809c0))(0x7f11767804b0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176784870) THEN t.examine_price(0x7f1176753bc0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767d2550) END(0x7f11767835e0))(0x7f11767830d0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176787490) THEN t.examine_gross_profit(0x7f1176756c20) ELSE cast(0, DECIMAL(65, 6))(0x7f11767d3960) END(0x7f1176786200))(0x7f1176785cf0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767a52c0) THEN t.avg_examine_gross_profit(0x7f1176759c80) ELSE cast(0, DOUBLE(17, 2))(0x7f11767d4d70) END(0x7f11767a4030))(0x7f11767a3b20)]), filter(nil), rowset=256 group([t.in_user_id(0x7f1176711200)], [t.in_user_name(0x7f1176711ab0)]), agg_func([T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176714580) THEN t.counts(0x7f1176715bf0) ELSE cast(0, DOUBLE(-1, -1))(0x7f11767a8790) END(0x7f11767132f0))(0x7f1176712de0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176717a20) THEN t.price(0x7f1176718c50) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767aab50) END(0x7f1176716790))(0x7f1176716280)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117671aa80) THEN t.sell_price(0x7f117671bcb0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767abf60) END(0x7f11767197f0))(0x7f11767192e0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117671dae0) THEN t.avg_price(0x7f117671ed10) ELSE cast(0, DOUBLE(17, 2))(0x7f11767ad370) END(0x7f117671c850))(0x7f117671c340)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176720b40) THEN t.gift_price(0x7f1176721d70) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767ae780) END(0x7f117671f8b0))(0x7f117671f3a0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176723ba0) THEN t.discount_price(0x7f1176724dd0) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767afb90) END(0x7f1176722910))(0x7f1176722400)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176726c00) THEN t.point_price(0x7f1176727e30) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767b0fa0) END(0x7f1176725970))(0x7f1176725460)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176729c60) THEN t.statistics_price(0x7f117672ae90) ELSE cast(0, DECIMAL(65, 6))(0x7f11767b23b0) END(0x7f11767289d0))(0x7f11767284c0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117672ccc0) THEN t.self_modify_price(0x7f117672def0) ELSE cast(0, DECIMAL_INT(61, 4))(0x7f11767b37c0) END(0x7f117672ba30))(0x7f117672b520)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176731c30) THEN t.statistics_in_price(0x7f1176732e60) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767b6bf0) END(0x7f11767309a0))(0x7f1176730490)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176734c90) THEN t.statistics_gross_profit(0x7f1176735ec0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767b8000) END(0x7f1176733a00))(0x7f11767334f0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117673a050) THEN t.in_price(0x7f117673b280) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767b9410) END(0x7f1176736a60))(0x7f1176736550)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f117673d0b0) THEN t.gross_profit(0x7f117673e2e0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767ba820) END(0x7f117673be20))(0x7f117673b910)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176740110) THEN t.avg_statistics_gross_profit(0x7f1176741340) ELSE cast(0, DOUBLE(17, 2))(0x7f11767bbc30) END(0x7f117673ee80))(0x7f117673e970)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176752990) THEN t.examine_price(0x7f1176753bc0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767bd040) END(0x7f1176751700))(0x7f11767511f0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f11767559f0) THEN t.examine_gross_profit(0x7f1176756c20) ELSE cast(0, DECIMAL(65, 6))(0x7f11767be450) END(0x7f1176754760))(0x7f1176754250)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'A'(0x7f1176758a50) THEN t.avg_examine_gross_profit(0x7f1176759c80) ELSE cast(0, DOUBLE(17, 2))(0x7f11767bf860) END(0x7f11767577c0))(0x7f11767572b0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117675bab0) THEN t.counts(0x7f1176715bf0) ELSE cast(0, DOUBLE(-1, -1))(0x7f11767c0c70) END(0x7f117675a820))(0x7f117675a310)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117675e6d0) THEN t.price(0x7f1176718c50) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767c2080) END(0x7f117675d440))(0x7f117675cf30)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767612f0) THEN t.sell_price(0x7f117671bcb0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767c3490) END(0x7f1176760060))(0x7f117675fb50)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176763f10) THEN t.avg_price(0x7f117671ed10) ELSE cast(0, DOUBLE(17, 2))(0x7f11767c48a0) END(0x7f1176762c80))(0x7f1176762770)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176766b30) THEN t.gift_price(0x7f1176721d70) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767c5cb0) END(0x7f11767658a0))(0x7f1176765390)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176769750) THEN t.discount_price(0x7f1176724dd0) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767c70c0) END(0x7f11767684c0))(0x7f1176767fb0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117676c370) THEN t.point_price(0x7f1176727e30) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767c84d0) END(0x7f117676b0e0))(0x7f117676abd0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117676ef90) THEN t.statistics_price(0x7f117672ae90) ELSE cast(0, DECIMAL(65, 6))(0x7f11767c98e0) END(0x7f117676dd00))(0x7f117676d7f0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176771bb0) THEN t.self_modify_price(0x7f117672def0) ELSE cast(0, DECIMAL_INT(61, 4))(0x7f11767cacf0) END(0x7f1176770920))(0x7f1176770410)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767747d0) THEN t.statistics_in_price(0x7f1176732e60) ELSE cast(0, DECIMAL_INT(81, 4))(0x7f11767cc100) END(0x7f1176773540))(0x7f1176773030)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767797f0) THEN t.statistics_gross_profit(0x7f1176735ec0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767cd510) END(0x7f1176778560))(0x7f1176778050)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117677c410) THEN t.in_price(0x7f117673b280) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767ce920) END(0x7f117677b180))(0x7f117677ac70)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f117677f030) THEN t.gross_profit(0x7f117673e2e0) ELSE cast(0, DECIMAL(65, 6))(0x7f11767cfd30) END(0x7f117677dda0))(0x7f117677d890)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176781c50) THEN t.avg_statistics_gross_profit(0x7f1176741340) ELSE cast(0, DOUBLE(17, 2))(0x7f11767d1140) END(0x7f11767809c0))(0x7f11767804b0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176784870) THEN t.examine_price(0x7f1176753bc0) ELSE cast(0, DECIMAL_INT(81, 2))(0x7f11767d2550) END(0x7f11767835e0))(0x7f11767830d0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f1176787490) THEN t.examine_gross_profit(0x7f1176756c20) ELSE cast(0, DECIMAL(65, 6))(0x7f11767d3960) END(0x7f1176786200))(0x7f1176785cf0)], [T_FUN_SUM(CASE WHEN t.data_mark(0x7f11767157b0) = 'B'(0x7f11767a52c0) THEN t.avg_examine_gross_profit(0x7f1176759c80) ELSE cast(0, DOUBLE(17, 2))(0x7f11767d4d70) END(0x7f11767a4030))(0x7f11767a3b20)]) 3 - output([t.in_user_id(0x7f1176711200)], [t.in_user_name(0x7f1176711ab0)], [t.data_mark(0x7f11767157b0)], [t.counts(0x7f1176715bf0)], [t.price(0x7f1176718c50)], [t.sell_price(0x7f117671bcb0)], [t.avg_price(0x7f117671ed10)], [t.gift_price(0x7f1176721d70)], [t.discount_price(0x7f1176724dd0)], [t.point_price(0x7f1176727e30)], [t.statistics_price(0x7f117672ae90)], [t.self_modify_price(0x7f117672def0)], [t.statistics_in_price(0x7f1176732e60)], [t.statistics_gross_profit(0x7f1176735ec0)], [t.in_price(0x7f117673b280)], [t.gross_profit(0x7f117673e2e0)], [t.avg_statistics_gross_profit(0x7f1176741340)], [t.examine_price(0x7f1176753bc0)], [t.examine_gross_profit(0x7f1176756c20)], [t.avg_examine_gross_profit(0x7f1176759c80)]), filter(nil), rowset=256 access([t.in_user_id(0x7f1176711200)], [t.in_user_name(0x7f1176711ab0)], [t.data_mark(0x7f11767157b0)], [t.counts(0x7f1176715bf0)], [t.price(0x7f1176718c50)], [t.sell_price(0x7f117671bcb0)], [t.avg_price(0x7f117671ed10)], [t.gift_price(0x7f1176721d70)], [t.discount_price(0x7f1176724dd0)], [t.point_price(0x7f1176727e30)], [t.statistics_price(0x7f117672ae90)], [t.self_modify_price(0x7f117672def0)], [t.statistics_in_price(0x7f1176732e60)], [t.statistics_gross_profit(0x7f1176735ec0)], [t.in_price(0x7f117673b280)], [t.gross_profit(0x7f117673e2e0)], [t.avg_statistics_gross_profit(0x7f1176741340)], [t.examine_price(0x7f1176753bc0)], [t.examine_gross_profit(0x7f1176756c20)], [t.avg_examine_gross_profit(0x7f1176759c80)]) 4 - output([UNION([1])(0x7f11766a1980)], [UNION([2])(0x7f11766a1d30)], [UNION([3])(0x7f11766a20e0)], [UNION([4])(0x7f11766a2490)], [UNION([5])(0x7f11766a2840)], [UNION([6])(0x7f11766a2bf0)], [UNION([7])(0x7f11766a2fa0)], [UNION([8])(0x7f11766a3350)], [UNION([9])(0x7f11766a3700)], [UNION([10])(0x7f11766a3ab0)], [UNION([11])(0x7f11766a3e60)], [UNION([12])(0x7f11766a4210)], [UNION([13])(0x7f11766a45c0)], [UNION([14])(0x7f11766a4970)], [UNION([15])(0x7f11766a4d20)], [UNION([16])(0x7f11766a50d0)], [UNION([17])(0x7f11766a5480)], [UNION([18])(0x7f11766b3140)], [UNION([19])(0x7f11766b34f0)], [UNION([20])(0x7f11766b38a0)]), filter(nil), rowset=256 5 - output([t.in_user_id(0x7f143362d020)], [t.in_user_name(0x7f143362d8d0)], [IFNULL(T_FUN_SUM(cast(t.count(0x7f143362f590), DOUBLE(-1, -1))(0x7f1433660740))(0x7f143362e5e0), cast(0, DOUBLE(-1, -1))(0x7f1433661630))(0x7f143362dd20)], [IFNULL(T_FUN_SUM(t.price(0x7f1433631330))(0x7f1433630380), cast(0, DECIMAL_INT(81, 2))(0x7f14336626f0))(0x7f143362fac0)], [IFNULL(T_FUN_SUM(t.sell_price(0x7f14336330d0))(0x7f1433632120), cast(0, DECIMAL_INT(81, 2))(0x7f1433663720))(0x7f1433631860)], [ROUND(cast(T_FUN_SUM(t.price(0x7f1433631330))(0x7f1433630380), DOUBLE(81, 2))(0x7f1433664a20) / T_FUN_SUM(cast(t.count(0x7f143362f590), DOUBLE(-1, -1))(0x7f1433660740))(0x7f143362e5e0)(0x7f14336351a0), 2)(0x7f1433633600)], [IFNULL(T_FUN_SUM(t.gift_price(0x7f1433637b00))(0x7f1433636b50), cast(0, DECIMAL_INT(81, 4))(0x7f1433665b10))(0x7f1433636290)], [IFNULL(T_FUN_SUM(t.discount_price(0x7f14336398a0))(0x7f14336388f0), cast(0, DECIMAL_INT(81, 4))(0x7f1433666b40))(0x7f1433638030)], [IFNULL(T_FUN_SUM(t.point_price(0x7f143363b640))(0x7f143363a690), cast(0, DECIMAL_INT(81, 4))(0x7f1433667b70))(0x7f1433639dd0)], [IFNULL(T_FUN_SUM(t.self_modify_price(0x7f143363d3e0))(0x7f143363c430), cast(0, DECIMAL_INT(61, 4))(0x7f1433668ba0))(0x7f143363bb70)], [T_FUN_SUM(t.actualPaymentPrice(0x7f143363e2a0))(0x7f143363d910)], [T_FUN_SUM(IFNULL(t.statistics_in_price(0x7f1433642050), cast(0, DECIMAL_INT(77, 4))(0x7f1433669c10))(0x7f143363ec60))(0x7f143363e750 )], [T_FUN_SUM(t.statistics_gross_profit(0x7f1433644e60))(0x7f14336444d0)], [T_FUN_SUM(IFNULL(t.in_price(0x7f1433646b80), cast(0, DECIMAL_INT(75, 2))(0x7f143366acc0))(0x7f1433645820))(0x7f1433645310)], [T_FUN_SUM(t.gross_profit(0x7f1433649990))(0x7f1433649000)], [ROUND(cast(T_FUN_SUM(t.statistics_gross_profit(0x7f1433644e60))(0x7f14336444d0), DOUBLE(83, 6))(0x7f143366c040) / T_FUN_SUM(cast(t.count(0x7f143362f590), DOUBLE(-1, -1))(0x7f1433660740))(0x7f143362e5e0)(0x7f143364b9e0), 2)(0x7f1433649e40)], [T_FUN_SUM(IFNULL(t.examine_price(0x7f143364e340), cast(0, DECIMAL_INT(75, 2))(0x7f143366d130))(0x7f143364cfe0))(0x7f143364cad0)], [T_FUN_SUM(t.examine_gross_profit(0x7f143365cb50))(0x7f143365c1c0)], [ROUND(cast(T_FUN_SUM(t.examine_gross_profit(0x7f14 3365cb50))(0x7f143365c1c0), DOUBLE(83, 6))(0x7f143366e4b0) / T_FUN_SUM(cast(t.count(0x7f143362f590), DOUBLE(-1, -1))(0x7f1433660740))(0x7f143362e5e0)(0x7f143365eba0), 2)(0x7f143365d000)], ['A']), filter(nil), rowset=256 group([t.in_user_id(0x7f143362d020)], [t.in_user_name(0x7f143362d8d0)]), agg_func([T_FUN_SUM(cast(t.count(0x7f143362f590), DOUBLE(-1, -1))(0x7f1433660740))(0x7f143362e5e0)], [T_FUN_SUM(t.price(0x7f1433631330))(0x7f1433630380)], [T_FUN_SUM(t.sell_price(0x7f14336330d0))(0x7f1433632120)], [T_FUN_SUM(t.gift_price(0x7f1433637b00))(0x7f1433636b50)], [T_FUN_SUM(t.discount_price(0x7f14336398a0))(0x7f14336388f0)], [T_FUN_SUM(t.point_price(0x7f143363b640))(0x7f143363a690)], [T_FUN_SUM(t.self_modify_price(0x7f143363d3e0))(0x7f143363c430)], [T_FUN_SUM(t.actualPaymentPrice(0x7f143363e2a0))(0x7f143363d910)], [T_FUN_SUM(IFNULL(t.statistics_in_price(0x7f1433642050), cast(0, DECIMAL_INT(77, 4))(0x7f1433669c10))(0x7f143363ec60))(0x7f143363e750 )], [T_FUN_SUM(t.statistics_gross_profit(0x7f1433644e60))(0x7f14336444d0)], [T_FUN_SUM(IFNULL(t.in_price(0x7f1433646b80), cast(0, DECIMAL_INT(75, 2))(0x7f143366acc0))(0x7f1433645820))(0x7f1433645310)], [T_FUN_SUM(t.gross_profit(0x7f1433649990))(0x7f1433649000)], [T_FUN_SUM(IFNULL(t.examine_price(0x7f143364e340), cast(0, DECIMAL_INT(75, 2))(0x7f143366d130))(0x7f143364cfe0))(0x7f143364cad0)], [T_FUN_SUM(t.examine_gross_profit(0x7f143365cb50))(0x7f143365c1c0)]) 6 - output([t.statistics_in_price(0x7f1433642050)], [t.in_price(0x7f1433646b80)], [t.statistics_gross_profit(0x7f1433644e60)], [t.gross_profit(0x7f1433649990)], [t.examine_price(0x7f143364e340)], [t.examine_gross_profit(0x7f143365cb50)], [t.count(0x7f143362f590)], [t.price(0x7f1433631330)], [t.sell_price(0x7f14336330d0)], [t.gift_price(0x7f1433637b00)], [t.discount_price(0x7f14336398a0)], [t.point_price(0x7f143363b640)], [t.actualPaymentPrice(0x7f143363e2a0)], [t.self_modify_price(0x7f143363d3e0)], [t.in_user_id(0x7f143362d020)], [t.in_user_name(0x7f143362d8d0)]), filter(nil), rowset=256 access([t.statistics_in_price(0x7f1433642050)], [t.in_price(0x7f1433646b80)], [t.statistics_gross_profit(0x7f1433644e60)], [t.gross_profit(0x7f1433649990)], [t.examine_price(0x7f143364e340)], [t.examine_gross_profit(0x7f143365cb50)], [t.count(0x7f143362f590)], [t.price(0x7f1433631330)], [t.sell_price(0x7f14336330d0)], [t.gift_price(0x7f1433637b00)], [t.discount_price(0x7f14336398a0)], [t.point_price(0x7f143363b640)], [t.actualPaymentPrice(0x7f143363e2a0)], [t.self_modify_price(0x7f143363d3e0)], [t.in_user_id(0x7f143362d020)], [t.in_user_name(0x7f143362d8d0)]) 7 - output([UNION([1])(0x7f13a4fa8bd0)], [UNION([2])(0x7f13a4fa8f80)], [UNION([3])(0x7f13a4fa9330)], [UNION([4])(0x7f13a4fa96e0)], [UNION([5])(0x7f13a4fa9a90)], [UNION([6])(0x7f13a4fa9e40)], [UNION([7])(0x7f13a4fc61f0)], [UNION([8])(0x7f13a4fc65a0)], [UNION([9])(0x7f13a4fc6d00)], [UNION([10])(0x7f13a4fc70b0)], [UNION([11])(0x7f13a4fc7460)], [UNION([12])(0x7f13a4fc7810)], [UNION([13])(0x7f13a4fe3180)], [UNION([14])(0x7f13a4fe3530)], [UNION([15])(0x7f13a4fe3c90)], [UNION([16])(0x7f13a4fe4040)]), filter(nil), rowset=256 8 - output([cast(cast(0, DECIMAL_INT(42, 4))(0x7f1333ac31f0) - cast(IFNULL(cast(t1.inprice(0x7f1333a2ec20), DECIMAL_INT(22, 2))(0x7f1333ab6d70), cast(0, DECIMAL_INT(22, 2))(0x7f1333ab7c60))(0x7f1333a27bd0), DECIMAL_INT(39, 4))(0x7f1333ab9be0) - cast(IFNULL(t16.self_modify_price(0x7f1333a2f060), cast(0.00, DECIMAL_INT(38, 4))(0x7f1333ab8b50))(0x7f1333a28ed0), DECIMAL_INT(39, 4))(0x7f1333abac00)(0x7f1333a2a1e0) - cast(IFNULL(t16.in_source_modify_price(0x7f1333a2f4e0), cast(0.00, DECIMAL_INT(38, 4))(0x7f1333abe050))(0x7f1333a2aa60), DECIMAL_INT(40, 4))(0x7f1333abf0e0)(0x7f1333a2bd70) + cast(IFNULL(cast(t1.transfer_price(0x7f1333a2f960), DECIMAL_INT(22, 2))(0x7f1333ac00b0), cast(0, DECIMAL_INT(22, 2))(0x7f1333ac0fa0))(0x7f1333a2c5f0), DECIMAL_INT(41, 4))(0x7f1333ac2030)(0x7f1333a2d920)(0x7f1333a2e1a0), DECIMAL_INT(77, 4))(0x7f133008ce90)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f1333ac4960) - cast(t1.inprice(0x7f1333a2ec20), DECIMAL_INT(23, 2))(0x7f1333ac5850)(0x7f1333a30aa0), DECIMAL_INT(75, 2))(0x7f1330091300)], [cast(cast(cast(0, DECIMAL_INT(23, 2))(0x7f1333ac6f40) - cast(t6.return_price(0x7f1333a395f0), DECIMAL_INT(23, 2))(0x7f1333ac7e30)(0x7f1333a31ce0) + IFNULL(cast(t1.inprice(0x7f1333a2ec20), DECIMAL_INT(22, 2))(0x7f1333ab6d70), cast(0, DECIMAL_INT(22, 2))(0x7f1333ab7c60))(0x7f1333a27bd0)(0x7f1333a33860), DECIMAL_INT(39, 4))(0x7f1333ac9060) - cast(IFNULL(t16.self_modify_price(0x7f1333a2f060), cast(0.00, DECIMAL_INT(38, 4))(0x7f1333ab8b50))(0x7f1333a28ed0), DECIMAL_INT(39, 4))(0x7f1333aca240)(0x7f1333a353f0) - cast(IFNULL(t16.in_source_modify_price(0x7f1333a2f4e0), cast(0.00, DECIMAL_INT(38, 4))(0x7f1333abe050))(0x7f1333a2aa60), DECIMAL_INT(40, 4))(0x7f1333acb380)(0x7f1333a36fb0) + cast(IFNULL(cast(t1.transfer_price(0x7f1333a2f960), DECIMAL_INT(22, 2))(0x7f1333ac00b0), cast(0, DECIMAL_INT(22, 2))(0x7f1333ac0fa0))(0x7f1333a2c5f0), DECIMAL_INT(41, 4))(0x7f1333acc4c0)(0x7f1333a38b30), DECIMAL(65, 6))(0x7f1330094150)], [cast(cast(cast(0, DECIMAL_INT(23, 2))(0x7f1333ac6f40) - cast(t6.return_price(0x7f1333a395f0), DECIMAL_INT(23, 2))(0x7f1333ac7e30)(0x7f1333a31ce0) + IFNULL(cast(t1.inprice(0x7f1333a2ec20), DECIMAL_INT(22, 2))(0x7f1333ab6d70), cast(0, DECIMAL_INT(22, 2))(0x7f1333ab7c60))(0x7f1333a27bd0)(0x7f1333a33860), DECIMAL_INT(26, 4))(0x7f1333bbf9c0), DECIMAL(65, 6))(0x7f1330097a20)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f1333ace1d0) - cast(t1.examine_price(0x7f1333a3dfb0), DECIMAL_INT(23, 2))(0x7f1333acf0c0)(0x7f1333a3d6f0), DECIMAL_INT(75, 2))(0x7f133009add0)], [cast(cast(cast(0, DECIMAL_INT(24, 2))(0x7f1333ad3190) - cast(t6.return_price(0x7f1333a395f0), DECIMAL_INT(23, 2))(0x7f1333ad2100) - IFNULL(cast(t1.examine_price(0x7f1333a3dfb0), DECIMAL_INT(22, 2))(0x7f1333ad0180), cast(0, DECIMAL_INT(22, 2))(0x7f1333ad1070))(0x7f1333a3ed70)(0x7f1333a421a0)(0x7f1333a42a20), DECIMAL_INT(26, 4))(0x7f1333bc1a40), DECIMAL(65, 6))(0x7f133009dc20)], ['-1'], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f1333ad4590) - cast(t2.price(0x7f1333a5c850), DECIMAL_INT(23, 2))(0x7f1333ad5480)(0x7f1333a5bf90), DECIMAL_INT(78, 2))(0x7f13300a77a0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f1333ad6660) - cast(t2.sell_price(0x7f1333a5f110), DECIMAL_INT(23, 2))(0x7f1333ad7550)(0x7f1333a5e850), DECIMAL_INT(78, 2))(0x7f13300ad440)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f1333ad8730) - cast(t2.gift_price(0x7f1333a60790), DECIMAL_INT(25, 4))(0x7f1333ad9620)(0x7f1333a5fed0), DECIMAL_INT(76, 4))(0x7f13300b0290)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f1333ada800) - cast(t2.discount_price(0x7f1333a61e10), DECIMAL_INT(25, 4))(0x7f1333adb6f0)(0x7f1333a61550), DECIMAL_INT(76, 4))(0x7f13300b30e0)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f1333adc8d0) - cast(t2.point_price(0x7f1333a63490), DECIMAL_INT(25, 4))(0x7f1333add7c0)(0x7f1333a62bd0), DECIMAL_INT(76, 4))(0x7f13300b5f30)], [cast(cast(cast(0, DECIMAL_INT(23, 2))(0x7f1333ac6f40) - cast(t6.return_price(0x7f1333a395f0), DECIMAL_INT(23, 2))(0x7f1333ac7e30)(0x7f1333a31ce0), DECIMAL_INT(25, 4))(0x7f1333bca3d0), DECIMAL(65, 6))(0x7f13300be050)], [cast(0, DECIMAL_INT(39, 4))(0x7f1333adec70) - cast(IFNULL(t16.self_modify_price(0x7f1333a2f060), cast(0.00, DECIMAL_INT(38, 4))(0x7f1333ab8b50))(0x7f1333a28ed0), DECIMAL_INT(39, 4))(0x7f1333adfb60)(0x7f1333a9dc50)], [t2.in_user_id(0x7f1333aa1170)], [t2.in_user_name(0x7f1333aa1a20)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.mkc_id(0x7f1133bb22a0)(:39)]), use_batch=false 9 - output([t1.mkc_id(0x7f1133bb22a0)], [t1.inprice(0x7f1333a2ec20)], [IFNULL(cast(t1.inprice(0x7f1333a2ec20), DECIMAL_INT(22, 2))(0x7f1333ab6d70), cast(0, DECIMAL_INT(22, 2))(0x7f1333ab7c60))(0x7f1333a27bd0)], [IFNULL(cast(t1.transfer_price(0x7f1333a2f960), DECIMAL_INT(22, 2))(0x7f1333ac00b0), cast(0, DECIMAL_INT(22, 2))(0x7f1333ac0fa0))(0x7f1333a2c5f0)], [cast(0, DECIMAL_INT(23, 2))(0x7f1333ac6f40) - cast(t6.return_price(0x7f1333a395f0), DECIMAL_INT(23, 2))(0x7f1333ac7e30)(0x7f1333a31ce0) + IFNULL(cast(t1.inprice(0x7f1333a2ec20), DECIMAL_INT(22, 2))(0x7f1333ab6d70), cast(0, DECIMAL_INT(22, 2))(0x7f1333ab7c60))(0x7f1333a27bd0)(0x7f1333a33860)], [t6.return_price(0x7f1333a395f0)], [t1.examine_price(0x7f1333a3dfb0)], [cast(0, DECIMAL_INT(23, 2))(0x7f1333ac6f40) - cast(t6.return_price(0x7f1333a395f0), DECIMAL_INT(23, 2))(0x7f1333ac7e30)(0x7f1333a31ce0)], [t2.in_user_id(0x7f1333aa1170)], [t2.in_user_name(0x7f1333aa1a20)], [t2.price(0x7f1333a5c850)], [t2.sell_price(0x7f1333a5f110)], [t2.gift_price(0x7f1333a60790)], [t2.discount_price(0x7f1333a61e10)], [t2.point_price(0x7f1333a63490)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f1133bc05d0) = pl.product_id(0x7f1133bc0a10)(0x7f1133bbfd10)]), other_conds(nil) 10 - output([t1.mkc_id(0x7f1133bb22a0)], [t1.inprice(0x7f1333a2ec20)], [t6.return_price(0x7f1333a395f0)], [t1.examine_price(0x7f1333a3dfb0)], [t2.in_user_id(0x7f1333aa1170)], [t2.in_user_name(0x7f1333aa1a20)], [t1.transfer_price(0x7f1333a2f960)], [t2.price(0x7f1333a5c850)], [t2.sell_price(0x7f1333a5f110)], [t2.gift_price(0x7f1333a60790)], [t2.discount_price(0x7f1333a61e10)], [t2.point_price(0x7f1333a63490)], [t4.productid(0x7f1133bc05d0)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.ppid(0x7f1133baa4e0)(:36)]), use_batch=true 11 - output([t1.mkc_id(0x7f1133bb22a0)], [t1.inprice(0x7f1333a2ec20)], [t6.return_price(0x7f1333a395f0)], [t1.examine_price(0x7f1333a3dfb0)], [t2.in_user_id(0x7f1333aa1170)], [t2.in_user_name(0x7f1333aa1a20)], [t1.ppid(0x7f1133baa4e0)], [t1.transfer_price(0x7f1333a2f960)], [t2.price(0x7f1333a5c850)], [t2.sell_price(0x7f1333a5f110)], [t2.gift_price(0x7f1333a60790)], [t2.discount_price(0x7f1333a61e10)], [t2.point_price(0x7f1333a63490)]), filter(nil), rowset=256 equal_conds([t2.order_id(0x7f1133ba8510) = t3.order_id(0x7f1133ba8950)(0x7f1133ba7c50)], [t1.order_detail_id(0x7f1133ba1570) = t2.id(0x7f1133ba19b0)(0x7f1133ba0cb0)]), other_conds(nil) 12 - output([t1.mkc_id(0x7f1133bb22a0)], [t1.inprice(0x7f1333a2ec20)], [t6.return_price(0x7f1333a395f0)], [t1.examine_price(0x7f1333a3dfb0)], [t1.ppid(0x7f1133baa4e0)], [t3.order_id(0x7f1133ba8950)], [t1.order_detail_id(0x7f1133ba1570)], [t1.transfer_price(0x7f1333a2f960)]), filter(nil), rowset=256 equal_conds([t1.mkc_id(0x7f1133bb22a0) = t6.mkc_id(0x7f1133bb26e0)(0x7f1133bb19e0)]), other_conds(nil) 13 - output([t6.return_price(0x7f1333a395f0)], [t6.mkc_id(0x7f1133bb26e0)], [t3.order_id(0x7f1133ba8950)]), filter(nil), rowset=256 equal_conds([t6.return_id(0x7f1133bb7330) = t7.id(0x7f1133bb7770)(0x7f1133bb6a70)]), other_conds(nil) 14 - output([t6.mkc_id(0x7f1133bb26e0)], [t6.return_id(0x7f1133bb7330)], [t6.return_price(0x7f1333a395f0)]), filter([t6.is_delete(0x7f1133bb57a0) = 0(0x7f1133bb4ee0)], [t6.product_stock_type(0x7f1133bb3f40) != 3(0x7f1133bb3680)]), rowset=256 access([t6.mkc_id(0x7f1133bb26e0)], [t6.product_stock_type(0x7f1133bb3f40)], [t6.is_delete(0x7f1133bb57a0)], [t6.return_id(0x7f1133bb7330)], [t6.return_price(0x7f1333a395f0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false], range_key([t6.id(0x7f1124494500)]), range(MIN ; MAX)always true 15 - output([t7.id(0x7f1133bb7770)], [t3.order_id(0x7f1133ba8950)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 16 - output([t7.id(0x7f1133bb7770)]), filter([t7.is_delete(0x7f1133bbaee0) = 0(0x7f1133bba620)], [(T_OP_NOT_IN, t7.return_type(0x7f1333a17330), (7, 8)(0x7f116c119fb0))(0x7f1333a15430)]), rowset=256 access([t7.id(0x7f1133bb7770)], [t7.is_delete(0x7f1133bbaee0)], [t7.return_type(0x7f1333a17330)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false], range_key([t7.check2_time(0x7f1333a1e4f0)], [t7.id(0x7f1133bb7770)]), range(2024-10-31 16:00:00.000000,MIN ; 2024-11-18 15:59:59.000000,MAX), range_cond([t7.check2_time(0x7f1333a1e4f0) >= cast('2024-11-01 00:00:00', TIMESTAMP(-1, -1))(0x7f11218c9450)(0x7f11218c8a10)], [t7.check2_time(0x7f1333a1e4f0) <= cast('2024-11-18 23:59:59', TIMESTAMP(-1, -1))(0x7f11218cb240)(0x7f11218ca800)]) 17 - output([t3.order_id(0x7f1133ba8950)]), filter(nil), rowset=256 18 - output([t3.order_id(0x7f1133ba8950)]), filter(nil), rowset=256 equal_conds([t3.order_id(0x7f1133ba8950) = t36.order_id(0x7f1333a0d090)(0x7f1333a0c7d0)]), other_conds(nil) merge_directions([ASC]) 19 - output([t3.order_id(0x7f1133ba8950)]), filter(nil), rowset=256 sort_keys([t3.order_id(0x7f1133ba8950), ASC]) 20 - output([t3.order_id(0x7f1133ba8950)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f1133bae800)(:72)]), use_batch=true 21 - output([t3.order_id(0x7f1133ba8950)], [t3.user_id(0x7f1133bae800)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 22 - output([t3.order_id(0x7f1133ba8950)], [t3.user_id(0x7f1133bae800)]), filter([t3.order_state(0x7f1333a10460) = 9(0x7f1333a0fba0)], [t3.is_delete(0x7f1333a13520) = 0(0x7f1333a12c60)]), rowset=256 access([t3.id(0x7f11244940c0)], [t3.order_id(0x7f1133ba8950)], [t3.user_id(0x7f1133bae800)], [t3.order_state(0x7f1333a10460)], [t3.is_delete(0x7f1333a13520)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false], range_key([t3.area_id(0x7f1133bbca70)], [t3.id(0x7f11244940c0)]), range(216,MIN ; 216,MAX), range_cond([t3.area_id(0x7f1133bbca70) = 216(0x7f11218cc5f0)]) 23 - output(nil), filter(nil), rowset=256 24 - output(nil), filter(nil), rowset=256 access(nil), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f1133bbceb0)]), range[216 ; 216], range_cond([t8.id(0x7f1133bbceb0) = 216(0x7f11218cd490)]) 25 - output(nil), filter([t5.is_delete(0x7f1333a14d80) = 0(0x7f1333a144c0)]), rowset=256 access([GROUP_ID(0x7f11ab096ae0)], [t5.is_delete(0x7f1333a14d80)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f1133bae3c0)]), range(MIN ; MAX), range_cond([t5.id(0x7f1133bae3c0) = :72(0x7f11218ce330)]) 26 - output([t36.order_id(0x7f1333a0d090)]), filter(nil), rowset=256 access([t36.order_id(0x7f1333a0d090)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f1333a0d090)], [t36.id(0x7f11244951c0)]), range(MIN,MIN ; MAX,MAX)always true 27 - output([t1.mkc_id(0x7f1133bb22a0)], [t1.inprice(0x7f1333a2ec20)], [t1.examine_price(0x7f1333a3dfb0)], [t1.ppid(0x7f1133baa4e0)], [t1.order_detail_id(0x7f1133ba1570)], [t1.transfer_price(0x7f1333a2f960)]), filter(nil), rowset=256 28 - output([t1.mkc_id(0x7f1133bb22a0)], [t1.inprice(0x7f1333a2ec20)], [t1.examine_price(0x7f1333a3dfb0)], [t1.ppid(0x7f1133baa4e0)], [t1.order_detail_id(0x7f1133ba1570)], [t1.transfer_price(0x7f1333a2f960)]), filter(nil), rowset=256 dop=1 29 - output([t1.order_detail_id(0x7f1133ba1570)], [t1.ppid(0x7f1133baa4e0)], [t1.mkc_id(0x7f1133bb22a0)], [t1.inprice(0x7f1333a2ec20)], [t1.transfer_price(0x7f1333a2f960)], [t1.examine_price(0x7f1333a3dfb0)]), filter(nil), rowset=256 force partition granule 30 - output([t1.order_detail_id(0x7f1133ba1570)], [t1.ppid(0x7f1133baa4e0)], [t1.mkc_id(0x7f1133bb22a0)], [t1.inprice(0x7f1333a2ec20)], [t1.transfer_price(0x7f1333a2f960)], [t1.examine_price(0x7f1333a3dfb0)]), filter([t1.order_detail_type(0x7f1133ba3210) = 1(0x7f1133ba2950)]), rowset=256 access([t1.order_detail_id(0x7f1133ba1570)], [t1.order_detail_type(0x7f1133ba3210)], [t1.ppid(0x7f1133baa4e0)], [t1.mkc_id(0x7f1133bb22a0)], [t1.inprice(0x7f1333a2ec20)], [t1.transfer_price(0x7f1333a2f960)], [t1.examine_price(0x7f1333a3dfb0)]), partitions(p[0-9]) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t1.id(0x7f1133b9ff90)]), range(MIN ; MAX)always true 31 - output([t2.id(0x7f1133ba19b0)], [t2.order_id(0x7f1133ba8510)], [t2.price(0x7f1333a5c850)], [t2.sell_price(0x7f1333a5f110)], [t2.gift_price(0x7f1333a60790)], [t2.discount_price(0x7f1333a61e10)], [t2.point_price(0x7f1333a63490)], [t2.in_user_id(0x7f1333aa1170)], [t2.in_user_name(0x7f1333aa1a20)]), filter([t2.is_mobile(0x7f1333a19f50) = 1(0x7f1333a19690)], [t2.is_delete(0x7f1333a11cc0) = 0(0x7f1333a11400)], [t2.product_stock_type(0x7f1133ba4a70) != 3(0x7f1133ba41b0)], [t2.product_stock_type(0x7f1133ba4a70) IN (0, 1, 2, 6)(0x7f116c11aab0)(0x7f1333a24610)]), rowset=256 access([t2.id(0x7f1133ba19b0)], [t2.product_stock_type(0x7f1133ba4a70)], [t2.order_id(0x7f1133ba8510)], [t2.is_delete(0x7f1333a11cc0)], [t2.is_mobile(0x7f1333a19f50)], [t2.price(0x7f1333a5c850)], [t2.sell_price(0x7f1333a5f110)], [t2.gift_price(0x7f1333a60790)], [t2.discount_price(0x7f1333a61e10)], [t2.point_price(0x7f1333a63490)], [t2.in_user_id(0x7f1333aa1170)], [t2.in_user_name(0x7f1333aa1a20)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false,false,false], range_key([t2.id(0x7f1133ba19b0)]), range(MIN ; MAX)always true 32 - output([t4.productid(0x7f1133bc05d0)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab0a7bf0)], [t4.productid(0x7f1133bc05d0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f1133baa920)]), range(MIN ; MAX), range_cond([:36 = t4.ppriceid(0x7f1133baa920)(0x7f11218ced40)]) 33 - output([pl.product_id(0x7f1133bc0a10)]), filter([pl.is_delete(0x7f1133bc2270) = 0(0x7f1133bc19b0)]), rowset=256 access([pl.product_id(0x7f1133bc0a10)], [pl.is_delete(0x7f1133bc2270)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f1124494d80)]), range(MIN ; MAX)always true 34 - output([t16.self_modify_price(0x7f1333a2f060)], [t16.in_source_modify_price(0x7f1333a2f4e0)]), filter(nil), rowset=256 access([t16.self_modify_price(0x7f1333a2f060)], [t16.in_source_modify_price(0x7f1333a2f4e0)]) 35 - output([t1.mkc_id(0x7f1133b36610)], [T_FUN_SUM(CASE WHEN t17.type(0x7f1133b5e010) = 3(0x7f1133b6c200) THEN t16.adjust_price(0x7f1133b6d440) ELSE cast(0.00, DECIMAL_INT(16, 4))(0x7f1133b7bd70) END(0x7f1133b6af70))(0x7f1133b6aa60)], [T_FUN_SUM(CASE WHEN t17.type(0x7f1133b5e010) = 2(0x7f1133b786f0) THEN t16.adjust_price(0x7f1133b6d440) ELSE cast(0.00, DECIMAL_INT(16, 4))(0x7f1133b801e0) END(0x7f1133b77460))(0x7f1133b76f50)]), filter(nil), rowset=256 group(nil), agg_func([T_FUN_SUM(CASE WHEN t17.type(0x7f1133b5e010) = 3(0x7f1133b6c200) THEN t16.adjust_price(0x7f1133b6d440) ELSE cast(0.00, DECIMAL_INT(16, 4))(0x7f1133b7bd70) END(0x7f1133b6af70))(0x7f1133b6aa60)], [T_FUN_SUM(CASE WHEN t17.type(0x7f1133b5e010) = 2(0x7f1133b786f0) THEN t16.adjust_price(0x7f1133b6d440) ELSE cast(0.00, DECIMAL_INT(16, 4))(0x7f1133b801e0) END(0x7f1133b77460))(0x7f1133b76f50)]) 36 - output([t17.type(0x7f1133b5e010)], [t16.adjust_price(0x7f1133b6d440)], [t1.mkc_id(0x7f1133b36610)]), filter(nil), rowset=256 conds(nil), nl_params_([t16.adjust_price_id(0x7f1133b4e490)(:55)]), use_batch=true 37 - output([t16.adjust_price(0x7f1133b6d440)], [t1.mkc_id(0x7f1133b36610)], [t16.adjust_price_id(0x7f1133b4e490)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.mkc_id(0x7f1133b36610)(:45)]), use_batch=true 38 - output([t1.mkc_id(0x7f1133b36610)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f1133b2ccc0)(:51)]), use_batch=true 39 - output([t1.mkc_id(0x7f1133b36610)], [t3.order_id(0x7f1133b2ccc0)]), filter(nil), rowset=256 conds(nil), nl_params_([t6.return_id(0x7f1133b385e0)(:53)]), use_batch=true 40 - output([t1.mkc_id(0x7f1133b36610)], [t3.order_id(0x7f1133b2ccc0)], [t6.return_id(0x7f1133b385e0)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.mkc_id(0x7f1133b36610)(:43)]), use_batch=true 41 - output([t1.mkc_id(0x7f1133b36610)], [t3.order_id(0x7f1133b2ccc0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f1133b32b70)(:49)]), use_batch=true 42 - output([t1.mkc_id(0x7f1133b36610)], [t3.order_id(0x7f1133b2ccc0)], [t3.user_id(0x7f1133b32b70)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f1133b41880) = pl.product_id(0x7f1133b41cc0)(0x7f1133b40fc0)]), other_conds(nil) 43 - output([t1.mkc_id(0x7f1133b36610)], [t3.order_id(0x7f1133b2ccc0)], [t3.user_id(0x7f1133b32b70)], [t4.productid(0x7f1133b41880)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.ppid(0x7f1133b2e850)(:42)]), use_batch=true 44 - output([t1.mkc_id(0x7f1133b36610)], [t3.order_id(0x7f1133b2ccc0)], [t3.user_id(0x7f1133b32b70)], [t1.ppid(0x7f1133b2e850)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.order_id(0x7f1133b2c880)(:47)]), use_batch=true 45 - output([t1.mkc_id(0x7f1133b36610)], [t1.ppid(0x7f1133b2e850)], [t2.order_id(0x7f1133b2c880)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.order_detail_id(0x7f1133b27140)(:40)]), use_batch=true 46 - output([t1.order_detail_id(0x7f1133b27140)], [t1.ppid(0x7f1133b2e850)], [t1.mkc_id(0x7f1133b36610)]), filter([t1.order_detail_type(0x7f1133b28de0) = 1(0x7f1133b28520)]), rowset=256 access([t1.id(0x7f1133b25800)], [t1.order_detail_id(0x7f1133b27140)], [t1.order_detail_type(0x7f1133b28de0)], [t1.ppid(0x7f1133b2e850)], [t1.mkc_id(0x7f1133b36610)]), partitions(p[0-9]) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t1.mkc_id(0x7f1133b36610)], [t1.id(0x7f1133b25800)]), range(MIN,MIN ; MAX,MAX)always true, range_cond([t1.mkc_id(0x7f1133b36610) = :39(0x7f11218cf750)]) 47 - output([t2.order_id(0x7f1133b2c880)]), filter([t2.is_mobile(0x7f1133b5ba60) = 1(0x7f1133b5b1a0)], [t2.is_delete(0x7f1133b52db0) = 0(0x7f1133b524f0)], [t2.product_stock_type(0x7f1133b69d50) IN (0, 1, 2, 6)(0x7f116c121420)(0x7f1133b674f0)]), rowset=256 access([GROUP_ID(0x7f11ab0b4460)], [t2.order_id(0x7f1133b2c880)], [t2.is_delete(0x7f1133b52db0)], [t2.is_mobile(0x7f1133b5ba60)], [t2.product_stock_type(0x7f1133b69d50)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false,false], range_key([t2.id(0x7f1133b27580)]), range(MIN ; MAX), range_cond([:40 = t2.id(0x7f1133b27580)(0x7f11218d0160)]) 48 - output([t3.order_id(0x7f1133b2ccc0)], [t3.user_id(0x7f1133b32b70)]), filter([t3.area_id(0x7f1133b3be10) = 216(0x7f1133b63d00)], [t3.order_state(0x7f1133b51550) = 9(0x7f1133b50c90)], [t3.is_delete(0x7f1133b54610) = 0(0x7f1133b53d50)]), rowset=256 access([GROUP_ID(0x7f11ab0bafb0)], [t3.id(0x7f112447d7d0)], [t3.order_id(0x7f1133b2ccc0)], [t3.user_id(0x7f1133b32b70)], [t3.area_id(0x7f1133b3be10)], [t3.order_state(0x7f1133b51550)], [t3.is_delete(0x7f1133b54610)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t3.order_id(0x7f1133b2ccc0)], [t3.shadow_pk_0(0x7f10f8cd7480)]), range(MIN ; MAX), range_cond([:47 = t3.order_id(0x7f1133b2ccc0)(0x7f11218d0b70)]) 49 - output([t4.productid(0x7f1133b41880)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab0c5cb0)], [t4.productid(0x7f1133b41880)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f1133b2ec90)]), range(MIN ; MAX), range_cond([:42 = t4.ppriceid(0x7f1133b2ec90)(0x7f11218d1580)]) 50 - output([pl.product_id(0x7f1133b41cc0)]), filter([pl.is_delete(0x7f1133b43520) = 0(0x7f1133b42c60)]), rowset=256 access([pl.product_id(0x7f1133b41cc0)], [pl.is_delete(0x7f1133b43520)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f11244804c0)]), range(MIN ; MAX)always true 51 - output(nil), filter([t5.is_delete(0x7f1133b55e70) = 0(0x7f1133b555b0)]), rowset=256 access([GROUP_ID(0x7f11ab0c7520)], [t5.is_delete(0x7f1133b55e70)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f1133b32730)]), range(MIN ; MAX), range_cond([t5.id(0x7f1133b32730) = :49(0x7f11218d1f90)]) 52 - output([t6.return_id(0x7f1133b385e0)]), filter([t6.is_delete(0x7f1133b576d0) = 0(0x7f1133b56e10)]), rowset=256 access([GROUP_ID(0x7f11ab0c8d90)], [t6.id(0x7f112447dc10)], [t6.return_id(0x7f1133b385e0)], [t6.is_delete(0x7f1133b576d0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t6.mkc_id(0x7f1133b36a50)], [t6.id(0x7f112447dc10)]), range(MIN ; MAX), range_cond([:43 = t6.mkc_id(0x7f1133b36a50)(0x7f11218d29a0)]) 53 - output(nil), filter([t7.is_delete(0x7f1133b3a280) = 0(0x7f1133b399c0)], [t7.check2_time(0x7f1133b613d0) >= cast('2024-11-01 00:00:00', TIMESTAMP(-1, -1))(0x7f1133b61be0)(0x7f1133b5f990)], [t7.check2_time(0x7f1133b613d0) <= cast('2024-11-18 23:59:59', TIMESTAMP(-1, -1))(0x7f1133b62c60)(0x7f1133b60210)]), rowset=256 access([GROUP_ID(0x7f11ab0cc510)], [t7.is_delete(0x7f1133b3a280)], [t7.check2_time(0x7f1133b613d0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false,false], range_key([t7.id(0x7f1133b38a20)]), range(MIN ; MAX), range_cond([:53 = t7.id(0x7f1133b38a20)(0x7f11218d33b0)]) 54 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab0cfc90)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f1133b4a910)], [t36.id(0x7f1124480900)]), range(MIN ; MAX), range_cond([:51 = t36.order_id(0x7f1133b4a910)(0x7f10d14629b0)]) 55 - output([t16.adjust_price_id(0x7f1133b4e490)], [t16.adjust_price(0x7f1133b6d440)]), filter([t16.is_delete(0x7f1133b5a200) = 0(0x7f1133b59940)]), rowset=256 access([GROUP_ID(0x7f11ab0d0040)], [t16.id(0x7f1124480d40)], [t16.adjust_price_id(0x7f1133b4e490)], [t16.is_delete(0x7f1133b5a200)], [t16.adjust_price(0x7f1133b6d440)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t16.mkc_id(0x7f1133b4c4b0)], [t16.id(0x7f1124480d40)]), range(MIN ; MAX), range_cond([t16.mkc_id(0x7f1133b4c4b0) = :45(0x7f11218d3dc0)]) 56 - output([t17.type(0x7f1133b5e010)]), filter([t17.status(0x7f1133b4fcf0) = 3(0x7f1133b4f430)], [t17.type(0x7f1133b5e010) IN (2, 3)(0x7f116c1209e0)(0x7f1133b5c110)]), rowset=256 access([GROUP_ID(0x7f11ab0d56d0)], [t17.status(0x7f1133b4fcf0)], [t17.type(0x7f1133b5e010)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false], range_key([t17.id(0x7f1133b4e050)]), range(MIN ; MAX), range_cond([t17.id(0x7f1133b4e050) = :55(0x7f11218d47d0)]) 57 - output([cast(cast(t1.statistics_price(0x7f1333b3c900), DECIMAL_INT(42, 4))(0x7f1333bbc980), DECIMAL_INT(77, 4))(0x7f133008e480)], [cast(cast(t1.inprice(0x7f1333b3d1b0), DECIMAL_INT(23, 2))(0x7f1333bbd850), DECIMAL_INT(75, 2))(0x7f1330092330)], [cast(cast(cast(t2.statictisc_price(0x7f1333b41260), DECIMAL_INT(25, 4))(0x7f1333bad910) + IFNULL(cast(t2.gift_price(0x7f1333b416a0), DECIMAL_INT(24, 4))(0x7f1333bab990), cast(0, DECIMAL_INT(24, 4))(0x7f1333bac880))(0x7f1333b3da60)(0x7f1333b3ed60) - cast(IFNULL(cast(t1.statistics_price(0x7f1333b3c900), DECIMAL_INT(22, 2))(0x7f1333bae800), cast(0, DECIMAL_INT(22, 2))(0x7f1333baf6f0))(0x7f1333b3f5e0), DECIMAL_INT(26, 4))(0x7f1333bb0780)(0x7f1333b408e0), DECIMAL_INT(41, 4))(0x7f1333bbe720), DECIMAL(65, 6))(0x7f1330095820)], [cast(cast(t2.statictisc_price(0x7f1333b41260), DECIMAL_INT(25, 4))(0x7f1333bad910) + IFNULL(cast(t2.gift_price(0x7f1333b416a0), DECIMAL_INT(24, 4))(0x7f1333bab990), cast(0, DECIMAL_INT(24, 4))(0x7f1333bac880))(0x7f1333b3da60)(0x7f1333b3ed60) - cast(IFNULL(cast(t1.inprice(0x7f1333b3d1b0), DECIMAL_INT(22, 2))(0x7f1333bb1dc0), cast(0, DECIMAL_INT(22, 2))(0x7f1333bb2cb0))(0x7f1333b43cd0), DECIMAL_INT(26, 4))(0x7f1333bb6050)(0x7f1333b44fd0), DECIMAL(65, 6))(0x7f1330098c20)], [cast(cast(t1.examine_price(0x7f1333b45fc0), DECIMAL_INT(23, 2))(0x7f1333bc0b70), DECIMAL_INT(75, 2))(0x7f133009be00)], [cast(cast(t2.statictisc_price(0x7f1333b41260), DECIMAL_INT(25, 4))(0x7f1333bad910) + IFNULL(cast(t2.gift_price(0x7f1333b416a0), DECIMAL_INT(24, 4))(0x7f1333bab990), cast(0, DECIMAL_INT(24, 4))(0x7f1333bac880))(0x7f1333b3da60)(0x7f1333b3ed60) - cast(IFNULL(cast(t1.examine_price(0x7f1333b45fc0), DECIMAL_INT(22, 2))(0x7f1333bb7600), cast(0, DECIMAL_INT(22, 2))(0x7f1333bb84f0))(0x7f1333b483f0), DECIMAL_INT(26, 4))(0x7f1333bb9580)(0x7f1333b496f0), DECIMAL(65, 6))(0x7f133009ee20)], ['1'], [cast(cast(t2.price(0x7f1333b64a10), DECIMAL_INT(23, 2))(0x7f1333bc2bf0), DECIMAL_INT(78, 2))(0x7f13300a87d0)], [cast(cast(t2.sell_price(0x7f1333b65730), DECIMAL_INT(23, 2))(0x7f1333bc4990), DECIMAL_INT(78, 2))(0x7f13300ae470)], [cast(cast(t2.gift_price(0x7f1333b416a0), DECIMAL_INT(25, 4))(0x7f1333bc5860), DECIMAL_INT(76, 4))(0x7f13300b12c0)], [cast(cast(t2.discount_price(0x7f1333b66450), DECIMAL_INT(25, 4))(0x7f1333bc6730), DECIMAL_INT(76, 4))(0x7f13300b4110)], [cast(cast(t2.point_price(0x7f1333b66d00), DECIMAL_INT(25, 4))(0x7f1333bc7600), DECIMAL_INT(76, 4))(0x7f13300b6f60)], [cast(cast(cast(t2.price(0x7f1333b64a10), DECIMAL_INT(17, 4))(0x7f1333bbaf70) - t2.discount_price(0x7f1333b66450)(0x7f1333b93b30) - t2.point_price(0x7f1333b66d00)(0x7f1333b94810), DECIMAL_INT(25, 4))(0x7f1333bcb400), DECIMAL(65, 6))(0x7f13300bf0d0)], [cast(t1.modify_price(0x7f1333b95680), DECIMAL_INT(39, 4))(0x7f1333bcc470)], [t2.in_user_id(0x7f1333b963d0)], [t2.in_user_name(0x7f1333b96c80)]), filter(nil), rowset=256 equal_conds([t3.order_id(0x7f1333b082c0) = t36.order_id(0x7f1333b23ef0)(0x7f1333b23630)]), other_conds(nil) merge_directions([ASC]) 58 - output([t36.order_id(0x7f1333b23ef0)]), filter(nil), rowset=256 access([t36.order_id(0x7f1333b23ef0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f1333b23ef0)], [t36.id(0x7f11244a73a0)]), range(MIN,MIN ; MAX,MAX)always true 59 - output([t1.statistics_price(0x7f1333b3c900)], [cast(t2.statictisc_price(0x7f1333b41260), DECIMAL_INT(25, 4))(0x7f1333bad910) + IFNULL(cast(t2.gift_price(0x7f1333b416a0), DECIMAL_INT(24, 4))(0x7f1333bab990), cast(0, DECIMAL_INT(24, 4))(0x7f1333bac880))(0x7f1333b3da60)(0x7f1333b3ed60)], [t1.inprice(0x7f1333b3d1b0)], [t1.examine_price(0x7f1333b45fc0)], [t2.gift_price(0x7f1333b416a0)], [t2.price(0x7f1333b64a10)], [t2.discount_price(0x7f1333b66450)], [t2.point_price(0x7f1333b66d00)], [t2.in_user_id(0x7f1333b963d0)], [t2.in_user_name(0x7f1333b96c80)], [t3.order_id(0x7f1333b082c0)], [t2.sell_price(0x7f1333b65730)], [t1.modify_price(0x7f1333b95680)]), filter(nil), rowset=256 sort_keys([t3.order_id(0x7f1333b082c0), ASC]) 60 - output([t1.statistics_price(0x7f1333b3c900)], [t1.inprice(0x7f1333b3d1b0)], [t1.examine_price(0x7f1333b45fc0)], [t2.gift_price(0x7f1333b416a0)], [t2.price(0x7f1333b64a10)], [t2.discount_price(0x7f1333b66450)], [t2.point_price(0x7f1333b66d00)], [t2.in_user_id(0x7f1333b963d0)], [t2.in_user_name(0x7f1333b96c80)], [t3.order_id(0x7f1333b082c0)], [t2.statictisc_price(0x7f1333b41260)], [t2.sell_price(0x7f1333b65730)], [t1.modify_price(0x7f1333b95680)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f1333b15770) = pl.product_id(0x7f1333b15bb0)(0x7f1333b14eb0)]), other_conds(nil) 61 - output([pl.product_id(0x7f1333b15bb0)]), filter([pl.is_delete(0x7f1333b17410) = 0(0x7f1333b16b50)]), rowset=256 access([pl.product_id(0x7f1333b15bb0)], [pl.is_delete(0x7f1333b17410)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f11244a6f60)]), range(MIN ; MAX)always true 62 - output([t1.statistics_price(0x7f1333b3c900)], [t1.inprice(0x7f1333b3d1b0)], [t1.examine_price(0x7f1333b45fc0)], [t2.gift_price(0x7f1333b416a0)], [t2.price(0x7f1333b64a10)], [t2.discount_price(0x7f1333b66450)], [t2.point_price(0x7f1333b66d00)], [t2.in_user_id(0x7f1333b963d0)], [t2.in_user_name(0x7f1333b96c80)], [t3.order_id(0x7f1333b082c0)], [t2.statictisc_price(0x7f1333b41260)], [t2.sell_price(0x7f1333b65730)], [t1.modify_price(0x7f1333b95680)], [t4.productid(0x7f1333b15770)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.ppid(0x7f1333b09e50)(:89)]), use_batch=true 63 - output([t1.statistics_price(0x7f1333b3c900)], [t1.inprice(0x7f1333b3d1b0)], [t1.examine_price(0x7f1333b45fc0)], [t2.gift_price(0x7f1333b416a0)], [t2.price(0x7f1333b64a10)], [t2.discount_price(0x7f1333b66450)], [t2.point_price(0x7f1333b66d00)], [t2.in_user_id(0x7f1333b963d0)], [t2.in_user_name(0x7f1333b96c80)], [t3.order_id(0x7f1333b082c0)], [t1.ppid(0x7f1333b09e50)], [t2.statictisc_price(0x7f1333b41260)], [t2.sell_price(0x7f1333b65730)], [t1.modify_price(0x7f1333b95680)]), filter(nil), rowset=256 conds([t2.product_stock_type(0x7f1333b043e0) != 3(0x7f1333b03b20)]), nl_params_([t2.id(0x7f1333b01320)(:86)]), use_batch=true 64 - output([t2.gift_price(0x7f1333b416a0)], [t2.price(0x7f1333b64a10)], [t2.discount_price(0x7f1333b66450)], [t2.point_price(0x7f1333b66d00)], [t2.in_user_id(0x7f1333b963d0)], [t2.in_user_name(0x7f1333b96c80)], [t3.order_id(0x7f1333b082c0)], [t2.product_stock_type(0x7f1333b043e0) != 3(0x7f1333b03b20)], [t2.id(0x7f1333b01320)], [t2.statictisc_price(0x7f1333b41260)], [t2.sell_price(0x7f1333b65730)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f1333b082c0)(:88)]), use_batch=true 65 - output([t3.order_id(0x7f1333b082c0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f1333b0e170)(:90)]), use_batch=true 66 - output([t3.order_id(0x7f1333b082c0)], [t3.user_id(0x7f1333b0e170)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 67 - output([t3.order_id(0x7f1333b082c0)], [t3.user_id(0x7f1333b0e170)]), filter([t3.order_complete_time(0x7f1333b30cb0) >= cast('2024-11-01 00:00:00', TIMESTAMP(-1, -1))(0x7f1333b314c0)(0x7f1333b2f270)], [t3.order_complete_time(0x7f1333b30cb0) <= cast('2024-11-18 23:59:59', TIMESTAMP(-1, -1))(0x7f1333b32540)(0x7f1333b2faf0)], [t3.order_state(0x7f1333b264a0) IN (3, 9)(0x7f116c1231f0)(0x7f1333b245a0)], [t3.is_delete(0x7f1333b29650) = 0(0x7f1333b28d90)]), rowset=256 access([t3.id(0x7f11244a66e0)], [t3.order_id(0x7f1333b082c0)], [t3.user_id(0x7f1333b0e170)], [t3.order_state(0x7f1333b264a0)], [t3.is_delete(0x7f1333b29650)], [t3.order_complete_time(0x7f1333b30cb0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false,false], range_key([t3.area_id(0x7f1333b11c10)], [t3.id(0x7f11244a66e0)]), range(216,MIN ; 216,MAX), range_cond([t3.area_id(0x7f1333b11c10) = 216(0x7f11218d51e0)]) 68 - output(nil), filter(nil), rowset=256 69 - output(nil), filter(nil), rowset=256 access(nil), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f1333b12050)]), range[216 ; 216], range_cond([t8.id(0x7f1333b12050) = 216(0x7f11218d6080)]) 70 - output(nil), filter([t5.is_delete(0x7f1333b2aeb0) = 0(0x7f1333b2a5f0)]), rowset=256 access([GROUP_ID(0x7f11ab0df5f0)], [t5.is_delete(0x7f1333b2aeb0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f1333b0dd30)]), range(MIN ; MAX), range_cond([t5.id(0x7f1333b0dd30) = :90(0x7f11218d6f20)]) 71 - output([t2.id(0x7f1333b01320)], [t2.statictisc_price(0x7f1333b41260)], [t2.gift_price(0x7f1333b416a0)], [t2.price(0x7f1333b64a10)], [t2.sell_price(0x7f1333b65730)], [t2.discount_price(0x7f1333b66450)], [t2.point_price(0x7f1333b66d00)], [t2.in_user_id(0x7f1333b963d0)], [t2.in_user_name(0x7f1333b96c80)], [t2.product_stock_type(0x7f1333b043e0) != 3(0x7f1333b03b20)]), filter([t2.is_mobile(0x7f1333b2c710) = 1(0x7f1333b2be50)], [t2.is_delete(0x7f1333b27df0) = 0(0x7f1333b27530)], [t2.product_stock_type(0x7f1333b043e0) != 3(0x7f1333b03b20)], [t2.product_stock_type(0x7f1333b043e0) IN (0, 1, 2, 6)(0x7f116c123c30)(0x7f1333b36dd0)]), rowset=256 access([GROUP_ID(0x7f11ab0e0e60)], [t2.id(0x7f1333b01320)], [t2.product_stock_type(0x7f1333b043e0)], [t2.is_delete(0x7f1333b27df0)], [t2.is_mobile(0x7f1333b2c710)], [t2.statictisc_price(0x7f1333b41260)], [t2.gift_price(0x7f1333b416a0)], [t2.price(0x7f1333b64a10)], [t2.sell_price(0x7f1333b65730)], [t2.discount_price(0x7f1333b66450)], [t2.point_price(0x7f1333b66d00)], [t2.in_user_id(0x7f1333b963d0)], [t2.in_user_name(0x7f1333b96c80)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false,false], range_key([t2.order_id(0x7f1333b07e80)], [t2.id(0x7f1333b01320)]), range(MIN ; MAX), range_cond([t2.order_id(0x7f1333b07e80) = :88(0x7f11218d7930)]) 72 - output([t1.ppid(0x7f1333b09e50)], [t1.statistics_price(0x7f1333b3c900)], [t1.inprice(0x7f1333b3d1b0)], [t1.examine_price(0x7f1333b45fc0)], [t1.modify_price(0x7f1333b95680)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab0eb7d0)], [t1.id(0x7f1333aff900)], [t1.ppid(0x7f1333b09e50)], [t1.statistics_price(0x7f1333b3c900)], [t1.inprice(0x7f1333b3d1b0)], [t1.examine_price(0x7f1333b45fc0)], [t1.modify_price(0x7f1333b95680)]), partitions(p[0-9]) is_index_back=true, is_global_index=false, range_key([t1.order_detail_id(0x7f1333b00ee0)], [t1.order_detail_type(0x7f1333b02b80)], [t1.id(0x7f1333aff900)]), range(MIN ; MAX), range_cond([t1.order_detail_type(0x7f1333b02b80) = 1(0x7f11218d8340)], [t1.order_detail_id(0x7f1333b00ee0) = :86(0x7f11218d91e0)]) 73 - output([t4.productid(0x7f1333b15770)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab0f37c0)], [t4.productid(0x7f1333b15770)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f1333b0a290)]), range(MIN ; MAX), range_cond([:89 = t4.ppriceid(0x7f1333b0a290)(0x7f11218d9bf0)]) 74 - output([cast(cast(cast(0, DECIMAL_INT(25, 4))(0x7f1100095f90) - cast(t16.adjust_price(0x7f110003dba0), DECIMAL_INT(25, 4))(0x7f1100096e80)(0x7f110003d2e0), DECIMAL_INT(42, 4))(0x7f110009b280), DECIMAL_INT(77, 4))(0x7f133008f390)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f110009c2b0), DECIMAL_INT(75, 2))(0x7f1330093240)], [cast(cast(t16.adjust_price(0x7f110003dba0), DECIMAL_INT(41, 4))(0x7f110009d180), DECIMAL(65, 6))(0x7f1330096b10)], [cast(cast(0, DECIMAL_INT(26, 4))(0x7f110009e050), DECIMAL(65, 6))(0x7f1330099ec0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f110009ef20), DECIMAL_INT(75, 2))(0x7f133009cd10)], [cast(cast(0, DECIMAL_INT(26, 4))(0x7f110009fdf0), DECIMAL(65, 6))(0x7f13300a00c0)], [cast(0, VARCHAR(20))(0x7f11000a0cc0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f11000a1b90), DECIMAL_INT(78, 2))(0x7f13300a96e0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f11000a3930), DECIMAL_INT(78, 2))(0x7f13300af380)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f11000a4800), DECIMAL_INT(76, 4))(0x7f13300b21d0)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f11000a56d0), DECIMAL_INT(76, 4))(0x7f13300b5020)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f11000a65a0), DECIMAL_INT(76, 4))(0x7f13300b7e70)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f11000a8340), DECIMAL(65, 6))(0x7f13300c0190)], [cast(CASE WHEN t17.type(0x7f110002eb80) = 3(0x7f110007a450) THEN t16.adjust_price(0x7f110003dba0) ELSE cast(0.00, DECIMAL_INT(16, 4))(0x7f11000986a0) END(0x7f11000791c0), DECIMAL_INT(39, 4))(0x7f11000a9210)], [t2.in_user_id(0x7f11000804a0)], [t2.in_user_name(0x7f1100080d50)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f1100007540)(:103)]), use_batch=true 75 - output([t3.user_id(0x7f1100007540)], [t16.adjust_price(0x7f110003dba0)], [t2.in_user_id(0x7f11000804a0)], [t2.in_user_name(0x7f1100080d50)], [t17.type(0x7f110002eb80)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f1333bee590)(:105)]), use_batch=true 76 - output([t3.user_id(0x7f1100007540)], [t16.adjust_price(0x7f110003dba0)], [t2.in_user_id(0x7f11000804a0)], [t2.in_user_name(0x7f1100080d50)], [t3.order_id(0x7f1333bee590)], [t17.type(0x7f110002eb80)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f110000eb40) = pl.product_id(0x7f110000ef80)(0x7f110000e280)]), other_conds(nil) 77 - output([pl.product_id(0x7f110000ef80)]), filter([pl.is_delete(0x7f11000107e0) = 0(0x7f110000ff20)]), rowset=256 access([pl.product_id(0x7f110000ef80)], [pl.is_delete(0x7f11000107e0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f11244b3e00)]), range(MIN ; MAX)always true 78 - output([t3.user_id(0x7f1100007540)], [t16.adjust_price(0x7f110003dba0)], [t2.in_user_id(0x7f11000804a0)], [t2.in_user_name(0x7f1100080d50)], [t3.order_id(0x7f1333bee590)], [t17.type(0x7f110002eb80)], [t4.productid(0x7f110000eb40)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 79 - output([t3.user_id(0x7f1100007540)], [t16.adjust_price(0x7f110003dba0)], [t2.in_user_id(0x7f11000804a0)], [t2.in_user_name(0x7f1100080d50)], [t3.order_id(0x7f1333bee590)], [t17.type(0x7f110002eb80)], [t4.productid(0x7f110000eb40)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.ppid(0x7f1333bf0120)(:100)]), use_batch=true 80 - output([t3.user_id(0x7f1100007540)], [t16.adjust_price(0x7f110003dba0)], [t2.in_user_id(0x7f11000804a0)], [t2.in_user_name(0x7f1100080d50)], [t3.order_id(0x7f1333bee590)], [t1.ppid(0x7f1333bf0120)], [t17.type(0x7f110002eb80)]), filter(nil), rowset=256 equal_conds([t2.order_id(0x7f1333bee150) = t3.order_id(0x7f1333bee590)(0x7f1333bed890)]), other_conds(nil) 81 - output([t16.adjust_price(0x7f110003dba0)], [t2.in_user_id(0x7f11000804a0)], [t2.in_user_name(0x7f1100080d50)], [t1.ppid(0x7f1333bf0120)], [t17.type(0x7f110002eb80)], [t2.order_id(0x7f1333bee150)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.order_detail_id(0x7f1333be71b0)(:97)]), use_batch=true 82 - output([t16.adjust_price(0x7f110003dba0)], [t1.ppid(0x7f1333bf0120)], [t1.order_detail_id(0x7f1333be71b0)], [t17.type(0x7f110002eb80)]), filter(nil), rowset=256 conds(nil), nl_params_([t16.mkc_id(0x7f110001ee60)(:102)]), use_batch=true 83 - output([t16.adjust_price(0x7f110003dba0)], [t16.mkc_id(0x7f110001ee60)], [t17.type(0x7f110002eb80)]), filter(nil), rowset=256 conds(nil), nl_params_([t17.id(0x7f1100020e40)(:108)]), use_batch=true 84 - output([t17.id(0x7f1100020e40)], [t17.type(0x7f110002eb80)]), filter(nil), rowset=256 access([t17.id(0x7f1100020e40)], [t17.type(0x7f110002eb80)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t17.type(0x7f110002eb80)], [t17.status(0x7f110002c5d0)], [t17.handle_time(0x7f11000337a0)], [t17.id(0x7f1100020e40)]), range(2,3,2024-10-31 16:00:00.000000,MIN ; 2,3,2024-11-18 15:59:59.000000,MAX), (3,3,2024-10-31 16:00:00.000000,MIN ; 3,3,2024-11-18 15:59:59.000000,MAX), range_cond([t17.status(0x7f110002c5d0) = 3(0x7f110002bd10)], [t17.handle_time(0x7f11000337a0) >= cast('2024-11-01 00:00:00', TIMESTAMP(-1, -1))(0x7f1100033fb0)(0x7f1100031d60)], [t17.handle_time(0x7f11000337a0) <= cast('2024-11-18 23:59:59', TIMESTAMP(-1, -1))(0x7f1100035030)(0x7f11000325e0)], [t17.type(0x7f110002eb80) IN (2, 3)(0x7f116c128430)(0x7f110002cc80)]) 85 - output([t16.mkc_id(0x7f110001ee60)], [t16.adjust_price(0x7f110003dba0)]), filter([t16.is_adjust_after_trade(0x7f11000304d0) = 1(0x7f110002fc10)]), rowset=256 access([GROUP_ID(0x7f11ab0fd510)], [t16.id(0x7f11244b4680)], [t16.mkc_id(0x7f110001ee60)], [t16.is_adjust_after_trade(0x7f11000304d0)], [t16.adjust_price(0x7f110003dba0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t16.adjust_price_id(0x7f1100021280)], [t16.id(0x7f11244b4680)]), range(MIN ; MAX), range_cond([:108 = t16.adjust_price_id(0x7f1100021280)(0x7f11218da600)]) 86 - output([t1.order_detail_id(0x7f1333be71b0)], [t1.ppid(0x7f1333bf0120)]), filter([t1.order_detail_type(0x7f1333be8e50) = 1(0x7f1333be8590)]), rowset=256 access([GROUP_ID(0x7f11ab102ba0)], [t1.id(0x7f1333be5bd0)], [t1.order_detail_id(0x7f1333be71b0)], [t1.order_detail_type(0x7f1333be8e50)], [t1.ppid(0x7f1333bf0120)]), partitions(p[0-9]) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t1.mkc_id(0x7f110001f2a0)], [t1.id(0x7f1333be5bd0)]), range(MIN ; MAX), range_cond([:102 = t1.mkc_id(0x7f110001f2a0)(0x7f11218db010)]) 87 - output([t2.order_id(0x7f1333bee150)], [t2.in_user_id(0x7f11000804a0)], [t2.in_user_name(0x7f1100080d50)]), filter([t2.is_mobile(0x7f1100029aa0) = 1(0x7f11000291e0)], [t2.is_delete(0x7f1100025180) = 0(0x7f11000248c0)], [t2.product_stock_type(0x7f1333bea6b0) != 3(0x7f1333be9df0)], [t2.product_stock_type(0x7f1333bea6b0) IN (0, 1, 2, 6)(0x7f116c128e70)(0x7f11000398c0)]), rowset=256 access([GROUP_ID(0x7f11ab108230)], [t2.product_stock_type(0x7f1333bea6b0)], [t2.order_id(0x7f1333bee150)], [t2.is_delete(0x7f1100025180)], [t2.is_mobile(0x7f1100029aa0)], [t2.in_user_id(0x7f11000804a0)], [t2.in_user_name(0x7f1100080d50)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false,false,false], range_key([t2.id(0x7f1333be75f0)]), range(MIN ; MAX), range_cond([:97 = t2.id(0x7f1333be75f0)(0x7f11218dba20)]) 88 - output([t3.order_id(0x7f1333bee590)], [t3.user_id(0x7f1100007540)]), filter([t3.order_state(0x7f1100023830) IN (3, 9)(0x7f116c1279a0)(0x7f1100021930)], [t3.is_delete(0x7f11000269e0) = 0(0x7f1100026120)]), rowset=256 access([t3.id(0x7f11244b3580)], [t3.order_id(0x7f1333bee590)], [t3.user_id(0x7f1100007540)], [t3.order_state(0x7f1100023830)], [t3.is_delete(0x7f11000269e0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false], range_key([t3.area_id(0x7f110000afe0)], [t3.id(0x7f11244b3580)]), range(216,MIN ; 216,MAX), range_cond([t3.area_id(0x7f110000afe0) = 216(0x7f11218dc430)]) 89 - output([t4.productid(0x7f110000eb40)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab114060)], [t4.productid(0x7f110000eb40)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f1333bf0560)]), range(MIN ; MAX), range_cond([:100 = t4.ppriceid(0x7f1333bf0560)(0x7f11218dd2d0)]) 90 - output(nil), filter(nil), rowset=256 91 - output(nil), filter(nil), rowset=256 access(nil), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f110000b420)]), range[216 ; 216], range_cond([t8.id(0x7f110000b420) = 216(0x7f11218ddce0)]) 92 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab114410)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f110001d2c0)], [t36.id(0x7f11244b4240)]), range(MIN ; MAX), range_cond([:105 = t36.order_id(0x7f110001d2c0)(0x7f11123e7110)]) 93 - output(nil), filter([t5.is_delete(0x7f1100028240) = 0(0x7f1100027980)]), rowset=256 access([GROUP_ID(0x7f11ab1147c0)], [t5.is_delete(0x7f1100028240)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f1100007100)]), range(MIN ; MAX), range_cond([t5.id(0x7f1100007100) = :103(0x7f11218deb80)]) 94 - output([cast(T_FUN_SUM(t10.statistics_in_price(0x7f11199ed790))(0x7f11199ece00), DECIMAL_INT(77, 4))(0x7f1330090410)], [T_FUN_SUM(t10.in_price(0x7f11199ee5d0))(0x7f11199edc40)], [T_FUN_SUM(t10.statistics_gross_profit(0x7f11199ef410))(0x7f11199eea80)], [T_FUN_SUM(t10.gross_profit(0x7f11199f0250))(0x7f11199ef8c0)], [T_FUN_SUM(t10.examine_price(0x7f11199f1090))(0x7f11199f0700)], [T_FUN_SUM(t10.examine_gross_profit(0x7f1330004050))(0x7f11199f1540)], [cast(T_FUN_SUM(t10.count(0x7f133001f060))(0x7f133001e6d0), VARCHAR(65))(0x7f13300a68b0)], [T_FUN_SUM(t10.price(0x7f133001fea0))(0x7f133001f510)], [T_FUN_SUM(t10.sell_price(0x7f13300235f0))(0x7f1330022c60)], [T_FUN_SUM(t10.gift_price(0x7f1330024430))(0x7f1330023aa0)], [T_FUN_SUM(t10.discount_price(0x7f1330025270))(0x7f13300248e0)], [T_FUN_SUM(t10.point_price(0x7f13300260b0))(0x7f1330025720)], [T_FUN_SUM(t10.actualPaymentPrice(0x7f133005dc00))(0x7f133005d270)], [cast(T_FUN_SUM(t10.self_modify_price(0x7f133005ea40))(0x7f133005e0b0), DECIMAL_INT(76, 4))(0x7f13300c10a0)], [t10.in_user_id(0x7f133005f7f0)], [t10.in_user_name(0x7f13300600a0)]), filter(nil), rowset=256 group([t10.business_type(0x7f1330007970)], [t10.is_mobile(0x7f11199e8860)], [t10.date(0x7f1330004dd0)], [t10.order_complete_time(0x7f1330005680)], [t10.area_id(0x7f11199ea0c0)], [t10.order_id(0x7f11199eb920)], [t10.order_type(0x7f1330008220)], [t10.user_id(0x7f1330008ad0)], [t10.ppid(0x7f1330018ba0)], [t10.insource_id(0x7f1330019d00)], [t10.i_mei_or_barcode(0x7f133001ae60)], [t10.in_user_id(0x7f133005f7f0)], [t10.in_user_name(0x7f13300600a0)], [t10.product_color(0x7f1330060950)], [t10.product_id(0x7f1330061200)], [t10.cid(0x7f1330061ab0)], [t10.brand_id(0x7f1330062360)], [t10.product_name(0x7f1330062c10)], [t10.customer_type(0x7f13300634c0)], [t10.order_customer_type(0x7f1330063d70)], [t10.customer_name(0x7f1330064620)], [t10.customer_phone(0x7f1330064ed0)], [t10.contract_name(0x7f1330065780)], [t10.contract_mobile(0x7f1330066030)], [t10.trader_name(0x7f13300668e0)], [t10.inSourceId2(0x7f133001a5b0)], [t10.detail_type(0x7f1330019450)], [t10.comment(0x7f1330067190)], [t10.product_comment(0x7f1330067a40)], [t10.label_id(0x7f13300682f0)], [t10.label_name(0x7f1330068ba0)], [t10.detail_parent_id(0x7f1330069450)], [t10.serial_number_mark_name(0x7f1330069d00)], [t10.serial_number_mark_color(0x7f133006a5b0)], [t10.serial_number_mark(0x7f133006ae60)], [t10.aux_sale_man_names(0x7f133006b710)], [t10.sample_product(0x7f133006bfc0)], [t10.accountingBodyId(0x7f13300063a0)], [t10.accountingBodyName(0x7f1330006c50)]), agg_func([T_FUN_SUM(t10.statistics_in_price(0x7f11199ed790))(0x7f11199ece00)], [T_FUN_SUM(t10.in_price(0x7f11199ee5d0))(0x7f11199edc40)], [T_FUN_SUM(t10.statistics_gross_profit(0x7f11199ef410))(0x7f11199eea80)], [T_FUN_SUM(t10.gross_profit(0x7f11199f0250))(0x7f11199ef8c0)], [T_FUN_SUM(t10.examine_price(0x7f11199f1090))(0x7f11199f0700)], [T_FUN_SUM(t10.examine_gross_profit(0x7f1330004050))(0x7f11199f1540)], [T_FUN_SUM(t10.count(0x7f133001f060))(0x7f133001e6d0)], [T_FUN_SUM(t10.price(0x7f133001fea0))(0x7f133001f510)], [T_FUN_SUM(t10.sell_price(0x7f13300235f0))(0x7f1330022c60)], [T_FUN_SUM(t10.gift_price(0x7f1330024430))(0x7f1330023aa0)], [T_FUN_SUM(t10.discount_price(0x7f1330025270))(0x7f13300248e0)], [T_FUN_SUM(t10.point_price(0x7f13300260b0))(0x7f1330025720)], [T_FUN_SUM(t10.actualPaymentPrice(0x7f133005dc00))(0x7f133005d270)], [T_FUN_SUM(t10.self_modify_price(0x7f133005ea40))(0x7f133005e0b0)]) 95 - output([t10.statistics_in_price(0x7f11199ed790)], [t10.in_price(0x7f11199ee5d0)], [t10.statistics_gross_profit(0x7f11199ef410)], [t10.gross_profit(0x7f11199f0250)], [t10.examine_price(0x7f11199f1090)], [t10.examine_gross_profit(0x7f1330004050)], [t10.is_mobile(0x7f11199e8860)], [t10.date(0x7f1330004dd0)], [t10.order_complete_time(0x7f1330005680)], [t10.area_id(0x7f11199ea0c0)], [t10.accountingBodyId(0x7f13300063a0)], [t10.accountingBodyName(0x7f1330006c50)], [t10.order_id(0x7f11199eb920)], [t10.business_type(0x7f1330007970)], [t10.order_type(0x7f1330008220)], [t10.user_id(0x7f1330008ad0)], [t10.ppid(0x7f1330018ba0)], [t10.detail_type(0x7f1330019450)], [t10.insource_id(0x7f1330019d00)], [t10.inSourceId2(0x7f133001a5b0)], [t10.i_mei_or_barcode(0x7f133001ae60)], [t10.count(0x7f133001f060)], [t10.price(0x7f133001fea0)], [t10.sell_price(0x7f13300235f0)], [t10.gift_price(0x7f1330024430)], [t10.discount_price(0x7f1330025270)], [t10.point_price(0x7f13300260b0)], [t10.actualPaymentPrice(0x7f133005dc00)], [t10.self_modify_price(0x7f133005ea40)], [t10.in_user_id(0x7f133005f7f0)], [t10.in_user_name(0x7f13300600a0)], [t10.product_color(0x7f1330060950)], [t10.product_id(0x7f1330061200)], [t10.cid(0x7f1330061ab0)], [t10.brand_id(0x7f1330062360)], [t10.product_name(0x7f1330062c10)], [t10.customer_type(0x7f13300634c0)], [t10.order_customer_type(0x7f1330063d70)], [t10.customer_name(0x7f1330064620)], [t10.customer_phone(0x7f1330064ed0)], [t10.contract_name(0x7f1330065780)], [t10.contract_mobile(0x7f1330066030)], [t10.trader_name(0x7f13300668e0)], [t10.comment(0x7f1330067190)], [t10.product_comment(0x7f1330067a40)], [t10.label_id(0x7f13300682f0)], [t10.label_name(0x7f1330068ba0)], [t10.detail_parent_id(0x7f1330069450)], [t10.serial_number_mark_name(0x7f1330069d00)], [t10.serial_number_mark_color(0x7f133006a5b0)], [t10.serial_number_mark(0x7f133006ae60)], [t10.aux_sale_man_names(0x7f133006b710)], [t10.sample_product(0x7f133006bfc0)]), filter(nil), rowset=256 access([t10.statistics_in_price(0x7f11199ed790)], [t10.in_price(0x7f11199ee5d0)], [t10.statistics_gross_profit(0x7f11199ef410)], [t10.gross_profit(0x7f11199f0250)], [t10.examine_price(0x7f11199f1090)], [t10.examine_gross_profit(0x7f1330004050)], [t10.is_mobile(0x7f11199e8860)], [t10.date(0x7f1330004dd0)], [t10.order_complete_time(0x7f1330005680)], [t10.area_id(0x7f11199ea0c0)], [t10.accountingBodyId(0x7f13300063a0)], [t10.accountingBodyName(0x7f1330006c50)], [t10.order_id(0x7f11199eb920)], [t10.business_type(0x7f1330007970)], [t10.order_type(0x7f1330008220)], [t10.user_id(0x7f1330008ad0)], [t10.ppid(0x7f1330018ba0)], [t10.detail_type(0x7f1330019450)], [t10.insource_id(0x7f1330019d00)], [t10.inSourceId2(0x7f133001a5b0)], [t10.i_mei_or_barcode(0x7f133001ae60)], [t10.count(0x7f133001f060)], [t10.price(0x7f133001fea0)], [t10.sell_price(0x7f13300235f0)], [t10.gift_price(0x7f1330024430)], [t10.discount_price(0x7f1330025270)], [t10.point_price(0x7f13300260b0)], [t10.actualPaymentPrice(0x7f133005dc00)], [t10.self_modify_price(0x7f133005ea40)], [t10.in_user_id(0x7f133005f7f0)], [t10.in_user_name(0x7f13300600a0)], [t10.product_color(0x7f1330060950)], [t10.product_id(0x7f1330061200)], [t10.cid(0x7f1330061ab0)], [t10.brand_id(0x7f1330062360)], [t10.product_name(0x7f1330062c10)], [t10.customer_type(0x7f13300634c0)], [t10.order_customer_type(0x7f1330063d70)], [t10.customer_name(0x7f1330064620)], [t10.customer_phone(0x7f1330064ed0)], [t10.contract_name(0x7f1330065780)], [t10.contract_mobile(0x7f1330066030)], [t10.trader_name(0x7f13300668e0)], [t10.comment(0x7f1330067190)], [t10.product_comment(0x7f1330067a40)], [t10.label_id(0x7f13300682f0)], [t10.label_name(0x7f1330068ba0)], [t10.detail_parent_id(0x7f1330069450)], [t10.serial_number_mark_name(0x7f1330069d00)], [t10.serial_number_mark_color(0x7f133006a5b0)], [t10.serial_number_mark(0x7f133006ae60)], [t10.aux_sale_man_names(0x7f133006b710)], [t10.sample_product(0x7f133006bfc0)]) 96 - output([UNION([1])(0x7f1119990f40)], [UNION([2])(0x7f11199912f0)], [UNION([3])(0x7f11199916a0)], [UNION([4])(0x7f1119991a50)], [UNION([5])(0x7f1119991e00)], [UNION([6])(0x7f11199921b0)], [UNION([7])(0x7f1119992560)], [UNION([8])(0x7f1119992910)], [UNION([9])(0x7f1119992cc0)], [UNION([10])(0x7f1119993070)], [UNION([11])(0x7f1119993420)], [UNION([12])(0x7f11199937d0)], [UNION([13])(0x7f1119993b80)], [UNION([14])(0x7f1119993f30)], [UNION([15])(0x7f11199942e0)], [UNION([16])(0x7f1119994690)], [UNION([17])(0x7f11199a2350)], [UNION([18])(0x7f11199a2700)], [UNION([19])(0x7f11199a2ab0)], [UNION([20])(0x7f11199a2e60)], [UNION([21])(0x7f11199a3210)], [UNION([22])(0x7f11199a4be0)], [UNION([23])(0x7f11199a4f90)], [UNION([24])(0x7f11199a5340)], [UNION([25])(0x7f11199a56f0)], [UNION([26])(0x7f11199a5aa0)], [UNION([27])(0x7f11199a5e50)], [UNION([28])(0x7f11199a65b0)], [UNION([29])(0x7f11199d1260)], [UNION([30])(0x7f11199d19c0)], [UNION([31])(0x7f11199d1d70)], [UNION([32])(0x7f11199d2120)], [UNION([33])(0x7f11199d24d0)], [UNION([34])(0x7f11199d2880)], [UNION([35])(0x7f11199d2c30)], [UNION([36])(0x7f11199d2fe0)], [UNION([37])(0x7f11199d3390)], [UNION([38])(0x7f11199d3740)], [UNION([39])(0x7f11199d3af0)], [UNION([40])(0x7f11199d3ea0)], [UNION([41])(0x7f11199d4250)], [UNION([42])(0x7f11199d4600)], [UNION([43])(0x7f11199d49b0)], [UNION([44])(0x7f11199d4d60)], [UNION([45])(0x7f11199d5110)], [UNION([46])(0x7f11199d54c0)], [UNION([47])(0x7f11199d5870)], [UNION([48])(0x7f11199d5c20)], [UNION([49])(0x7f11199d5fd0)], [UNION([50])(0x7f11199d6380)], [UNION([51])(0x7f11199d6730)], [UNION([52])(0x7f11199d6ae0)], [UNION([53])(0x7f11199d6e90)]), filter(nil), rowset=256 97 - output([T_FUN_SUM(IFNULL(IFNULL(t1.statistics_price(0x7f1100143c50) * cast(t1.counts(0x7f1100144090), DECIMAL_INT(20, 0))(0x7f11001f1500)(0x7f110013ec80), cast(CASE WHEN NULL = 1(0x7f1100141040) AND t2.jiuxun_service_flag(0x7f11001444d0) = 1(0x7f11001421b0)(0x7f110013fea0) THEN t2.jiuxun_service_cost_price(0x7f1100144910) ELSE t2.in_price(0x7f1100144d50) END(0x7f110013f500), DECIMAL_INT(30, 2))(0x7f1119804c90))(0x7f110013db00), cast(0, DECIMAL_INT(30, 2))(0x7f1119805d60))(0x7f110013d240))(0x7f110013cd30)], [T_FUN_SUM(IFNULL(IFNULL(t1.inprice(0x7f110014c6c0) * cast(t1.counts(0x7f1100144090), DECIMAL_INT(20, 0))(0x7f11198073d0)(0x7f11001476f0), cast(CASE WHEN NULL = 1(0x7f1100149ab0) AND t2.jiuxun_service_flag(0x7f11001444d0) = 1(0x7f110014ac20)(0x7f1100148910) THEN t2.jiuxun_service_cost_price(0x7f1100144910) ELSE t2.in_price(0x7f1100144d50) END(0x7f1100147f70), DECIMAL_INT(30, 2))(0x7f11198088c0))(0x7f1100146570), cast(0, DECIMAL_INT(30, 2))(0x7f1119809990))(0x7f1100145cb0))(0x7f11001457a0)], [cast(cast(t2.statictisc_price(0x7f1100159c10), DECIMAL_INT(25, 4))(0x7f111980d100) + IFNULL(cast(t2.gift_price(0x7f110015a050), DECIMAL_INT(24, 4))(0x7f111980b180), cast(0, DECIMAL_INT(24, 4))(0x7f111980c070))(0x7f110014d570)(0x7f110014e870) * CASE WHEN t2.virtual_product(0x7f110015a490) = 0(0x7f1100150380) THEN T_FUN_SUM(t1.counts(0x7f1100144090))(0x7f1100150c00 ) ELSE cast(t2.counts(0x7f110015a8d0), DECIMAL_INT(42, 0))(0x7f111980e2d0) END(0x7f110014f0f0)(0x7f1100151a00) - cast(T_FUN_SUM(IFNULL(IFNULL(t1.statistics_price(0x7f1100143c50) * cast(t1.counts(0x7f1100144090), DECIMAL_INT(20, 0))(0x7f11001f1500)(0x7f110013ec80), cast(CASE WHEN NULL = 1(0x7f1100141040) AND t2.jiuxun_service_flag(0x7f11001444d0) = 1(0x7f11001421b0)(0x7f110013fea0) THEN t2.jiuxun_service_cost_price(0x7f1100144910) ELSE t2.in_price(0x7f1100144d50) END(0x7f110013f500), DECIMAL_INT(30, 2))(0x7f1119804c90))(0x7f110013db00), cast(0, DECIMAL_INT(30, 2))(0x7f1119805d60))(0x7f110013d240))(0x7f110013cd30), DECIMAL_INT(68, 4))(0x7f111980f600)(0x7f1100158fd0), DECIMAL(65, 6))(0x7f11199892c0)], [cast(cast(t2.statictisc_price(0x7f1100159c10), DECIMAL_INT(25, 4))(0x7f111980d100) + IFNULL(cast(t2.gift_price(0x7f110015a050), DECIMAL_INT(24, 4))(0x7f111980b180), cast(0, DECIMAL_INT(24, 4))(0x7f111980c070))(0x7f110014d570)(0x7f110014e870) * CASE WHEN t2.virtual_product(0x7f110015a490) = 0(0x7f110015e930) THEN T_FUN_SUM(t1.counts(0x7f1100144090))(0x7f1100150c00) ELSE cast(t2.counts(0x7f110015a8d0), DECIMAL_INT(42, 0))(0x7f1119811a40) END(0x7f110015d6a0)(0x7f110015ffb0) - cast(T_FUN_SUM(IFNULL(IFNULL(t1.inprice(0x7f110014c6c0) * cast(t1.counts(0x7f1100144090), DECIMAL_INT(20, 0))(0x7f11198073d0)(0x7f11001476f0), cast(CASE WHEN NULL = 1(0x7f1100149ab0) AND t2.jiuxun_service_flag(0x7f11001444d0) = 1(0x7f110014ac20)(0x7f1100148910) THEN t2.jiuxun_service_cost_price(0x7f1100144910) ELSE t2.in_price(0x7f1100144d50) END(0x7f1100147f70), DECIMAL_INT(30, 2))(0x7f11198088c0))(0x7f1100146570), cast(0, DECIMAL_INT(30, 2))(0x7f1119809990))(0x7f1100145cb0))(0x7f11001457a0), DECIMAL_INT(68, 4))(0x7f1119812d70)(0x7f1100167580), DECIMAL(65, 6))(0x7f111998aa90)], [T_FUN_SUM(IFNULL(IFNULL(t1.examine_price(0x7f110016bfb0) * cast(t1.counts(0x7f1100144090), DECIMAL_INT(20, 0))(0x7f1119814a10)(0x7f110016aac0), cast(t2.examine_price(0x7f110016c3f0), DECIMAL_INT(30, 2))(0x7f1119815900))(0x7f1100169940), cast(0, DECIMAL_INT(30, 2))(0x7f11198167f0))(0x7f1100169080))(0x7f1100168b70)], [cast(cast(t2.statictisc_price(0x7f1100159c10), DECIMAL_INT(25, 4))(0x7f111980d100) + IFNULL(cast(t2.gift_price(0x7f110015a050), DECIMAL_INT(24, 4))(0x7f111980b180), cast(0, DECIMAL_INT(24, 4))(0x7f111980c070))(0x7f110014d570)(0x7f110014e870) * CASE WHEN t2.virtual_product(0x7f110015a490) = 0(0x7f110016fd50) THEN T_FUN_SUM(t1.counts(0x7f1100144090))(0x7f1100150c00) ELSE cast(t2.counts(0x7f110015a8d0), DECIMAL_INT(42, 0))(0x7f1119818210) END(0x7f110016eac0)(0x7f11001713d0) - cast(T_FUN_SUM(IFNULL(IFNULL(t1.examine_price(0x7f110016bfb0) * cast(t1.counts(0x7f1100144090), DECIMAL_INT(20, 0))(0x7f1119814a10)(0x7f110016aac0), cast(t2.examine_price(0x7f110016c3f0), DECIMAL_INT(30, 2))(0x7f1119815900))(0x7f1100169940), cast(0, DECIMAL_INT(30, 2))(0x7f11198167f0))(0x7f1100169080))(0x7f1100168b70), DECIMAL_INT(68, 4))(0x7f1119819480)(0x7f1100175010), DECIMAL(65, 6))(0x7f111998c260)], [t2.is_mobile(0x7f110012e140)], [t3.order_complete_time(0x7f1100131410)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [CASE WHEN t3.order_state(0x7f1100127ed0) = 9(0x7f110017b310) THEN ifnull(t3.order_parent_id(0x7f110017d3d0), t3.order_id(0x7f11001031b0))(0x7f110017bb90) ELSE t3.order_id(0x7f11001031b0) END(0x7f110017a080)], ['销售'], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t2.ppid(0x7f1100104d40)], [t2.detail_type(0x7f110018cd80)], [IFNULL(t1.insource_id(0x7f110018e4e0), vpcc.in_source_id(0x7f110018e920))(0x7f110018d1d0)], [t16.channel(0x7f110018f250)], [t4.bar_code(0x7f110018fb00)], [CASE WHEN t2.virtual_product(0x7f110015a490) = 0(0x7f1100192da0) THEN T_FUN_SUM(t1.counts(0x7f1100144090))(0x7f1100150c00) ELSE cast(t2.counts(0x7f110015a8d0), DECIMAL_INT(42, 0))(0x7f111981b460) END(0x7f1100191b10)], [t2.price(0x7f1100197d50) * CASE WHEN t2.virtual_product(0x7f110015a490) = 0(0x7f1100195d50) THEN T_FUN_SUM(t1.counts(0x7f1100144090))(0x7f1100150c00) ELSE cast(t2.counts(0x7f110015a8d0), DECIMAL_INT(42, 0))(0x7f111981c870) END(0x7f1100194ac0)(0x7f11001973d0)], [t2.sell_price(0x7f110019bab0) * CASE WHEN t2.virtual_product(0x7f110015a490) = 0(0x7f1100199ab0) THEN T_FUN_SUM(t1.counts(0x7f1100144090))(0x7f1100150c00) ELSE cast(t2.counts(0x7f110015a8d0), DECIMAL_INT(42, 0))(0x7f111981dea0) END(0x7f1100198820)(0x7f110019b130)], [t2.gift_price(0x7f110015a050) * CASE WHEN t2.virtual_product(0x7f110015a490) = 0(0x7f110019d810) THEN T_FUN_SUM(t1.counts(0x7f1100144090))(0x7f1100150c00) ELSE cast(t2.counts(0x7f110015a8d0), DECIMAL_INT(42, 0))(0x7f111981f4d0) END(0x7f110019c580)(0x7f110019ee90)], [t2.discount_price(0x7f11001a3130) * CASE WHEN t2.virtual_product(0x7f110015a490) = 0(0x7f11001a1130) THEN T_FUN_SUM(t1.counts(0x7f1100144090))(0x7f1100150c00) ELSE cast(t2.counts(0x7f110015a8d0), DECIMAL_INT(42, 0))(0x7f1119820b00) END(0x7f110019fea0)(0x7f11001a27b0)], [t2.point_price(0x7f11001a6e90) * CASE WHEN t2.virtual_product(0x7f110015a490) = 0(0x7f11001a4e90) THEN T_FUN_SUM(t1.counts(0x7f1100144090))(0x7f1100150c00) ELSE cast(t2.counts(0x7f110015a8d0), DECIMAL_INT(42, 0))(0x7f1119822130) END(0x7f11001a3c00)(0x7f11001a6510)], [cast(cast(t2.price(0x7f1100197d50), DECIMAL_INT(17, 4))(0x7f1119824cd0) - t2.discount_price(0x7f11001a3130)(0x7f11001ab6e0) - t2.point_price(0x7f11001a6e90)(0x7f11001ac3c0) * CASE WHEN t2.virtual_product(0x7f110015a490) = 0(0x7f11001adf00) THEN T_FUN_SUM(t1.counts(0x7f1100144090))(0x7f1100150c00) ELSE cast(t2.counts(0x7f110015a8d0), DECIMAL_INT(42, 0))(0x7f1119826040) END(0x7f11001acc40)(0x7f11001af550), DECIMAL(62, 6))(0x7f111998f930)], [T_FUN_SUM(IFNULL(t1.modify_price(0x7f11001d3800) * cast(t1.counts(0x7f1100144090), DECIMAL_INT(20, 0))(0x7f1119827620)(0x7f11001d2900), cast(0, DECIMAL_INT(30, 2))(0x7f1119828510))(0x7f11001d1780))(0x7f11001d1270)], [t2.in_user_id(0x7f11001d4730)], [t2.in_user_name(0x7f11001d4fe0)], [t4.product_color(0x7f11001d5890)], [t4.productid(0x7f1100115600)], [t4.cid(0x7f11001d65b0)], [t4.brand_id(0x7f11001d6e60)], [t4.product_name(0x7f11001d7710)], [t5.user_type(0x7f11001d7fc0)], [t3.customer_type(0x7f11001d8870)], [CASE WHEN t3.order_type(0x7f110017e2e0) = 3(0x7f11001da7d0) OR t3.order_type(0x7f110017e2e0) = 4(0x7f11001db940)(0x7f11001d9660) THEN t11.special_username(0x7f11001dcbd0) ELSE t5.real_name(0x7f11001dd010) END(0x7f11001d8cc0)], [t5.user_mobile(0x7f11001e1910)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.trader_name(0x7f11001e3320)], [t3.comment(0x7f11001e3bd0)], [t2.comment(0x7f11001e4480)], [la.id(0x7f110011b180)], [la.label_name(0x7f11001e51a0)], [t2.detail_parent_id(0x7f11001e5a50)], [sysc.name(0x7f11001e6300)], [sysc.value(0x7f11001e6bb0)], [sysc.id(0x7f110011e9b0)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t1.sample_product(0x7f11001e8180)]), filter([CASE WHEN t3.order_state(0x7f1100127ed0) = 9(0x7f110017b310) THEN ifnull(t3.order_parent_id(0x7f110017d3d0), t3.order_id(0x7f11001031b0))(0x7f110017bb90) ELSE t3.order_id(0x7f11001031b0) END(0x7f110017a080) IS NOT NULL(0x7f1396129a40)]), rowset=256 group([t2.id(0x7f11000fda70)], [t1.insource_id(0x7f110018e4e0)], [t3.trader_name(0x7f11001e3320)], [la.id(0x7f110011b180)], [la.label_name(0x7f11001e51a0)], [sysc.name(0x7f11001e6300)], [sysc.value(0x7f11001e6bb0)], [sysc.id(0x7f110011e9b0)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t1.sample_product(0x7f11001e8180)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)]), agg_func([T_FUN_SUM(IFNULL(IFNULL(t1.statistics_price(0x7f1100143c50) * cast(t1.counts(0x7f1100144090), DECIMAL_INT(20, 0))(0x7f11001f1500)(0x7f110013ec80), cast(CASE WHEN NULL = 1(0x7f1100141040) AND t2.jiuxun_service_flag(0x7f11001444d0) = 1(0x7f11001421b0)(0x7f110013fea0) THEN t2.jiuxun_service_cost_price(0x7f1100144910) ELSE t2.in_price(0x7f1100144d50) END(0x7f110013f500), DECIMAL_INT(30, 2))(0x7f1119804c90))(0x7f110013db00), cast(0, DECIMAL_INT(30, 2))(0x7f1119805d60))(0x7f110013d240))(0x7f110013cd30)], [T_FUN_SUM(IFNULL(IFNULL(t1.inprice(0x7f110014c6c0) * cast(t1.counts(0x7f1100144090), DECIMAL_INT(20, 0))(0x7f11198073d0)(0x7f11001476f0), cast(CASE WHEN NULL = 1(0x7f1100149ab0) AND t2.jiuxun_service_flag(0x7f11001444d0) = 1(0x7f110014ac20)(0x7f1100148910) THEN t2.jiuxun_service_cost_price(0x7f1100144910) ELSE t2.in_price(0x7f1100144d50) END(0x7f1100147f70), DECIMAL_INT(30, 2))(0x7f11198088c0))(0x7f1100146570), cast(0, DECIMAL_INT(30, 2))(0x7f1119809990))(0x7f1100145cb0))(0x7f11001457a0)], [T_FUN_SUM(t1.counts(0x7f1100144090))(0x7f1100150c00)], [T_FUN_SUM(IFNULL(IFNULL(t1.examine_price(0x7f110016bfb0) * cast(t1.counts(0x7f1100144090), DECIMAL_INT(20, 0))(0x7f1119814a10)(0x7f110016aac0), cast(t2.examine_price(0x7f110016c3f0), DECIMAL_INT(30, 2))(0x7f1119815900))(0x7f1100169940), cast(0, DECIMAL_INT(30, 2))(0x7f11198167f0))(0x7f1100169080))(0x7f1100168b70)], [T_FUN_SUM(IFNULL(t1.modify_price(0x7f11001d3800) * cast(t1.counts(0x7f1100144090), DECIMAL_INT(20, 0))(0x7f1119827620)(0x7f11001d2900), cast(0, DECIMAL_INT(30, 2))(0x7f1119828510))(0x7f11001d1780))(0x7f11001d1270)]) 98 - output([t2.id(0x7f11000fda70)], [t1.insource_id(0x7f110018e4e0)], [t3.trader_name(0x7f11001e3320)], [la.id(0x7f110011b180)], [la.label_name(0x7f11001e51a0)], [sysc.name(0x7f11001e6300)], [sysc.value(0x7f11001e6bb0)], [sysc.id(0x7f110011e9b0)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t1.sample_product(0x7f11001e8180)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [t1.counts(0x7f1100144090)], [t2.jiuxun_service_flag(0x7f11001444d0)], [t2.jiuxun_service_cost_price(0x7f1100144910)], [t2.in_price(0x7f1100144d50)], [cast(t2.statictisc_price(0x7f1100159c10), DECIMAL_INT(25, 4))(0x7f111980d100) + IFNULL(cast(t2.gift_price(0x7f110015a050), DECIMAL_INT(24, 4))(0x7f111980b180), cast(0, DECIMAL_INT(24, 4))(0x7f111980c070))(0x7f110014d570)(0x7f110014e870)], [t2.virtual_product(0x7f110015a490)], [t2.counts(0x7f110015a8d0)], [t2.is_mobile(0x7f110012e140)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [CASE WHEN t3.order_state(0x7f1100127ed0) = 9(0x7f110017b310) THEN ifnull(t3.order_parent_id(0x7f110017d3d0), t3.order_id(0x7f11001031b0))(0x7f110017bb90) ELSE t3.order_id(0x7f11001031b0) END(0x7f110017a080)], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t2.ppid(0x7f1100104d40)], [t2.detail_type(0x7f110018cd80)], [t16.channel(0x7f110018f250)], [t4.bar_code(0x7f110018fb00)], [t2.gift_price(0x7f110015a050)], [t2.price(0x7f1100197d50)], [t2.discount_price(0x7f11001a3130)], [t2.point_price(0x7f11001a6e90)], [t2.in_user_id(0x7f11001d4730)], [t2.in_user_name(0x7f11001d4fe0)], [t4.product_color(0x7f11001d5890)], [t4.productid(0x7f1100115600)], [t4.cid(0x7f11001d65b0)], [t4.brand_id(0x7f11001d6e60)], [t4.product_name(0x7f11001d7710)], [t5.user_type(0x7f11001d7fc0)], [t3.customer_type(0x7f11001d8870)], [t5.user_mobile(0x7f11001e1910)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.comment(0x7f11001e3bd0)], [t2.comment(0x7f11001e4480)], [t2.detail_parent_id(0x7f11001e5a50)], [t11.special_username(0x7f11001dcbd0)], [t5.real_name(0x7f11001dd010)], [t2.examine_price(0x7f110016c3f0)], [t2.sell_price(0x7f110019bab0)], [vpcc.in_source_id(0x7f110018e920)], [t1.statistics_price(0x7f1100143c50)], [t1.inprice(0x7f110014c6c0)], [t1.examine_price(0x7f110016bfb0)], [t1.modify_price(0x7f11001d3800)]), filter(nil), rowset=256 equal_conds([t1.serial_number_mark(0x7f110011e570) = sysc.id(0x7f110011e9b0)(0x7f110011dcb0)]), other_conds(nil) 99 - output([sysc.id(0x7f110011e9b0)], [sysc.name(0x7f11001e6300)], [sysc.value(0x7f11001e6bb0)]), filter([sysc.is_delete(0x7f1100120210) = 0(0x7f110011f950)]), rowset=256 access([sysc.id(0x7f110011e9b0)], [sysc.is_delete(0x7f1100120210)], [sysc.name(0x7f11001e6300)], [sysc.value(0x7f11001e6bb0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([sysc.id(0x7f110011e9b0)]), range(MIN ; MAX)always true 100 - output([t2.id(0x7f11000fda70)], [t1.insource_id(0x7f110018e4e0)], [t3.trader_name(0x7f11001e3320)], [la.id(0x7f110011b180)], [la.label_name(0x7f11001e51a0)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t1.sample_product(0x7f11001e8180)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [t1.counts(0x7f1100144090)], [t2.jiuxun_service_flag(0x7f11001444d0)], [t2.jiuxun_service_cost_price(0x7f1100144910)], [t2.in_price(0x7f1100144d50)], [t2.virtual_product(0x7f110015a490)], [t2.counts(0x7f110015a8d0)], [t2.is_mobile(0x7f110012e140)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [t3.order_id(0x7f11001031b0)], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t2.ppid(0x7f1100104d40)], [t2.detail_type(0x7f110018cd80)], [t16.channel(0x7f110018f250)], [t4.bar_code(0x7f110018fb00)], [t2.gift_price(0x7f110015a050)], [t2.price(0x7f1100197d50)], [t2.discount_price(0x7f11001a3130)], [t2.point_price(0x7f11001a6e90)], [t2.in_user_id(0x7f11001d4730)], [t2.in_user_name(0x7f11001d4fe0)], [t4.product_color(0x7f11001d5890)], [t4.productid(0x7f1100115600)], [t4.cid(0x7f11001d65b0)], [t4.brand_id(0x7f11001d6e60)], [t4.product_name(0x7f11001d7710)], [t5.user_type(0x7f11001d7fc0)], [t3.customer_type(0x7f11001d8870)], [t5.user_mobile(0x7f11001e1910)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.comment(0x7f11001e3bd0)], [t2.comment(0x7f11001e4480)], [t2.detail_parent_id(0x7f11001e5a50)], [t11.special_username(0x7f11001dcbd0)], [t3.order_state(0x7f1100127ed0)], [t3.order_parent_id(0x7f110017d3d0)], [t5.real_name(0x7f11001dd010)], [t2.statictisc_price(0x7f1100159c10)], [t2.examine_price(0x7f110016c3f0)], [t2.sell_price(0x7f110019bab0)], [vpcc.in_source_id(0x7f110018e920)], [t1.serial_number_mark(0x7f110011e570)], [t1.statistics_price(0x7f1100143c50)], [t1.inprice(0x7f110014c6c0)], [t1.examine_price(0x7f110016bfb0)], [t1.modify_price(0x7f11001d3800)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f11000fda70)(:113)]), use_batch=true 101 - output([t2.id(0x7f11000fda70)], [t3.trader_name(0x7f11001e3320)], [la.id(0x7f110011b180)], [la.label_name(0x7f11001e51a0)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [t2.jiuxun_service_flag(0x7f11001444d0)], [t2.jiuxun_service_cost_price(0x7f1100144910)], [t2.in_price(0x7f1100144d50)], [t2.virtual_product(0x7f110015a490)], [t2.counts(0x7f110015a8d0)], [t2.is_mobile(0x7f110012e140)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [t3.order_id(0x7f11001031b0)], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t2.ppid(0x7f1100104d40)], [t2.detail_type(0x7f110018cd80)], [t16.channel(0x7f110018f250)], [t4.bar_code(0x7f110018fb00)], [t2.gift_price(0x7f110015a050)], [t2.price(0x7f1100197d50)], [t2.discount_price(0x7f11001a3130)], [t2.point_price(0x7f11001a6e90)], [t2.in_user_id(0x7f11001d4730)], [t2.in_user_name(0x7f11001d4fe0)], [t4.product_color(0x7f11001d5890)], [t4.productid(0x7f1100115600)], [t4.cid(0x7f11001d65b0)], [t4.brand_id(0x7f11001d6e60)], [t4.product_name(0x7f11001d7710)], [t5.user_type(0x7f11001d7fc0)], [t3.customer_type(0x7f11001d8870)], [t5.user_mobile(0x7f11001e1910)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.comment(0x7f11001e3bd0)], [t2.comment(0x7f11001e4480)], [t2.detail_parent_id(0x7f11001e5a50)], [t11.special_username(0x7f11001dcbd0)], [t3.order_state(0x7f1100127ed0)], [t3.order_parent_id(0x7f110017d3d0)], [t5.real_name(0x7f11001dd010)], [t2.statictisc_price(0x7f1100159c10)], [t2.examine_price(0x7f110016c3f0)], [t2.sell_price(0x7f110019bab0)], [vpcc.in_source_id(0x7f110018e920)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f11000fda70)(:119)]), use_batch=true 102 - output([t2.id(0x7f11000fda70)], [t3.trader_name(0x7f11001e3320)], [la.id(0x7f110011b180)], [la.label_name(0x7f11001e51a0)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [t2.jiuxun_service_flag(0x7f11001444d0)], [t2.jiuxun_service_cost_price(0x7f1100144910)], [t2.in_price(0x7f1100144d50)], [t2.virtual_product(0x7f110015a490)], [t2.counts(0x7f110015a8d0)], [t2.is_mobile(0x7f110012e140)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [t3.order_id(0x7f11001031b0)], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t2.ppid(0x7f1100104d40)], [t2.detail_type(0x7f110018cd80)], [t16.channel(0x7f110018f250)], [t4.bar_code(0x7f110018fb00)], [t2.gift_price(0x7f110015a050)], [t2.price(0x7f1100197d50)], [t2.discount_price(0x7f11001a3130)], [t2.point_price(0x7f11001a6e90)], [t2.in_user_id(0x7f11001d4730)], [t2.in_user_name(0x7f11001d4fe0)], [t4.product_color(0x7f11001d5890)], [t4.productid(0x7f1100115600)], [t4.cid(0x7f11001d65b0)], [t4.brand_id(0x7f11001d6e60)], [t4.product_name(0x7f11001d7710)], [t5.user_type(0x7f11001d7fc0)], [t3.customer_type(0x7f11001d8870)], [t5.user_mobile(0x7f11001e1910)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.comment(0x7f11001e3bd0)], [t2.comment(0x7f11001e4480)], [t2.detail_parent_id(0x7f11001e5a50)], [t11.special_username(0x7f11001dcbd0)], [t3.order_state(0x7f1100127ed0)], [t3.order_parent_id(0x7f110017d3d0)], [t5.real_name(0x7f11001dd010)], [t2.statictisc_price(0x7f1100159c10)], [t2.examine_price(0x7f110016c3f0)], [t2.sell_price(0x7f110019bab0)]), filter(nil), rowset=256 equal_conds([pl.label_id(0x7f110011ad40) = la.id(0x7f110011b180)(0x7f110011a480)]), other_conds(nil) 103 - output([la.id(0x7f110011b180)], [la.label_name(0x7f11001e51a0)]), filter([la.is_delete(0x7f110011c9e0) = 0(0x7f110011c120)]), rowset=256 access([la.id(0x7f110011b180)], [la.is_delete(0x7f110011c9e0)], [la.label_name(0x7f11001e51a0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([la.id(0x7f110011b180)]), range(MIN ; MAX)always true 104 - output([t2.id(0x7f11000fda70)], [t3.trader_name(0x7f11001e3320)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [t2.jiuxun_service_flag(0x7f11001444d0)], [t2.jiuxun_service_cost_price(0x7f1100144910)], [t2.in_price(0x7f1100144d50)], [t2.virtual_product(0x7f110015a490)], [t2.counts(0x7f110015a8d0)], [t2.is_mobile(0x7f110012e140)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [t3.order_id(0x7f11001031b0)], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t2.ppid(0x7f1100104d40)], [t2.detail_type(0x7f110018cd80)], [t16.channel(0x7f110018f250)], [t4.bar_code(0x7f110018fb00)], [t2.gift_price(0x7f110015a050)], [t2.price(0x7f1100197d50)], [t2.discount_price(0x7f11001a3130)], [t2.point_price(0x7f11001a6e90)], [t2.in_user_id(0x7f11001d4730)], [t2.in_user_name(0x7f11001d4fe0)], [t4.product_color(0x7f11001d5890)], [t4.productid(0x7f1100115600)], [t4.cid(0x7f11001d65b0)], [t4.brand_id(0x7f11001d6e60)], [t4.product_name(0x7f11001d7710)], [t5.user_type(0x7f11001d7fc0)], [t3.customer_type(0x7f11001d8870)], [t5.user_mobile(0x7f11001e1910)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.comment(0x7f11001e3bd0)], [t2.comment(0x7f11001e4480)], [t2.detail_parent_id(0x7f11001e5a50)], [pl.label_id(0x7f110011ad40)], [t11.special_username(0x7f11001dcbd0)], [t3.order_state(0x7f1100127ed0)], [t3.order_parent_id(0x7f110017d3d0)], [t5.real_name(0x7f11001dd010)], [t2.statictisc_price(0x7f1100159c10)], [t2.examine_price(0x7f110016c3f0)], [t2.sell_price(0x7f110019bab0)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f1100115600) = pl.product_id(0x7f1100117950)(0x7f1100114d40)]), other_conds(nil) 105 - output([pl.product_id(0x7f1100117950)], [pl.label_id(0x7f110011ad40)]), filter([pl.is_delete(0x7f11001191b0) = 0(0x7f11001188f0)]), rowset=256 access([pl.product_id(0x7f1100117950)], [pl.is_delete(0x7f11001191b0)], [pl.label_id(0x7f110011ad40)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f11244c40f0)]), range(MIN ; MAX)always true 106 - output([t2.id(0x7f11000fda70)], [t3.trader_name(0x7f11001e3320)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [t2.jiuxun_service_flag(0x7f11001444d0)], [t2.jiuxun_service_cost_price(0x7f1100144910)], [t2.in_price(0x7f1100144d50)], [t2.virtual_product(0x7f110015a490)], [t2.counts(0x7f110015a8d0)], [t2.is_mobile(0x7f110012e140)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [t3.order_id(0x7f11001031b0)], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t2.ppid(0x7f1100104d40)], [t2.detail_type(0x7f110018cd80)], [t16.channel(0x7f110018f250)], [t4.bar_code(0x7f110018fb00)], [t2.gift_price(0x7f110015a050)], [t2.price(0x7f1100197d50)], [t2.discount_price(0x7f11001a3130)], [t2.point_price(0x7f11001a6e90)], [t2.in_user_id(0x7f11001d4730)], [t2.in_user_name(0x7f11001d4fe0)], [t4.product_color(0x7f11001d5890)], [t4.productid(0x7f1100115600)], [t4.cid(0x7f11001d65b0)], [t4.brand_id(0x7f11001d6e60)], [t4.product_name(0x7f11001d7710)], [t5.user_type(0x7f11001d7fc0)], [t3.customer_type(0x7f11001d8870)], [t5.user_mobile(0x7f11001e1910)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.comment(0x7f11001e3bd0)], [t2.comment(0x7f11001e4480)], [t2.detail_parent_id(0x7f11001e5a50)], [t11.special_username(0x7f11001dcbd0)], [t3.order_state(0x7f1100127ed0)], [t3.order_parent_id(0x7f110017d3d0)], [t5.real_name(0x7f11001dd010)], [t2.statictisc_price(0x7f1100159c10)], [t2.examine_price(0x7f110016c3f0)], [t2.sell_price(0x7f110019bab0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.ppid(0x7f1100104d40)(:116)]), use_batch=true 107 - output([t2.id(0x7f11000fda70)], [t3.trader_name(0x7f11001e3320)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [t2.jiuxun_service_flag(0x7f11001444d0)], [t2.jiuxun_service_cost_price(0x7f1100144910)], [t2.in_price(0x7f1100144d50)], [t2.virtual_product(0x7f110015a490)], [t2.counts(0x7f110015a8d0)], [t2.is_mobile(0x7f110012e140)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [t3.order_id(0x7f11001031b0)], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t2.ppid(0x7f1100104d40)], [t2.detail_type(0x7f110018cd80)], [t16.channel(0x7f110018f250)], [t2.gift_price(0x7f110015a050)], [t2.price(0x7f1100197d50)], [t2.discount_price(0x7f11001a3130)], [t2.point_price(0x7f11001a6e90)], [t2.in_user_id(0x7f11001d4730)], [t2.in_user_name(0x7f11001d4fe0)], [t5.user_type(0x7f11001d7fc0)], [t3.customer_type(0x7f11001d8870)], [t5.user_mobile(0x7f11001e1910)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.comment(0x7f11001e3bd0)], [t2.comment(0x7f11001e4480)], [t2.detail_parent_id(0x7f11001e5a50)], [t11.special_username(0x7f11001dcbd0)], [t3.order_state(0x7f1100127ed0)], [t3.order_parent_id(0x7f110017d3d0)], [t5.real_name(0x7f11001dd010)], [t2.statictisc_price(0x7f1100159c10)], [t2.examine_price(0x7f110016c3f0)], [t2.sell_price(0x7f110019bab0)]), filter(nil), rowset=256 equal_conds([t2.id(0x7f11000fda70) = t16.order_detail_id(0x7f110010eae0)(0x7f110010e220)]), other_conds(nil) 108 - output([t2.id(0x7f11000fda70)], [t3.trader_name(0x7f11001e3320)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [t2.jiuxun_service_flag(0x7f11001444d0)], [t2.jiuxun_service_cost_price(0x7f1100144910)], [t2.in_price(0x7f1100144d50)], [t2.virtual_product(0x7f110015a490)], [t2.counts(0x7f110015a8d0)], [t2.is_mobile(0x7f110012e140)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [t3.order_id(0x7f11001031b0)], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t2.ppid(0x7f1100104d40)], [t2.detail_type(0x7f110018cd80)], [t2.gift_price(0x7f110015a050)], [t2.price(0x7f1100197d50)], [t2.discount_price(0x7f11001a3130)], [t2.point_price(0x7f11001a6e90)], [t2.in_user_id(0x7f11001d4730)], [t2.in_user_name(0x7f11001d4fe0)], [t5.user_type(0x7f11001d7fc0)], [t3.customer_type(0x7f11001d8870)], [t5.user_mobile(0x7f11001e1910)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.comment(0x7f11001e3bd0)], [t2.comment(0x7f11001e4480)], [t2.detail_parent_id(0x7f11001e5a50)], [t11.special_username(0x7f11001dcbd0)], [t3.order_state(0x7f1100127ed0)], [t3.order_parent_id(0x7f110017d3d0)], [t5.real_name(0x7f11001dd010)], [t2.statictisc_price(0x7f1100159c10)], [t2.examine_price(0x7f110016c3f0)], [t2.sell_price(0x7f110019bab0)]), filter(nil), rowset=256 equal_conds([t2.id(0x7f11000fda70) = t17.bind_order_detail_id(0x7f1100110680)(0x7f110010fdc0)]), other_conds(nil) 109 - output([t2.id(0x7f11000fda70)], [t3.trader_name(0x7f11001e3320)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [t2.jiuxun_service_flag(0x7f11001444d0)], [t2.jiuxun_service_cost_price(0x7f1100144910)], [t2.in_price(0x7f1100144d50)], [t2.virtual_product(0x7f110015a490)], [t2.counts(0x7f110015a8d0)], [t2.is_mobile(0x7f110012e140)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [t3.order_id(0x7f11001031b0)], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t2.ppid(0x7f1100104d40)], [t2.detail_type(0x7f110018cd80)], [t2.gift_price(0x7f110015a050)], [t2.price(0x7f1100197d50)], [t2.discount_price(0x7f11001a3130)], [t2.point_price(0x7f11001a6e90)], [t2.in_user_id(0x7f11001d4730)], [t2.in_user_name(0x7f11001d4fe0)], [t5.user_type(0x7f11001d7fc0)], [t3.customer_type(0x7f11001d8870)], [t5.user_mobile(0x7f11001e1910)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.comment(0x7f11001e3bd0)], [t2.comment(0x7f11001e4480)], [t2.detail_parent_id(0x7f11001e5a50)], [t11.special_username(0x7f11001dcbd0)], [t3.order_state(0x7f1100127ed0)], [t3.order_parent_id(0x7f110017d3d0)], [t5.real_name(0x7f11001dd010)], [t2.statictisc_price(0x7f1100159c10)], [t2.examine_price(0x7f110016c3f0)], [t2.sell_price(0x7f110019bab0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f11001031b0)(:115)]), use_batch=true 110 - output([t3.trader_name(0x7f11001e3320)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [t3.order_id(0x7f11001031b0)], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t5.user_type(0x7f11001d7fc0)], [t3.customer_type(0x7f11001d8870)], [t5.user_mobile(0x7f11001e1910)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.comment(0x7f11001e3bd0)], [t11.special_username(0x7f11001dcbd0)], [t3.order_state(0x7f1100127ed0)], [t3.order_parent_id(0x7f110017d3d0)], [t5.real_name(0x7f11001dd010)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f1100109060)(:121)]), use_batch=true 111 - output([t3.trader_name(0x7f11001e3320)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [t3.order_id(0x7f11001031b0)], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t3.customer_type(0x7f11001d8870)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.comment(0x7f11001e3bd0)], [t11.special_username(0x7f11001dcbd0)], [t3.order_state(0x7f1100127ed0)], [t3.order_parent_id(0x7f110017d3d0)]), filter(nil), rowset=256 equal_conds([t11.user_id(0x7f1100113a70) = t3.user_id(0x7f1100109060)(0x7f11001131b0)]), other_conds(nil) 112 - output([t11.user_id(0x7f1100113a70)], [t11.special_username(0x7f11001dcbd0)]), filter(nil), rowset=256 access([t11.user_id(0x7f1100113a70)], [t11.special_username(0x7f11001dcbd0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t11.id(0x7f11244c3cb0)]), range(MIN ; MAX)always true 113 - output([t3.trader_name(0x7f11001e3320)], [t36.aux_sale_man_names(0x7f11001e78d0)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [t3.order_id(0x7f11001031b0)], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t3.customer_type(0x7f11001d8870)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.comment(0x7f11001e3bd0)], [t3.order_state(0x7f1100127ed0)], [t3.order_parent_id(0x7f110017d3d0)]), filter(nil), rowset=256 equal_conds([t3.order_id(0x7f11001031b0) = t36.order_id(0x7f1100125920)(0x7f1100125060)]), other_conds(nil) 114 - output([t3.trader_name(0x7f11001e3320)], [t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)], [t3.order_complete_time(0x7f1100131410)], [t3.area_id(0x7f110010cb00)], [t3.order_id(0x7f11001031b0)], [t3.order_type(0x7f110017e2e0)], [t3.user_id(0x7f1100109060)], [t3.customer_type(0x7f11001d8870)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.comment(0x7f11001e3bd0)], [t3.order_state(0x7f1100127ed0)], [t3.order_parent_id(0x7f110017d3d0)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 115 - output([t3.order_id(0x7f11001031b0)], [t3.user_id(0x7f1100109060)], [t3.area_id(0x7f110010cb00)], [t3.order_state(0x7f1100127ed0)], [t3.order_complete_time(0x7f1100131410)], [t3.order_parent_id(0x7f110017d3d0)], [t3.order_type(0x7f110017e2e0)], [t3.customer_type(0x7f11001d8870)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.trader_name(0x7f11001e3320)], [t3.comment(0x7f11001e3bd0)]), filter([t3.order_complete_time(0x7f1100131410) >= cast('2024-11-01 00:00:00', TIMESTAMP(-1, -1))(0x7f1100131c20)(0x7f110012f9d0)], [t3.order_complete_time(0x7f1100131410) <= cast('2024-11-18 23:59:59', TIMESTAMP(-1, -1))(0x7f1100132ca0)(0x7f1100130250)], [t3.order_state(0x7f1100127ed0) IN (3, 9)(0x7f116c12c480)(0x7f1100125fd0)], [t3.is_delete(0x7f110012b080) = 0(0x7f110012a7c0)]), rowset=256 access([t3.id(0x7f11244c2ff0)], [t3.order_id(0x7f11001031b0)], [t3.user_id(0x7f1100109060)], [t3.area_id(0x7f110010cb00)], [t3.order_state(0x7f1100127ed0)], [t3.is_delete(0x7f110012b080)], [t3.order_complete_time(0x7f1100131410)], [t3.order_parent_id(0x7f110017d3d0)], [t3.order_type(0x7f110017e2e0)], [t3.customer_type(0x7f11001d8870)], [t3.contract_name(0x7f11001e21c0)], [t3.contract_mobile(0x7f11001e2a70)], [t3.trader_name(0x7f11001e3320)], [t3.comment(0x7f11001e3bd0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false,false], range_key([t3.area_id(0x7f110010cb00)], [t3.id(0x7f11244c2ff0)]), range(216,MIN ; 216,MAX), range_cond([t3.area_id(0x7f110010cb00) = 216(0x7f11218df590)]) 116 - output([t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)]), filter(nil), rowset=256 117 - output([t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)]), filter(nil), rowset=256 equal_conds([t40.id(0x7f1100123950) = t8.accounting_body_id(0x7f1100123d90)(0x7f1100123090)]), other_conds(nil) merge_directions([ASC]) 118 - output([t8.accounting_body_id(0x7f1100123d90)]), filter(nil), rowset=256 access([t8.accounting_body_id(0x7f1100123d90)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f110010cf40)]), range[216 ; 216], range_cond([t8.id(0x7f110010cf40) = 216(0x7f11218e0430)]) 119 - output([t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)]), filter(nil), rowset=256 access([t40.id(0x7f1100123950)], [t40.name(0x7f1100179c30)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t40.id(0x7f1100123950)]), range(MIN ; MAX)always true 120 - output([t36.order_id(0x7f1100125920)], [t36.aux_sale_man_names(0x7f11001e78d0)]), filter(nil), rowset=256 access([t36.order_id(0x7f1100125920)], [t36.aux_sale_man_names(0x7f11001e78d0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.id(0x7f11244c4530)]), range(MIN ; MAX)always true 121 - output([t5.user_type(0x7f11001d7fc0)], [t5.real_name(0x7f11001dd010)], [t5.user_mobile(0x7f11001e1910)]), filter([t5.is_delete(0x7f110012c8e0) = 0(0x7f110012c020)]), rowset=256 access([GROUP_ID(0x7f11ab13bf60)], [t5.is_delete(0x7f110012c8e0)], [t5.user_type(0x7f11001d7fc0)], [t5.real_name(0x7f11001dd010)], [t5.user_mobile(0x7f11001e1910)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f1100108c20)]), range(MIN ; MAX), range_cond([t5.id(0x7f1100108c20) = :121(0x7f11218e12d0)]) 122 - output([t2.id(0x7f11000fda70)], [t2.ppid(0x7f1100104d40)], [t2.is_mobile(0x7f110012e140)], [t2.jiuxun_service_flag(0x7f11001444d0)], [t2.jiuxun_service_cost_price(0x7f1100144910)], [t2.in_price(0x7f1100144d50)], [t2.statictisc_price(0x7f1100159c10)], [t2.gift_price(0x7f110015a050)], [t2.virtual_product(0x7f110015a490)], [t2.counts(0x7f110015a8d0)], [t2.examine_price(0x7f110016c3f0)], [t2.detail_type(0x7f110018cd80)], [t2.price(0x7f1100197d50)], [t2.sell_price(0x7f110019bab0)], [t2.discount_price(0x7f11001a3130)], [t2.point_price(0x7f11001a6e90)], [t2.in_user_id(0x7f11001d4730)], [t2.in_user_name(0x7f11001d4fe0)], [t2.comment(0x7f11001e4480)], [t2.detail_parent_id(0x7f11001e5a50)]), filter([t2.is_mobile(0x7f110 012e140) = 0(0x7f110012d880)], [t2.is_delete(0x7f1100129820) = 0(0x7f1100128f60)], [t2.product_stock_type(0x7f110013c020) IN (0, 1, 2, 6)(0x7f116c12cec0)(0x7f1100137530)]), rowset=256 access([GROUP_ID(0x7f11ab143500)], [t2.id(0x7f11000fda70)], [t2.ppid(0x7f1100104d40)], [t2.is_delete(0x7f1100129820)], [t2.is_mobile(0x7f110012e140)], [t2.product_stock_type(0x7f110013c020)], [t2.jiuxun_service_flag(0x7f11001444d0)], [t2.jiuxun_service_cost_price(0x7f1100144910)], [t2.in_price(0x7f1100144d50)], [t2.statictisc_price(0x7f1100159c10)], [t2.gift_price(0x7f110015a050)], [t2.virtual_product(0x7f110015a490)], [t2.counts(0x7f110015a8d0)], [t2.examine_price(0x7f110016c3f0)], [t2.detail_type(0x7f110018cd80)], [t2.price(0x7f1100197d50)], [t2.sell_price(0x7f110019bab0)], [t2.discount_price(0x7f11001a3130)], [t2.point_price(0x7f11001a6e90)], [t2.in_user_id(0x7f11001d4730)], [t2.in_user_name(0x7f11001d4fe0)], [t2.comment(0x7f11001e4480)], [t2.detail_parent_id(0x7f11001e5a50)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t2.order_id(0x7f1100102d70)], [t2.id(0x7f11000fda70)]), range(MIN ; MAX), range_cond([t2.order_id(0x7f1100102d70) = :115(0x7f11218e1ce0)]) 123 - output([t17.bind_order_detail_id(0x7f1100110680)]), filter([t17.is_delete(0x7f1100111ee0) = 0(0x7f1100111620)]), rowset=256 access([t17.bind_order_detail_id(0x7f1100110680)], [t17.is_delete(0x7f1100111ee0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t17.id(0x7f11244c3870)]), range(MIN ; MAX)always true 124 - output([t16.order_detail_id(0x7f110010eae0)], [t16.channel(0x7f110018f250)]), filter(nil), rowset=256 access([t16.order_detail_id(0x7f110010eae0)], [t16.channel(0x7f110018f250)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t16.id(0x7f11244c3430)]), range(MIN ; MAX)always true 125 - output([t4.productid(0x7f1100115600)], [t4.bar_code(0x7f110018fb00)], [t4.product_color(0x7f11001d5890)], [t4.cid(0x7f11001d65b0)], [t4.brand_id(0x7f11001d6e60)], [t4.product_name(0x7f11001d7710)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab153150)], [t4.productid(0x7f1100115600)], [t4.bar_code(0x7f110018fb00)], [t4.product_color(0x7f11001d5890)], [t4.cid(0x7f11001d65b0)], [t4.brand_id(0x7f11001d6e60)], [t4.product_name(0x7f11001d7710)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f1100105180)]), range(MIN ; MAX), range_cond([:116 = t4.ppriceid(0x7f1100105180)(0x7f11218e26f0)]) 126 - output([vpcc.in_source_id(0x7f110018e920)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab15b140)], [vpcc.in_source_id(0x7f110018e920)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([vpcc.id(0x7f1100121db0)]), range(MIN ; MAX), range_cond([:119 = vpcc.id(0x7f1100121db0)(0x7f11218e3100)]) 127 - output([t1.serial_number_mark(0x7f110011e570)], [t1.statistics_price(0x7f1100143c50)], [t1.counts(0x7f1100144090)], [t1.inprice(0x7f110014c6c0)], [t1.examine_price(0x7f110016bfb0)], [t1.insource_id(0x7f110018e4e0)], [t1.modify_price(0x7f11001d3800)], [t1.sample_product(0x7f11001e8180)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab15d400)], [t1.id(0x7f11000fc050)], [t1.serial_number_mark(0x7f110011e570)], [t1.statistics_price(0x7f1100143c50)], [t1.counts(0x7f1100144090)], [t1.inprice(0x7f110014c6c0)], [t1.examine_price(0x7f110016bfb0)], [t1.insource_id(0x7f110018e4e0)], [t1.modify_price(0x7f11001d3800)], [t1.sample_product(0x7f11001e8180)]), partitions(p[0-9]) is_index_back=true, is_global_index=false, range_key([t1.order_detail_id(0x7f11000fd630)], [t1.order_detail_type(0x7f11000ff2d0)], [t1.id(0x7f11000fc050)]), range(MIN ; MAX), range_cond([t1.order_detail_type(0x7f11000ff2d0) = 1(0x7f11218e3b10)], [t1.order_detail_id(0x7f11000fd630) = :113(0x7f11218e49b0)]) 128 - output([cast(0, DECIMAL_INT(53, 2))(0x7f1119959bb0) - T_FUN_SUM(IFNULL(IFNULL(t1.statistics_price(0x7f11198b0b30) * cast(t1.counts(0x7f11198b0f70), DECIMAL_INT(20, 0))(0x7f1119956560)(0x7f11198ab2a0), cast(CASE WHEN NULL = 1(0x7f11198ad660) AND t2.jiuxun_service_flag(0x7f11198b13b0) = 1(0x7f11198ae7d0)(0x7f11198ac4c0) THEN t2.jiuxun_service_cost_price(0x7f11198b17f0) ELSE t2.in_price(0x7f11198b1c30) END(0x7f11198abb20), DECIMAL_INT(30, 2))(0x7f1119957a50))(0x7f11198aa120), cast(0, DECIMAL_INT(30, 2))(0x7f1119958b20))(0x7f11198a9860))(0x7f11198a9350)(0x7f11198b0070)], [cast(0, DECIMAL_INT(53, 2))(0x7f111995e980) - T_FUN_SUM(IFNULL(IFNULL(t1.inprice(0x7f11198ba370) * cast(t1.counts(0x7f11198b0f70), DECIMAL_INT(20, 0))(0x7f111995b330)(0x7f11198b4ae0), cast(CASE WHEN NULL = 1(0x7f11198b6ea0) AND t2.jiuxun_service_flag(0x7f11198b13b0) = 1(0x7f11198b8010)(0x7f11198b5d00) THEN t2.jiuxun_service_cost_price(0x7f11198b17f0) ELSE t2.in_price(0x7f11198b1c30) END(0x7f11198b5360), DECIMAL_INT(30, 2))(0x7f111995c820))(0x7f11198b3960), cast(0, DECIMAL_INT(30, 2))(0x7f111995d8f0))(0x7f11198b30a0))(0x7f11198b2b90)(0x7f11198b98b0)], [cast(0, DECIMAL(1, 0))(0x7f1119963a90) - t6.return_price(0x7f11198c7c60) * cast(t6.return_count(0x7f11198c80a0), DECIMAL(11, 0))(0x7f1119960380)(0x7f11198be050) * cast(T_FUN_COUNT(t2.id(0x7f11198462a0))(0x7f11198be8d0), DECIMAL(20, 0))(0x7f1119961410)(0x7f11198bf240) - cast(T_FUN_SUM(IFNULL(IFNULL(t1.statistics_price(0x7f11198b0b30) * cast(t1.counts(0x7f11198b0f70), DECIMAL_INT(20, 0))(0x7f1119956560)(0x7f11198ab2a0), cast(CASE WHEN NULL = 1(0x7f11198ad660) AND t2.jiuxun_service_flag(0x7f11198b13b0) = 1(0x7f11198ae7d0)(0x7f11198ac4c0) THEN t2.jiuxun_service_cost_price(0x7f11198b17f0) ELSE t2.in_price(0x7f11198b1c30) END(0x7f11198abb20), DECIMAL_INT(30, 2))(0x7f1119957a50))(0x7f11198aa120), cast(0, DECIMAL_INT(30, 2))(0x7f1119958b20))(0x7f11198a9860))(0x7f11198a9350), DECIMAL(52, 2))(0x7f11199625c0)(0x7f11198c6840)(0x7f11198c70c0)], [cast(0, DECIMAL(1, 0))(0x7f1119966d10) - t6.return_price(0x7f11198c7c60) * cast(t6.return_count(0x7f11198c80a0), DECIMAL(11, 0))(0x7f1119960380)(0x7f11198be050) * cast(T_FUN_COUNT(t2.id(0x7f11198462a0))(0x7f11198be8d0), DECIMAL(20, 0))(0x7f1119961410)(0x7f11198bf240) - cast(T_FUN_SUM(IFNULL(IFNULL(t1.inprice(0x7f11198ba370) * cast(t1.counts(0x7f11198b0f70), DECIMAL_INT(20, 0))(0x7f111995b330)(0x7f11198b4ae0), cast(CASE WHEN NULL = 1(0x7f11198b6ea0) AND t2.jiuxun_service_flag(0x7f11198b13b0) = 1(0x7f11198b8010)(0x7f11198b5d00) THEN t2.jiuxun_service_cost_price(0x7f11198b17f0) ELSE t2.in_price(0x7f11198b1c30) END(0x7f11198b5360), DECIMAL_INT(30, 2))(0x7f111995c820))(0x7f11198b3960), cast(0, DECIMAL_INT(30, 2))(0x7f111995d8f0))(0x7f11198b30a0))(0x7f11198b2b90), DECIMAL(52, 2))(0x7f1119965840)(0x7f11198d2290)(0x7f11198d2b10)], [cast(0, DECIMAL_INT(53, 2))(0x7f111996b2f0) - T_FUN_SUM(IFNULL(IFNULL(t1.examine_price(0x7f11198d80b0) * cast(t1.counts(0x7f11198b0f70), DECIMAL_INT(20, 0))(0x7f1119968480)(0x7f11198d6300), cast(t2.examine_price(0x7f11198d84f0), DECIMAL_INT(30, 2))(0x7f1119969370))(0x7f11198d5180), cast(0, DECIMAL_INT(30, 2))(0x7f111996a260))(0x7f11198d48c0))(0x7f11198d43b0)(0x7f11198d7710)], [cast(0, DECIMAL(1, 0))(0x7f111996df20) - t6.return_price(0x7f11198c7c60) * cast(t6.return_count(0x7f11198c80a0), DECIMAL(11, 0))(0x7f1119960380)(0x7f11198be050) * cast(T_FUN_COUNT(t2.id(0x7f11198462a0))(0x7f11198be8d0), DECIMAL(20, 0))(0x7f1119961410)(0x7f11198bf240) - cast(T_FUN_SUM(IFNULL(IFNULL(t1.examine_price(0x7f11198d80b0) * cast(t1.counts(0x7f11198b0f70), DECIMAL_INT(20, 0))(0x7f1119968480)(0x7f11198d6300), cast(t2.examine_price(0x7f11198d84f0), DECIMAL_INT(30, 2))(0x7f1119969370))(0x7f11198d5180), cast(0, DECIMAL_INT(30, 2))(0x7f111996a260))(0x7f11198d48c0))(0x7f11198d43b0), DECIMAL(52, 2))(0x7f111996cc30)(0x7f11198de7b0)(0x7f11198df030)], [t2.is_mobile(0x7f111989c560)], [t7.check2_time(0x7f111989f830)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [ifnull(t3.order_parent_id(0x7f11198e35f0), t3.order_id(0x7f111984b9e0))(0x7f11198e22e0)], ['退款'], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [IFNULL(t1.insource_id(0x7f11198f45c0), vpcc.in_source_id(0x7f11198f4a00))(0x7f11198f32b0)], [t16.channel(0x7f11198f5330)], [t4.bar_code(0x7f11198f5be0)], [cast(0 - T_FUN_COUNT(t2.id(0x7f11198462a0))(0x7f11198be8d0) * t6.return_count(0x7f11198c80a0)(0x7f11198f8e50)(0x7f11198f96d0), DECIMAL_INT(42, 0))(0x7f111998d850)], [cast(0, DECIMAL_INT(46, 2))(0x7f1119971bf0) - t2.price(0x7f11198ff2a0) * cast(T_FUN_COUNT(t2.id(0x7f11198462a0))(0x7f11198be8d0), DECIMAL_INT(20, 0))(0x7f111996fab0)(0x7f11198fd3e0) * cast(t6.return_count(0x7f11198c80a0), DECIMAL_INT(11, 0))(0x7f1119970b60)(0x7f11198fe0c0)(0x7f11198fe940)], [cast(0, DECIMAL_INT(46, 2))(0x7f1119975120) - t2.sell_price(0x7f11199029f0) * cast(T_FUN_COUNT(t2.id(0x7f11198462a0))(0x7f11198be8d0), DECIMAL_INT(20, 0))(0x7f1119972fe0)(0x7f1119900b30) * cast(t6.return_count(0x7f11198c80a0), DECIMAL_INT(11, 0))(0x7f1119974090)(0x7f1119901810)(0x7f1119902090)], [cast(0, DECIMAL_INT(44, 4))(0x7f111997a670) - t2.gift_price(0x7f1119906140) * cast(T_FUN_COUNT(t2.id(0x7f11198462a0))(0x7f11198be8d0), DECIMAL_INT(20, 0))(0x7f1119978530)(0x7f1119904280) * cast(t6.return_count(0x7f11198c80a0), DECIMAL_INT(11, 0))(0x7f11199795e0)(0x7f1119904f60)(0x7f11199057e0)], [cast(0, DECIMAL_INT(44, 4))(0x7f111997dba0) - t2.discount_price(0x7f1119909890) * cast(T_FUN_COUNT(t2.id(0x7f11198462a0))(0x7f11198be8d0), DECIMAL_INT(20, 0))(0x7f111997ba60)(0x7f11199079d0) * cast(t6.return_count(0x7f11198c80a0), DECIMAL_INT(11, 0))(0x7f111997cb10)(0x7f11199086b0)(0x7f1119908f30)], [cast(0, DECIMAL_INT(44, 4))(0x7f11199810d0) - t2.point_price(0x7f111990cfe0) * cast(T_FUN_COUNT(t2.id(0x7f11198462a0))(0x7f11198b e8d0), DECIMAL_INT(20, 0))(0x7f111997ef90)(0x7f111990b120) * cast(t6.return_count(0x7f11198c80a0), DECIMAL_INT(11, 0))(0x7f1119980040)(0x7f111990be00)(0x7f111990c680)], [cast(0, DECIMAL(1, 0))(0x7f1119984600) - t6.return_price(0x7f11198c7c60) * cast(T_FUN_COUNT(t2.id(0x7f11198462a0))(0x7f11198be8d0), DECIMAL(20, 0))(0x7f11199824c0)(0x7f111990e870) * cast(t6.return_count(0x7f11198c80a0), DECIMAL(11, 0))(0x7f1119983570)(0x7f111990f550)(0x7f111990fdd0)], [cast(0, DECIMAL_INT(45, 2))(0x7f1119987790) - T_FUN_SUM(IFNULL(cast(t1.modify_price(0x7f1119931400), DECIMAL_INT(22, 2))(0x7f1119985810), cast(0, DECIMAL_INT(22, 2))(0x7f1119986700))(0x7f111992f7e0))(0x7f111992f2d0)(0x7f1119930ae0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t4.product_color(0x7f1119933450)], [t4.productid(0x7f111987ccf0)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)], [t5.user_type(0x7f111993f430)], [t3.customer_type(0x7f111993fce0)], [CASE WHEN t3.order_type(0x7f11198e43c0) = 3(0x7f1119941c40) OR t3.order_type(0x7f11198e43c0) = 4(0x7f1119942db0)(0x7f1119940ad0) THEN t11.special_username(0x7f1119944040) ELSE t5.real_name(0x7f1119944480) END(0x7f1119940130)], [t5.user_mobile(0x7f1119944f70)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t7.comment(0x7f1119947230)], [t2.comment(0x7f1119947ae0)], [la.id(0x7f1119882d70)], [la.label_name(0x7f1119948800)], [t2.detail_parent_id(0x7f11199490b0)], [sysc.name(0x7f1119949960)], [sysc.value(0x7f111994a210)], [sysc.id(0x7f11198865a0)], [t36.aux_sale_man_names(0x7f111994af30)], [t1.sample_product(0x7f111994b7e0)]), filter([ifnull(t3.order_parent_id( 0x7f11198e35f0), t3.order_id(0x7f111984b9e0))(0x7f11198e22e0) IS NOT NULL(0x7f139612b040)]), rowset=256 group([t2.id(0x7f11198462a0)], [t1.insource_id(0x7f11198f45c0)], [t6.return_price(0x7f11198c7c60)], [t6.return_count(0x7f11198c80a0)], [t7.check2_time(0x7f111989f830)], [t7.check2_user_name(0x7f11199514b0)], [t7.comment(0x7f1119947230)], [la.id(0x7f1119882d70)], [la.label_name(0x7f1119948800)], [sysc.name(0x7f1119949960)], [sysc.value(0x7f111994a210)], [sysc.id(0x7f11198865a0)], [t36.aux_sale_man_names(0x7f111994af30)], [t1.sample_product(0x7f111994b7e0)]), agg_func([T_FUN_SUM(IFNULL(IFNULL(t1.statistics_price(0x7f11198 b0b30) * cast(t1.counts(0x7f11198b0f70), DECIMAL_INT(20, 0))(0x7f1119956560)(0x7f11198ab2a0), cast(CASE WHEN NULL = 1(0x7f11198ad660) AND t2.jiuxun_service_flag(0x7f11198b13b0) = 1(0x7f11198ae7d0)(0x7f11198ac4c0) THEN t2.jiuxun_service_cost_price(0x7f11198b17f0) ELSE t2.in_price(0x7f11198b1c30) END(0x7f11198abb20), DECIMAL_INT(30, 2))(0x7f1119957a50))(0x7f11198aa120), cast(0, DECIMAL_INT(30, 2))(0x7f1119958b20))(0x7f11198a9860))(0x7f11198a9350)], [T_FUN_SUM(IFNULL(IFNULL(t1.inprice(0x7f11198ba370) * cast(t1.counts(0x7f11198b0f70), DECIMAL_INT(20, 0))(0x7f111995b330)(0x7f11198b4ae0), cast(CASE WHEN NULL = 1(0x7f11198b6ea0) AND t2.jiuxun_service_flag(0x7f11198b13b0) = 1(0x7f11198b8010)(0x7f11198b5d00) THEN t2.jiuxun_service_cost_price(0x7f11198b17f0) ELSE t2.in_price(0x7f11198b1c30) END(0x7f11198b5360), DECIMAL_INT(30, 2))(0x7f111995c820))(0x7f11198b3960), cast(0, DECIMAL_INT(30, 2))(0x7f111995d8f0))(0x7f11198b30a0))(0x7f11198b2b90)], [T_FUN_COUNT(t2.id(0x7f11198462a0))(0x7f11198be8d0)], [T_FUN_SUM(IFNULL(IFNULL(t1.examine_price(0x7f11198d80b0) * cast(t1.counts(0x7f11198b0f70), DECIMAL_INT(20, 0))(0x7f1119968480)(0x7f11198d6300), cast(t2.examine_price(0x7f11198d84f0), DECIMAL_INT(30, 2))(0x7f1119969370))(0x7f11198d5180), cast(0, DECIMAL_INT(30, 2))(0x7f111996a260))(0x7f11198d48c0))(0x7f11198d43b0)], [T_FUN_SUM(IFNULL(cast(t1.modify_price(0x7f1119931400), DECIMAL_INT(22, 2))(0x7f1119985810), cast(0, DECIMAL_INT(22, 2))(0x7f1119986700))(0x7f111992f7e0))(0x7f111992f2d0)]) 129 - output([t2.id(0x7f11198462a0)], [t1.insource_id(0x7f11198f45c0)], [t6.return_price(0x7f11198c7c60)], [t6.return_count(0x7f11198c80a0)], [t7.check2_time(0x7f111989f830)], [t7.check2_user_name(0x7f11199514b0)], [t7.comment(0x7f1119947230)], [la.id(0x7f1119882d70)], [la.label_name(0x7f1119948800)], [sysc.name(0x7f1119949960)], [sysc.value(0x7f111994a210)], [sysc.id(0x7f11198865a0)], [t36.aux_sale_man_names(0x7f111994af30)], [t1.sample_product(0x7f111994b7e0)], [t1.counts(0x7f11198b0f70)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.is_mobile(0x7f111989c560)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [ifnull(t3.order_parent_id(0x7f11198e35f0), t3.order_id(0x7f111984b9e0))(0x7f11198e22e0)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [t16.channel(0x7f11198f5330)], [t4.bar_code(0x7f11198f5be0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t4.product_color(0x7f1119933450)], [t4.productid(0x7f111987ccf0)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)], [t5.user_type(0x7f111993f430)], [t3.customer_type(0x7f111993fce0)], [t5.user_mobile(0x7f1119944f70)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)], [t11.special_username(0x7f1119944040)], [t2.examine_price(0x7f11198d84f0)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)], [t5.real_name(0x7f1119944480)], [vpcc.in_source_id(0x7f11198f4a00)], [t1.statistics_price(0x7f11198b0b30)], [t1.inprice(0x7f11198ba370)], [t1.examine_price(0x7f11198d80b0)], [t1.modify_price(0x7f1119931400)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f111984b9e0)(:143)]), use_batch=true 130 - output([t2.id(0x7f11198462a0)], [t1.insource_id(0x7f11198f45c0)], [t6.return_price(0x7f11198c7c60)], [t6.return_count(0x7f11198c80a0)], [t7.check2_time(0x7f111989f830)], [t7.check2_user_name(0x7f11199514b0)], [t7.comment(0x7f1119947230)], [la.id(0x7f1119882d70)], [la.label_name(0x7f1119948800)], [sysc.name(0x7f1119949960)], [sysc.value(0x7f111994a210)], [sysc.id(0x7f11198865a0)], [t1.sample_product(0x7f111994b7e0)], [t1.counts(0x7f11198b0f70)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.is_mobile(0x7f111989c560)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [t16.channel(0x7f11198f5330)], [t4.bar_code(0x7f11198f5be0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t4.product_color(0x7f1119933450)], [t4.productid(0x7f111987ccf0)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)], [t5.user_type(0x7f111993f430)], [t3.customer_type(0x7f111993fce0)], [t5.user_mobile(0x7f1119944f70)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)], [t3.order_id(0x7f111984b9e0)], [t11.special_username(0x7f1119944040)], [t3.order_parent_id(0x7f11198e35f0)], [t2.examine_price(0x7f11198d84f0)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)], [t5.real_name(0x7f1119944480)], [vpcc.in_source_id(0x7f11198f4a00)], [t1.statistics_price(0x7f11198b0b30)], [t1.inprice(0x7f11198ba370)], [t1.examine_price(0x7f11198d80b0)], [t1.modify_price(0x7f1119931400)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.serial_number_mark(0x7f1119886160)(:139)]), use_batch=true 131 - output([t2.id(0x7f11198462a0)], [t1.insource_id(0x7f11198f45c0)], [t6.return_price(0x7f11198c7c60)], [t6.return_count(0x7f11198c80a0)], [t7.check2_time(0x7f111989f830)], [t7.check2_user_name(0x7f11199514b0)], [t7.comment(0x7f1119947230)], [la.id(0x7f1119882d70)], [la.label_name(0x7f1119948800)], [t1.sample_product(0x7f111994b7e0)], [t1.counts(0x7f11198b0f70)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.is_mobile(0x7f111989c560)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [t16.channel(0x7f11198f5330)], [t4.bar_code(0x7f11198f5be0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t4.product_color(0x7f1119933450)], [t4.productid(0x7f111987ccf0)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)], [t5.user_type(0x7f111993f430)], [t3.customer_type(0x7f111993fce0)], [t5.user_mobile(0x7f1119944f70)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)], [t3.order_id(0x7f111984b9e0)], [t1.serial_number_mark(0x7f1119886160)], [t11.special_username(0x7f1119944040)], [t3.order_parent_id(0x7f11198e35f0)], [t2.examine_price(0x7f11198d84f0)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)], [t5.real_name(0x7f1119944480)], [vpcc.in_source_id(0x7f11198f4a00)], [t1.statistics_price(0x7f11198b0b30)], [t1.inprice(0x7f11198ba370)], [t1.examine_price(0x7f11198d80b0)], [t1.modify_price(0x7f1119931400)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f11198462a0)(:137)]), use_batch=true 132 - output([t2.id(0x7f11198462a0)], [t1.insource_id(0x7f11198f45c0)], [t6.return_price(0x7f11198c7c60)], [t6.return_count(0x7f11198c80a0)], [t7.check2_time(0x7f111989f830)], [t7.check2_user_name(0x7f11199514b0)], [t7.comment(0x7f1119947230)], [la.id(0x7f1119882d70)], [la.label_name(0x7f1119948800)], [t1.sample_product(0x7f111994b7e0)], [t1.counts(0x7f11198b0f70)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.is_mobile(0x7f111989c560)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [t16.channel(0x7f11198f5330)], [t4.bar_code(0x7f11198f5be0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t4.product_color(0x7f1119933450)], [t4.productid(0x7f111987ccf0)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)], [t5.user_type(0x7f111993f430)], [t3.customer_type(0x7f111993fce0)], [t5.user_mobile(0x7f1119944f70)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)], [t3.order_id(0x7f111984b9e0)], [t1.serial_number_mark(0x7f1119886160)], [t11.special_username(0x7f1119944040)], [t3.order_parent_id(0x7f11198e35f0)], [t2.examine_price(0x7f11198d84f0)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)], [t5.real_name(0x7f1119944480)], [vpcc.in_source_id(0x7f11198f4a00)], [t1.statistics_price(0x7f11198b0b30)], [t1.inprice(0x7f11198ba370)], [t1.examine_price(0x7f11198d80b0)], [t1.modify_price(0x7f1119931400)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f11198462a0)(:136)]), use_batch=true 133 - output([t2.id(0x7f11198462a0)], [t1.insource_id(0x7f11198f45c0)], [t6.return_price(0x7f11198c7c60)], [t6.return_count(0x7f11198c80a0)], [t7.check2_time(0x7f111989f830)], [t7.check2_user_name(0x7f11199514b0)], [t7.comment(0x7f1119947230)], [la.id(0x7f1119882d70)], [la.label_name(0x7f1119948800)], [t1.sample_product(0x7f111994b7e0)], [t1.counts(0x7f11198b0f70)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.is_mobile(0x7f111989c560)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [t4.bar_code(0x7f11198f5be0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t4.product_color(0x7f1119933450)], [t4.productid(0x7f111987ccf0)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)], [t5.user_type(0x7f111993f430)], [t3.customer_type(0x7f111993fce0)], [t5.user_mobile(0x7f1119944f70)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)], [t3.order_id(0x7f111984b9e0)], [t1.serial_number_mark(0x7f1119886160)], [t11.special_username(0x7f1119944040)], [t3.order_parent_id(0x7f11198e35f0)], [t2.examine_price(0x7f11198d84f0)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)], [t5.real_name(0x7f1119944480)], [vpcc.in_source_id(0x7f11198f4a00)], [t1.statistics_price(0x7f11198b0b30)], [t1.inprice(0x7f11198ba370)], [t1.examine_price(0x7f11198d80b0)], [t1.modify_price(0x7f1119931400)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f11198462a0)(:130)]), use_batch=true 134 - output([t2.id(0x7f11198462a0)], [t6.return_price(0x7f11198c7c60)], [t6.return_count(0x7f11198c80a0)], [t7.check2_time(0x7f111989f830)], [t7.check2_user_name(0x7f11199514b0)], [t7.comment(0x7f1119947230)], [la.id(0x7f1119882d70)], [la.label_name(0x7f1119948800)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.is_mobile(0x7f111989c560)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [t4.bar_code(0x7f11198f5be0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t4.product_color(0x7f1119933450)], [t4.productid(0x7f111987ccf0)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)], [t5.user_type(0x7f111993f430)], [t3.customer_type(0x7f111993fce0)], [t5.user_mobile(0x7f1119944f70)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)], [t3.order_id(0x7f111984b9e0)], [t11.special_username(0x7f1119944040)], [t3.order_parent_id(0x7f11198e35f0)], [t2.examine_price(0x7f11198d84f0)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)], [t5.real_name(0x7f1119944480)], [vpcc.in_source_id(0x7f11198f4a00)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f11198462a0)(:138)]), use_batch=true 135 - output([t2.id(0x7f11198462a0)], [t6.return_price(0x7f11198c7c60)], [t6.return_count(0x7f11198c80a0)], [t7.check2_time(0x7f111989f830)], [t7.check2_user_name(0x7f11199514b0)], [t7.comment(0x7f1119947230)], [la.id(0x7f1119882d70)], [la.label_name(0x7f1119948800)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.is_mobile(0x7f111989c560)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [t4.bar_code(0x7f11198f5be0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t4.product_color(0x7f1119933450)], [t4.productid(0x7f111987ccf0)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)], [t5.user_type(0x7f111993f430)], [t3.customer_type(0x7f111993fce0)], [t5.user_mobile(0x7f1119944f70)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)], [t3.order_id(0x7f111984b9e0)], [t11.special_username(0x7f1119944040)], [t3.order_parent_id(0x7f11198e35f0)], [t2.examine_price(0x7f11198d84f0)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)], [t5.real_name(0x7f1119944480)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f1119851890)(:140)]), use_batch=true 136 - output([t2.id(0x7f11198462a0)], [t6.return_price(0x7f11198c7c60)], [t6.return_count(0x7f11198c80a0)], [t7.check2_time(0x7f111989f830)], [t7.check2_user_name(0x7f11199514b0)], [t7.comment(0x7f1119947230)], [la.id(0x7f1119882d70)], [la.label_name(0x7f1119948800)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.is_mobile(0x7f111989c560)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [t4.bar_code(0x7f11198f5be0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t4.product_color(0x7f1119933450)], [t4.productid(0x7f111987ccf0)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)], [t3.customer_type(0x7f111993fce0)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)], [t3.order_id(0x7f111984b9e0)], [t11.special_username(0x7f1119944040)], [t3.order_parent_id(0x7f11198e35f0)], [t2.examine_price(0x7f11198d84f0)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)]), filter(nil), rowset=256 conds(nil), nl_params_([t6.return_id(0x7f1119870310)(:145)]), use_batch=true 137 - output([t2.id(0x7f11198462a0)], [t6.return_price(0x7f11198c7c60)], [t6.return_count(0x7f11198c80a0)], [la.id(0x7f1119882d70)], [la.label_name(0x7f1119948800)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.is_mobile(0x7f111989c560)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [t4.bar_code(0x7f11198f5be0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t4.product_color(0x7f1119933450)], [t4.productid(0x7f111987ccf0)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)], [t3.customer_type(0x7f111993fce0)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)], [t3.order_id(0x7f111984b9e0)], [t6.return_id(0x7f1119870310)], [t11.special_username(0x7f1119944040)], [t3.order_parent_id(0x7f11198e35f0)], [t2.examine_price(0x7f11198d84f0)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)]), filter(nil), rowset=256 equal_conds([t2.id(0x7f11198462a0) = t6.order_detail_id(0x7f111986e780)(0x7f111986dec0)]), other_conds(nil) 138 - output([t2.id(0x7f11198462a0)], [la.id(0x7f1119882d70)], [la.label_name(0x7f1119948800)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.is_mobile(0x7f111989c560)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [t4.bar_code(0x7f11198f5be0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t4.product_color(0x7f1119933450)], [t4.productid(0x7f111987ccf0)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)], [t3.customer_type(0x7f111993fce0)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)], [t3.order_id(0x7f111984b9e0)], [t11.special_username(0x7f1119944040)], [t3.order_parent_id(0x7f11198e35f0)], [t2.examine_price(0x7f11198d84f0)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)]), filter(nil), rowset=256 equal_conds([pl.label_id(0x7f1119882930) = la.id(0x7f1119882d70)(0x7f1119882070)]), other_conds(nil) 139 - output([la.id(0x7f1119882d70)], [la.label_name(0x7f1119948800)]), filter([la.is_delete(0x7f11198845d0) = 0(0x7f1119883d10)]), rowset=256 access([la.id(0x7f1119882d70)], [la.is_delete(0x7f11198845d0)], [la.label_name(0x7f1119948800)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([la.id(0x7f1119882d70)]), range(MIN ; MAX)always true 140 - output([t2.id(0x7f11198462a0)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.is_mobile(0x7f111989c560)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [t4.bar_code(0x7f11198f5be0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t4.product_color(0x7f1119933450)], [t4.productid(0x7f111987ccf0)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)], [t3.customer_type(0x7f111993fce0)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)], [t3.order_id(0x7f111984b9e0)], [pl.label_id(0x7f1119882930)], [t11.special_username(0x7f1119944040)], [t3.order_parent_id(0x7f11198e35f0)], [t2.examine_price(0x7f11198d84f0)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f111987ccf0) = pl.product_id(0x7f111987d130)(0x7f111987c430)]), other_conds(nil) 141 - output([pl.product_id(0x7f111987d130)], [pl.label_id(0x7f1119882930)]), filter([pl.is_delete(0x7f1119880da0) = 0(0x7f11198804e0)]), rowset=256 access([pl.product_id(0x7f111987d130)], [pl.is_delete(0x7f1119880da0)], [pl.label_id(0x7f1119882930)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f11244de350)]), range(MIN ; MAX)always true 142 - output([t2.id(0x7f11198462a0)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.is_mobile(0x7f111989c560)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [t4.bar_code(0x7f11198f5be0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t4.product_color(0x7f1119933450)], [t4.productid(0x7f111987ccf0)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)], [t3.customer_type(0x7f111993fce0)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)], [t3.order_id(0x7f111984b9e0)], [t11.special_username(0x7f1119944040)], [t3.order_parent_id(0x7f11198e35f0)], [t2.examine_price(0x7f11198d84f0)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.ppid(0x7f111984d570)(:133)]), use_batch=true 143 - output([t2.id(0x7f11198462a0)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.is_mobile(0x7f111989c560)], [t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t2.ppid(0x7f111984d570)], [t2.detail_type(0x7f11198f2e60)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t3.customer_type(0x7f111993fce0)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)], [t3.order_id(0x7f111984b9e0)], [t11.special_username(0x7f1119944040)], [t3.order_parent_id(0x7f11198e35f0)], [t2.examine_price(0x7f11198d84f0)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f111984b9e0)(:132)]), use_batch=true 144 - output([t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t3.customer_type(0x7f111993fce0)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t3.order_id(0x7f111984b9e0)], [t11.special_username(0x7f1119944040)], [t3.order_parent_id(0x7f11198e35f0)]), filter(nil), rowset=256 equal_conds([t11.user_id(0x7f111987b160) = t3.user_id(0x7f1119851890)(0x7f111987a8a0)]), other_conds(nil) 145 - output([t11.user_id(0x7f111987b160)], [t11.special_username(0x7f1119944040)]), filter(nil), rowset=256 access([t11.user_id(0x7f111987b160)], [t11.special_username(0x7f1119944040)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t11.id(0x7f11244ddf10)]), range(MIN ; MAX)always true 146 - output([t3.order_complete_time(0x7f11198e0d00)], [t3.area_id(0x7f11198722e0)], [t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)], [t3.order_type(0x7f11198e43c0)], [t3.user_id(0x7f1119851890)], [t3.customer_type(0x7f111993fce0)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)], [t3.order_id(0x7f111984b9e0)], [t3.order_parent_id(0x7f11198e35f0)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 147 - output([t3.order_id(0x7f111984b9e0)], [t3.user_id(0x7f1119851890)], [t3.area_id(0x7f11198722e0)], [t3.order_complete_time(0x7f11198e0d00)], [t3.order_parent_id(0x7f11198e35f0)], [t3.order_type(0x7f11198e43c0)], [t3.customer_type(0x7f111993fce0)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)]), filter([t3.order_state (0x7f1119890c80) = 9(0x7f11198903c0)], [t3.is_delete(0x7f1119893d40) = 0(0x7f1119893480)]), rowset=256 access([t3.id(0x7f11244dd250)], [t3.order_id(0x7f111984b9e0)], [t3.user_id(0x7f1119851890)], [t3.area_id(0x7f11198722e0)], [t3.order_state(0x7f1119890c80)], [t3.is_delete(0x7f1119893d40)], [t3.order_complete_time(0x7f11198e0d00)], [t3.order_parent_id(0x7f11198e35f0)], [t3.order_type(0x7f11198e43c0)], [t3.customer_type(0x7f111993fce0)], [t3.contract_name(0x7f1119945820)], [t3.contract_mobile(0x7f11199460d0)], [t3.trader_name(0x7f1119946980)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false], range_key([t3.area_id(0x7f11198722e0)], [t3.id(0x7f11244dd250)]), range(216,MIN ; 216,MAX), range_cond([t3.area_id(0x7f11198722e0) = 216(0x7f11218e53c0)]) 148 - output([t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)]), filter(nil), rowset=256 149 - output([t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)]), filter(nil), rowset=256 equal_conds([t40.id(0x7f111988b540) = t8.accounting_body_id(0x7f111988b980)(0x7f111988ac80)]), other_conds(nil) merge_directions([ASC]) 150 - output([t8.accounting_body_id(0x7f111988b980)]), filter(nil), rowset=256 access([t8.accounting_body_id(0x7f111988b980)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f1119872720)]), range[216 ; 216], range_cond([t8.id(0x7f1119872720) = 216(0x7f11218e6260)]) 151 - output([t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)]), filter(nil), rowset=256 access([t40.id(0x7f111988b540)], [t40.name(0x7f11198e1e90)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t40.id(0x7f111988b540)]), range(MIN ; MAX)always true 152 - output([t2.id(0x7f11198462a0)], [t2.ppid(0x7f111984d570)], [t2.is_mobile(0x7f111989c560)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.examine_price(0x7f11198d84f0)], [t2.detail_type(0x7f11198f2e60)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)]), filter([t2.is_mobile(0x7f111989c560) = 0(0x7f111989bca0)], [t2.is_delete(0x7f11198924e0) = 0(0x7f1119891c20)], [t2.product_stock_type(0x7f11198a81b0) IN (0, 1, 2, 6)(0x7f116c135fd0)(0x7f11198a5950)]), rowset=256 access([GROUP_ID(0x7f11ab17fc90)], [t2.id(0x7f11198462a0)], [t2.ppid(0x7f111984d570)], [t2.is_delete(0x7f11198924e0)], [t2.is_mobile(0x7f111989c560)], [t2.product_stock_type(0x7f11198a81b0)], [t2.jiuxun_service_flag(0x7f11198b13b0)], [t2.jiuxun_service_cost_price(0x7f11198b17f0)], [t2.in_price(0x7f11198b1c30)], [t2.examine_price(0x7f11198d84f0)], [t2.detail_type(0x7f11198f2e60)], [t2.price(0x7f11198ff2a0)], [t2.sell_price(0x7f11199029f0)], [t2.gift_price(0x7f1119906140)], [t2.discount_price(0x7f1119909890)], [t2.point_price(0x7f111990cfe0)], [t2.in_user_id(0x7f11199322f0)], [t2.in_user_name(0x7f1119932ba0)], [t2.comment(0x7f1119947ae0)], [t2.detail_parent_id(0x7f11199490b0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t2.order_id(0x7f111984b5a0)], [t2.id(0x7f11198462a0)]), range(MIN ; MAX), range_cond([t2.order_id(0x7f111984b5a0) = :132(0x7f11218e7100)]) 153 - output([t4.productid(0x7f111987ccf0)], [t4.bar_code(0x7f11198f5be0)], [t4.product_color(0x7f1119933450)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab18a600)], [t4.productid(0x7f111987ccf0)], [t4.bar_code(0x7f11198f5be0)], [t4.product_color(0x7f1119933450)], [t4.cid(0x7f1119934170)], [t4.brand_id(0x7f111993e2d0)], [t4.product_name(0x7f111993eb80)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f111984d9b0)]), range(MIN ; MAX), range_cond([:133 = t4.ppriceid(0x7f111984d9b0)(0x7f11218e7b10)]) 154 - output([t6.order_detail_id(0x7f111986e780)], [t6.return_price(0x7f11198c7c60)], [t6.return_id(0x7f1119870310)], [t6.return_count(0x7f11198c80a0)]), filter(nil), rowset=256 access([t6.order_detail_id(0x7f111986e780)], [t6.return_price(0x7f11198c7c60)], [t6.return_id(0x7f1119870310)], [t6.return_count(0x7f11198c80a0)]) 155 - output([t_return_detail.order_detail_id(0x7f11198677c0)], [cast(cast(T_FUN_SUM(t_return_detail.return_price(0x7f11198685a0))(0x7f11244d8550), DECIMAL(32, 2))(0x7f11244d9a50) / cast(T_FUN_COUNT(t_return_detail.return_price(0x7f11198685a0))(0x7f11244d8a80), DECIMAL(20, 0))(0x7f11244da960)(0x7f11244d8fb0), DECIMAL(14, 6))(0x7f11244db870)], [t_return_detail.return_id(0x7f1119869320)], [t_return_detail.return_count(0x7f1119869bd0)]), filter(nil), rowset=256 group([t_return_detail.order_detail_id(0x7f11198677c0)], [t_return_detail.return_id(0x7f1119869320)], [t_return_detail.return_count(0x7f1119869bd0)]), agg_func([T_FUN_SUM(t_return_detail.return_price(0x7f11198685a0))(0x7f11244d8550)], [T_FUN_COUNT(t_return_detail.return_price(0x7f11198685a0))(0x7f11244d8a80)]) 156 - output([t_return_detail.order_detail_id(0x7f11198677c0)], [t_return_detail.return_price(0x7f11198685a0)], [t_return_detail.return_id(0x7f1119869320)], [t_return_detail.return_count(0x7f1119869bd0)]), filter([t_return_detail.is_delete(0x7f1119865460) = 0(0x7f1119864ba0)], [t_return_detail.order_detail_type(0x7f1119866cc0) = 1(0x7f1119866400)]), rowset=256 access([t_return_detail.is_delete(0x7f1119865460)], [t_return_detail.order_detail_type(0x7f1119866cc0)], [t_return_detail.order_detail_id(0x7f11198677c0)], [t_return_detail.return_price(0x7f11198685a0)], [t_return_detail.return_id(0x7f1119869320)], [t_return_detail.return_count(0x7f1119869bd0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false], range_key([t_return_detail.id(0x7f11244d8010)]), range(MIN ; MAX)always true 157 - output([t7.check2_time(0x7f111989f830)], [t7.comment(0x7f1119947230)], [t7.check2_user_name(0x7f11199514b0)]), filter([t7.is_delete(0x7f1119898660) = 0(0x7f1119897da0)], [(T_OP_NOT_IN, t7.return_type(0x7f111989ac10), (7, 8)(0x7f116c135590))(0x7f1119898d10)], [t7.check2_time(0x7f111989f830) >= cast('2024-11-01 00:00:00', TIMESTAMP(-1, -1))(0x7f11198a0040)(0x7f111989ddf0)], [t7.check2_time(0x7f111989f830) <= cast('2024-11-18 23:59:59', TIMESTAMP(-1, -1))(0x7f11198a10c0)(0x7f111989e670)]), rowset=256 access([GROUP_ID(0x7f11ab19aca0)], [t7.is_delete(0x7f1119898660)], [t7.return_type(0x7f111989ac10)], [t7.check2_time(0x7f111989f830)], [t7.comment(0x7f1119947230)], [t7.check2_user_name(0x7f11199514b0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false,false,false], range_key([t7.id(0x7f1119870750)]), range(MIN ; MAX), range_cond([:145 = t7.id(0x7f1119870750)(0x7f11218e8520)]) 158 - output([t5.user_type(0x7f111993f430)], [t5.real_name(0x7f1119944480)], [t5.user_mobile(0x7f1119944f70)]), filter([t5.is_delete(0x7f11198955a0) = 0(0x7f1119894ce0)]), rowset=256 access([GROUP_ID(0x7f11ab1a2240)], [t5.is_delete(0x7f11198955a0)], [t5.user_type(0x7f111993f430)], [t5.real_name(0x7f1119944480)], [t5.user_mobile(0x7f1119944f70)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f1119851450)]), range(MIN ; MAX), range_cond([t5.id(0x7f1119851450) = :140(0x7f11218e8f30)]) 159 - output([vpcc.in_source_id(0x7f11198f4a00)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab1a97e0)], [vpcc.in_source_id(0x7f11198f4a00)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([vpcc.id(0x7f11198899a0)]), range(MIN ; MAX), range_cond([:138 = vpcc.id(0x7f11198899a0)(0x7f11218e9940)]) 160 - output([t1.serial_number_mark(0x7f1119886160)], [t1.statistics_price(0x7f11198b0b30)], [t1.counts(0x7f11198b0f70)], [t1.inprice(0x7f11198ba370)], [t1.examine_price(0x7f11198d80b0)], [t1.insource_id(0x7f11198f45c0)], [t1.modify_price(0x7f1119931400)], [t1.sample_product(0x7f111994b7e0)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab1abaa0)], [t1.id(0x7f1119844880)], [t1.serial_number_mark(0x7f1119886160)], [t1.statistics_price(0x7f11198b0b30)], [t1.counts(0x7f11198b0f70)], [t1.inprice(0x7f11198ba370)], [t1.examine_price(0x7f11198d80b0)], [t1.insource_id(0x7f11198f45c0)], [t1.modify_price(0x7f1119931400)], [t1.sample_product(0x7f111994b7e0)]), partitions(p[0-9]) is_index_back=true, is_global_index=false, range_key([t1.order_detail_id(0x7f1119845e60)], [t1.order_detail_type(0x7f1119847b00)], [t1.id(0x7f1119844880)]), range(MIN ; MAX), range_cond([t1.order_detail_type(0x7f1119847b00) = 1(0x7f11218ea350)], [t1.order_detail_id(0x7f1119845e60) = :130(0x7f11218eb1f0)]) 161 - output([t16.channel(0x7f11198f5330)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab1b3a90)], [t16.id(0x7f11244dd690)], [t16.channel(0x7f11198f5330)]), partitions(p0) is_index_back=true, is_global_index=false, range_key([t16.order_detail_id(0x7f11198742c0)], [t16.shadow_pk_0(0x7f11060c3670)]), range(MIN ; MAX), range_cond([:136 = t16.order_detail_id(0x7f11198742c0)(0x7f11218ebc00)]) 162 - output(nil), filter([t17.is_delete(0x7f11198795d0) = 0(0x7f1119878d10)]), rowset=256 access([GROUP_ID(0x7f11ab1b7f60)], [t17.id(0x7f11244ddad0)], [t17.is_delete(0x7f11198795d0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t17.bind_order_detail_id(0x7f1119875e60)], [t17.id(0x7f11244ddad0)]), range(MIN ; MAX), range_cond([:137 = t17.bind_order_detail_id(0x7f1119875e60)(0x7f11218ec610)]) 163 - output([sysc.id(0x7f11198865a0)], [sysc.name(0x7f1119949960)], [sysc.value(0x7f111994a210)]), filter([sysc.is_delete(0x7f1119887e00) = 0(0x7f1119887540)]), rowset=256 access([GROUP_ID(0x7f11ab1bb6e0)], [sysc.id(0x7f11198865a0)], [sysc.is_delete(0x7f1119887e00)], [sysc.name(0x7f1119949960)], [sysc.value(0x7f111994a210)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([sysc.id(0x7f11198865a0)]), range(MIN ; MAX), range_cond([:139 = sysc.id(0x7f11198865a0)(0x7f11218ed020)]) 164 - output([t36.aux_sale_man_names(0x7f111994af30)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab1c0d70)], [t36.id(0x7f11244de790)], [t36.aux_sale_man_names(0x7f111994af30)]), partitions(p0) is_index_back=true, is_global_index=false, range_key([t36.order_id(0x7f111988f420)], [t36.id(0x7f11244de790)]), range(MIN ; MAX), range_cond([:143 = t36.order_id(0x7f111988f420)(0x7f11218eda30)]) 165 - output([cast(0, DECIMAL_INT(77, 4))(0x7f133019f390)], [cast(0, DECIMAL_INT(75, 2))(0x7f13301a0260)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f1330192690) - IFNULL(cast(b.deduction_price(0x7f133012a3f0), DECIMAL_INT(22, 2))(0x7f1330190710), cast(0, DECIMAL_INT(22, 2))(0x7f1330191600))(0x7f13301287f0)(0x7f1330129af0), DECIMAL(65, 6))(0x7f13301a1130)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f1330192690) - IFNULL(cast(b.deduction_price(0x7f133012a3f0), DECIMAL_INT(22, 2))(0x7f1330190710), cast(0, DECIMAL_INT(22, 2))(0x7f1330191600))(0x7f13301287f0)(0x7f1330129af0), DECIMAL(65, 6))(0x7f13301a2200)], [cast(0, DECIMAL_INT(75, 2))(0x7f13301a32d0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f1330192690) - IFNULL(cast(b.deduction_price(0x7f133012a3f0), DECIMAL_INT(22, 2))(0x7f1330190710), cast(0, DECIMAL_INT(22, 2))(0x7f1330191600))(0x7f13301287f0)(0x7f1330129af0), DECIMAL(65, 6))(0x7f13301a41a0)], [cast(0, VARCHAR(65))(0x7f13301aab50)], [cast(0, DECIMAL_INT(78, 2))(0x7f13301aba20)], [cast(0, DECIMAL_INT(78, 2))(0x7f13301ad7c0)], [cast(0, DECIMAL_INT(76, 4))(0x7f13301ae690)], [cast(0, DECIMAL_INT(76, 4))(0x7f13301af560)], [cast(0, DECIMAL_INT(76, 4))(0x7f13301b0430)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f1330192690) - IFNULL(cast(b.deduction_price(0x7f133012a3f0), DECIMAL_INT(22, 2))(0x7f1330190710), cast(0, DECIMAL_INT(22, 2))(0x7f1330191600))(0x7f13301287f0)(0x7f1330129af0), DECIMAL(65, 6))(0x7f13301b21d0)], [cast(0, DECIMAL_INT(39, 4))(0x7f13301b32a0)], [t2.in_user_id(0x7f133017ab00)], [t2.in_user_name(0x7f133017b3b0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f13300ea4d0)(:170)]), use_batch=true 166 - output([t3.order_id(0x7f13300ea4d0)], [cast(0, DECIMAL_INT(23, 2))(0x7f1330192690) - IFNULL(cast(b.deduction_price(0x7f133012a3f0), DECIMAL_INT(22, 2))(0x7f1330190710), cast(0, DECIMAL_INT(22, 2))(0x7f1330191600))(0x7f13301287f0)(0x7f1330129af0)], [t2.in_user_id(0x7f133017ab00)], [t2.in_user_name(0x7f133017b3b0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f13300e0200)(:167)]), use_batch=true 167 - output([t3.order_id(0x7f13300ea4d0)], [t2.in_user_id(0x7f133017ab00)], [t2.in_user_name(0x7f133017b3b0)], [t2.id(0x7f13300e0200)], [b.deduction_price(0x7f133012a3f0)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 168 - output([t3.order_id(0x7f13300ea4d0)], [t2.in_user_id(0x7f133017ab00)], [t2.in_user_name(0x7f133017b3b0)], [t2.id(0x7f13300e0200)], [b.deduction_price(0x7f133012a3f0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f13300f0380)(:168)]), use_batch=true 169 - output([t3.order_id(0x7f13300ea4d0)], [t2.in_user_id(0x7f133017ab00)], [t2.in_user_name(0x7f133017b3b0)], [t2.id(0x7f13300e0200)], [t3.user_id(0x7f13300f0380)], [b.deduction_price(0x7f133012a3f0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.order_id(0x7f13300ea090)(:164)]), use_batch=true 170 - output([t2.in_user_id(0x7f133017ab00)], [t2.in_user_name(0x7f133017b3b0)], [t2.id(0x7f13300e0200)], [t2.order_id(0x7f13300ea090)], [b.deduction_price(0x7f133012a3f0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f13300e0200)(:163)]), use_batch=true 171 - output([t2.in_user_id(0x7f133017ab00)], [t2.in_user_name(0x7f133017b3b0)], [t2.id(0x7f13300e0200)], [t2.order_id(0x7f13300ea090)], [b.deduction_price(0x7f133012a3f0)]), filter(nil), rowset=256 conds(nil), nl_params_([b.return_time(0x7f13301113d0)(:172)], [a.order_id(0x7f13300e1e10)(:173)]), use_batch=true 172 - output([t2.in_user_id(0x7f133017ab00)], [t2.in_user_name(0x7f133017b3b0)], [t2.id(0x7f13300e0200)], [t2.order_id(0x7f13300ea090)], [b.return_time(0x7f13301113d0)], [a.order_id(0x7f13300e1e10)], [b.deduction_price(0x7f133012a3f0)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f13300fe940) = pl.product_id(0x7f13300fed80)(0x7f13300fe080)]), other_conds(nil) 173 - output([pl.product_id(0x7f13300fed80)]), filter([pl.is_delete(0x7f13301005e0) = 0(0x7f13300ffd20)]), rowset=256 access([pl.product_id(0x7f13300fed80)], [pl.is_delete(0x7f13301005e0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f112451b880)]), range(MIN ; MAX)always true 174 - output([t2.in_user_id(0x7f133017ab00)], [t2.in_user_name(0x7f133017b3b0)], [t2.id(0x7f13300e0200)], [t2.order_id(0x7f13300ea090)], [b.return_time(0x7f13301113d0)], [a.order_id(0x7f13300e1e10)], [b.deduction_price(0x7f133012a3f0)], [t4.productid(0x7f13300fe940)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.ppid(0x7f13300ec060)(:166)]), use_batch=true 175 - output([t2.in_user_id(0x7f133017ab00)], [t2.in_user_name(0x7f133017b3b0)], [t2.id(0x7f13300e0200)], [t2.order_id(0x7f13300ea090)], [b.return_time(0x7f13301113d0)], [a.order_id(0x7f13300e1e10)], [t2.ppid(0x7f13300ec060)], [b.deduction_price(0x7f133012a3f0)]), filter(nil), rowset=256 conds(nil), nl_params_([a.detail_parent_id(0x7f13300dfdc0)(:157)]), use_batch=true 176 - output([b.return_time(0x7f13301113d0)], [a.order_id(0x7f13300e1e10)], [a.detail_parent_id(0x7f13300dfdc0)], [b.deduction_price(0x7f133012a3f0)]), filter(nil), rowset=256 conds(nil), nl_params_([b.order_detail_id(0x7f13300dc320)(:156)]), use_batch=true 177 - output([b.order_detail_id(0x7f13300dc320)], [b.return_time(0x7f13301113d0)], [b.deduction_price(0x7f133012a3f0)]), filter([b.return_time(0x7f13301113d0) >= INTERNAL_FUNCTION('2024-11-01 00:00:00', 114, 17)(0x7f112451d2d0)(0x7f133011cd90)], [b.return_time(0x7f13301113d0) <= INTERNAL_FUNCTION('2024-11-18 23:59:59', 112, 17)(0x7f112451e4a0)(0x7f133011d610)], [b.status(0x7f1330113b20) = 2(0x7f1330113260)], [b.is_delete(0x7f1330115380) = 0(0x7f1330114ac0)], [b.version(0x7f133011b500) = 0(0x7f133011ac40)]), rowset=256 access([b.order_detail_id(0x7f13300dc320)], [b.return_time(0x7f13301113d0)], [b.status(0x7f1330113b20)], [b.is_delete(0x7f1330115380)], [b.version(0x7f133011b500)], [b.deduction_price(0x7f133012a3f0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false,false,false,false], range_key([b.id(0x7f1124519f00)]), range(MIN ; MAX)always true 178 - output([a.detail_parent_id(0x7f13300dfdc0)], [a.order_id(0x7f13300e1e10)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab1df780)], [a.detail_parent_id(0x7f13300dfdc0)], [a.order_id(0x7f13300e1e10)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([a.id(0x7f13300dbee0)]), range(MIN ; MAX), range_cond([a.id(0x7f13300dbee0) = :156(0x7f11218ee440)]) 179 - output([t2.id(0x7f13300e0200)], [t2.order_id(0x7f13300ea090)], [t2.ppid(0x7f13300ec060)], [t2.in_user_id(0x7f133017ab00)], [t2.in_user_name(0x7f133017b3b0)]), filter([t2.is_delete(0x7f1330116be0) = 0(0x7f1330116320)], [t2.product_stock_type(0x7f1330126d10) IN (0, 1, 2, 6)(0x7f116c141170)(0x7f13301244b0)]), rowset=256 access([GROUP_ID(0x7f11ab1dfb30)], [t2.id(0x7f13300e0200)], [t2.order_id(0x7f13300ea090)], [t2.ppid(0x7f13300ec060)], [t2.is_delete(0x7f1330116be0)], [t2.product_stock_type(0x7f1330126d10)], [t2.in_user_id(0x7f133017ab00)], [t2.in_user_name(0x7f133017b3b0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false], range_key([t2.id(0x7f13300e0200)]), range(MIN ; MAX), range_cond([:157 = t2.id(0x7f13300e0200)(0x7f11218eee50)]) 180 - output([t4.productid(0x7f13300fe940)]), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab1e51c0)], [t4.productid(0x7f13300fe940)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f13300ec4a0)]), range(MIN ; MAX), range_cond([:166 = t4.ppriceid(0x7f13300ec4a0)(0x7f11218ef860)]) 181 - output(nil), filter([cast(c.order_complete_time(0x7f1330110f90), DATETIME(19, 0))(0x7f1330111a60) <= :172(0x7f10ea586670)]), rowset=256 access([GROUP_ID(0x7f11ab1e5570)], [c.id(0x7f112451a340)], [c.order_complete_time(0x7f1330110f90)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([c.order_id(0x7f13300e2250)], [c.shadow_pk_0(0x7f113b1481d0)]), range(MIN ; MAX), range_cond([:173 = c.order_id(0x7f13300e2250)(0x7f11218f0270)]) 182 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab1e5920)]), partitions(p[0-9]) is_index_back=false, is_global_index=false, range_key([t1.order_detail_id(0x7f13300e6ca0)], [t1.order_detail_type(0x7f13300e8500)], [t1.id(0x7f13300e56c0)]), range(MIN ; MAX), range_cond([t1.order_detail_type(0x7f13300e8500) = 1(0x7f13300e7c40)], [t1.order_detail_id(0x7f13300e6ca0) = :163(0x7f12ac068300)]) 183 - output([t3.order_id(0x7f13300ea4d0)], [t3.user_id(0x7f13300f0380)]), filter([t3.area_id(0x7f13300f1f10) = 216(0x7f1330120cc0)], [t3.order_state(0x7f133010f670) IN (3, 9)(0x7f116c140730)(0x7f133010d770)], [t3.is_delete(0x7f1330118440) = 0(0x7f1330117b80)]), rowset=256 access([GROUP_ID(0x7f11ab1e5cd0)], [t3.id(0x7f112451a780)], [t3.order_id(0x7f13300ea4d0)], [t3.user_id(0x7f13300f0380)], [t3.area_id(0x7f13300f1f10)], [t3.order_state(0x7f133010f670)], [t3.is_delete(0x7f1330118440)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t3.order_id(0x7f13300ea4d0)], [t3.shadow_pk_0(0x7f113b1945f0)]), range(MIN ; MAX), range_cond([:164 = t3.order_id(0x7f13300ea4d0)(0x7f11218f0c80)]) 184 - output(nil), filter([t5.is_delete(0x7f1330119ca0) = 0(0x7f13301193e0)]), rowset=256 access([GROUP_ID(0x7f11ab1ec820)], [t5.is_delete(0x7f1330119ca0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f13300eff40)]), range(MIN ; MAX), range_cond([t5.id(0x7f13300eff40) = :168(0x7f11218f1690)]) 185 - output(nil), filter(nil), rowset=256 186 - output(nil), filter(nil), rowset=256 access(nil), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f13300f2350)]), range[216 ; 216], range_cond([t8.id(0x7f13300f2350) = 216(0x7f11218f20a0)]) 187 - output(nil), filter([t17.is_delete(0x7f13300f9200) = 0(0x7f13300f8940)]), rowset=256 access([GROUP_ID(0x7f11ab1ee090)], [t17.id(0x7f112451b000)], [t17.is_delete(0x7f13300f9200)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t17.bind_order_detail_id(0x7f13300f79a0)], [t17.id(0x7f112451b000)]), range(MIN ; MAX), range_cond([:167 = t17.bind_order_detail_id(0x7f13300f79a0)(0x7f11218f2f40)]) 188 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f11ab1ef900)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f133010d0c0)], [t36.id(0x7f112451bcc0)]), range(MIN ; MAX), range_cond([:170 = t36.order_id(0x7f133010d0c0)(0x7f10ea4f6550)]) 189 - output([cast(0, DECIMAL_INT(77, 4))(0x7f13a4e9bc40)], [cast(0, DECIMAL_INT(75, 2))(0x7f13a4e9cb10)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f13a4e95c60) - t6.return_price(0x7f13a4e2d120) * cast(t6.return_count(0x7f13a4e2d560), DECIMAL_INT(11, 0))(0x7f13a4e94bd0)(0x7f13a4e2bfa0)(0x7f13a4e2c820), DECIMAL(65, 6))(0x7f13a4e9d9e0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f13a4e95c60) - t6.return_price(0x7f13a4e2d120) * cast(t6.return_count(0x7f13a4e2d560), DECIMAL_INT(11, 0))(0x7f13a4e94bd0)(0x7f13a4e2bfa0)(0x7f13a4e2c820), DECIMAL(65, 6))(0x7f13a4e9eaa0)], [cast(0, DECIMAL_INT(75, 2))(0x7f13a4e9fb60)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f13a4e95c60) - t6.return_price(0x7f13a4e2d120) * cast(t6.return_count(0x7f13a4e2d560), DECIMAL_INT(11, 0))(0x7f13a4e94bd0)(0x7f13a4e2bfa0)(0x7f13a4e2c820), DECIMAL(65, 6))(0x7f13a4ea0a30)], [cast(0, VARCHAR(65))(0x7f13a4ea4760)], [cast(0, DECIMAL_INT(78, 2))(0x7f13a4ea5630)], [cast(0, DECIMAL_INT(78, 2))(0x7f13a4ea73d0)], [cast(0, DECIMAL_INT(76, 4))(0x7f13a4ea82a0)], [cast(0, DECIMAL_INT(76, 4))(0x7f13a4ea9170)], [cast(0, DECIMAL_INT(76, 4))(0x7f13a4eaa040)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f13a4e95c60) - t6.return_price(0x7f13a4e2d120) * cast(t6.return_count(0x7f13a4e2d560), DECIMAL_INT(11, 0))(0x7f13a4e94bd0)(0x7f13a4e2bfa0)(0x7f13a4e2c820), DECIMAL(65, 6))(0x7f13a4eabfd0)], [cast(0, DECIMAL_INT(39, 4))(0x7f13a4ead090)], [t2.in_user_id(0x7f13a4e7cb30)], [t2.in_user_name(0x7f13a4e7d3e0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f13301d6c10)(:196)]), use_batch=true 190 - output([t3.order_id(0x7f13301d6c10)], [cast(0, DECIMAL_INT(23, 2))(0x7f13a4e95c60) - t6.return_price(0x7f13a4e2d120) * cast(t6.return_count(0x7f13a4e2d560), DECIMAL_INT(11, 0))(0x7f13a4e94bd0)(0x7f13a4e2bfa0)(0x7f13a4e2c820)], [t2.in_user_id(0x7f13a4e7cb30)], [t2.in_user_name(0x7f13a4e7d3e0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f13301d14d0)(:193)]), use_batch=true 191 - output([t3.order_id(0x7f13301d6c10)], [t2.in_user_id(0x7f13a4e7cb30)], [t2.in_user_name(0x7f13a4e7d3e0)], [t2.id(0x7f13301d14d0)], [t6.return_price(0x7f13a4e2d120)], [t6.return_count(0x7f13a4e2d560)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 192 - output([t3.order_id(0x7f13301d6c10)], [t2.in_user_id(0x7f13a4e7cb30)], [t2.in_user_name(0x7f13a4e7d3e0)], [t2.id(0x7f13301d14d0)], [t6.return_price(0x7f13a4e2d120)], [t6.return_count(0x7f13a4e2d560)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f13301d14d0)(:187)]), use_batch=true 193 - output([t3.order_id(0x7f13301d6c10)], [t2.in_user_id(0x7f13a4e7cb30)], [t2.in_user_name(0x7f13a4e7d3e0)], [t2.id(0x7f13301d14d0)], [t6.return_price(0x7f13a4e2d120)], [t6.return_count(0x7f13a4e2d560)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f13301dcac0)(:194)]), use_batch=true 194 - output([t3.order_id(0x7f13301d6c10)], [t2.in_user_id(0x7f13a4e7cb30)], [t2.in_user_name(0x7f13a4e7d3e0)], [t2.id(0x7f13301d14d0)], [t3.user_id(0x7f13301dcac0)], [t6.return_price(0x7f13a4e2d120)], [t6.return_count(0x7f13a4e2d560)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f13301f0330) = pl.product_id(0x7f13301f0770)(0x7f13301efa70)]), other_conds(nil) 195 - output([t3.order_id(0x7f13301d6c10)], [t2.in_user_id(0x7f13a4e7cb30)], [t2.in_user_name(0x7f13a4e7d3e0)], [t2.id(0x7f13301d14d0)], [t3.user_id(0x7f13301dcac0)], [t6.return_price(0x7f13a4e2d120)], [t6.return_count(0x7f13a4e2d560)], [t4.productid(0x7f13301f0330)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.ppid(0x7f13301d87a0)(:190)]), use_batch=true 196 - output([t3.order_id(0x7f13301d6c10)], [t2.in_user_id(0x7f13a4e7cb30)], [t2.in_user_name(0x7f13a4e7d3e0)], [t2.id(0x7f13301d14d0)], [t3.user_id(0x7f13301dcac0)], [t2.ppid(0x7f13301d87a0)], [t6.return_price(0x7f13a4e2d120)], [t6.return_count(0x7f13a4e2d560)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.order_id(0x7f13301d67d0)(:188)]), use_batch=true 197 - output([t2.in_user_id(0x7f13a4e7cb30)], [t2.in_user_name(0x7f13a4e7d3e0)], [t2.id(0x7f13301d14d0)], [t2.ppid(0x7f13301d87a0)], [t2.order_id(0x7f13301d67d0)], [t6.return_price(0x7f13a4e2d120)], [t6.return_count(0x7f13a4e2d560)]), filter(nil), rowset=256 conds(nil), nl_params_([t6.order_detail_id(0x7f13301e0560)(:192)]), use_batch=true 198 - output([t6.order_detail_id(0x7f13301e0560)], [t6.return_price(0x7f13a4e2d120)], [t6.return_count(0x7f13a4e2d560)]), filter(nil), rowset=256 conds(nil), nl_params_([t7.id(0x7f13301e3d90)(:199)]), use_batch=true 199 - output([t7.id(0x7f13301e3d90)]), filter([t7.is_delete(0x7f13a4e1c750) = 0(0x7f13a4e1be90)], [t7.check2_time(0x7f13a4e21280) >= cast('2024-11-01 00:00:00', TIMESTAMP(-1, -1))(0x7f13a4e21a90)(0x7f13a4e1f840)], [t7.check2_time(0x7f13a4e21280) <= cast('2024-11-18 23:59:59', TIMESTAMP(-1, -1))(0x7f13a4e22b10)(0x7f13a4e200c0)]), rowset=256 access([t7.id(0x7f13301e3d90)], [t7.is_delete(0x7f13a4e1c750)], [t7.check2_time(0x7f13a4e21280)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t7.return_type(0x7f13a4e1dfb0)], [t7.id(0x7f13301e3d90)]), range(8,MIN ; 8,MAX), range_cond([t7.return_type(0x7f13a4e1dfb0) = 8(0x7f11218f3950)]) 200 - output([t6.order_detail_id(0x7f13301e0560)], [t6.return_price(0x7f13a4e2d120)], [t6.return_count(0x7f13a4e2d560)]), filter([t6.mkc_id(0x7f13301e1dc0) IS NULL(0x7f13301e1500)], [t6.is_delete(0x7f13a4e1aef0) = 0(0x7f13a4e1a630)]), rowset=256 access([GROUP_ID(0x7f10e7e05f60)], [t6.id(0x7f112452b730)], [t6.order_detail_id(0x7f13301e0560)], [t6.mkc_id(0x7f13301e1dc0)], [t6.is_delete(0x7f13a4e1aef0)], [t6.return_price(0x7f13a4e2d120)], [t6.return_count(0x7f13a4e2d560)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false], range_key([t6.return_id(0x7f13301e3950)], [t6.id(0x7f112452b730)]), range(MIN ; MAX), range_cond([t6.return_id(0x7f13301e3950) = :199(0x7f11218f47f0)]) 201 - output([t2.id(0x7f13301d14d0)], [t2.order_id(0x7f13301d67d0)], [t2.ppid(0x7f13301d87a0)], [t2.in_user_id(0x7f13a4e7cb30)], [t2.in_user_name(0x7f13a4e7d3e0)]), filter([t2.is_delete(0x7f13a4e165d0) = 0(0x7f13a4e15d10)], [t2.product_stock_type(0x7f13a4e29c00) IN (0, 1, 2, 6)(0x7f116c144cc0)(0x7f13a4e273a0)]), rowset=256 access([GROUP_ID(0x7f10e7e0b5f0)], [t2.id(0x7f13301d14d0)], [t2.order_id(0x7f13301d67d0)], [t2.ppid(0x7f13301d87a0)], [t2.is_delete(0x7f13a4e165d0)], [t2.product_stock_type(0x7f13a4e29c00)], [t2.in_user_id(0x7f13a4e7cb30)], [t2.in_user_name(0x7f13a4e7d3e0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false], range_key([t2.id(0x7f13301d14d0)]), range(MIN ; MAX), range_cond([t2.id(0x7f13301d14d0) = :192(0x7f11218f5200)]) 202 - output([t3.order_id(0x7f13301d6c10)], [t3.user_id(0x7f13301dcac0)]), filter([t3.area_id(0x7f13301e5920) = 216(0x7f13a4e23bb0)], [t3.order_state(0x7f13a4e14c80) IN (3, 9)(0x7f116c144280)(0x7f13a4e12d80)], [t3.is_delete(0x7f13a4e17e30) = 0(0x7f13a4e17570)]), rowset=256 access([GROUP_ID(0x7f10e7e10c80)], [t3.id(0x7f112452b2f0)], [t3.order_id(0x7f13301d6c10)], [t3.user_id(0x7f13301dcac0)], [t3.area_id(0x7f13301e5920)], [t3.order_state(0x7f13a4e14c80)], [t3.is_delete(0x7f13a4e17e30)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t3.order_id(0x7f13301d6c10)], [t3.shadow_pk_0(0x7f1105f6d590)]), range(MIN ; MAX), range_cond([:188 = t3.order_id(0x7f13301d6c10)(0x7f11218f5c10)]) 203 - output([t4.productid(0x7f13301f0330)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7e177d0)], [t4.productid(0x7f13301f0330)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f13301d8be0)]), range(MIN ; MAX), range_cond([:190 = t4.ppriceid(0x7f13301d8be0)(0x7f11218f6620)]) 204 - output([pl.product_id(0x7f13301f0770)]), filter([pl.is_delete(0x7f13a4e04050) = 0(0x7f13301f1710)]), rowset=256 access([pl.product_id(0x7f13301f0770)], [pl.is_delete(0x7f13a4e04050)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f112452c830)]), range(MIN ; MAX)always true 205 - output(nil), filter([t5.is_delete(0x7f13a4e19690) = 0(0x7f13a4e18dd0)]), rowset=256 access([GROUP_ID(0x7f10e7e19040)], [t5.is_delete(0x7f13a4e19690)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f13301dc680)]), range(MIN ; MAX), range_cond([t5.id(0x7f13301dc680) = :194(0x7f11218f7030)]) 206 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7e1a8b0)]), partitions(p[0-9]) is_index_back=false, is_global_index=false, range_key([t1.order_detail_id(0x7f13301d1090)], [t1.order_detail_type(0x7f13301d2d30)], [t1.id(0x7f13301cfab0)]), range(MIN ; MAX), range_cond([t1.order_detail_type(0x7f13301d2d30) = 1(0x7f13301d2470)], [t1.order_detail_id(0x7f13301d1090) = :187(0x7f111bcd37f0)]) 207 - output(nil), filter(nil), rowset=256 208 - output(nil), filter(nil), rowset=256 access(nil), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f13301e5d60)]), range[216 ; 216], range_cond([t8.id(0x7f13301e5d60) = 216(0x7f11218f7a40)]) 209 - output(nil), filter([t17.is_delete(0x7f13301ecc10) = 0(0x7f13301ec350)]), rowset=256 access([GROUP_ID(0x7f10e7e1ac60)], [t17.id(0x7f112452bfb0)], [t17.is_delete(0x7f13301ecc10)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t17.bind_order_detail_id(0x7f13301eb3b0)], [t17.id(0x7f112452bfb0)]), range(MIN ; MAX), range_cond([:193 = t17.bind_order_detail_id(0x7f13301eb3b0)(0x7f11218f88e0)]) 210 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7e1c4d0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f13a4e126d0)], [t36.id(0x7f112452cc70)]), range(MIN ; MAX), range_cond([:196 = t36.order_id(0x7f13a4e126d0)(0x7f11836859e0)]) 211 - output([cast(0, DECIMAL_INT(77, 4))(0x7f13a4f95630)], [cast(0, DECIMAL_INT(75, 2))(0x7f13a4f96500)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f13a4f8d740) - t6.return_price(0x7f13a4f22c70) * cast(t6.return_count(0x7f13a4f230b0), DECIMAL_INT(11, 0))(0x7f13a4f8c6b0)(0x7f13a4f21af0)(0x7f13a4f22370), DECIMAL(65, 6))(0x7f13a4f973d0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f13a4f8d740) - t6.return_price(0x7f13a4f22c70) * cast(t6.return_count(0x7f13a4f230b0), DECIMAL_INT(11, 0))(0x7f13a4f8c6b0)(0x7f13a4f21af0)(0x7f13a4f22370), DECIMAL(65, 6))(0x7f13a4f98490)], [cast(0, DECIMAL_INT(75, 2))(0x7f13a4f99550)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f13a4f8d740) - t6.return_price(0x7f13a4f22c70) * cast(t6.return_count(0x7f13a4f230b0), DECIMAL_INT(11, 0))(0x7f13a4f8c6b0)(0x7f13a4f21af0)(0x7f13a4f22370), DECIMAL(65, 6))(0x7f13a4f9a420)], [cast(0, VARCHAR(65))(0x7f13a4f9e150)], [cast(0, DECIMAL_INT(78, 2))(0x7f13a4f9f020)], [cast(0, DECIMAL_INT(78, 2))(0x7f13a4fa0dc0)], [cast(0, DECIMAL_INT(76, 4))(0x7f13a4fa1c90)], [cast(0, DECIMAL_INT(76, 4))(0x7f13a4fa2b60)], [cast(0, DECIMAL_INT(76, 4))(0x7f13a4fa3a30)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f13a4f8d740) - t6.return_price(0x7f13a4f22c70) * cast(t6.return_count(0x7f13a4f230b0), DECIMAL_INT(11, 0))(0x7f13a4f8c6b0)(0x7f13a4f21af0)(0x7f13a4f22370), DECIMAL(65, 6))(0x7f13a4fa59c0)], [cast(0, DECIMAL_INT(39, 4))(0x7f13a4fa6a80)], [t2.in_user_id(0x7f13a4f746f0)], [t2.in_user_name(0x7f13a4f74fa0)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f13a4ef5ef0) = pl.product_id(0x7f13a4ef6330)(0x7f13a4ef5630)]), other_conds(nil) 212 - output([cast(0, DECIMAL_INT(23, 2))(0x7f13a4f8d740) - t6.return_price(0x7f13a4f22c70) * cast(t6.return_count(0x7f13a4f230b0), DECIMAL_INT(11, 0))(0x7f13a4f8c6b0)(0x7f13a4f21af0)(0x7f13a4f22370)], [t2.in_user_id(0x7f13a4f746f0)], [t2.in_user_name(0x7f13a4f74fa0)], [t4.productid(0x7f13a4ef5ef0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f13a4eddbf0)(:216)]), use_batch=true 213 - output([t2.in_user_id(0x7f13a4f746f0)], [t2.in_user_name(0x7f13a4f74fa0)], [t3.order_id(0x7f13a4eddbf0)], [t6.return_price(0x7f13a4f22c70)], [t6.return_count(0x7f13a4f230b0)], [t4.productid(0x7f13a4ef5ef0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f13a4ed84b0)(:211)]), use_batch=true 214 - output([t2.in_user_id(0x7f13a4f746f0)], [t2.in_user_name(0x7f13a4f74fa0)], [t3.order_id(0x7f13a4eddbf0)], [t2.id(0x7f13a4ed84b0)], [t6.return_price(0x7f13a4f22c70)], [t6.return_count(0x7f13a4f230b0)], [t4.productid(0x7f13a4ef5ef0)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 215 - output([t2.in_user_id(0x7f13a4f746f0)], [t2.in_user_name(0x7f13a4f74fa0)], [t3.order_id(0x7f13a4eddbf0)], [t2.id(0x7f13a4ed84b0)], [t6.return_price(0x7f13a4f22c70)], [t6.return_count(0x7f13a4f230b0)], [t4.productid(0x7f13a4ef5ef0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f13a4ee3aa0)(:214)]), use_batch=true 216 - output([t2.in_user_id(0x7f13a4f746f0)], [t2.in_user_name(0x7f13a4f74fa0)], [t3.order_id(0x7f13a4eddbf0)], [t2.id(0x7f13a4ed84b0)], [t3.user_id(0x7f13a4ee3aa0)], [t6.return_price(0x7f13a4f22c70)], [t6.return_count(0x7f13a4f230b0)], [t4.productid(0x7f13a4ef5ef0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.order_id(0x7f13a4edd7b0)(:208)]), use_batch=true 217 - output([t2.in_user_id(0x7f13a4f746f0)], [t2.in_user_name(0x7f13a4f74fa0)], [t2.id(0x7f13a4ed84b0)], [t2.order_id(0x7f13a4edd7b0)], [t6.return_price(0x7f13a4f22c70)], [t6.return_count(0x7f13a4f230b0)], [t4.productid(0x7f13a4ef5ef0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.ppid(0x7f13a4edf780)(:210)]), use_batch=true 218 - output([t2.in_user_id(0x7f13a4f746f0)], [t2.in_user_name(0x7f13a4f74fa0)], [t2.id(0x7f13a4ed84b0)], [t2.order_id(0x7f13a4edd7b0)], [t2.ppid(0x7f13a4edf780)], [t6.return_price(0x7f13a4f22c70)], [t6.return_count(0x7f13a4f230b0)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.order_detail_id(0x7f13a4ed8070)(:207)]), use_batch=true 219 - output([t1.order_detail_id(0x7f13a4ed8070)], [t6.return_price(0x7f13a4f22c70)], [t6.return_count(0x7f13a4f230b0)]), filter(nil), rowset=256 conds(nil), nl_params_([t6.mkc_id(0x7f13a4ee7540)(:213)]), use_batch=true 220 - output([t6.mkc_id(0x7f13a4ee7540)], [t6.return_price(0x7f13a4f22c70)], [t6.return_count(0x7f13a4f230b0)]), filter(nil), rowset=256 conds(nil), nl_params_([t7.id(0x7f13a4ee9950)(:219)]), use_batch=true 221 - output([t7.id(0x7f13a4ee9950)]), filter([t7.is_delete(0x7f13a4f122a0) = 0(0x7f13a4f119e0)], [t7.check2_time(0x7f13a4f16dd0) >= cast('2024-11-01 00:00:00', TIMESTAMP(-1, -1))(0x7f13a4f175e0)(0x7f13a4f15390)], [t7.check2_time(0x7f13a4f16dd0) <= cast('2024-11-18 23:59:59', TIMESTAMP(-1, -1))(0x7f13a4f18660)(0x7f13a4f15c10)]), rowset=256 access([t7.id(0x7f13a4ee9950)], [t7.is_delete(0x7f13a4f122a0)], [t7.check2_time(0x7f13a4f16dd0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t7.return_type(0x7f13a4f13b00)], [t7.id(0x7f13a4ee9950)]), range(8,MIN ; 8,MAX), range_cond([t7.return_type(0x7f13a4f13b00) = 8(0x7f11218f92f0)]) 222 - output([t6.mkc_id(0x7f13a4ee7540)], [t6.return_price(0x7f13a4f22c70)], [t6.return_count(0x7f13a4f230b0)]), filter([t6.is_delete(0x7f13a4f10a40) = 0(0x7f13a4f10180)]), rowset=256 access([GROUP_ID(0x7f10e7e1fc50)], [t6.id(0x7f112453aef0)], [t6.mkc_id(0x7f13a4ee7540)], [t6.is_delete(0x7f13a4f10a40)], [t6.return_price(0x7f13a4f22c70)], [t6.return_count(0x7f13a4f230b0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t6.return_id(0x7f13a4ee9510)], [t6.id(0x7f112453aef0)]), range(MIN ; MAX), range_cond([t6.return_id(0x7f13a4ee9510) = :219(0x7f11218fc4e0)]) 223 - output([t1.order_detail_id(0x7f13a4ed8070)]), filter([t1.order_detail_type(0x7f13a4ed9d10) = 1(0x7f13a4ed9450)]), rowset=256 access([GROUP_ID(0x7f10e7e252e0)], [t1.id(0x7f13a4ed6a90)], [t1.order_detail_id(0x7f13a4ed8070)], [t1.order_detail_type(0x7f13a4ed9d10)]), partitions(p[0-9]) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t1.mkc_id(0x7f13a4ee7980)], [t1.id(0x7f13a4ed6a90)]), range(MIN ; MAX), range_cond([:213 = t1.mkc_id(0x7f13a4ee7980)(0x7f11218fcef0)]) 224 - output([t2.id(0x7f13a4ed84b0)], [t2.order_id(0x7f13a4edd7b0)], [t2.ppid(0x7f13a4edf780)], [t2.in_user_id(0x7f13a4f746f0)], [t2.in_user_name(0x7f13a4f74fa0)]), filter([t2.is_delete(0x7f13a4f0c120) = 0(0x7f13a4f0b860)], [t2.product_stock_type(0x7f13a4f1f750) IN (0, 1, 2, 6)(0x7f116c148750)(0x7f13a4f1cef0)]), rowset=256 access([GROUP_ID(0x7f10e7e28a60)], [t2.id(0x7f13a4ed84b0)], [t2.order_id(0x7f13a4edd7b0)], [t2.ppid(0x7f13a4edf780)], [t2.is_delete(0x7f13a4f0c120)], [t2.product_stock_type(0x7f13a4f1f750)], [t2.in_user_id(0x7f13a4f746f0)], [t2.in_user_name(0x7f13a4f74fa0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false], range_key([t2.id(0x7f13a4ed84b0)]), range(MIN ; MAX), range_cond([:207 = t2.id(0x7f13a4ed84b0)(0x7f11218fd900)]) 225 - output([t4.productid(0x7f13a4ef5ef0)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7e2e0f0)], [t4.productid(0x7f13a4ef5ef0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f13a4edfbc0)]), range(MIN ; MAX), range_cond([:210 = t4.ppriceid(0x7f13a4edfbc0)(0x7f11218fe310)]) 226 - output([t3.order_id(0x7f13a4eddbf0)], [t3.user_id(0x7f13a4ee3aa0)]), filter([t3.area_id(0x7f13a4eeb4e0) = 216(0x7f13a4f19700)], [t3.order_state(0x7f13a4f0a7d0) IN (3, 9)(0x7f116c147d10)(0x7f13a4f088d0)], [t3.is_delete(0x7f13a4f0d980) = 0(0x7f13a4f0d0c0)]), rowset=256 access([GROUP_ID(0x7f10e7e2e4a0)], [t3.id(0x7f112453aab0)], [t3.order_id(0x7f13a4eddbf0)], [t3.user_id(0x7f13a4ee3aa0)], [t3.area_id(0x7f13a4eeb4e0)], [t3.order_state(0x7f13a4f0a7d0)], [t3.is_delete(0x7f13a4f0d980)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t3.order_id(0x7f13a4eddbf0)], [t3.shadow_pk_0(0x7f119a1173b0)]), range(MIN ; MAX), range_cond([:208 = t3.order_id(0x7f13a4eddbf0)(0x7f11218fed20)]) 227 - output(nil), filter([t5.is_delete(0x7f13a4f0f1e0) = 0(0x7f13a4f0e920)]), rowset=256 access([GROUP_ID(0x7f10e7e34ff0)], [t5.is_delete(0x7f13a4f0f1e0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f13a4ee3660)]), range(MIN ; MAX), range_cond([t5.id(0x7f13a4ee3660) = :214(0x7f11218ff730)]) 228 - output(nil), filter(nil), rowset=256 229 - output(nil), filter(nil), rowset=256 access(nil), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f13a4eeb920)]), range[216 ; 216], range_cond([t8.id(0x7f13a4eeb920) = 216(0x7f1121900140)]) 230 - output(nil), filter([t17.is_delete(0x7f13a4ef27d0) = 0(0x7f13a4ef1f10)]), rowset=256 access([GROUP_ID(0x7f10e7e36860)], [t17.id(0x7f112453b770)], [t17.is_delete(0x7f13a4ef27d0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t17.bind_order_detail_id(0x7f13a4ef0f70)], [t17.id(0x7f112453b770)]), range(MIN ; MAX), range_cond([:211 = t17.bind_order_detail_id(0x7f13a4ef0f70)(0x7f1121900fe0)]) 231 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7e380d0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f13a4f08220)], [t36.id(0x7f112453c430)]), range(MIN ; MAX), range_cond([:216 = t36.order_id(0x7f13a4f08220)(0x7f1125c3d9b0)]) 232 - output([pl.product_id(0x7f13a4ef6330)]), filter([pl.is_delete(0x7f13a4ef7b90) = 0(0x7f13a4ef72d0)]), rowset=256 access([pl.product_id(0x7f13a4ef6330)], [pl.is_delete(0x7f13a4ef7b90)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f112453bff0)]), range(MIN ; MAX)always true 233 - output([t.in_user_id(0x7f11163df020)], [t.in_user_name(0x7f11163df8d0)], [IFNULL(T_FUN_SUM(cast(t.count(0x7f11163e1590), DOUBLE(-1, -1))(0x7f1176622740))(0x7f11163e05e0), cast(0, DOUBLE(-1, -1))(0x7f1176623630))(0x7f11163dfd20)], [IFNULL(T_FUN_SUM(t.price(0x7f11163e3330))(0x7f11163e2380), cast(0, DECIMAL_INT(81, 2))(0x7f11766246f0))(0x7f11163e1ac0)], [IFNULL(T_FUN_SUM(t.sell_price(0x7f11163e50d0))(0x7f11163e4120), cast(0, DECIMAL_INT(81, 2))(0x7f1176625720))(0x7f11163e3860)], [ROUND(cast(T_FUN_SUM(t.price(0x7f11163e3330))(0x7f11163e2380), DOUBLE(81, 2))(0x7f1176626a20) / T_FUN_SUM(cast(t.count(0x7f11163e1590), DOUBLE(-1, -1))(0x7f1176622740))(0x7f11163e05e0)(0x7f11163e71a0), 2)(0x7f11163e5600)], [IFNULL(T_FUN_SUM(t.gift_price(0x7f11163e9b00))(0x7f11163e8b50), cast(0, DECIMAL_INT(81, 4))(0x7f1176627b10))(0x7f11163e8290)], [IFNULL(T_FUN_SUM(t.discount_price(0x7f11163eb8a0))(0x7f11163ea8f0), cast(0, DECIMAL_INT(81, 4))(0x7f1176628b40))(0x7f11163ea030)], [IFNULL(T_FUN_SUM(t.point_price(0x7f11163ed640))(0x7f11163ec690), cast(0, DECIMAL_INT(81, 4))(0x7f1176629b70))(0x7f11163ebdd0)], [IFNULL(T_FUN_SUM(t.self_modify_price(0x7f11163ef3e0))(0x7f11163ee430), cast(0, DECIMAL_INT(61, 4))(0x7f117662aba0))(0x7f11163edb70)], [T_FUN_SUM(t.actualPaymentPrice(0x7f11163f02a0))(0x7f11163ef910)], [T_FUN_SUM(IFNULL(t.statistics_in_price(0x7f1176604050), cast(0, DECIMAL_INT(77, 4))(0x7f117662bc10))(0x7f11163f0c60))(0x7f11163f0750 )], [T_FUN_SUM(t.statistics_gross_profit(0x7f1176606e60))(0x7f11766064d0)], [T_FUN_SUM(IFNULL(t.in_price(0x7f1176608b80), cast(0, DECIMAL_INT(75, 2))(0x7f117662ccc0))(0x7f1176607820))(0x7f1176607310)], [T_FUN_SUM(t.gross_profit(0x7f117660b990))(0x7f117660b000)], [ROUND(cast(T_FUN_SUM(t.statistics_gross_profit(0x7f1176606e60))(0x7f11766064d0), DOUBLE(83, 6))(0x7f117662e040) / T_FUN_SUM(cast(t.count(0x7f11163e1590), DOUBLE(-1, -1))(0x7f1176622740))(0x7f11163e05e0)(0x7f117660d9e0), 2)(0x7f117660be40)], [T_FUN_SUM(IFNULL(t.examine_price(0x7f1176610340), cast(0, DECIMAL_INT(75, 2))(0x7f117662f130))(0x7f117660efe0))(0x7f117660ead0)], [T_FUN_SUM(t.examine_gross_profit(0x7f117661eb50))(0x7f117661e1c0)], [ROUND(cast(T_FUN_SUM(t.examine_gross_profit(0x7f11 7661eb50))(0x7f117661e1c0), DOUBLE(83, 6))(0x7f11766304b0) / T_FUN_SUM(cast(t.count(0x7f11163e1590), DOUBLE(-1, -1))(0x7f1176622740))(0x7f11163e05e0)(0x7f1176620ba0), 2)(0x7f117661f000)], ['B']), filter(nil), rowset=256 group([t.in_user_id(0x7f11163df020)], [t.in_user_name(0x7f11163df8d0)]), agg_func([T_FUN_SUM(cast(t.count(0x7f11163e1590), DOUBLE(-1, -1))(0x7f1176622740))(0x7f11163e05e0)], [T_FUN_SUM(t.price(0x7f11163e3330))(0x7f11163e2380)], [T_FUN_SUM(t.sell_price(0x7f11163e50d0))(0x7f11163e4120)], [T_FUN_SUM(t.gift_price(0x7f11163e9b00))(0x7f11163e8b50)], [T_FUN_SUM(t.discount_price(0x7f11163eb8a0))(0x7f11163ea8f0)], [T_FUN_SUM(t.point_price(0x7f11163ed640))(0x7f11163ec690)], [T_FUN_SUM(t.self_modify_price(0x7f11163ef3e0))(0x7f11163ee430)], [T_FUN_SUM(t.actualPaymentPrice(0x7f11163f02a0))(0x7f11163ef910)], [T_FUN_SUM(IFNULL(t.statistics_in_price(0x7f1176604050), cast(0, DECIMAL_INT(77, 4))(0x7f117662bc10))(0x7f11163f0c60))(0x7f11163f0750 )], [T_FUN_SUM(t.statistics_gross_profit(0x7f1176606e60))(0x7f11766064d0)], [T_FUN_SUM(IFNULL(t.in_price(0x7f1176608b80), cast(0, DECIMAL_INT(75, 2))(0x7f117662ccc0))(0x7f1176607820))(0x7f1176607310)], [T_FUN_SUM(t.gross_profit(0x7f117660b990))(0x7f117660b000)], [T_FUN_SUM(IFNULL(t.examine_price(0x7f1176610340), cast(0, DECIMAL_INT(75, 2))(0x7f117662f130))(0x7f117660efe0))(0x7f117660ead0)], [T_FUN_SUM(t.examine_gross_profit(0x7f117661eb50))(0x7f117661e1c0)]) 234 - output([t.statistics_in_price(0x7f1176604050)], [t.in_price(0x7f1176608b80)], [t.statistics_gross_profit(0x7f1176606e60)], [t.gross_profit(0x7f117660b990)], [t.examine_price(0x7f1176610340)], [t.examine_gross_profit(0x7f117661eb50)], [t.count(0x7f11163e1590)], [t.price(0x7f11163e3330)], [t.sell_price(0x7f11163e50d0)], [t.gift_price(0x7f11163e9b00)], [t.discount_price(0x7f11163eb8a0)], [t.point_price(0x7f11163ed640)], [t.actualPaymentPrice(0x7f11163f02a0)], [t.self_modify_price(0x7f11163ef3e0)], [t.in_user_id(0x7f11163df020)], [t.in_user_name(0x7f11163df8d0)]), filter(nil), rowset=256 access([t.statistics_in_price(0x7f1176604050)], [t.in_price(0x7f1176608b80)], [t.statistics_gross_profit(0x7f1176606e60)], [t.gross_profit(0x7f117660b990)], [t.examine_price(0x7f1176610340)], [t.examine_gross_profit(0x7f117661eb50)], [t.count(0x7f11163e1590)], [t.price(0x7f11163e3330)], [t.sell_price(0x7f11163e50d0)], [t.gift_price(0x7f11163e9b00)], [t.discount_price(0x7f11163eb8a0)], [t.point_price(0x7f11163ed640)], [t.actualPaymentPrice(0x7f11163f02a0)], [t.self_modify_price(0x7f11163ef3e0)], [t.in_user_id(0x7f11163df020)], [t.in_user_name(0x7f11163df8d0)]) 235 - output([UNION([1])(0x7f111636abd0)], [UNION([2])(0x7f111636af80)], [UNION([3])(0x7f111636b330)], [UNION([4])(0x7f111636b6e0)], [UNION([5])(0x7f111636ba90)], [UNION([6])(0x7f111636be40)], [UNION([7])(0x7f11163881f0)], [UNION([8])(0x7f11163885a0)], [UNION([9])(0x7f1116388d00)], [UNION([10])(0x7f11163890b0)], [UNION([11])(0x7f1116389460)], [UNION([12])(0x7f1116389810)], [UNION([13])(0x7f11163a5180)], [UNION([14])(0x7f11163a5530)], [UNION([15])(0x7f11163a5c90)], [UNION([16])(0x7f11163a6040)]), filter(nil), rowset=256 236 - output([cast(cast(0, DECIMAL_INT(42, 4))(0x7f11a628a390) - cast(IFNULL(cast(t1.inprice(0x7f11a62115d0), DECIMAL_INT(22, 2))(0x7f11a6280390), cast(0, DECIMAL_INT(22, 2))(0x7f11a6281280))(0x7f11a620a580), DECIMAL_INT(39, 4))(0x7f11a6283200) - cast(IFNULL(t16.self_modify_price(0x7f11a6211a10), cast(0.00, DECIMAL_INT(38, 4))(0x7f11a6282170))(0x7f11a620b880), DECIMAL_INT(39, 4))(0x7f11a6284220)(0x7f11a620cb90) - cast(IFNULL(t16.in_source_modify_price(0x7f11a6211e90), cast(0.00, DECIMAL_INT(38, 4))(0x7f11a62851f0))(0x7f11a620d410), DECIMAL_INT(40, 4))(0x7f11a6286280)(0x7f11a620e720) + cast(IFNULL(cast(t1.transfer_price(0x7f11a6212310), DECIMAL_INT(22, 2))(0x7f11a6287250), cast(0, DECIMAL_INT(22, 2))(0x7f11a6288140))(0x7f11a620efa0), DECIMAL_INT(41, 4))(0x7f11a62891d0)(0x7f11a62102d0)(0x7f11a6210b50), DECIMAL_INT(77, 4))(0x7f10db44ee90)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f11a628bb00) - cast(t1.inprice(0x7f11a62115d0), DECIMAL_INT(23, 2))(0x7f11a628c9f0)(0x7f11a6213450), DECIMAL_INT(75, 2))(0x7f10db453300)], [cast(cast(cast(0, DECIMAL_INT(23, 2))(0x7f11a628e0e0) - cast(t6.return_price(0x7f11a621bfa0), DECIMAL_INT(23, 2))(0x7f11a628efd0)(0x7f11a6214690) + IFNULL(cast(t1.inprice(0x7f11a62115d0), DECIMAL_INT(22, 2))(0x7f11a6280390), cast(0, DECIMAL_INT(22, 2))(0x7f11a6281280))(0x7f11a620a580)(0x7f11a6216210), DECIMAL_INT(39, 4))(0x7f11a6290200) - cast(IFNULL(t16.self_modify_price(0x7f11a6211a10), cast(0.00, DECIMAL_INT(38, 4))(0x7f11a6282170))(0x7f11a620b880), DECIMAL_INT(39, 4))(0x7f11a62913e0)(0x7f11a6217da0) - cast(IFNULL(t16.in_source_modify_price(0x7f11a6211e90), cast(0.00, DECIMAL_INT(38, 4))(0x7f11a62851f0))(0x7f11a620d410), DECIMAL_INT(40, 4))(0x7f11a6292520)(0x7f11a6219960) + cast(IFNULL(cast(t1.transfer_price(0x7f11a6212310), DECIMAL_INT(22, 2))(0x7f11a6287250), cast(0, DECIMAL_INT(22, 2))(0x7f11a6288140))(0x7f11a620efa0), DECIMAL_INT(41, 4))(0x7f11a6293660)(0x7f11a621b4e0), DECIMAL(65, 6))(0x7f10db456150)], [cast(cast(cast(0, DECIMAL_INT(23, 2))(0x7f11a628e0e0) - cast(t6.return_price(0x7f11a621bfa0), DECIMAL_INT(23, 2))(0x7f11a628efd0)(0x7f11a6214690) + IFNULL(cast(t1.inprice(0x7f11a62115d0), DECIMAL_INT(22, 2))(0x7f11a6280390), cast(0, DECIMAL_INT(22, 2))(0x7f11a6281280))(0x7f11a620a580)(0x7f11a6216210), DECIMAL_INT(26, 4))(0x7f11a6386180), DECIMAL(65, 6))(0x7f10db459a20)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f11a6295370) - cast(t1.examine_price(0x7f11a6220960), DECIMAL_INT(23, 2))(0x7f11a6296260)(0x7f11a62200a0), DECIMAL_INT(75, 2))(0x7f10db45cdd0)], [cast(cast(cast(0, DECIMAL_INT(24, 2))(0x7f11a629a330) - cast(t6.return_price(0x7f11a621bfa0), DECIMAL_INT(23, 2))(0x7f11a62992a0) - IFNULL(cast(t1.examine_price(0x7f11a6220960), DECIMAL_INT(22, 2))(0x7f11a6297320), cast(0, DECIMAL_INT(22, 2))(0x7f11a6298210))(0x7f11a6221720)(0x7f11a6222a20)(0x7f11a62232a0), DECIMAL_INT(26, 4))(0x7f11a6388200), DECIMAL(65, 6))(0x7f10db45fc20)], ['-1'], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f11a629b730) - cast(t2.price(0x7f11a623d0d0), DECIMAL_INT(23, 2))(0x7f11a629c620)(0x7f11a623c810), DECIMAL_INT(78, 2))(0x7f10db4697a0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f11a629d800) - cast(t2.sell_price(0x7f11a623f990), DECIMAL_INT(23, 2))(0x7f11a629e6f0)(0x7f11a623f0d0), DECIMAL_INT(78, 2))(0x7f10db46f440)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f11a629f8d0) - cast(t2.gift_price(0x7f11a6243200), DECIMAL_INT(25, 4))(0x7f11a62a07c0)(0x7f11a6242940), DECIMAL_INT(76, 4))(0x7f10db472290)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f11a62a19a0) - cast(t2.discount_price(0x7f11a6244880), DECIMAL_INT(25, 4))(0x7f11a62a2890)(0x7f11a6243fc0), DECIMAL_INT(76, 4))(0x7f10db4750e0)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f11a62a3a70) - cast(t2.point_price(0x7f11a6245f00), DECIMAL_INT(25, 4))(0x7f11a62a4960)(0x7f11a6245640), DECIMAL_INT(76, 4))(0x7f10db477f30)], [cast(cast(cast(0, DECIMAL_INT(23, 2))(0x7f11a628e0e0) - cast(t6.return_price(0x7f11a621bfa0), DECIMAL_INT(23, 2))(0x7f11a628efd0)(0x7f11a6214690), DECIMAL_INT(25, 4))(0x7f11a6390b90), DECIMAL(65, 6))(0x7f10db480050)], [cast(0, DECIMAL_INT(39, 4))(0x7f11a62a5e10) - cast(IFNULL(t16.self_modify_price(0x7f11a6211a10), cast(0.00, DECIMAL_INT(38, 4))(0x7f11a6282170))(0x7f11a620b880), DECIMAL_INT(39, 4))(0x7f11a62a6d00)(0x7f11a6265200)], [t2.in_user_id(0x7f11a6268720)], [t2.in_user_name(0x7f11a6268fd0)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.mkc_id(0x7f14337c2e90)(:267)]), use_batch=false 237 - output([t1.mkc_id(0x7f14337c2e90)], [t1.inprice(0x7f11a62115d0)], [IFNULL(cast(t1.inprice(0x7f11a62115d0), DECIMAL_INT(22, 2))(0x7f11a6280390), cast(0, DECIMAL_INT(22, 2))(0x7f11a6281280))(0x7f11a620a580)], [IFNULL(cast(t1.transfer_price(0x7f11a6212310), DECIMAL_INT(22, 2))(0x7f11a6287250), cast(0, DECIMAL_INT(22, 2))(0x7f11a6288140))(0x7f11a620efa0)], [cast(0, DECIMAL_INT(23, 2))(0x7f11a628e0e0) - cast(t6.return_price(0x7f11a621bfa0), DECIMAL_INT(23, 2))(0x7f11a628efd0)(0x7f11a6214690) + IFNULL(cast(t1.inprice(0x7f11a62115d0), DECIMAL_INT(22, 2))(0x7f11a6280390), cast(0, DECIMAL_INT(22, 2))(0x7f11a6281280))(0x7f11a620a580)(0x7f11a6216210)], [t6.return_price(0x7f11a621bfa0)], [t1.examine_price(0x7f11a6220960)], [cast(0, DECIMAL_INT(23, 2))(0x7f11a628e0e0) - cast(t6.return_price(0x7f11a621bfa0), DECIMAL_INT(23, 2))(0x7f11a628efd0)(0x7f11a6214690)], [t2.in_user_id(0x7f11a6268720)], [t2.in_user_name(0x7f11a6268fd0)], [t2.price(0x7f11a623d0d0)], [t2.sell_price(0x7f11a623f990)], [t2.gift_price(0x7f11a6243200)], [t2.discount_price(0x7f11a6244880)], [t2.point_price(0x7f11a6245f00)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f14337d11c0) = pl.product_id(0x7f14337d1600)(0x7f14337d0900)]), other_conds(nil) 238 - output([t1.mkc_id(0x7f14337c2e90)], [t1.inprice(0x7f11a62115d0)], [t6.return_price(0x7f11a621bfa0)], [t1.examine_price(0x7f11a6220960)], [t2.in_user_id(0x7f11a6268720)], [t2.in_user_name(0x7f11a6268fd0)], [t1.transfer_price(0x7f11a6212310)], [t2.price(0x7f11a623d0d0)], [t2.sell_price(0x7f11a623f990)], [t2.gift_price(0x7f11a6243200)], [t2.discount_price(0x7f11a6244880)], [t2.point_price(0x7f11a6245f00)], [t4.productid(0x7f14337d11c0)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.ppid(0x7f14337bb0d0)(:264)]), use_batch=true 239 - output([t1.mkc_id(0x7f14337c2e90)], [t1.inprice(0x7f11a62115d0)], [t6.return_price(0x7f11a621bfa0)], [t1.examine_price(0x7f11a6220960)], [t2.in_user_id(0x7f11a6268720)], [t2.in_user_name(0x7f11a6268fd0)], [t1.ppid(0x7f14337bb0d0)], [t1.transfer_price(0x7f11a6212310)], [t2.price(0x7f11a623d0d0)], [t2.sell_price(0x7f11a623f990)], [t2.gift_price(0x7f11a6243200)], [t2.discount_price(0x7f11a6244880)], [t2.point_price(0x7f11a6245f00)]), filter(nil), rowset=256 equal_conds([t2.order_id(0x7f14337b9100) = t3.order_id(0x7f14337b9540)(0x7f14337b8840)], [t1.order_detail_id(0x7f14337afea0) = t2.id(0x7f14337b02e0)(0x7f14337af5e0)]), other_conds(nil) 240 - output([t1.mkc_id(0x7f14337c2e90)], [t1.inprice(0x7f11a62115d0)], [t6.return_price(0x7f11a621bfa0)], [t1.examine_price(0x7f11a6220960)], [t1.ppid(0x7f14337bb0d0)], [t3.order_id(0x7f14337b9540)], [t1.order_detail_id(0x7f14337afea0)], [t1.transfer_price(0x7f11a6212310)]), filter(nil), rowset=256 equal_conds([t1.mkc_id(0x7f14337c2e90) = t6.mkc_id(0x7f14337c32d0)(0x7f14337c25d0)]), other_conds(nil) 241 - output([t6.return_price(0x7f11a621bfa0)], [t6.mkc_id(0x7f14337c32d0)], [t3.order_id(0x7f14337b9540)]), filter(nil), rowset=256 equal_conds([t6.return_id(0x7f14337c7f20) = t7.id(0x7f14337c8360)(0x7f14337c7660)]), other_conds(nil) 242 - output([t6.mkc_id(0x7f14337c32d0)], [t6.return_id(0x7f14337c7f20)], [t6.return_price(0x7f11a621bfa0)]), filter([t6.is_delete(0x7f14337c6390) = 0(0x7f14337c5ad0)], [t6.product_stock_type(0x7f14337c4b30) != 3(0x7f14337c4270)]), rowset=256 access([t6.mkc_id(0x7f14337c32d0)], [t6.product_stock_type(0x7f14337c4b30)], [t6.is_delete(0x7f14337c6390)], [t6.return_id(0x7f14337c7f20)], [t6.return_price(0x7f11a621bfa0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false], range_key([t6.id(0x7f117a033420)]), range(MIN ; MAX)always true 243 - output([t7.id(0x7f14337c8360)], [t3.order_id(0x7f14337b9540)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 244 - output([t7.id(0x7f14337c8360)]), filter([t7.is_delete(0x7f14337cbad0) = 0(0x7f14337cb210)], [(T_OP_NOT_IN, t7.return_type(0x7f14337e7cd0), (7, 8)(0x7f116c14d080))(0x7f14337e5dd0)]), rowset=256 access([t7.id(0x7f14337c8360)], [t7.is_delete(0x7f14337cbad0)], [t7.return_type(0x7f14337e7cd0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false], range_key([t7.check2_time(0x7f14337eee90)], [t7.id(0x7f14337c8360)]), range(2024-10-13 16:00:00.000000,MIN ; 2024-10-31 15:59:59.000000,MAX), range_cond([t7.check2_time(0x7f14337eee90) >= cast('2024-10-14 00:00:00', TIMESTAMP(-1, -1))(0x7f1121902430)(0x7f11219019f0)], [t7.check2_time(0x7f14337eee90) <= cast('2024-10-31 23:59:59', TIMESTAMP(-1, -1))(0x7f1121904220)(0x7f11219037e0)]) 245 - output([t3.order_id(0x7f14337b9540)]), filter(nil), rowset=256 246 - output([t3.order_id(0x7f14337b9540)]), filter(nil), rowset=256 equal_conds([t3.order_id(0x7f14337b9540) = t36.order_id(0x7f14337dda30)(0x7f14337dd170)]), other_conds(nil) merge_directions([ASC]) 247 - output([t3.order_id(0x7f14337b9540)]), filter(nil), rowset=256 sort_keys([t3.order_id(0x7f14337b9540), ASC]) 248 - output([t3.order_id(0x7f14337b9540)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f14337bf3f0)(:300)]), use_batch=true 249 - output([t3.order_id(0x7f14337b9540)], [t3.user_id(0x7f14337bf3f0)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 250 - output([t3.order_id(0x7f14337b9540)], [t3.user_id(0x7f14337bf3f0)]), filter([t3.order_state(0x7f14337e0e00) = 9(0x7f14337e0540)], [t3.is_delete(0x7f14337e3ec0) = 0(0x7f14337e3600)]), rowset=256 access([t3.id(0x7f117a032fe0)], [t3.order_id(0x7f14337b9540)], [t3.user_id(0x7f14337bf3f0)], [t3.order_state(0x7f14337e0e00)], [t3.is_delete(0x7f14337e3ec0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false], range_key([t3.area_id(0x7f14337cd660)], [t3.id(0x7f117a032fe0)]), range(216,MIN ; 216,MAX), range_cond([t3.area_id(0x7f14337cd660) = 216(0x7f11219055d0)]) 251 - output(nil), filter(nil), rowset=256 252 - output(nil), filter(nil), rowset=256 access(nil), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f14337cdaa0)]), range[216 ; 216], range_cond([t8.id(0x7f14337cdaa0) = 216(0x7f1121906470)]) 253 - output(nil), filter([t5.is_delete(0x7f14337e5720) = 0(0x7f14337e4e60)]), rowset=256 access([GROUP_ID(0x7f10e7e54cc0)], [t5.is_delete(0x7f14337e5720)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f14337befb0)]), range(MIN ; MAX), range_cond([t5.id(0x7f14337befb0) = :300(0x7f1121907310)]) 254 - output([t36.order_id(0x7f14337dda30)]), filter(nil), rowset=256 access([t36.order_id(0x7f14337dda30)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f14337dda30)], [t36.id(0x7f117a0340e0)]), range(MIN,MIN ; MAX,MAX)always true 255 - output([t1.mkc_id(0x7f14337c2e90)], [t1.inprice(0x7f11a62115d0)], [t1.examine_price(0x7f11a6220960)], [t1.ppid(0x7f14337bb0d0)], [t1.order_detail_id(0x7f14337afea0)], [t1.transfer_price(0x7f11a6212310)]), filter(nil), rowset=256 256 - output([t1.mkc_id(0x7f14337c2e90)], [t1.inprice(0x7f11a62115d0)], [t1.examine_price(0x7f11a6220960)], [t1.ppid(0x7f14337bb0d0)], [t1.order_detail_id(0x7f14337afea0)], [t1.transfer_price(0x7f11a6212310)]), filter(nil), rowset=256 dop=1 257 - output([t1.order_detail_id(0x7f14337afea0)], [t1.ppid(0x7f14337bb0d0)], [t1.mkc_id(0x7f14337c2e90)], [t1.inprice(0x7f11a62115d0)], [t1.transfer_price(0x7f11a6212310)], [t1.examine_price(0x7f11a6220960)]), filter(nil), rowset=256 force partition granule 258 - output([t1.order_detail_id(0x7f14337afea0)], [t1.ppid(0x7f14337bb0d0)], [t1.mkc_id(0x7f14337c2e90)], [t1.inprice(0x7f11a62115d0)], [t1.transfer_price(0x7f11a6212310)], [t1.examine_price(0x7f11a6220960)]), filter([t1.order_detail_type(0x7f14337b1b40) = 1(0x7f14337b1280)]), rowset=256 access([t1.order_detail_id(0x7f14337afea0)], [t1.order_detail_type(0x7f14337b1b40)], [t1.ppid(0x7f14337bb0d0)], [t1.mkc_id(0x7f14337c2e90)], [t1.inprice(0x7f11a62115d0)], [t1.transfer_price(0x7f11a6212310)], [t1.examine_price(0x7f11a6220960)]), partitions(p[0-9]) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t1.id(0x7f14337ae8c0)]), range(MIN ; MAX)always true 259 - output([t2.id(0x7f14337b02e0)], [t2.order_id(0x7f14337b9100)], [t2.price(0x7f11a623d0d0)], [t2.sell_price(0x7f11a623f990)], [t2.gift_price(0x7f11a6243200)], [t2.discount_price(0x7f11a6244880)], [t2.point_price(0x7f11a6245f00)], [t2.in_user_id(0x7f11a6268720)], [t2.in_user_name(0x7f11a6268fd0)]), filter([t2.is_mobile(0x7f14337ea8f0) = 1(0x7f14337ea030)], [t2.is_delete(0x7f14337e2660) = 0(0x7f14337e1da0)], [t2.product_stock_type(0x7f14337b33a0) != 3(0x7f14337b2ae0)], [t2.product_stock_type(0x7f14337b33a0) IN (0, 1, 2, 6)(0x7f116c14db80)(0x7f11a6206fc0)]), rowset=256 access([t2.id(0x7f14337b02e0)], [t2.product_stock_type(0x7f14337b33a0)], [t2.order_id(0x7f14337b9100)], [t2.is_delete(0x7f14337e2660)], [t2.is_mobile(0x7f14337ea8f0)], [t2.price(0x7f11a623d0d0)], [t2.sell_price(0x7f11a623f990)], [t2.gift_price(0x7f11a6243200)], [t2.discount_price(0x7f11a6244880)], [t2.point_price(0x7f11a6245f00)], [t2.in_user_id(0x7f11a6268720)], [t2.in_user_name(0x7f11a6268fd0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false,false,false], range_key([t2.id(0x7f14337b02e0)]), range(MIN ; MAX)always true 260 - output([t4.productid(0x7f14337d11c0)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7e65dd0)], [t4.productid(0x7f14337d11c0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f14337bb510)]), range(MIN ; MAX), range_cond([:264 = t4.ppriceid(0x7f14337bb510)(0x7f1121907d20)]) 261 - output([pl.product_id(0x7f14337d1600)]), filter([pl.is_delete(0x7f14337d2e60) = 0(0x7f14337d25a0)]), rowset=256 access([pl.product_id(0x7f14337d1600)], [pl.is_delete(0x7f14337d2e60)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f117a033ca0)]), range(MIN ; MAX)always true 262 - output([t16.self_modify_price(0x7f11a6211a10)], [t16.in_source_modify_price(0x7f11a6211e90)]), filter(nil), rowset=256 access([t16.self_modify_price(0x7f11a6211a10)], [t16.in_source_modify_price(0x7f11a6211e90)]) 263 - output([t1.mkc_id(0x7f143374b2b0)], [T_FUN_SUM(CASE WHEN t17.type(0x7f1433770c80) = 3(0x7f14337815f0) THEN t16.adjust_price(0x7f1433782830) ELSE cast(0.00, DECIMAL_INT(16, 4))(0x7f1433791160) END(0x7f1433780360))(0x7f143377fe50)], [T_FUN_SUM(CASE WHEN t17.type(0x7f1433770c80) = 2(0x7f143378dae0) THEN t16.adjust_price(0x7f1433782830) ELSE cast(0.00, DECIMAL_INT(16, 4))(0x7f14337955d0) END(0x7f143378c850))(0x7f143378c340)]), filter(nil), rowset=256 group(nil), agg_func([T_FUN_SUM(CASE WHEN t17.type(0x7f1433770c80) = 3(0x7f14337815f0) THEN t16.adjust_price(0x7f1433782830) ELSE cast(0.00, DECIMAL_INT(16, 4))(0x7f1433791160) END(0x7f1433780360))(0x7f143377fe50)], [T_FUN_SUM(CASE WHEN t17.type(0x7f1433770c80) = 2(0x7f143378dae0) THEN t16.adjust_price(0x7f1433782830) ELSE cast(0.00, DECIMAL_INT(16, 4))(0x7f14337955d0) END(0x7f143378c850))(0x7f143378c340)]) 264 - output([t17.type(0x7f1433770c80)], [t16.adjust_price(0x7f1433782830)], [t1.mkc_id(0x7f143374b2b0)]), filter(nil), rowset=256 conds(nil), nl_params_([t16.adjust_price_id(0x7f1433761100)(:283)]), use_batch=true 265 - output([t16.adjust_price(0x7f1433782830)], [t1.mkc_id(0x7f143374b2b0)], [t16.adjust_price_id(0x7f1433761100)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.mkc_id(0x7f143374b2b0)(:273)]), use_batch=true 266 - output([t1.mkc_id(0x7f143374b2b0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f1433741960)(:279)]), use_batch=true 267 - output([t1.mkc_id(0x7f143374b2b0)], [t3.order_id(0x7f1433741960)]), filter(nil), rowset=256 conds(nil), nl_params_([t6.return_id(0x7f143374d280)(:281)]), use_batch=true 268 - output([t1.mkc_id(0x7f143374b2b0)], [t3.order_id(0x7f1433741960)], [t6.return_id(0x7f143374d280)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.mkc_id(0x7f143374b2b0)(:271)]), use_batch=true 269 - output([t1.mkc_id(0x7f143374b2b0)], [t3.order_id(0x7f1433741960)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f1433747810)(:277)]), use_batch=true 270 - output([t1.mkc_id(0x7f143374b2b0)], [t3.order_id(0x7f1433741960)], [t3.user_id(0x7f1433747810)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f1433756520) = pl.product_id(0x7f1433756960)(0x7f1433755c60)]), other_conds(nil) 271 - output([t1.mkc_id(0x7f143374b2b0)], [t3.order_id(0x7f1433741960)], [t3.user_id(0x7f1433747810)], [t4.productid(0x7f1433756520)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.ppid(0x7f14337434f0)(:270)]), use_batch=true 272 - output([t1.mkc_id(0x7f143374b2b0)], [t3.order_id(0x7f1433741960)], [t3.user_id(0x7f1433747810)], [t1.ppid(0x7f14337434f0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.order_id(0x7f1433741520)(:275)]), use_batch=true 273 - output([t1.mkc_id(0x7f143374b2b0)], [t1.ppid(0x7f14337434f0)], [t2.order_id(0x7f1433741520)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.order_detail_id(0x7f143373bde0)(:268)]), use_batch=true 274 - output([t1.order_detail_id(0x7f143373bde0)], [t1.ppid(0x7f14337434f0)], [t1.mkc_id(0x7f143374b2b0)]), filter([t1.order_detail_type(0x7f143373da80) = 1(0x7f143373d1c0)]), rowset=256 access([t1.id(0x7f143373a4a0)], [t1.order_detail_id(0x7f143373bde0)], [t1.order_detail_type(0x7f143373da80)], [t1.ppid(0x7f14337434f0)], [t1.mkc_id(0x7f143374b2b0)]), partitions(p[0-9]) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t1.mkc_id(0x7f143374b2b0)], [t1.id(0x7f143373a4a0)]), range(MIN,MIN ; MAX,MAX)always true, range_cond([t1.mkc_id(0x7f143374b2b0) = :267(0x7f1121908730)]) 275 - output([t2.order_id(0x7f1433741520)]), filter([t2.is_mobile(0x7f143376e6d0) = 1(0x7f143376de10)], [t2.is_delete(0x7f1433765a20) = 0(0x7f1433765160)], [t2.product_stock_type(0x7f143377f140) IN (0, 1, 2, 6)(0x7f116c1544f0)(0x7f143377c8e0)]), rowset=256 access([GROUP_ID(0x7f10e7e6e830)], [t2.order_id(0x7f1433741520)], [t2.is_delete(0x7f1433765a20)], [t2.is_mobile(0x7f143376e6d0)], [t2.product_stock_type(0x7f143377f140)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false,false], range_key([t2.id(0x7f143373c220)]), range(MIN ; MAX), range_cond([:268 = t2.id(0x7f143373c220)(0x7f1121909140)]) 276 - output([t3.order_id(0x7f1433741960)], [t3.user_id(0x7f1433747810)]), filter([t3.area_id(0x7f1433750ab0) = 216(0x7f14337790f0)], [t3.order_state(0x7f14337641c0) = 9(0x7f1433763900)], [t3.is_delete(0x7f1433767280) = 0(0x7f14337669c0)]), rowset=256 access([GROUP_ID(0x7f10e7e75380)], [t3.id(0x7f1124489c60)], [t3.order_id(0x7f1433741960)], [t3.user_id(0x7f1433747810)], [t3.area_id(0x7f1433750ab0)], [t3.order_state(0x7f14337641c0)], [t3.is_delete(0x7f1433767280)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t3.order_id(0x7f1433741960)], [t3.shadow_pk_0(0x7f1409a99480)]), range(MIN ; MAX), range_cond([:275 = t3.order_id(0x7f1433741960)(0x7f1121909b50)]) 277 - output([t4.productid(0x7f1433756520)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7e7d390)], [t4.productid(0x7f1433756520)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f1433743930)]), range(MIN ; MAX), range_cond([:270 = t4.ppriceid(0x7f1433743930)(0x7f112190a560)]) 278 - output([pl.product_id(0x7f1433756960)]), filter([pl.is_delete(0x7f14337581c0) = 0(0x7f1433757900)]), rowset=256 access([pl.product_id(0x7f1433756960)], [pl.is_delete(0x7f14337581c0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f112448a920)]), range(MIN ; MAX)always true 279 - output(nil), filter([t5.is_delete(0x7f1433768ae0) = 0(0x7f1433768220)]), rowset=256 access([GROUP_ID(0x7f10e7e80c50)], [t5.is_delete(0x7f1433768ae0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f14337473d0)]), range(MIN ; MAX), range_cond([t5.id(0x7f14337473d0) = :277(0x7f112190af70)]) 280 - output([t6.return_id(0x7f143374d280)]), filter([t6.is_delete(0x7f143376a340) = 0(0x7f1433769a80)]), rowset=256 access([GROUP_ID(0x7f10e7e824c0)], [t6.id(0x7f112448a0a0)], [t6.return_id(0x7f143374d280)], [t6.is_delete(0x7f143376a340)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t6.mkc_id(0x7f143374b6f0)], [t6.id(0x7f112448a0a0)]), range(MIN ; MAX), range_cond([:271 = t6.mkc_id(0x7f143374b6f0)(0x7f112190b980)]) 281 - output(nil), filter([t7.is_delete(0x7f143374ef20) = 0(0x7f143374e660)], [t7.check2_time(0x7f1433774040) >= cast('2024-10-14 00:00:00', TIMESTAMP(-1, -1))(0x7f1433774850)(0x7f1433772600)], [t7.check2_time(0x7f1433774040) <= cast('2024-10-31 23:59:59', TIMESTAMP(-1, -1))(0x7f1433778050)(0x7f1433772e80)]), rowset=256 access([GROUP_ID(0x7f10e7e85c40)], [t7.is_delete(0x7f143374ef20)], [t7.check2_time(0x7f1433774040)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false,false], range_key([t7.id(0x7f143374d6c0)]), range(MIN ; MAX), range_cond([:281 = t7.id(0x7f143374d6c0)(0x7f112190c390)]) 282 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7e893c0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f143375d580)], [t36.id(0x7f112448ad60)]), range(MIN ; MAX), range_cond([:279 = t36.order_id(0x7f143375d580)(0x7f112b426260)]) 283 - output([t16.adjust_price_id(0x7f1433761100)], [t16.adjust_price(0x7f1433782830)]), filter([t16.is_delete(0x7f143376ce70) = 0(0x7f143376c5b0)]), rowset=256 access([GROUP_ID(0x7f10e7e89770)], [t16.id(0x7f112448b1a0)], [t16.adjust_price_id(0x7f1433761100)], [t16.is_delete(0x7f143376ce70)], [t16.adjust_price(0x7f1433782830)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t16.mkc_id(0x7f143375f120)], [t16.id(0x7f112448b1a0)]), range(MIN ; MAX), range_cond([t16.mkc_id(0x7f143375f120) = :273(0x7f112190cda0)]) 284 - output([t17.type(0x7f1433770c80)]), filter([t17.status(0x7f1433762960) = 3(0x7f14337620a0)], [t17.type(0x7f1433770c80) IN (2, 3)(0x7f116c153ab0)(0x7f143376ed80)]), rowset=256 access([GROUP_ID(0x7f10e7e8ee00)], [t17.status(0x7f1433762960)], [t17.type(0x7f1433770c80)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false], range_key([t17.id(0x7f1433760cc0)]), range(MIN ; MAX), range_cond([t17.id(0x7f1433760cc0) = :283(0x7f112190d7b0)]) 285 - output([cast(cast(t1.statistics_price(0x7f11a6311e10), DECIMAL_INT(42, 4))(0x7f11a6383140), DECIMAL_INT(77, 4))(0x7f10db450480)], [cast(cast(t1.inprice(0x7f11a63126c0), DECIMAL_INT(23, 2))(0x7f11a6384010), DECIMAL_INT(75, 2))(0x7f10db454330)], [cast(cast(cast(t2.statictisc_price(0x7f11a6316770), DECIMAL_INT(25, 4))(0x7f11a63743a0) + IFNULL(cast(t2.gift_price(0x7f11a6316bb0), DECIMAL_INT(24, 4))(0x7f11a6372420), cast(0, DECIMAL_INT(24, 4))(0x7f11a6373310))(0x7f11a6312f70)(0x7f11a6314270) - cast(IFNULL(cast(t1.statistics_price(0x7f11a6311e10), DECIMAL_INT(22, 2))(0x7f11a6375290), cast(0, DECIMAL_INT(22, 2))(0x7f11a63781c0))(0x7f11a6314af0), DECIMAL_INT(26, 4))(0x7f11a6379250)(0x7f11a6315df0), DECIMAL_INT(41, 4))(0x7f11a6384ee0), DECIMAL(65, 6))(0x7f10db457820)], [cast(cast(t2.statictisc_price(0x7f11a6316770), DECIMAL_INT(25, 4))(0x7f11a63743a0) + IFNULL(cast(t2.gift_price(0x7f11a6316bb0), DECIMAL_INT(24, 4))(0x7f11a6372420), cast(0, DECIMAL_INT(24, 4))(0x7f11a6373310))(0x7f11a6312f70)(0x7f11a6314270) - cast(IFNULL(cast(t1.inprice(0x7f11a63126c0), DECIMAL_INT(22, 2))(0x7f11a637a890), cast(0, DECIMAL_INT(22, 2))(0x7f11a637b780))(0x7f11a63191e0), DECIMAL_INT(26, 4))(0x7f11a637c810)(0x7f11a631a4e0), DECIMAL(65, 6))(0x7f10db45ac20)], [cast(cast(t1.examine_price(0x7f11a631b4d0), DECIMAL_INT(23, 2))(0x7f11a6387330), DECIMAL_INT(75, 2))(0x7f10db45de00)], [cast(cast(t2.statictisc_price(0x7f11a6316770), DECIMAL_INT(25, 4))(0x7f11a63743a0) + IFNULL(cast(t2.gift_price(0x7f11a6316bb0), DECIMAL_INT(24, 4))(0x7f11a6372420), cast(0, DECIMAL_INT(24, 4))(0x7f11a6373310))(0x7f11a6312f70)(0x7f11a6314270) - cast(IFNULL(cast(t1.examine_price(0x7f11a631b4d0), DECIMAL_INT(22, 2))(0x7f11a637ddc0), cast(0, DECIMAL_INT(22, 2))(0x7f11a637ecb0))(0x7f11a631d900), DECIMAL_INT(26, 4))(0x7f11a637fd40)(0x7f11a631ec00), DECIMAL(65, 6))(0x7f10db460e20)], ['1'], [cast(cast(t2.price(0x7f11a633bf40), DECIMAL_INT(23, 2))(0x7f11a63893b0), DECIMAL_INT(78, 2))(0x7f10db46a7d0)], [cast(cast(t2.sell_price(0x7f11a633cc60), DECIMAL_INT(23, 2))(0x7f11a638b150), DECIMAL_INT(78, 2))(0x7f10db470470)], [cast(cast(t2.gift_price(0x7f11a6316bb0), DECIMAL_INT(25, 4))(0x7f11a638c020), DECIMAL_INT(76, 4))(0x7f10db4732c0)], [cast(cast(t2.discount_price(0x7f11a633d980), DECIMAL_INT(25, 4))(0x7f11a638cef0), DECIMAL_INT(76, 4))(0x7f10db476110)], [cast(cast(t2.point_price(0x7f11a633e230), DECIMAL_INT(25, 4))(0x7f11a638ddc0), DECIMAL_INT(76, 4))(0x7f10db478f60)], [cast(cast(cast(t2.price(0x7f11a633bf40), DECIMAL_INT(17, 4))(0x7f11a6381730) - t2.discount_price(0x7f11a633d980)(0x7f11a635a5c0) - t2.point_price(0x7f11a633e230)(0x7f11a635b2a0), DECIMAL_INT(25, 4))(0x7f11a6391bc0), DECIMAL(65, 6))(0x7f10db4810d0)], [cast(t1.modify_price(0x7f11a635c110), DECIMAL_INT(39, 4))(0x7f11a6392c30)], [t2.in_user_id(0x7f11a635ce60)], [t2.in_user_name(0x7f11a635d710)]), filter(nil), rowset=256 equal_conds([t3.order_id(0x7f11a62dd8d0) = t36.order_id(0x7f11a62f9500)(0x7f11a62f8c40)]), other_conds(nil) 286 - output([t36.order_id(0x7f11a62f9500)]), filter(nil), rowset=256 access([t36.order_id(0x7f11a62f9500)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f11a62f9500)], [t36.id(0x7f117a048510)]), range(MIN,MIN ; MAX,MAX)always true 287 - output([t1.statistics_price(0x7f11a6311e10)], [cast(t2.statictisc_price(0x7f11a6316770), DECIMAL_INT(25, 4))(0x7f11a63743a0) + IFNULL(cast(t2.gift_price(0x7f11a6316bb0), DECIMAL_INT(24, 4))(0x7f11a6372420), cast(0, DECIMAL_INT(24, 4))(0x7f11a6373310))(0x7f11a6312f70)(0x7f11a6314270)], [t1.inprice(0x7f11a63126c0)], [t1.examine_price(0x7f11a631b4d0)], [t2.gift_price(0x7f11a6316bb0)], [t2.price(0x7f11a633bf40)], [t2.discount_price(0x7f11a633d980)], [t2.point_price(0x7f11a633e230)], [t2.in_user_id(0x7f11a635ce60)], [t2.in_user_name(0x7f11a635d710)], [t3.order_id(0x7f11a62dd8d0)], [t2.sell_price(0x7f11a633cc60)], [t1.modify_price(0x7f11a635c110)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f11a62ead80) = pl.product_id(0x7f11a62eb1c0)(0x7f11a62ea4c0)]), other_conds(nil) 288 - output([pl.product_id(0x7f11a62eb1c0)]), filter([pl.is_delete(0x7f11a62eca20) = 0(0x7f11a62ec160)]), rowset=256 access([pl.product_id(0x7f11a62eb1c0)], [pl.is_delete(0x7f11a62eca20)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f117a0480d0)]), range(MIN ; MAX)always true 289 - output([t1.statistics_price(0x7f11a6311e10)], [t1.inprice(0x7f11a63126c0)], [t1.examine_price(0x7f11a631b4d0)], [t2.gift_price(0x7f11a6316bb0)], [t2.price(0x7f11a633bf40)], [t2.discount_price(0x7f11a633d980)], [t2.point_price(0x7f11a633e230)], [t2.in_user_id(0x7f11a635ce60)], [t2.in_user_name(0x7f11a635d710)], [t3.order_id(0x7f11a62dd8d0)], [t2.statictisc_price(0x7f11a6316770)], [t2.sell_price(0x7f11a633cc60)], [t1.modify_price(0x7f11a635c110)], [t4.productid(0x7f11a62ead80)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.ppid(0x7f11a62df460)(:317)]), use_batch=true 290 - output([t1.statistics_price(0x7f11a6311e10)], [t1.inprice(0x7f11a63126c0)], [t1.examine_price(0x7f11a631b4d0)], [t2.gift_price(0x7f11a6316bb0)], [t2.price(0x7f11a633bf40)], [t2.discount_price(0x7f11a633d980)], [t2.point_price(0x7f11a633e230)], [t2.in_user_id(0x7f11a635ce60)], [t2.in_user_name(0x7f11a635d710)], [t1.ppid(0x7f11a62df460)], [t3.order_id(0x7f11a62dd8d0)], [t2.statictisc_price(0x7f11a6316770)], [t2.sell_price(0x7f11a633cc60)], [t1.modify_price(0x7f11a635c110)]), filter(nil), rowset=256 conds([t2.product_stock_type(0x7f11a62d99f0) != 3(0x7f11a62d9130)]), nl_params_([t2.id(0x7f11a62d6930)(:314)]), use_batch=true 291 - output([t2.gift_price(0x7f11a6316bb0)], [t2.price(0x7f11a633bf40)], [t2.discount_price(0x7f11a633d980)], [t2.point_price(0x7f11a633e230)], [t2.in_user_id(0x7f11a635ce60)], [t2.in_user_name(0x7f11a635d710)], [t2.product_stock_type(0x7f11a62d99f0) != 3(0x7f11a62d9130)], [t2.id(0x7f11a62d6930)], [t3.order_id(0x7f11a62dd8d0)], [t2.statictisc_price(0x7f11a6316770)], [t2.sell_price(0x7f11a633cc60)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f11a62dd8d0)(:316)]), use_batch=true 292 - output([t3.order_id(0x7f11a62dd8d0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f11a62e3780)(:318)]), use_batch=true 293 - output([t3.order_id(0x7f11a62dd8d0)], [t3.user_id(0x7f11a62e3780)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 294 - output([t3.order_id(0x7f11a62dd8d0)], [t3.user_id(0x7f11a62e3780)]), filter([t3.order_complete_time(0x7f11a6308760) >= cast('2024-10-14 00:00:00', TIMESTAMP(-1, -1))(0x7f11a6308f70)(0x7f11a6306d20)], [t3.order_complete_time(0x7f11a6308760) <= cast('2024-10-31 23:59:59', TIMESTAMP(-1, -1))(0x7f11a6309ff0)(0x7f11a63075a0)], [t3.order_state(0x7f11a62fdf50) IN (3, 9)(0x7f116c1562c0)(0x7f11a62fc050)], [t3.is_delete(0x7f11a6301100) = 0(0x7f11a6300840)]), rowset=256 access([t3.id(0x7f117a047850)], [t3.order_id(0x7f11a62dd8d0)], [t3.user_id(0x7f11a62e3780)], [t3.order_state(0x7f11a62fdf50)], [t3.is_delete(0x7f11a6301100)], [t3.order_complete_time(0x7f11a6308760)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false,false], range_key([t3.area_id(0x7f11a62e7220)], [t3.id(0x7f117a047850)]), range(216,MIN ; 216,MAX), range_cond([t3.area_id(0x7f11a62e7220) = 216(0x7f112190e1c0)]) 295 - output(nil), filter(nil), rowset=256 296 - output(nil), filter(nil), rowset=256 access(nil), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f11a62e7660)]), range[216 ; 216], range_cond([t8.id(0x7f11a62e7660) = 216(0x7f112190f060)]) 297 - output(nil), filter([t5.is_delete(0x7f11a6302960) = 0(0x7f11a63020a0)]), rowset=256 access([GROUP_ID(0x7f10e7ea0930)], [t5.is_delete(0x7f11a6302960)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f11a62e3340)]), range(MIN ; MAX), range_cond([t5.id(0x7f11a62e3340) = :318(0x7f112190ff00)]) 298 - output([t2.id(0x7f11a62d6930)], [t2.statictisc_price(0x7f11a6316770)], [t2.gift_price(0x7f11a6316bb0)], [t2.price(0x7f11a633bf40)], [t2.sell_price(0x7f11a633cc60)], [t2.discount_price(0x7f11a633d980)], [t2.point_price(0x7f11a633e230)], [t2.in_user_id(0x7f11a635ce60)], [t2.in_user_name(0x7f11a635d710)], [t2.product_stock_type(0x7f11a62d99f0) != 3(0x7f11a62d9130)]), filter([t2.is_mobile(0x7f11a63041c0) = 1(0x7f11a6303900)], [t2.is_delete(0x7f11a62ff8a0) = 0(0x7f11a62fefe0)], [t2.product_stock_type(0x7f11a62d99f0) != 3(0x7f11a62d9130)], [t2.product_stock_type(0x7f11a62d99f0) IN (0, 1, 2, 6)(0x7f116c156d00)(0x7f11a630e880)]), rowset=256 access([GROUP_ID(0x7f10e7ea21a0)], [t2.id(0x7f11a62d6930)], [t2.product_stock_type(0x7f11a62d99f0)], [t2.is_delete(0x7f11a62ff8a0)], [t2.is_mobile(0x7f11a63041c0)], [t2.statictisc_price(0x7f11a6316770)], [t2.gift_price(0x7f11a6316bb0)], [t2.price(0x7f11a633bf40)], [t2.sell_price(0x7f11a633cc60)], [t2.discount_price(0x7f11a633d980)], [t2.point_price(0x7f11a633e230)], [t2.in_user_id(0x7f11a635ce60)], [t2.in_user_name(0x7f11a635d710)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false,false], range_key([t2.order_id(0x7f11a62dd490)], [t2.id(0x7f11a62d6930)]), range(MIN ; MAX), range_cond([t2.order_id(0x7f11a62dd490) = :316(0x7f1121910910)]) 299 - output([t1.ppid(0x7f11a62df460)], [t1.statistics_price(0x7f11a6311e10)], [t1.inprice(0x7f11a63126c0)], [t1.examine_price(0x7f11a631b4d0)], [t1.modify_price(0x7f11a635c110)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7eacb10)], [t1.id(0x7f11a62d4f10)], [t1.ppid(0x7f11a62df460)], [t1.statistics_price(0x7f11a6311e10)], [t1.inprice(0x7f11a63126c0)], [t1.examine_price(0x7f11a631b4d0)], [t1.modify_price(0x7f11a635c110)]), partitions(p[0-9]) is_index_back=true, is_global_index=false, range_key([t1.order_detail_id(0x7f11a62d64f0)], [t1.order_detail_type(0x7f11a62d8190)], [t1.id(0x7f11a62d4f10)]), range(MIN ; MAX), range_cond([t1.order_detail_type(0x7f11a62d8190) = 1(0x7f1121911320)], [t1.order_detail_id(0x7f11a62d64f0) = :314(0x7f11219121c0)]) 300 - output([t4.productid(0x7f11a62ead80)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7eb4b00)], [t4.productid(0x7f11a62ead80)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f11a62df8a0)]), range(MIN ; MAX), range_cond([:317 = t4.ppriceid(0x7f11a62df8a0)(0x7f1121912bd0)]) 301 - output([cast(cast(cast(0, DECIMAL_INT(25, 4))(0x7f119a278260) - cast(t16.adjust_price(0x7f119a207650), DECIMAL_INT(25, 4))(0x7f119a279150)(0x7f119a206d90), DECIMAL_INT(42, 4))(0x7f119a27d550), DECIMAL_INT(77, 4))(0x7f10db451390)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f119a2807d0), DECIMAL_INT(75, 2))(0x7f10db455240)], [cast(cast(t16.adjust_price(0x7f119a207650), DECIMAL_INT(41, 4))(0x7f119a2816a0), DECIMAL(65, 6))(0x7f10db458b10)], [cast(cast(0, DECIMAL_INT(26, 4))(0x7f119a282570), DECIMAL(65, 6))(0x7f10db45bec0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f119a283440), DECIMAL_INT(75, 2))(0x7f10db45ed10)], [cast(cast(0, DECIMAL_INT(26, 4))(0x7f119a284310), DECIMAL(65, 6))(0x7f10db4620c0)], [cast(0, VARCHAR(20))(0x7f119a2851e0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f119a2860b0), DECIMAL_INT(78, 2))(0x7f10db46b6e0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f119a287e50), DECIMAL_INT(78, 2))(0x7f10db471380)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f119a288d20), DECIMAL_INT(76, 4))(0x7f10db4741d0)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f119a289bf0), DECIMAL_INT(76, 4))(0x7f10db477020)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f119a28aac0), DECIMAL_INT(76, 4))(0x7f10db479e70)], [cast(cast(0, DECIMAL_INT(25, 4))(0x7f119a28c860), DECIMAL(65, 6))(0x7f10db482190)], [cast(CASE WHEN t17.type(0x7f11a63e6160) = 3(0x7f119a25e9a0) THEN t16.adjust_price(0x7f119a207650) ELSE cast(0.00, DECIMAL_INT(16, 4))(0x7f119a27a970) END(0x7f119a25d710), DECIMAL_INT(39, 4))(0x7f119a28d730)], [t2.in_user_id(0x7f119a262770)], [t2.in_user_name(0x7f119a263020)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f11a63bcc10)(:331)]), use_batch=true 302 - output([t3.user_id(0x7f11a63bcc10)], [t16.adjust_price(0x7f119a207650)], [t2.in_user_id(0x7f119a262770)], [t2.in_user_name(0x7f119a263020)], [t17.type(0x7f11a63e6160)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f11a63b6d60)(:333)]), use_batch=true 303 - output([t3.user_id(0x7f11a63bcc10)], [t16.adjust_price(0x7f119a207650)], [t2.in_user_id(0x7f119a262770)], [t2.in_user_name(0x7f119a263020)], [t3.order_id(0x7f11a63b6d60)], [t17.type(0x7f11a63e6160)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f11a63c4210) = pl.product_id(0x7f11a63c4650)(0x7f11a63c3950)]), other_conds(nil) 304 - output([pl.product_id(0x7f11a63c4650)]), filter([pl.is_delete(0x7f11a63c5eb0) = 0(0x7f11a63c55f0)]), rowset=256 access([pl.product_id(0x7f11a63c4650)], [pl.is_delete(0x7f11a63c5eb0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f117a054f70)]), range(MIN ; MAX)always true 305 - output([t3.user_id(0x7f11a63bcc10)], [t16.adjust_price(0x7f119a207650)], [t2.in_user_id(0x7f119a262770)], [t2.in_user_name(0x7f119a263020)], [t3.order_id(0x7f11a63b6d60)], [t17.type(0x7f11a63e6160)], [t4.productid(0x7f11a63c4210)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 306 - output([t3.user_id(0x7f11a63bcc10)], [t16.adjust_price(0x7f119a207650)], [t2.in_user_id(0x7f119a262770)], [t2.in_user_name(0x7f119a263020)], [t3.order_id(0x7f11a63b6d60)], [t17.type(0x7f11a63e6160)], [t4.productid(0x7f11a63c4210)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.ppid(0x7f11a63b88f0)(:328)]), use_batch=true 307 - output([t3.user_id(0x7f11a63bcc10)], [t16.adjust_price(0x7f119a207650)], [t2.in_user_id(0x7f119a262770)], [t2.in_user_name(0x7f119a263020)], [t3.order_id(0x7f11a63b6d60)], [t1.ppid(0x7f11a63b88f0)], [t17.type(0x7f11a63e6160)]), filter(nil), rowset=256 equal_conds([t2.order_id(0x7f11a63b6920) = t3.order_id(0x7f11a63b6d60)(0x7f11a63b6060)]), other_conds(nil) 308 - output([t16.adjust_price(0x7f119a207650)], [t2.in_user_id(0x7f119a262770)], [t2.in_user_name(0x7f119a263020)], [t1.ppid(0x7f11a63b88f0)], [t17.type(0x7f11a63e6160)], [t2.order_id(0x7f11a63b6920)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.order_detail_id(0x7f11a63ad970)(:325)]), use_batch=true 309 - output([t16.adjust_price(0x7f119a207650)], [t1.ppid(0x7f11a63b88f0)], [t1.order_detail_id(0x7f11a63ad970)], [t17.type(0x7f11a63e6160)]), filter(nil), rowset=256 conds(nil), nl_params_([t16.mkc_id(0x7f11a63d4530)(:330)]), use_batch=true 310 - output([t16.adjust_price(0x7f119a207650)], [t16.mkc_id(0x7f11a63d4530)], [t17.type(0x7f11a63e6160)]), filter(nil), rowset=256 conds(nil), nl_params_([t17.id(0x7f11a63d8420)(:336)]), use_batch=true 311 - output([t17.id(0x7f11a63d8420)], [t17.type(0x7f11a63e6160)]), filter(nil), rowset=256 access([t17.id(0x7f11a63d8420)], [t17.type(0x7f11a63e6160)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t17.type(0x7f11a63e6160)], [t17.status(0x7f11a63e3bb0)], [t17.handle_time(0x7f11a63ead80)], [t17.id(0x7f11a63d8420)]), range(2,3,2024-10-13 16:00:00.000000,MIN ; 2,3,2024-10-31 15:59:59.000000,MAX), (3,3,2024-10-13 16:00:00.000000,MIN ; 3,3,2024-10-31 15:59:59.000000,MAX), range_cond([t17.status(0x7f11a63e3bb0) = 3(0x7f11a63e32f0)], [t17.handle_time(0x7f11a63ead80) >= cast('2024-10-14 00:00:00', TIMESTAMP(-1, -1))(0x7f11a63eb590)(0x7f11a63e9340)], [t17.handle_time(0x7f11a63ead80) <= cast('2024-10-31 23:59:59', TIMESTAMP(-1, -1))(0x7f11a63ec610)(0x7f11a63e9bc0)], [t17.type(0x7f11a63e6160) IN (2, 3)(0x7f116c15b500)(0x7f11a63e4260)]) 312 - output([t16.mkc_id(0x7f11a63d4530)], [t16.adjust_price(0x7f119a207650)]), filter([t16.is_adjust_after_trade(0x7f11a63e7ab0) = 1(0x7f11a63e71f0)]), rowset=256 access([GROUP_ID(0x7f10e7eba190)], [t16.id(0x7f117a0557f0)], [t16.mkc_id(0x7f11a63d4530)], [t16.is_adjust_after_trade(0x7f11a63e7ab0)], [t16.adjust_price(0x7f119a207650)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t16.adjust_price_id(0x7f11a63d8860)], [t16.id(0x7f117a0557f0)]), range(MIN ; MAX), range_cond([:336 = t16.adjust_price_id(0x7f11a63d8860)(0x7f11219135e0)]) 313 - output([t1.order_detail_id(0x7f11a63ad970)], [t1.ppid(0x7f11a63b88f0)]), filter([t1.order_detail_type(0x7f11a63af610) = 1(0x7f11a63aed50)]), rowset=256 access([GROUP_ID(0x7f10e7ec3330)], [t1.id(0x7f11a63ac390)], [t1.order_detail_id(0x7f11a63ad970)], [t1.order_detail_type(0x7f11a63af610)], [t1.ppid(0x7f11a63b88f0)]), partitions(p[0-9]) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t1.mkc_id(0x7f11a63d4970)], [t1.id(0x7f11a63ac390)]), range(MIN ; MAX), range_cond([:330 = t1.mkc_id(0x7f11a63d4970)(0x7f1121913ff0)]) 314 - output([t2.order_id(0x7f11a63b6920)], [t2.in_user_id(0x7f119a262770)], [t2.in_user_name(0x7f119a263020)]), filter([t2.is_mobile(0x7f11a63e1080) = 1(0x7f11a63e07c0)], [t2.is_delete(0x7f11a63dc760) = 0(0x7f11a63dbea0)], [t2.product_stock_type(0x7f11a63b0e70) != 3(0x7f11a63b05b0)], [t2.product_stock_type(0x7f11a63b0e70) IN (0, 1, 2, 6)(0x7f116c15bf40)(0x7f11a63f0ea0)]), rowset=256 access([GROUP_ID(0x7f10e7ec89c0)], [t2.product_stock_type(0x7f11a63b0e70)], [t2.order_id(0x7f11a63b6920)], [t2.is_delete(0x7f11a63dc760)], [t2.is_mobile(0x7f11a63e1080)], [t2.in_user_id(0x7f119a262770)], [t2.in_user_name(0x7f119a263020)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false,false,false], range_key([t2.id(0x7f11a63addb0)]), range(MIN ; MAX), range_cond([:325 = t2.id(0x7f11a63addb0)(0x7f1121914a00)]) 315 - output([t3.order_id(0x7f11a63b6d60)], [t3.user_id(0x7f11a63bcc10)]), filter([t3.order_state(0x7f11a63dae10) IN (3, 9)(0x7f116c15aa70)(0x7f11a63d8f10)], [t3.is_delete(0x7f11a63ddfc0) = 0(0x7f11a63dd700)]), rowset=256 access([t3.id(0x7f117a0546f0)], [t3.order_id(0x7f11a63b6d60)], [t3.user_id(0x7f11a63bcc10)], [t3.order_state(0x7f11a63dae10)], [t3.is_delete(0x7f11a63ddfc0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false], range_key([t3.area_id(0x7f11a63c06b0)], [t3.id(0x7f117a0546f0)]), range(216,MIN ; 216,MAX), range_cond([t3.area_id(0x7f11a63c06b0) = 216(0x7f1121915410)]) 316 - output([t4.productid(0x7f11a63c4210)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7ed47f0)], [t4.productid(0x7f11a63c4210)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f11a63b8d30)]), range(MIN ; MAX), range_cond([:328 = t4.ppriceid(0x7f11a63b8d30)(0x7f11219162b0)]) 317 - output(nil), filter(nil), rowset=256 318 - output(nil), filter(nil), rowset=256 access(nil), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f11a63c0af0)]), range[216 ; 216], range_cond([t8.id(0x7f11a63c0af0) = 216(0x7f1121916cc0)]) 319 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7ed4ba0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f11a63d2990)], [t36.id(0x7f117a0553b0)]), range(MIN ; MAX), range_cond([:333 = t36.order_id(0x7f11a63d2990)(0x7f12b65a9110)]) 320 - output(nil), filter([t5.is_delete(0x7f11a63df820) = 0(0x7f11a63def60)]), rowset=256 access([GROUP_ID(0x7f10e7ed4f50)], [t5.is_delete(0x7f11a63df820)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f11a63bc7d0)]), range(MIN ; MAX), range_cond([t5.id(0x7f11a63bc7d0) = :331(0x7f1121917b60)]) 321 - output([cast(T_FUN_SUM(t10.statistics_in_price(0x7f11857c4ce0))(0x7f11857c4350), DECIMAL_INT(77, 4))(0x7f10db452410)], [T_FUN_SUM(t10.in_price(0x7f11857c5b20))(0x7f11857c5190)], [T_FUN_SUM(t10.statistics_gross_profit(0x7f11857c6960))(0x7f11857c5fd0)], [T_FUN_SUM(t10.gross_profit(0x7f11857c77a0))(0x7f11857c6e10)], [T_FUN_SUM(t10.examine_price(0x7f11857c85e0))(0x7f11857c7c50)], [T_FUN_SUM(t10.examine_gross_profit(0x7f11857c9420))(0x7f11857c8a90)], [cast(T_FUN_SUM(t10.count(0x7f11857e4430))(0x7f11857e3aa0), VARCHAR(65))(0x7f10db4688b0)], [T_FUN_SUM(t10.price(0x7f11857e5270))(0x7f11857e48e0)], [T_FUN_SUM(t10.sell_price(0x7f11857e89c0))(0x7f11857e8030)], [T_FUN_SUM(t10.gift_price(0x7f11857e9800))(0x7f11857e8e70)], [T_FUN_SUM(t10.discount_price(0x7f11857ea640))(0x7f11857e9cb0)], [T_FUN_SUM(t10.point_price(0x7f11857eb480))(0x7f11857eaaf0)], [T_FUN_SUM(t10.actualPaymentPrice(0x7f10db41fc00))(0x7f10db41f270)], [cast(T_FUN_SUM(t10.self_modify_price(0x7f10db420a40))(0x7f10db4200b0), DECIMAL_INT(76, 4))(0x7f10db4830a0)], [t10.in_user_id(0x7f10db4217f0)], [t10.in_user_name(0x7f10db4220a0)]), filter(nil), rowset=256 group([t10.business_type(0x7f11857ccd40)], [t10.is_mobile(0x7f11857bfdb0)], [t10.date(0x7f11857ca1a0)], [t10.order_complete_time(0x7f11857caa50)], [t10.area_id(0x7f11857c1610)], [t10.order_id(0x7f11857c2e70)], [t10.order_type(0x7f11857cd5f0)], [t10.user_id(0x7f11857cdea0)], [t10.ppid(0x7f11857ddf70)], [t10.insource_id(0x7f11857df0d0)], [t10.i_mei_or_barcode(0x7f11857e0230)], [t10.in_user_id(0x7f10db4217f0)], [t10.in_user_name(0x7f10db4220a0)], [t10.product_color(0x7f10db422950)], [t10.product_id(0x7f10db423200)], [t10.cid(0x7f10db423ab0)], [t10.brand_id(0x7f10db424360)], [t10.product_name(0x7f10db424c10)], [t10.customer_type(0x7f10db4254c0)], [t10.order_customer_type(0x7f10db425d70)], [t10.customer_name(0x7f10db426620)], [t10.customer_phone(0x7f10db426ed0)], [t10.contract_name(0x7f10db427780)], [t10.contract_mobile(0x7f10db428030)], [t10.trader_name(0x7f10db4288e0)], [t10.inSourceId2(0x7f11857df980)], [t10.detail_type(0x7f11857de820)], [t10.comment(0x7f10db429190)], [t10.product_comment(0x7f10db429a40)], [t10.label_id(0x7f10db42a2f0)], [t10.label_name(0x7f10db42aba0)], [t10.detail_parent_id(0x7f10db42b450)], [t10.serial_number_mark_name(0x7f10db42bd00)], [t10.serial_number_mark_color(0x7f10db42c5b0)], [t10.serial_number_mark(0x7f10db42ce60)], [t10.aux_sale_man_names(0x7f10db42d710)], [t10.sample_product(0x7f10db42dfc0)], [t10.accountingBodyId(0x7f11857cb770)], [t10.accountingBodyName(0x7f11857cc020)]), agg_func([T_FUN_SUM(t10.statistics_in_price(0x7f11857c4ce0))(0x7f11857c4350)], [T_FUN_SUM(t10.in_price(0x7f11857c5b20))(0x7f11857c5190)], [T_FUN_SUM(t10.statistics_gross_profit(0x7f11857c6960))(0x7f11857c5fd0)], [T_FUN_SUM(t10.gross_profit(0x7f11857c77a0))(0x7f11857c6e10)], [T_FUN_SUM(t10.examine_price(0x7f11857c85e0))(0x7f11857c7c50)], [T_FUN_SUM(t10.examine_gross_profit(0x7f11857c9420))(0x7f11857c8a90)], [T_FUN_SUM(t10.count(0x7f11857e4430))(0x7f11857e3aa0)], [T_FUN_SUM(t10.price(0x7f11857e5270))(0x7f11857e48e0)], [T_FUN_SUM(t10.sell_price(0x7f11857e89c0))(0x7f11857e8030)], [T_FUN_SUM(t10.gift_price(0x7f11857e9800))(0x7f11857e8e70)], [T_FUN_SUM(t10.discount_price(0x7f11857ea640))(0x7f11857e9cb0)], [T_FUN_SUM(t10.point_price(0x7f11857eb480))(0x7f11857eaaf0)], [T_FUN_SUM(t10.actualPaymentPrice(0x7f10db41fc00))(0x7f10db41f270)], [T_FUN_SUM(t10.self_modify_price(0x7f10db420a40))(0x7f10db4200b0)]) 322 - output([t10.statistics_in_price(0x7f11857c4ce0)], [t10.in_price(0x7f11857c5b20)], [t10.statistics_gross_profit(0x7f11857c6960)], [t10.gross_profit(0x7f11857c77a0)], [t10.examine_price(0x7f11857c85e0)], [t10.examine_gross_profit(0x7f11857c9420)], [t10.is_mobile(0x7f11857bfdb0)], [t10.date(0x7f11857ca1a0)], [t10.order_complete_time(0x7f11857caa50)], [t10.area_id(0x7f11857c1610)], [t10.accountingBodyId(0x7f11857cb770)], [t10.accountingBodyName(0x7f11857cc020)], [t10.order_id(0x7f11857c2e70)], [t10.business_type(0x7f11857ccd40)], [t10.order_type(0x7f11857cd5f0)], [t10.user_id(0x7f11857cdea0)], [t10.ppid(0x7f11857ddf70)], [t10.detail_type(0x7f11857de820)], [t10.insource_id(0x7f11857df0d0)], [t10.inSourceId2(0x7f11857df980)], [t10.i_mei_or_barcode(0x7f11857e0230)], [t10.count(0x7f11857e4430)], [t10.price(0x7f11857e5270)], [t10.sell_price(0x7f11857e89c0)], [t10.gift_price(0x7f11857e9800)], [t10.discount_price(0x7f11857ea640)], [t10.point_price(0x7f11857eb480)], [t10.actualPaymentPrice(0x7f10db41fc00)], [t10.self_modify_price(0x7f10db420a40)], [t10.in_user_id(0x7f10db4217f0)], [t10.in_user_name(0x7f10db4220a0)], [t10.product_color(0x7f10db422950)], [t10.product_id(0x7f10db423200)], [t10.cid(0x7f10db423ab0)], [t10.brand_id(0x7f10db424360)], [t10.product_name(0x7f10db424c10)], [t10.customer_type(0x7f10db4254c0)], [t10.order_customer_type(0x7f10db425d70)], [t10.customer_name(0x7f10db426620)], [t10.customer_phone(0x7f10db426ed0)], [t10.contract_name(0x7f10db427780)], [t10.contract_mobile(0x7f10db428030)], [t10.trader_name(0x7f10db4288e0)], [t10.comment(0x7f10db429190)], [t10.product_comment(0x7f10db429a40)], [t10.label_id(0x7f10db42a2f0)], [t10.label_name(0x7f10db42aba0)], [t10.detail_parent_id(0x7f10db42b450)], [t10.serial_number_mark_name(0x7f10db42bd00)], [t10.serial_number_mark_color(0x7f10db42c5b0)], [t10.serial_number_mark(0x7f10db42ce60)], [t10.aux_sale_man_names(0x7f10db42d710)], [t10.sample_product(0x7f10db42dfc0)]), filter(nil), rowset=256 access([t10.statistics_in_price(0x7f11857c4ce0)], [t10.in_price(0x7f11857c5b20)], [t10.statistics_gross_profit(0x7f11857c6960)], [t10.gross_profit(0x7f11857c77a0)], [t10.examine_price(0x7f11857c85e0)], [t10.examine_gross_profit(0x7f11857c9420)], [t10.is_mobile(0x7f11857bfdb0)], [t10.date(0x7f11857ca1a0)], [t10.order_complete_time(0x7f11857caa50)], [t10.area_id(0x7f11857c1610)], [t10.accountingBodyId(0x7f11857cb770)], [t10.accountingBodyName(0x7f11857cc020)], [t10.order_id(0x7f11857c2e70)], [t10.business_type(0x7f11857ccd40)], [t10.order_type(0x7f11857cd5f0)], [t10.user_id(0x7f11857cdea0)], [t10.ppid(0x7f11857ddf70)], [t10.detail_type(0x7f11857de820)], [t10.insource_id(0x7f11857df0d0)], [t10.inSourceId2(0x7f11857df980)], [t10.i_mei_or_barcode(0x7f11857e0230)], [t10.count(0x7f11857e4430)], [t10.price(0x7f11857e5270)], [t10.sell_price(0x7f11857e89c0)], [t10.gift_price(0x7f11857e9800)], [t10.discount_price(0x7f11857ea640)], [t10.point_price(0x7f11857eb480)], [t10.actualPaymentPrice(0x7f10db41fc00)], [t10.self_modify_price(0x7f10db420a40)], [t10.in_user_id(0x7f10db4217f0)], [t10.in_user_name(0x7f10db4220a0)], [t10.product_color(0x7f10db422950)], [t10.product_id(0x7f10db423200)], [t10.cid(0x7f10db423ab0)], [t10.brand_id(0x7f10db424360)], [t10.product_name(0x7f10db424c10)], [t10.customer_type(0x7f10db4254c0)], [t10.order_customer_type(0x7f10db425d70)], [t10.customer_name(0x7f10db426620)], [t10.customer_phone(0x7f10db426ed0)], [t10.contract_name(0x7f10db427780)], [t10.contract_mobile(0x7f10db428030)], [t10.trader_name(0x7f10db4288e0)], [t10.comment(0x7f10db429190)], [t10.product_comment(0x7f10db429a40)], [t10.label_id(0x7f10db42a2f0)], [t10.label_name(0x7f10db42aba0)], [t10.detail_parent_id(0x7f10db42b450)], [t10.serial_number_mark_name(0x7f10db42bd00)], [t10.serial_number_mark_color(0x7f10db42c5b0)], [t10.serial_number_mark(0x7f10db42ce60)], [t10.aux_sale_man_names(0x7f10db42d710)], [t10.sample_product(0x7f10db42dfc0)]) 323 - output([UNION([1])(0x7f11857738c0)], [UNION([2])(0x7f1185773c70)], [UNION([3])(0x7f1185774020)], [UNION([4])(0x7f11857743d0)], [UNION([5])(0x7f1185774780)], [UNION([6])(0x7f1185774b30)], [UNION([7])(0x7f1185774ee0)], [UNION([8])(0x7f1185775290)], [UNION([9])(0x7f1185775640)], [UNION([10])(0x7f11857759f0)], [UNION([11])(0x7f1185778050)], [UNION([12])(0x7f1185778400)], [UNION([13])(0x7f11857787b0)], [UNION([14])(0x7f1185778b60)], [UNION([15])(0x7f1185778f10)], [UNION([16])(0x7f11857792c0)], [UNION([17])(0x7f1185786f80)], [UNION([18])(0x7f1185787330)], [UNION([19])(0x7f11857876e0)], [UNION([20])(0x7f1185787a90)], [UNION([21])(0x7f1185787e40)], [UNION([22])(0x7f1185789810)], [UNION([23])(0x7f1185789bc0)], [UNION([24])(0x7f1185789f70)], [UNION([25])(0x7f118578a320)], [UNION([26])(0x7f118578a6d0)], [UNION([27])(0x7f118578aa80)], [UNION([28])(0x7f118578b1e0)], [UNION([29])(0x7f11857a67a0)], [UNION([30])(0x7f11857a6f00)], [UNION([31])(0x7f11857a72b0)], [UNION([32])(0x7f11857a7660)], [UNION([33])(0x7f11857a7a10)], [UNION([34])(0x7f11857a7dc0)], [UNION([35])(0x7f11857a8170)], [UNION([36])(0x7f11857a8520)], [UNION([37])(0x7f11857a88d0)], [UNION([38])(0x7f11857a8c80)], [UNION([39])(0x7f11857a9030)], [UNION([40])(0x7f11857a93e0)], [UNION([41])(0x7f11857a9790)], [UNION([42])(0x7f11857a9b40)], [UNION([43])(0x7f11857a9ef0)], [UNION([44])(0x7f11857aa2a0)], [UNION([45])(0x7f11857aa650)], [UNION([46])(0x7f11857aaa00)], [UNION([47])(0x7f11857aadb0)], [UNION([48])(0x7f11857ab160)], [UNION([49])(0x7f11857ab510)], [UNION([50])(0x7f11857ab8c0)], [UNION([51])(0x7f11857abc70)], [UNION([52])(0x7f11857ac020)], [UNION([53])(0x7f11857ac3d0)]), filter(nil), rowset=256 324 - output([T_FUN_SUM(IFNULL(IFNULL(t1.statistics_price(0x7f119a31e0c0) * cast(t1.counts(0x7f119a31e500), DECIMAL_INT(20, 0))(0x7f119a3ca980)(0x7f119a3190f0), cast(CASE WHEN NULL = 1(0x7f119a31b4b0) AND t2.jiuxun_service_flag(0x7f119a31e940) = 1(0x7f119a31c620)(0x7f119a31a310) THEN t2.jiuxun_service_cost_price(0x7f119a31ed80) ELSE t2.in_price(0x7f119a31f1c0) END(0x7f119a319970), DECIMAL_INT(30, 2))(0x7f119a3cbe70))(0x7f119a317f70), cast(0, DECIMAL_INT(30, 2))(0x7f119a3ccf40))(0x7f119a3176b0))(0x7f119a3171a0)], [T_FUN_SUM(IFNULL(IFNULL(t1.inprice(0x7f119a326b30) * cast(t1.counts(0x7f119a31e500), DECIMAL_INT(20, 0))(0x7f119a3ce5b0)(0x7f119a321b60), cast(CASE WHEN NULL = 1(0x7f119a323f20) AND t2.jiuxun_service_flag(0x7f119a31e940) = 1(0x7f119a325090)(0x7f119a322d80) THEN t2.jiuxun_service_cost_price(0x7f119a31ed80) ELSE t2.in_price(0x7f119a31f1c0) END(0x7f119a3223e0), DECIMAL_INT(30, 2))(0x7f119a3cfaa0))(0x7f119a3209e0), cast(0, DECIMAL_INT(30, 2))(0x7f119a3d0b70))(0x7f119a320120))(0x7f119a31fc10)], [cast(cast(t2.statictisc_price(0x7f119a334080), DECIMAL_INT(25, 4))(0x7f119a3d42e0) + IFNULL(cast(t2.gift_price(0x7f119a3344c0), DECIMAL_INT(24, 4))(0x7f119a3d2360), cast(0, DECIMAL_INT(24, 4))(0x7f119a3d3250))(0x7f119a3279e0)(0x7f119a328ce0) * CASE WHEN t2.virtual_product(0x7f119a334900) = 0(0x7f119a32a7f0) THEN T_FUN_SUM(t1.counts(0x7f119a31e500))(0x7f119a32b070 ) ELSE cast(t2.counts(0x7f119a334d40), DECIMAL_INT(42, 0))(0x7f119a3d54b0) END(0x7f119a329560)(0x7f119a32be70) - cast(T_FUN_SUM(IFNULL(IFNULL(t1.statistics_price(0x7f119a31e0c0) * cast(t1.counts(0x7f119a31e500), DECIMAL_INT(20, 0))(0x7f119a3ca980)(0x7f119a3190f0), cast(CASE WHEN NULL = 1(0x7f119a31b4b0) AND t2.jiuxun_service_flag(0x7f119a31e940) = 1(0x7f119a31c620)(0x7f119a31a310) THEN t2.jiuxun_service_cost_price(0x7f119a31ed80) ELSE t2.in_price(0x7f119a31f1c0) END(0x7f119a319970), DECIMAL_INT(30, 2))(0x7f119a3cbe70))(0x7f119a317f70), cast(0, DECIMAL_INT(30, 2))(0x7f119a3ccf40))(0x7f119a3176b0))(0x7f119a3171a0), DECIMAL_INT(68, 4))(0x7f119a3d67e0)(0x7f119a333440), DECIMAL(65, 6))(0x7f118576bc40)], [cast(cast(t2.statictisc_price(0x7f119a334080), DECIMAL_INT(25, 4))(0x7f119a3d42e0) + IFNULL(cast(t2.gift_price(0x7f119a3344c0), DECIMAL_INT(24, 4))(0x7f119a3d2360), cast(0, DECIMAL_INT(24, 4))(0x7f119a3d3250))(0x7f119a3279e0)(0x7f119a328ce0) * CASE WHEN t2.virtual_product(0x7f119a334900) = 0(0x7f119a33b2e0) THEN T_FUN_SUM(t1.counts(0x7f119a31e500))(0x7f119a32b070) ELSE cast(t2.counts(0x7f119a334d40), DECIMAL_INT(42, 0))(0x7f119a3d8c20) END(0x7f119a33a050)(0x7f119a33c960) - cast(T_FUN_SUM(IFNULL(IFNULL(t1.inprice(0x7f119a326b30) * cast(t1.counts(0x7f119a31e500), DECIMAL_INT(20, 0))(0x7f119a3ce5b0)(0x7f119a321b60), cast(CASE WHEN NULL = 1(0x7f119a323f20) AND t2.jiuxun_service_flag(0x7f119a31e940) = 1(0x7f119a325090)(0x7f119a322d80) THEN t2.jiuxun_service_cost_price(0x7f119a31ed80) ELSE t2.in_price(0x7f119a31f1c0) END(0x7f119a3223e0), DECIMAL_INT(30, 2))(0x7f119a3cfaa0))(0x7f119a3209e0), cast(0, DECIMAL_INT(30, 2))(0x7f119a3d0b70))(0x7f119a320120))(0x7f119a31fc10), DECIMAL_INT(68, 4))(0x7f119a3d9f50)(0x7f119a343f30), DECIMAL(65, 6))(0x7f118576d410)], [T_FUN_SUM(IFNULL(IFNULL(t1.examine_price(0x7f119a348960) * cast(t1.counts(0x7f119a31e500), DECIMAL_INT(20, 0))(0x7f119a3dbbf0)(0x7f119a347470), cast(t2.examine_price(0x7f119a348da0), DECIMAL_INT(30, 2))(0x7f119a3dcae0))(0x7f119a3462f0), cast(0, DECIMAL_INT(30, 2))(0x7f119a3dd9d0))(0x7f119a345a30))(0x7f119a345520)], [cast(cast(t2.statictisc_price(0x7f119a334080), DECIMAL_INT(25, 4))(0x7f119a3d42e0) + IFNULL(cast(t2.gift_price(0x7f119a3344c0), DECIMAL_INT(24, 4))(0x7f119a3d2360), cast(0, DECIMAL_INT(24, 4))(0x7f119a3d3250))(0x7f119a3279e0)(0x7f119a328ce0) * CASE WHEN t2.virtual_product(0x7f119a334900) = 0(0x7f119a34c700) THEN T_FUN_SUM(t1.counts(0x7f119a31e500))(0x7f119a32b070) ELSE cast(t2.counts(0x7f119a334d40), DECIMAL_INT(42, 0))(0x7f119a3df3f0) END(0x7f119a34b470)(0x7f119a34dd80) - cast(T_FUN_SUM(IFNULL(IFNULL(t1.examine_price(0x7f119a348960) * cast(t1.counts(0x7f119a31e500), DECIMAL_INT(20, 0))(0x7f119a3dbbf0)(0x7f119a347470), cast(t2.examine_price(0x7f119a348da0), DECIMAL_INT(30, 2))(0x7f119a3dcae0))(0x7f119a3462f0), cast(0, DECIMAL_INT(30, 2))(0x7f119a3dd9d0))(0x7f119a345a30))(0x7f119a345520), DECIMAL_INT(68, 4))(0x7f119a3e0660)(0x7f119a3519c0), DECIMAL(65, 6))(0x7f118576ebe0)], [t2.is_mobile(0x7f119a30a840)], [t3.order_complete_time(0x7f119a30db10)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [CASE WHEN t3.order_state(0x7f119a3045d0) = 9(0x7f119a355ca0) THEN ifnull(t3.order_parent_id(0x7f119a357d60), t3.order_id(0x7f119a2dd0f0))(0x7f119a356520) ELSE t3.order_id(0x7f119a2dd0f0) END(0x7f119a354a10)], ['销售'], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t2.ppid(0x7f119a2dec80)], [t2.detail_type(0x7f119a367710)], [IFNULL(t1.insource_id(0x7f119a368e70), vpcc.in_source_id(0x7f119a3692b0))(0x7f119a367b60)], [t16.channel(0x7f119a369be0)], [t4.bar_code(0x7f119a36a490)], [CASE WHEN t2.virtual_product(0x7f119a334900) = 0(0x7f119a36d730) THEN T_FUN_SUM(t1.counts(0x7f119a31e500))(0x7f119a32b070) ELSE cast(t2.counts(0x7f119a334d40), DECIMAL_INT(42, 0))(0x7f119a3e2640) END(0x7f119a36c4a0)], [t2.price(0x7f119a3726e0) * CASE WHEN t2.virtual_product(0x7f119a334900) = 0(0x7f119a3706e0) THEN T_FUN_SUM(t1.counts(0x7f119a31e500))(0x7f119a32b070) ELSE cast(t2.counts(0x7f119a334d40), DECIMAL_INT(42, 0))(0x7f119a3e3a50) END(0x7f119a36f450)(0x7f119a371d60)], [t2.sell_price(0x7f119a3789d0) * CASE WHEN t2.virtual_product(0x7f119a334900) = 0(0x7f119a374440) THEN T_FUN_SUM(t1.counts(0x7f119a31e500))(0x7f119a32b070) ELSE cast(t2.counts(0x7f119a334d40), DECIMAL_INT(42, 0))(0x7f119a3e5080) END(0x7f119a3731b0)(0x7f119a378050)], [t2.gift_price(0x7f119a3344c0) * CASE WHEN t2.virtual_product(0x7f119a334900) = 0(0x7f119a37a730) THEN T_FUN_SUM(t1.counts(0x7f119a31e500))(0x7f119a32b070) ELSE cast(t2.counts(0x7f119a334d40), DECIMAL_INT(42, 0))(0x7f119a3e66b0) END(0x7f119a3794a0)(0x7f119a37bdb0)], [t2.discount_price(0x7f119a380050) * CASE WHEN t2.virtual_product(0x7f119a334900) = 0(0x7f119a37e050) THEN T_FUN_SUM(t1.counts(0x7f119a31e500))(0x7f119a32b070) ELSE cast(t2.counts(0x7f119a334d40), DECIMAL_INT(42, 0))(0x7f119a3e7ce0) END(0x7f119a37cdc0)(0x7f119a37f6d0)], [t2.point_price(0x7f119a383db0) * CASE WHEN t2.virtual_product(0x7f119a334900) = 0(0x7f119a381db0) THEN T_FUN_SUM(t1.counts(0x7f119a31e500))(0x7f119a32b070) ELSE cast(t2.counts(0x7f119a334d40), DECIMAL_INT(42, 0))(0x7f119a3e9310) END(0x7f119a380b20)(0x7f119a383430)], [cast(cast(t2.price(0x7f119a3726e0), DECIMAL_INT(17, 4))(0x7f119a3ebeb0) - t2.discount_price(0x7f119a380050)(0x7f119a388600) - t2.point_price(0x7f119a383db0)(0x7f119a3892e0) * CASE WHEN t2.virtual_product(0x7f119a334900) = 0(0x7f119a38ae20) THEN T_FUN_SUM(t1.counts(0x7f119a31e500))(0x7f119a32b070) ELSE cast(t2.counts(0x7f119a334d40), DECIMAL_INT(42, 0))(0x7f119a3ed220) END(0x7f119a389b60)(0x7f119a38c470), DECIMAL(62, 6))(0x7f11857722b0)], [T_FUN_SUM(IFNULL(t1.modify_price(0x7f119a3aa940) * cast(t1.counts(0x7f119a31e500), DECIMAL_INT(20, 0))(0x7f119a3ee800)(0x7f119a3a9a40), cast(0, DECIMAL_INT(30, 2))(0x7f119a3ef6f0))(0x7f119a3a88c0))(0x7f119a3a83b0)], [t2.in_user_id(0x7f119a3ab870)], [t2.in_user_name(0x7f119a3ac120)], [t4.product_color(0x7f119a3ac9d0)], [t4.productid(0x7f119a2ef540)], [t4.cid(0x7f119a3ad6f0)], [t4.brand_id(0x7f119a3adfa0)], [t4.product_name(0x7f119a3ae850)], [t5.user_type(0x7f119a3af100)], [t3.customer_type(0x7f119a3af9b0)], [CASE WHEN t3.order_type(0x7f119a358c70) = 3(0x7f119a3b1910) OR t3.order_type(0x7f119a358c70) = 4(0x7f119a3b2a80)(0x7f119a3b07a0) THEN t11.special_username(0x7f119a3b6050) ELSE t5.real_name(0x7f119a3b6490) END(0x7f119a3afe00)], [t5.user_mobile(0x7f119a3bad90)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.trader_name(0x7f119a3bc7a0)], [t3.comment(0x7f119a3bd050)], [t2.comment(0x7f119a3bd900)], [la.id(0x7f119a2f50c0)], [la.label_name(0x7f119a3be620)], [t2.detail_parent_id(0x7f119a3beed0)], [sysc.name(0x7f119a3bf780)], [sysc.value(0x7f119a3c0030)], [sysc.id(0x7f119a2f88f0)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t1.sample_product(0x7f119a3c1600)]), filter([CASE WHEN t3.order_state(0x7f119a3045d0) = 9(0x7f119a355ca0) THEN ifnull(t3.order_parent_id(0x7f119a357d60), t3.order_id(0x7f119a2dd0f0))(0x7f119a356520) ELSE t3.order_id(0x7f119a2dd0f0) END(0x7f119a354a10) IS NOT NULL(0x7f139613d440)]), rowset=256 group([t2.id(0x7f119a2d79b0)], [t1.insource_id(0x7f119a368e70)], [t3.trader_name(0x7f119a3bc7a0)], [la.id(0x7f119a2f50c0)], [la.label_name(0x7f119a3be620)], [sysc.name(0x7f119a3bf780)], [sysc.value(0x7f119a3c0030)], [sysc.id(0x7f119a2f88f0)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t1.sample_product(0x7f119a3c1600)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)]), agg_func([T_FUN_SUM(IFNULL(IFNULL(t1.statistics_price(0x7f119a31e0c0) * cast(t1.counts(0x7f119a31e500), DECIMAL_INT(20, 0))(0x7f119a3ca980)(0x7f119a3190f0), cast(CASE WHEN NULL = 1(0x7f119a31b4b0) AND t2.jiuxun_service_flag(0x7f119a31e940) = 1(0x7f119a31c620)(0x7f119a31a310) THEN t2.jiuxun_service_cost_price(0x7f119a31ed80) ELSE t2.in_price(0x7f119a31f1c0) END(0x7f119a319970), DECIMAL_INT(30, 2))(0x7f119a3cbe70))(0x7f119a317f70), cast(0, DECIMAL_INT(30, 2))(0x7f119a3ccf40))(0x7f119a3176b0))(0x7f119a3171a0)], [T_FUN_SUM(IFNULL(IFNULL(t1.inprice(0x7f119a326b30) * cast(t1.counts(0x7f119a31e500), DECIMAL_INT(20, 0))(0x7f119a3ce5b0)(0x7f119a321b60), cast(CASE WHEN NULL = 1(0x7f119a323f20) AND t2.jiuxun_service_flag(0x7f119a31e940) = 1(0x7f119a325090)(0x7f119a322d80) THEN t2.jiuxun_service_cost_price(0x7f119a31ed80) ELSE t2.in_price(0x7f119a31f1c0) END(0x7f119a3223e0), DECIMAL_INT(30, 2))(0x7f119a3cfaa0))(0x7f119a3209e0), cast(0, DECIMAL_INT(30, 2))(0x7f119a3d0b70))(0x7f119a320120))(0x7f119a31fc10)], [T_FUN_SUM(t1.counts(0x7f119a31e500))(0x7f119a32b070)], [T_FUN_SUM(IFNULL(IFNULL(t1.examine_price(0x7f119a348960) * cast(t1.counts(0x7f119a31e500), DECIMAL_INT(20, 0))(0x7f119a3dbbf0)(0x7f119a347470), cast(t2.examine_price(0x7f119a348da0), DECIMAL_INT(30, 2))(0x7f119a3dcae0))(0x7f119a3462f0), cast(0, DECIMAL_INT(30, 2))(0x7f119a3dd9d0))(0x7f119a345a30))(0x7f119a345520)], [T_FUN_SUM(IFNULL(t1.modify_price(0x7f119a3aa940) * cast(t1.counts(0x7f119a31e500), DECIMAL_INT(20, 0))(0x7f119a3ee800)(0x7f119a3a9a40), cast(0, DECIMAL_INT(30, 2))(0x7f119a3ef6f0))(0x7f119a3a88c0))(0x7f119a3a83b0)]) 325 - output([t2.id(0x7f119a2d79b0)], [t1.insource_id(0x7f119a368e70)], [t3.trader_name(0x7f119a3bc7a0)], [la.id(0x7f119a2f50c0)], [la.label_name(0x7f119a3be620)], [sysc.name(0x7f119a3bf780)], [sysc.value(0x7f119a3c0030)], [sysc.id(0x7f119a2f88f0)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t1.sample_product(0x7f119a3c1600)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [t1.counts(0x7f119a31e500)], [t2.jiuxun_service_flag(0x7f119a31e940)], [t2.jiuxun_service_cost_price(0x7f119a31ed80)], [t2.in_price(0x7f119a31f1c0)], [cast(t2.statictisc_price(0x7f119a334080), DECIMAL_INT(25, 4))(0x7f119a3d42e0) + IFNULL(cast(t2.gift_price(0x7f119a3344c0), DECIMAL_INT(24, 4))(0x7f119a3d2360), cast(0, DECIMAL_INT(24, 4))(0x7f119a3d3250))(0x7f119a3279e0)(0x7f119a328ce0)], [t2.virtual_product(0x7f119a334900)], [t2.counts(0x7f119a334d40)], [t2.is_mobile(0x7f119a30a840)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [CASE WHEN t3.order_state(0x7f119a3045d0) = 9(0x7f119a355ca0) THEN ifnull(t3.order_parent_id(0x7f119a357d60), t3.order_id(0x7f119a2dd0f0))(0x7f119a356520) ELSE t3.order_id(0x7f119a2dd0f0) END(0x7f119a354a10)], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t2.ppid(0x7f119a2dec80)], [t2.detail_type(0x7f119a367710)], [t16.channel(0x7f119a369be0)], [t4.bar_code(0x7f119a36a490)], [t2.gift_price(0x7f119a3344c0)], [t2.price(0x7f119a3726e0)], [t2.discount_price(0x7f119a380050)], [t2.point_price(0x7f119a383db0)], [t2.in_user_id(0x7f119a3ab870)], [t2.in_user_name(0x7f119a3ac120)], [t4.product_color(0x7f119a3ac9d0)], [t4.productid(0x7f119a2ef540)], [t4.cid(0x7f119a3ad6f0)], [t4.brand_id(0x7f119a3adfa0)], [t4.product_name(0x7f119a3ae850)], [t5.user_type(0x7f119a3af100)], [t3.customer_type(0x7f119a3af9b0)], [t5.user_mobile(0x7f119a3bad90)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.comment(0x7f119a3bd050)], [t2.comment(0x7f119a3bd900)], [t2.detail_parent_id(0x7f119a3beed0)], [t11.special_username(0x7f119a3b6050)], [t5.real_name(0x7f119a3b6490)], [t2.examine_price(0x7f119a348da0)], [t2.sell_price(0x7f119a3789d0)], [vpcc.in_source_id(0x7f119a3692b0)], [t1.statistics_price(0x7f119a31e0c0)], [t1.inprice(0x7f119a326b30)], [t1.examine_price(0x7f119a348960)], [t1.modify_price(0x7f119a3aa940)]), filter(nil), rowset=256 equal_conds([t1.serial_number_mark(0x7f119a2f84b0) = sysc.id(0x7f119a2f88f0)(0x7f119a2f7bf0)]), other_conds(nil) 326 - output([sysc.id(0x7f119a2f88f0)], [sysc.name(0x7f119a3bf780)], [sysc.value(0x7f119a3c0030)]), filter([sysc.is_delete(0x7f119a2fc910) = 0(0x7f119a2fc050)]), rowset=256 access([sysc.id(0x7f119a2f88f0)], [sysc.is_delete(0x7f119a2fc910)], [sysc.name(0x7f119a3bf780)], [sysc.value(0x7f119a3c0030)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([sysc.id(0x7f119a2f88f0)]), range(MIN ; MAX)always true 327 - output([t2.id(0x7f119a2d79b0)], [t1.insource_id(0x7f119a368e70)], [t3.trader_name(0x7f119a3bc7a0)], [la.id(0x7f119a2f50c0)], [la.label_name(0x7f119a3be620)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t1.sample_product(0x7f119a3c1600)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [t1.counts(0x7f119a31e500)], [t2.jiuxun_service_flag(0x7f119a31e940)], [t2.jiuxun_service_cost_price(0x7f119a31ed80)], [t2.in_price(0x7f119a31f1c0)], [t2.virtual_product(0x7f119a334900)], [t2.counts(0x7f119a334d40)], [t2.is_mobile(0x7f119a30a840)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [t3.order_id(0x7f119a2dd0f0)], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t2.ppid(0x7f119a2dec80)], [t2.detail_type(0x7f119a367710)], [t16.channel(0x7f119a369be0)], [t4.bar_code(0x7f119a36a490)], [t2.gift_price(0x7f119a3344c0)], [t2.price(0x7f119a3726e0)], [t2.discount_price(0x7f119a380050)], [t2.point_price(0x7f119a383db0)], [t2.in_user_id(0x7f119a3ab870)], [t2.in_user_name(0x7f119a3ac120)], [t4.product_color(0x7f119a3ac9d0)], [t4.productid(0x7f119a2ef540)], [t4.cid(0x7f119a3ad6f0)], [t4.brand_id(0x7f119a3adfa0)], [t4.product_name(0x7f119a3ae850)], [t5.user_type(0x7f119a3af100)], [t3.customer_type(0x7f119a3af9b0)], [t5.user_mobile(0x7f119a3bad90)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.comment(0x7f119a3bd050)], [t2.comment(0x7f119a3bd900)], [t2.detail_parent_id(0x7f119a3beed0)], [t11.special_username(0x7f119a3b6050)], [t3.order_state(0x7f119a3045d0)], [t3.order_parent_id(0x7f119a357d60)], [t5.real_name(0x7f119a3b6490)], [t2.statictisc_price(0x7f119a334080)], [t2.examine_price(0x7f119a348da0)], [t2.sell_price(0x7f119a3789d0)], [vpcc.in_source_id(0x7f119a3692b0)], [t1.serial_number_mark(0x7f119a2f84b0)], [t1.statistics_price(0x7f119a31e0c0)], [t1.inprice(0x7f119a326b30)], [t1.examine_price(0x7f119a348960)], [t1.modify_price(0x7f119a3aa940)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f119a2d79b0)(:341)]), use_batch=true 328 - output([t2.id(0x7f119a2d79b0)], [t3.trader_name(0x7f119a3bc7a0)], [la.id(0x7f119a2f50c0)], [la.label_name(0x7f119a3be620)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [t2.jiuxun_service_flag(0x7f119a31e940)], [t2.jiuxun_service_cost_price(0x7f119a31ed80)], [t2.in_price(0x7f119a31f1c0)], [t2.virtual_product(0x7f119a334900)], [t2.counts(0x7f119a334d40)], [t2.is_mobile(0x7f119a30a840)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [t3.order_id(0x7f119a2dd0f0)], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t2.ppid(0x7f119a2dec80)], [t2.detail_type(0x7f119a367710)], [t16.channel(0x7f119a369be0)], [t4.bar_code(0x7f119a36a490)], [t2.gift_price(0x7f119a3344c0)], [t2.price(0x7f119a3726e0)], [t2.discount_price(0x7f119a380050)], [t2.point_price(0x7f119a383db0)], [t2.in_user_id(0x7f119a3ab870)], [t2.in_user_name(0x7f119a3ac120)], [t4.product_color(0x7f119a3ac9d0)], [t4.productid(0x7f119a2ef540)], [t4.cid(0x7f119a3ad6f0)], [t4.brand_id(0x7f119a3adfa0)], [t4.product_name(0x7f119a3ae850)], [t5.user_type(0x7f119a3af100)], [t3.customer_type(0x7f119a3af9b0)], [t5.user_mobile(0x7f119a3bad90)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.comment(0x7f119a3bd050)], [t2.comment(0x7f119a3bd900)], [t2.detail_parent_id(0x7f119a3beed0)], [t11.special_username(0x7f119a3b6050)], [t3.order_state(0x7f119a3045d0)], [t3.order_parent_id(0x7f119a357d60)], [t5.real_name(0x7f119a3b6490)], [t2.statictisc_price(0x7f119a334080)], [t2.examine_price(0x7f119a348da0)], [t2.sell_price(0x7f119a3789d0)], [vpcc.in_source_id(0x7f119a3692b0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f119a2d79b0)(:347)]), use_batch=true 329 - output([t2.id(0x7f119a2d79b0)], [t3.trader_name(0x7f119a3bc7a0)], [la.id(0x7f119a2f50c0)], [la.label_name(0x7f119a3be620)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [t2.jiuxun_service_flag(0x7f119a31e940)], [t2.jiuxun_service_cost_price(0x7f119a31ed80)], [t2.in_price(0x7f119a31f1c0)], [t2.virtual_product(0x7f119a334900)], [t2.counts(0x7f119a334d40)], [t2.is_mobile(0x7f119a30a840)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [t3.order_id(0x7f119a2dd0f0)], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t2.ppid(0x7f119a2dec80)], [t2.detail_type(0x7f119a367710)], [t16.channel(0x7f119a369be0)], [t4.bar_code(0x7f119a36a490)], [t2.gift_price(0x7f119a3344c0)], [t2.price(0x7f119a3726e0)], [t2.discount_price(0x7f119a380050)], [t2.point_price(0x7f119a383db0)], [t2.in_user_id(0x7f119a3ab870)], [t2.in_user_name(0x7f119a3ac120)], [t4.product_color(0x7f119a3ac9d0)], [t4.productid(0x7f119a2ef540)], [t4.cid(0x7f119a3ad6f0)], [t4.brand_id(0x7f119a3adfa0)], [t4.product_name(0x7f119a3ae850)], [t5.user_type(0x7f119a3af100)], [t3.customer_type(0x7f119a3af9b0)], [t5.user_mobile(0x7f119a3bad90)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.comment(0x7f119a3bd050)], [t2.comment(0x7f119a3bd900)], [t2.detail_parent_id(0x7f119a3beed0)], [t11.special_username(0x7f119a3b6050)], [t3.order_state(0x7f119a3045d0)], [t3.order_parent_id(0x7f119a357d60)], [t5.real_name(0x7f119a3b6490)], [t2.statictisc_price(0x7f119a334080)], [t2.examine_price(0x7f119a348da0)], [t2.sell_price(0x7f119a3789d0)]), filter(nil), rowset=256 equal_conds([pl.label_id(0x7f119a2f4c80) = la.id(0x7f119a2f50c0)(0x7f119a2f43c0)]), other_conds(nil) 330 - output([la.id(0x7f119a2f50c0)], [la.label_name(0x7f119a3be620)]), filter([la.is_delete(0x7f119a2f6920) = 0(0x7f119a2f6060)]), rowset=256 access([la.id(0x7f119a2f50c0)], [la.is_delete(0x7f119a2f6920)], [la.label_name(0x7f119a3be620)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([la.id(0x7f119a2f50c0)]), range(MIN ; MAX)always true 331 - output([t2.id(0x7f119a2d79b0)], [t3.trader_name(0x7f119a3bc7a0)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [t2.jiuxun_service_flag(0x7f119a31e940)], [t2.jiuxun_service_cost_price(0x7f119a31ed80)], [t2.in_price(0x7f119a31f1c0)], [t2.virtual_product(0x7f119a334900)], [t2.counts(0x7f119a334d40)], [t2.is_mobile(0x7f119a30a840)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [t3.order_id(0x7f119a2dd0f0)], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t2.ppid(0x7f119a2dec80)], [t2.detail_type(0x7f119a367710)], [t16.channel(0x7f119a369be0)], [t4.bar_code(0x7f119a36a490)], [t2.gift_price(0x7f119a3344c0)], [t2.price(0x7f119a3726e0)], [t2.discount_price(0x7f119a380050)], [t2.point_price(0x7f119a383db0)], [t2.in_user_id(0x7f119a3ab870)], [t2.in_user_name(0x7f119a3ac120)], [t4.product_color(0x7f119a3ac9d0)], [t4.productid(0x7f119a2ef540)], [t4.cid(0x7f119a3ad6f0)], [t4.brand_id(0x7f119a3adfa0)], [t4.product_name(0x7f119a3ae850)], [t5.user_type(0x7f119a3af100)], [t3.customer_type(0x7f119a3af9b0)], [t5.user_mobile(0x7f119a3bad90)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.comment(0x7f119a3bd050)], [t2.comment(0x7f119a3bd900)], [t2.detail_parent_id(0x7f119a3beed0)], [pl.label_id(0x7f119a2f4c80)], [t11.special_username(0x7f119a3b6050)], [t3.order_state(0x7f119a3045d0)], [t3.order_parent_id(0x7f119a357d60)], [t5.real_name(0x7f119a3b6490)], [t2.statictisc_price(0x7f119a334080)], [t2.examine_price(0x7f119a348da0)], [t2.sell_price(0x7f119a3789d0)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f119a2ef540) = pl.product_id(0x7f119a2f1890)(0x7f119a2eec80)]), other_conds(nil) 332 - output([pl.product_id(0x7f119a2f1890)], [pl.label_id(0x7f119a2f4c80)]), filter([pl.is_delete(0x7f119a2f30f0) = 0(0x7f119a2f2830)]), rowset=256 access([pl.product_id(0x7f119a2f1890)], [pl.is_delete(0x7f119a2f30f0)], [pl.label_id(0x7f119a2f4c80)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f117a063250)]), range(MIN ; MAX)always true 333 - output([t2.id(0x7f119a2d79b0)], [t3.trader_name(0x7f119a3bc7a0)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [t2.jiuxun_service_flag(0x7f119a31e940)], [t2.jiuxun_service_cost_price(0x7f119a31ed80)], [t2.in_price(0x7f119a31f1c0)], [t2.virtual_product(0x7f119a334900)], [t2.counts(0x7f119a334d40)], [t2.is_mobile(0x7f119a30a840)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [t3.order_id(0x7f119a2dd0f0)], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t2.ppid(0x7f119a2dec80)], [t2.detail_type(0x7f119a367710)], [t16.channel(0x7f119a369be0)], [t4.bar_code(0x7f119a36a490)], [t2.gift_price(0x7f119a3344c0)], [t2.price(0x7f119a3726e0)], [t2.discount_price(0x7f119a380050)], [t2.point_price(0x7f119a383db0)], [t2.in_user_id(0x7f119a3ab870)], [t2.in_user_name(0x7f119a3ac120)], [t4.product_color(0x7f119a3ac9d0)], [t4.productid(0x7f119a2ef540)], [t4.cid(0x7f119a3ad6f0)], [t4.brand_id(0x7f119a3adfa0)], [t4.product_name(0x7f119a3ae850)], [t5.user_type(0x7f119a3af100)], [t3.customer_type(0x7f119a3af9b0)], [t5.user_mobile(0x7f119a3bad90)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.comment(0x7f119a3bd050)], [t2.comment(0x7f119a3bd900)], [t2.detail_parent_id(0x7f119a3beed0)], [t11.special_username(0x7f119a3b6050)], [t3.order_state(0x7f119a3045d0)], [t3.order_parent_id(0x7f119a357d60)], [t5.real_name(0x7f119a3b6490)], [t2.statictisc_price(0x7f119a334080)], [t2.examine_price(0x7f119a348da0)], [t2.sell_price(0x7f119a3789d0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.ppid(0x7f119a2dec80)(:344)]), use_batch=true 334 - output([t2.id(0x7f119a2d79b0)], [t3.trader_name(0x7f119a3bc7a0)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [t2.jiuxun_service_flag(0x7f119a31e940)], [t2.jiuxun_service_cost_price(0x7f119a31ed80)], [t2.in_price(0x7f119a31f1c0)], [t2.virtual_product(0x7f119a334900)], [t2.counts(0x7f119a334d40)], [t2.is_mobile(0x7f119a30a840)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [t3.order_id(0x7f119a2dd0f0)], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t2.ppid(0x7f119a2dec80)], [t2.detail_type(0x7f119a367710)], [t16.channel(0x7f119a369be0)], [t2.gift_price(0x7f119a3344c0)], [t2.price(0x7f119a3726e0)], [t2.discount_price(0x7f119a380050)], [t2.point_price(0x7f119a383db0)], [t2.in_user_id(0x7f119a3ab870)], [t2.in_user_name(0x7f119a3ac120)], [t5.user_type(0x7f119a3af100)], [t3.customer_type(0x7f119a3af9b0)], [t5.user_mobile(0x7f119a3bad90)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.comment(0x7f119a3bd050)], [t2.comment(0x7f119a3bd900)], [t2.detail_parent_id(0x7f119a3beed0)], [t11.special_username(0x7f119a3b6050)], [t3.order_state(0x7f119a3045d0)], [t3.order_parent_id(0x7f119a357d60)], [t5.real_name(0x7f119a3b6490)], [t2.statictisc_price(0x7f119a334080)], [t2.examine_price(0x7f119a348da0)], [t2.sell_price(0x7f119a3789d0)]), filter(nil), rowset=256 equal_conds([t2.id(0x7f119a2d79b0) = t16.order_detail_id(0x7f119a2e8a20)(0x7f119a2e8160)]), other_conds(nil) 335 - output([t2.id(0x7f119a2d79b0)], [t3.trader_name(0x7f119a3bc7a0)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [t2.jiuxun_service_flag(0x7f119a31e940)], [t2.jiuxun_service_cost_price(0x7f119a31ed80)], [t2.in_price(0x7f119a31f1c0)], [t2.virtual_product(0x7f119a334900)], [t2.counts(0x7f119a334d40)], [t2.is_mobile(0x7f119a30a840)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [t3.order_id(0x7f119a2dd0f0)], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t2.ppid(0x7f119a2dec80)], [t2.detail_type(0x7f119a367710)], [t2.gift_price(0x7f119a3344c0)], [t2.price(0x7f119a3726e0)], [t2.discount_price(0x7f119a380050)], [t2.point_price(0x7f119a383db0)], [t2.in_user_id(0x7f119a3ab870)], [t2.in_user_name(0x7f119a3ac120)], [t5.user_type(0x7f119a3af100)], [t3.customer_type(0x7f119a3af9b0)], [t5.user_mobile(0x7f119a3bad90)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.comment(0x7f119a3bd050)], [t2.comment(0x7f119a3bd900)], [t2.detail_parent_id(0x7f119a3beed0)], [t11.special_username(0x7f119a3b6050)], [t3.order_state(0x7f119a3045d0)], [t3.order_parent_id(0x7f119a357d60)], [t5.real_name(0x7f119a3b6490)], [t2.statictisc_price(0x7f119a334080)], [t2.examine_price(0x7f119a348da0)], [t2.sell_price(0x7f119a3789d0)]), filter(nil), rowset=256 equal_conds([t2.id(0x7f119a2d79b0) = t17.bind_order_detail_id(0x7f119a2ea5c0)(0x7f119a2e9d00)]), other_conds(nil) 336 - output([t2.id(0x7f119a2d79b0)], [t3.trader_name(0x7f119a3bc7a0)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [t2.jiuxun_service_flag(0x7f119a31e940)], [t2.jiuxun_service_cost_price(0x7f119a31ed80)], [t2.in_price(0x7f119a31f1c0)], [t2.virtual_product(0x7f119a334900)], [t2.counts(0x7f119a334d40)], [t2.is_mobile(0x7f119a30a840)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [t3.order_id(0x7f119a2dd0f0)], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t2.ppid(0x7f119a2dec80)], [t2.detail_type(0x7f119a367710)], [t2.gift_price(0x7f119a3344c0)], [t2.price(0x7f119a3726e0)], [t2.discount_price(0x7f119a380050)], [t2.point_price(0x7f119a383db0)], [t2.in_user_id(0x7f119a3ab870)], [t2.in_user_name(0x7f119a3ac120)], [t5.user_type(0x7f119a3af100)], [t3.customer_type(0x7f119a3af9b0)], [t5.user_mobile(0x7f119a3bad90)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.comment(0x7f119a3bd050)], [t2.comment(0x7f119a3bd900)], [t2.detail_parent_id(0x7f119a3beed0)], [t11.special_username(0x7f119a3b6050)], [t3.order_state(0x7f119a3045d0)], [t3.order_parent_id(0x7f119a357d60)], [t5.real_name(0x7f119a3b6490)], [t2.statictisc_price(0x7f119a334080)], [t2.examine_price(0x7f119a348da0)], [t2.sell_price(0x7f119a3789d0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f119a2dd0f0)(:343)]), use_batch=true 337 - output([t3.trader_name(0x7f119a3bc7a0)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [t3.order_id(0x7f119a2dd0f0)], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t5.user_type(0x7f119a3af100)], [t3.customer_type(0x7f119a3af9b0)], [t5.user_mobile(0x7f119a3bad90)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.comment(0x7f119a3bd050)], [t11.special_username(0x7f119a3b6050)], [t3.order_state(0x7f119a3045d0)], [t3.order_parent_id(0x7f119a357d60)], [t5.real_name(0x7f119a3b6490)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f119a2e2fa0)(:349)]), use_batch=true 338 - output([t3.trader_name(0x7f119a3bc7a0)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [t3.order_id(0x7f119a2dd0f0)], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t3.customer_type(0x7f119a3af9b0)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.comment(0x7f119a3bd050)], [t11.special_username(0x7f119a3b6050)], [t3.order_state(0x7f119a3045d0)], [t3.order_parent_id(0x7f119a357d60)]), filter(nil), rowset=256 equal_conds([t11.user_id(0x7f119a2ed9b0) = t3.user_id(0x7f119a2e2fa0)(0x7f119a2ed0f0)]), other_conds(nil) 339 - output([t11.user_id(0x7f119a2ed9b0)], [t11.special_username(0x7f119a3b6050)]), filter(nil), rowset=256 access([t11.user_id(0x7f119a2ed9b0)], [t11.special_username(0x7f119a3b6050)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t11.id(0x7f117a062e10)]), range(MIN ; MAX)always true 340 - output([t3.trader_name(0x7f119a3bc7a0)], [t36.aux_sale_man_names(0x7f119a3c0d50)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [t3.order_id(0x7f119a2dd0f0)], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t3.customer_type(0x7f119a3af9b0)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.comment(0x7f119a3bd050)], [t3.order_state(0x7f119a3045d0)], [t3.order_parent_id(0x7f119a357d60)]), filter(nil), rowset=256 equal_conds([t3.order_id(0x7f119a2dd0f0) = t36.order_id(0x7f119a302020)(0x7f119a301760)]), other_conds(nil) 341 - output([t3.trader_name(0x7f119a3bc7a0)], [t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)], [t3.order_complete_time(0x7f119a30db10)], [t3.area_id(0x7f119a2e6a40)], [t3.order_id(0x7f119a2dd0f0)], [t3.order_type(0x7f119a358c70)], [t3.user_id(0x7f119a2e2fa0)], [t3.customer_type(0x7f119a3af9b0)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.comment(0x7f119a3bd050)], [t3.order_state(0x7f119a3045d0)], [t3.order_parent_id(0x7f119a357d60)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 342 - output([t3.order_id(0x7f119a2dd0f0)], [t3.user_id(0x7f119a2e2fa0)], [t3.area_id(0x7f119a2e6a40)], [t3.order_state(0x7f119a3045d0)], [t3.order_complete_time(0x7f119a30db10)], [t3.order_parent_id(0x7f119a357d60)], [t3.order_type(0x7f119a358c70)], [t3.customer_type(0x7f119a3af9b0)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.trader_name(0x7f119a3bc7a0)], [t3.comment(0x7f119a3bd050)]), filter([t3.order_complete_time(0x7f119a30db10) >= cast('2024-10-14 00:00:00', TIMESTAMP(-1, -1))(0x7f119a30e320)(0x7f119a30c0d0)], [t3.order_complete_time(0x7f119a30db10) <= cast('2024-10-31 23:59:59', TIMESTAMP(-1, -1))(0x7f119a30f3a0)(0x7f119a30c950)], [t3.order_state(0x7f119a3045d0) IN (3, 9)(0x7f116c15f550)(0x7f119a3026d0)], [t3.is_delete(0x7f119a307780) = 0(0x7f119a306ec0)]), rowset=256 access([t3.id(0x7f117a062150)], [t3.order_id(0x7f119a2dd0f0)], [t3.user_id(0x7f119a2e2fa0)], [t3.area_id(0x7f119a2e6a40)], [t3.order_state(0x7f119a3045d0)], [t3.is_delete(0x7f119a307780)], [t3.order_complete_time(0x7f119a30db10)], [t3.order_parent_id(0x7f119a357d60)], [t3.order_type(0x7f119a358c70)], [t3.customer_type(0x7f119a3af9b0)], [t3.contract_name(0x7f119a3bb640)], [t3.contract_mobile(0x7f119a3bbef0)], [t3.trader_name(0x7f119a3bc7a0)], [t3.comment(0x7f119a3bd050)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false,false], range_key([t3.area_id(0x7f119a2e6a40)], [t3.id(0x7f117a062150)]), range(216,MIN ; 216,MAX), range_cond([t3.area_id(0x7f119a2e6a40) = 216(0x7f1121918570)]) 343 - output([t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)]), filter(nil), rowset=256 344 - output([t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)]), filter(nil), rowset=256 equal_conds([t40.id(0x7f119a300050) = t8.accounting_body_id(0x7f119a300490)(0x7f119a2ff790)]), other_conds(nil) merge_directions([ASC]) 345 - output([t8.accounting_body_id(0x7f119a300490)]), filter(nil), rowset=256 access([t8.accounting_body_id(0x7f119a300490)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f119a2e6e80)]), range[216 ; 216], range_cond([t8.id(0x7f119a2e6e80) = 216(0x7f1121919410)]) 346 - output([t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)]), filter(nil), rowset=256 access([t40.id(0x7f119a300050)], [t40.name(0x7f119a3545c0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t40.id(0x7f119a300050)]), range(MIN ; MAX)always true 347 - output([t36.order_id(0x7f119a302020)], [t36.aux_sale_man_names(0x7f119a3c0d50)]), filter(nil), rowset=256 access([t36.order_id(0x7f119a302020)], [t36.aux_sale_man_names(0x7f119a3c0d50)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.id(0x7f117a063690)]), range(MIN ; MAX)always true 348 - output([t5.user_type(0x7f119a3af100)], [t5.real_name(0x7f119a3b6490)], [t5.user_mobile(0x7f119a3bad90)]), filter([t5.is_delete(0x7f119a308fe0) = 0(0x7f119a308720)]), rowset=256 access([GROUP_ID(0x7f10e7ef1070)], [t5.is_delete(0x7f119a308fe0)], [t5.user_type(0x7f119a3af100)], [t5.real_name(0x7f119a3b6490)], [t5.user_mobile(0x7f119a3bad90)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f119a2e2b60)]), range(MIN ; MAX), range_cond([t5.id(0x7f119a2e2b60) = :349(0x7f112191a2b0)]) 349 - output([t2.id(0x7f119a2d79b0)], [t2.ppid(0x7f119a2dec80)], [t2.is_mobile(0x7f119a30a840)], [t2.jiuxun_service_flag(0x7f119a31e940)], [t2.jiuxun_service_cost_price(0x7f119a31ed80)], [t2.in_price(0x7f119a31f1c0)], [t2.statictisc_price(0x7f119a334080)], [t2.gift_price(0x7f119a3344c0)], [t2.virtual_product(0x7f119a334900)], [t2.counts(0x7f119a334d40)], [t2.examine_price(0x7f119a348da0)], [t2.detail_type(0x7f119a367710)], [t2.price(0x7f119a3726e0)], [t2.sell_price(0x7f119a3789d0)], [t2.discount_price(0x7f119a380050)], [t2.point_price(0x7f119a383db0)], [t2.in_user_id(0x7f119a3ab870)], [t2.in_user_name(0x7f119a3ac120)], [t2.comment(0x7f119a3bd900)], [t2.detail_parent_id(0x7f119a3beed0)]), filter([t2.is_mobile(0x7f119 a30a840) = 0(0x7f119a309f80)], [t2.is_delete(0x7f119a305f20) = 0(0x7f119a305660)], [t2.product_stock_type(0x7f119a316490) IN (0, 1, 2, 6)(0x7f116c15ff90)(0x7f119a313c30)]), rowset=256 access([GROUP_ID(0x7f10e7ef8610)], [t2.id(0x7f119a2d79b0)], [t2.ppid(0x7f119a2dec80)], [t2.is_delete(0x7f119a305f20)], [t2.is_mobile(0x7f119a30a840)], [t2.product_stock_type(0x7f119a316490)], [t2.jiuxun_service_flag(0x7f119a31e940)], [t2.jiuxun_service_cost_price(0x7f119a31ed80)], [t2.in_price(0x7f119a31f1c0)], [t2.statictisc_price(0x7f119a334080)], [t2.gift_price(0x7f119a3344c0)], [t2.virtual_product(0x7f119a334900)], [t2.counts(0x7f119a334d40)], [t2.examine_price(0x7f119a348da0)], [t2.detail_type(0x7f119a367710)], [t2.price(0x7f119a3726e0)], [t2.sell_price(0x7f119a3789d0)], [t2.discount_price(0x7f119a380050)], [t2.point_price(0x7f119a383db0)], [t2.in_user_id(0x7f119a3ab870)], [t2.in_user_name(0x7f119a3ac120)], [t2.comment(0x7f119a3bd900)], [t2.detail_parent_id(0x7f119a3beed0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t2.order_id(0x7f119a2dccb0)], [t2.id(0x7f119a2d79b0)]), range(MIN ; MAX), range_cond([t2.order_id(0x7f119a2dccb0) = :343(0x7f112191acc0)]) 350 - output([t17.bind_order_detail_id(0x7f119a2ea5c0)]), filter([t17.is_delete(0x7f119a2ebe20) = 0(0x7f119a2eb560)]), rowset=256 access([t17.bind_order_detail_id(0x7f119a2ea5c0)], [t17.is_delete(0x7f119a2ebe20)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t17.id(0x7f117a0629d0)]), range(MIN ; MAX)always true 351 - output([t16.order_detail_id(0x7f119a2e8a20)], [t16.channel(0x7f119a369be0)]), filter(nil), rowset=256 access([t16.order_detail_id(0x7f119a2e8a20)], [t16.channel(0x7f119a369be0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t16.id(0x7f117a062590)]), range(MIN ; MAX)always true 352 - output([t4.productid(0x7f119a2ef540)], [t4.bar_code(0x7f119a36a490)], [t4.product_color(0x7f119a3ac9d0)], [t4.cid(0x7f119a3ad6f0)], [t4.brand_id(0x7f119a3adfa0)], [t4.product_name(0x7f119a3ae850)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7f0b8f0)], [t4.productid(0x7f119a2ef540)], [t4.bar_code(0x7f119a36a490)], [t4.product_color(0x7f119a3ac9d0)], [t4.cid(0x7f119a3ad6f0)], [t4.brand_id(0x7f119a3adfa0)], [t4.product_name(0x7f119a3ae850)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f119a2df0c0)]), range(MIN ; MAX), range_cond([:344 = t4.ppriceid(0x7f119a2df0c0)(0x7f112191b6d0)]) 353 - output([vpcc.in_source_id(0x7f119a3692b0)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7f138e0)], [vpcc.in_source_id(0x7f119a3692b0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([vpcc.id(0x7f119a2fe4b0)]), range(MIN ; MAX), range_cond([:347 = vpcc.id(0x7f119a2fe4b0)(0x7f112191c0e0)]) 354 - output([t1.serial_number_mark(0x7f119a2f84b0)], [t1.statistics_price(0x7f119a31e0c0)], [t1.counts(0x7f119a31e500)], [t1.inprice(0x7f119a326b30)], [t1.examine_price(0x7f119a348960)], [t1.insource_id(0x7f119a368e70)], [t1.modify_price(0x7f119a3aa940)], [t1.sample_product(0x7f119a3c1600)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7f15ba0)], [t1.id(0x7f119a2d5f90)], [t1.serial_number_mark(0x7f119a2f84b0)], [t1.statistics_price(0x7f119a31e0c0)], [t1.counts(0x7f119a31e500)], [t1.inprice(0x7f119a326b30)], [t1.examine_price(0x7f119a348960)], [t1.insource_id(0x7f119a368e70)], [t1.modify_price(0x7f119a3aa940)], [t1.sample_product(0x7f119a3c1600)]), partitions(p[0-9]) is_index_back=true, is_global_index=false, range_key([t1.order_detail_id(0x7f119a2d7570)], [t1.order_detail_type(0x7f119a2d9210)], [t1.id(0x7f119a2d5f90)]), range(MIN ; MAX), range_cond([t1.order_detail_type(0x7f119a2d9210) = 1(0x7f112191caf0)], [t1.order_detail_id(0x7f119a2d7570) = :341(0x7f112191d990)]) 355 - output([cast(0, DECIMAL_INT(53, 2))(0x7f118573e550) - T_FUN_SUM(IFNULL(IFNULL(t1.statistics_price(0x7f118568b230) * cast(t1.counts(0x7f118568b670), DECIMAL_INT(20, 0))(0x7f118573af00)(0x7f11856859a0), cast(CASE WHEN NULL = 1(0x7f1185687d60) AND t2.jiuxun_service_flag(0x7f118568bab0) = 1(0x7f1185688ed0)(0x7f1185686bc0) THEN t2.jiuxun_service_cost_price(0x7f118568bef0) ELSE t2.in_price(0x7f118568c330) END(0x7f1185686220), DECIMAL_INT(30, 2))(0x7f118573c3f0))(0x7f1185684820), cast(0, DECIMAL_INT(30, 2))(0x7f118573d4c0))(0x7f1185683f60))(0x7f1185683a50)(0x7f118568a770)], [cast(0, DECIMAL_INT(53, 2))(0x7f1185743320) - T_FUN_SUM(IFNULL(IFNULL(t1.inprice(0x7f1185694a70) * cast(t1.counts(0x7f118568b670), DECIMAL_INT(20, 0))(0x7f118573fcd0)(0x7f118568f1e0), cast(CASE WHEN NULL = 1(0x7f11856915a0) AND t2.jiuxun_service_flag(0x7f118568bab0) = 1(0x7f1185692710)(0x7f1185690400) THEN t2.jiuxun_service_cost_price(0x7f118568bef0) ELSE t2.in_price(0x7f118568c330) END(0x7f118568fa60), DECIMAL_INT(30, 2))(0x7f11857411c0))(0x7f118568e060), cast(0, DECIMAL_INT(30, 2))(0x7f1185742290))(0x7f118568d7a0))(0x7f118568d290)(0x7f1185693fb0)], [cast(0, DECIMAL(1, 0))(0x7f1185748430) - t6.return_price(0x7f118569fea0) * cast(t6.return_count(0x7f11856a02e0), DECIMAL(11, 0))(0x7f1185744d20)(0x7f1185696290) * cast(T_FUN_COUNT(t2.id(0x7f118561e4b0))(0x7f1185696b10), DECIMAL(20, 0))(0x7f1185745db0)(0x7f1185697480) - cast(T_FUN_SUM(IFNULL(IFNULL(t1.statistics_price(0x7f118568b230) * cast(t1.counts(0x7f118568b670), DECIMAL_INT(20, 0))(0x7f118573af00)(0x7f11856859a0), cast(CASE WHEN NULL = 1(0x7f1185687d60) AND t2.jiuxun_service_flag(0x7f118568bab0) = 1(0x7f1185688ed0)(0x7f1185686bc0) THEN t2.jiuxun_service_cost_price(0x7f118568bef0) ELSE t2.in_price(0x7f118568c330) END(0x7f1185686220), DECIMAL_INT(30, 2))(0x7f118573c3f0))(0x7f1185684820), cast(0, DECIMAL_INT(30, 2))(0x7f118573d4c0))(0x7f1185683f60))(0x7f1185683a50), DECIMAL(52, 2))(0x7f1185746f60)(0x7f118569ea80)(0x7f118569f300)], [cast(0, DECIMAL(1, 0))(0x7f118574b6b0) - t6.return_price(0x7f118569fea0) * cast(t6.return_count(0x7f11856a02e0), DECIMAL(11, 0))(0x7f1185744d20)(0x7f1185696290) * cast(T_FUN_COUNT(t2.id(0x7f118561e4b0))(0x7f1185696b10), DECIMAL(20, 0))(0x7f1185745db0)(0x7f1185697480) - cast(T_FUN_SUM(IFNULL(IFNULL(t1.inprice(0x7f1185694a70) * cast(t1.counts(0x7f118568b670), DECIMAL_INT(20, 0))(0x7f118573fcd0)(0x7f118568f1e0), cast(CASE WHEN NULL = 1(0x7f11856915a0) AND t2.jiuxun_service_flag(0x7f118568bab0) = 1(0x7f1185692710)(0x7f1185690400) THEN t2.jiuxun_service_cost_price(0x7f118568bef0) ELSE t2.in_price(0x7f118568c330) END(0x7f118568fa60), DECIMAL_INT(30, 2))(0x7f11857411c0))(0x7f118568e060), cast(0, DECIMAL_INT(30, 2))(0x7f1185742290))(0x7f118568d7a0))(0x7f118568d290), DECIMAL(52, 2))(0x7f118574a1e0)(0x7f11856aa4d0)(0x7f11856aad50)], [cast(0, DECIMAL_INT(53, 2))(0x7f118574fc90) - T_FUN_SUM(IFNULL(IFNULL(t1.examine_price(0x7f11856b02f0) * cast(t1.counts(0x7f118568b670), DECIMAL_INT(20, 0))(0x7f118574ce20)(0x7f11856ae540), cast(t2.examine_price(0x7f11856b0730), DECIMAL_INT(30, 2))(0x7f118574dd10))(0x7f11856ad3c0), cast(0, DECIMAL_INT(30, 2))(0x7f118574ec00))(0x7f11856acb00))(0x7f11856ac5f0)(0x7f11856af950)], [cast(0, DECIMAL(1, 0))(0x7f11857528c0) - t6.return_price(0x7f118569fea0) * cast(t6.return_count(0x7f11856a02e0), DECIMAL(11, 0))(0x7f1185744d20)(0x7f1185696290) * cast(T_FUN_COUNT(t2.id(0x7f118561e4b0))(0x7f1185696b10), DECIMAL(20, 0))(0x7f1185745db0)(0x7f1185697480) - cast(T_FUN_SUM(IFNULL(IFNULL(t1.examine_price(0x7f11856b02f0) * cast(t1.counts(0x7f118568b670), DECIMAL_INT(20, 0))(0x7f118574ce20)(0x7f11856ae540), cast(t2.examine_price(0x7f11856b0730), DECIMAL_INT(30, 2))(0x7f118574dd10))(0x7f11856ad3c0), cast(0, DECIMAL_INT(30, 2))(0x7f118574ec00))(0x7f11856acb00))(0x7f11856ac5f0), DECIMAL(52, 2))(0x7f11857515d0)(0x7f11856b69f0)(0x7f11856b7270)], [t2.is_mobile(0x7f1185674590)], [t7.check2_time(0x7f1185677860)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [ifnull(t3.order_parent_id(0x7f11856bb830), t3.order_id(0x7f1185623bf0))(0x7f11856ba520)], ['退款'], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [IFNULL(t1.insource_id(0x7f11856ceb50), vpcc.in_source_id(0x7f11856cef90))(0x7f11856cd840)], [t16.channel(0x7f11856cf8c0)], [t4.bar_code(0x7f11856d0170)], [cast(0 - T_FUN_COUNT(t2.id(0x7f118561e4b0))(0x7f1185696b10) * t6.return_count(0x7f11856a02e0)(0x7f11856d33e0)(0x7f11856d3c60), DECIMAL_INT(42, 0))(0x7f11857701d0)], [cast(0, DECIMAL_INT(46, 2))(0x7f1185756590) - t2.price(0x7f11856d7810) * cast(T_FUN_COUNT(t2.id(0x7f118561e4b0))(0x7f1185696b10), DECIMAL_INT(20, 0))(0x7f1185754450)(0x7f11856d5950) * cast(t6.return_count(0x7f11856a02e0), DECIMAL_INT(11, 0))(0x7f1185755500)(0x7f11856d6630)(0x7f11856d6eb0)], [cast(0, DECIMAL_INT(46, 2))(0x7f1185759ac0) - t2.sell_price(0x7f11856daf60) * cast(T_FUN_COUNT(t2.id(0x7f118561e4b0))(0x7f1185696b10), DECIMAL_INT(20, 0))(0x7f1185757980)(0x7f11856d90a0) * cast(t6.return_count(0x7f11856a02e0), DECIMAL_INT(11, 0))(0x7f1185758a30)(0x7f11856d9d80)(0x7f11856da600)], [cast(0, DECIMAL_INT(44, 4))(0x7f118575cff0) - t2.gift_price(0x7f11856de6b0) * cast(T_FUN_COUNT(t2.id(0x7f118561e4b0))(0x7f1185696b10), DECIMAL_INT(20, 0))(0x7f118575aeb0)(0x7f11856dc7f0) * cast(t6.return_count(0x7f11856a02e0), DECIMAL_INT(11, 0))(0x7f118575bf60)(0x7f11856dd4d0)(0x7f11856ddd50)], [cast(0, DECIMAL_INT(44, 4))(0x7f1185760520) - t2.discount_price(0x7f11856e1e00) * cast(T_FUN_COUNT(t2.id(0x7f118561e4b0))(0x7f1185696b10), DECIMAL_INT(20, 0))(0x7f118575e3e0)(0x7f11856dff40) * cast(t6.return_count(0x7f11856a02e0), DECIMAL_INT(11, 0))(0x7f118575f490)(0x7f11856e0c20)(0x7f11856e14a0)], [cast(0, DECIMAL_INT(44, 4))(0x7f1185763a50) - t2.point_price(0x7f11856e5550) * cast(T_FUN_COUNT(t2.id(0x7f118561e4b0))(0x7f118569 6b10), DECIMAL_INT(20, 0))(0x7f1185761910)(0x7f11856e3690) * cast(t6.return_count(0x7f11856a02e0), DECIMAL_INT(11, 0))(0x7f11857629c0)(0x7f11856e4370)(0x7f11856e4bf0)], [cast(0, DECIMAL(1, 0))(0x7f1185766f80) - t6.return_price(0x7f118569fea0) * cast(T_FUN_COUNT(t2.id(0x7f118561e4b0))(0x7f1185696b10), DECIMAL(20, 0))(0x7f1185764e40)(0x7f11856e6de0) * cast(t6.return_count(0x7f11856a02e0), DECIMAL(11, 0))(0x7f1185765ef0)(0x7f11856e7ac0)(0x7f11856e8340)], [cast(0, DECIMAL_INT(45, 2))(0x7f118576a110) - T_FUN_SUM(IFNULL(cast(t1.modify_price(0x7f1185719830), DECIMAL_INT(22, 2))(0x7f1185768190), cast(0, DECIMAL_INT(22, 2))(0x7f1185769080))(0x7f1185717c10))(0x7f1185717700)(0x7f1185718f10)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t4.product_color(0x7f118571b880)], [t4.productid(0x7f1185657130)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)], [t5.user_type(0x7f1185721dc0)], [t3.customer_type(0x7f1185722670)], [CASE WHEN t3.order_type(0x7f11856be950) = 3(0x7f11857245d0) OR t3.order_type(0x7f11856be950) = 4(0x7f1185725740)(0x7f1185723460) THEN t11.special_username(0x7f11857269d0) ELSE t5.real_name(0x7f1185726e10) END(0x7f1185722ac0)], [t5.user_mobile(0x7f1185727900)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t7.comment(0x7f1185729bc0)], [t2.comment(0x7f118572a470)], [la.id(0x7f118565ada0)], [la.label_name(0x7f118572b190)], [t2.detail_parent_id(0x7f118572ba40)], [sysc.name(0x7f118572c2f0)], [sysc.value(0x7f118572cba0)], [sysc.id(0x7f118565e5d0)], [t36.aux_sale_man_names(0x7f118572d8c0)], [t1.sample_product(0x7f118572e170)]), filter([ifnull(t3.order_parent_id( 0x7f11856bb830), t3.order_id(0x7f1185623bf0))(0x7f11856ba520) IS NOT NULL(0x7f139613ea40)]), rowset=256 group([t2.id(0x7f118561e4b0)], [t1.insource_id(0x7f11856ceb50)], [t6.return_price(0x7f118569fea0)], [t6.return_count(0x7f11856a02e0)], [t7.check2_time(0x7f1185677860)], [t7.check2_user_name(0x7f1185733e40)], [t7.comment(0x7f1185729bc0)], [la.id(0x7f118565ada0)], [la.label_name(0x7f118572b190)], [sysc.name(0x7f118572c2f0)], [sysc.value(0x7f118572cba0)], [sysc.id(0x7f118565e5d0)], [t36.aux_sale_man_names(0x7f118572d8c0)], [t1.sample_product(0x7f118572e170)]), agg_func([T_FUN_SUM(IFNULL(IFNULL(t1.statistics_price(0x7f11856 8b230) * cast(t1.counts(0x7f118568b670), DECIMAL_INT(20, 0))(0x7f118573af00)(0x7f11856859a0), cast(CASE WHEN NULL = 1(0x7f1185687d60) AND t2.jiuxun_service_flag(0x7f118568bab0) = 1(0x7f1185688ed0)(0x7f1185686bc0) THEN t2.jiuxun_service_cost_price(0x7f118568bef0) ELSE t2.in_price(0x7f118568c330) END(0x7f1185686220), DECIMAL_INT(30, 2))(0x7f118573c3f0))(0x7f1185684820), cast(0, DECIMAL_INT(30, 2))(0x7f118573d4c0))(0x7f1185683f60))(0x7f1185683a50)], [T_FUN_SUM(IFNULL(IFNULL(t1.inprice(0x7f1185694a70) * cast(t1.counts(0x7f118568b670), DECIMAL_INT(20, 0))(0x7f118573fcd0)(0x7f118568f1e0), cast(CASE WHEN NULL = 1(0x7f11856915a0) AND t2.jiuxun_service_flag(0x7f118568bab0) = 1(0x7f1185692710)(0x7f1185690400) THEN t2.jiuxun_service_cost_price(0x7f118568bef0) ELSE t2.in_price(0x7f118568c330) END(0x7f118568fa60), DECIMAL_INT(30, 2))(0x7f11857411c0))(0x7f118568e060), cast(0, DECIMAL_INT(30, 2))(0x7f1185742290))(0x7f118568d7a0))(0x7f118568d290)], [T_FUN_COUNT(t2.id(0x7f118561e4b0))(0x7f1185696b10)], [T_FUN_SUM(IFNULL(IFNULL(t1.examine_price(0x7f11856b02f0) * cast(t1.counts(0x7f118568b670), DECIMAL_INT(20, 0))(0x7f118574ce20)(0x7f11856ae540), cast(t2.examine_price(0x7f11856b0730), DECIMAL_INT(30, 2))(0x7f118574dd10))(0x7f11856ad3c0), cast(0, DECIMAL_INT(30, 2))(0x7f118574ec00))(0x7f11856acb00))(0x7f11856ac5f0)], [T_FUN_SUM(IFNULL(cast(t1.modify_price(0x7f1185719830), DECIMAL_INT(22, 2))(0x7f1185768190), cast(0, DECIMAL_INT(22, 2))(0x7f1185769080))(0x7f1185717c10))(0x7f1185717700)]) 356 - output([t2.id(0x7f118561e4b0)], [t1.insource_id(0x7f11856ceb50)], [t6.return_price(0x7f118569fea0)], [t6.return_count(0x7f11856a02e0)], [t7.check2_time(0x7f1185677860)], [t7.check2_user_name(0x7f1185733e40)], [t7.comment(0x7f1185729bc0)], [la.id(0x7f118565ada0)], [la.label_name(0x7f118572b190)], [sysc.name(0x7f118572c2f0)], [sysc.value(0x7f118572cba0)], [sysc.id(0x7f118565e5d0)], [t36.aux_sale_man_names(0x7f118572d8c0)], [t1.sample_product(0x7f118572e170)], [t1.counts(0x7f118568b670)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.is_mobile(0x7f1185674590)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [ifnull(t3.order_parent_id(0x7f11856bb830), t3.order_id(0x7f1185623bf0))(0x7f11856ba520)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [t16.channel(0x7f11856cf8c0)], [t4.bar_code(0x7f11856d0170)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t4.product_color(0x7f118571b880)], [t4.productid(0x7f1185657130)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)], [t5.user_type(0x7f1185721dc0)], [t3.customer_type(0x7f1185722670)], [t5.user_mobile(0x7f1185727900)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)], [t11.special_username(0x7f11857269d0)], [t2.examine_price(0x7f11856b0730)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)], [t5.real_name(0x7f1185726e10)], [vpcc.in_source_id(0x7f11856cef90)], [t1.statistics_price(0x7f118568b230)], [t1.inprice(0x7f1185694a70)], [t1.examine_price(0x7f11856b02f0)], [t1.modify_price(0x7f1185719830)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f1185623bf0)(:371)]), use_batch=true 357 - output([t2.id(0x7f118561e4b0)], [t1.insource_id(0x7f11856ceb50)], [t6.return_price(0x7f118569fea0)], [t6.return_count(0x7f11856a02e0)], [t7.check2_time(0x7f1185677860)], [t7.check2_user_name(0x7f1185733e40)], [t7.comment(0x7f1185729bc0)], [la.id(0x7f118565ada0)], [la.label_name(0x7f118572b190)], [sysc.name(0x7f118572c2f0)], [sysc.value(0x7f118572cba0)], [sysc.id(0x7f118565e5d0)], [t1.sample_product(0x7f118572e170)], [t1.counts(0x7f118568b670)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.is_mobile(0x7f1185674590)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [t16.channel(0x7f11856cf8c0)], [t4.bar_code(0x7f11856d0170)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t4.product_color(0x7f118571b880)], [t4.productid(0x7f1185657130)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)], [t5.user_type(0x7f1185721dc0)], [t3.customer_type(0x7f1185722670)], [t5.user_mobile(0x7f1185727900)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)], [t3.order_id(0x7f1185623bf0)], [t11.special_username(0x7f11857269d0)], [t3.order_parent_id(0x7f11856bb830)], [t2.examine_price(0x7f11856b0730)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)], [t5.real_name(0x7f1185726e10)], [vpcc.in_source_id(0x7f11856cef90)], [t1.statistics_price(0x7f118568b230)], [t1.inprice(0x7f1185694a70)], [t1.examine_price(0x7f11856b02f0)], [t1.modify_price(0x7f1185719830)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.serial_number_mark(0x7f118565e190)(:367)]), use_batch=true 358 - output([t2.id(0x7f118561e4b0)], [t1.insource_id(0x7f11856ceb50)], [t6.return_price(0x7f118569fea0)], [t6.return_count(0x7f11856a02e0)], [t7.check2_time(0x7f1185677860)], [t7.check2_user_name(0x7f1185733e40)], [t7.comment(0x7f1185729bc0)], [la.id(0x7f118565ada0)], [la.label_name(0x7f118572b190)], [t1.sample_product(0x7f118572e170)], [t1.counts(0x7f118568b670)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.is_mobile(0x7f1185674590)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [t16.channel(0x7f11856cf8c0)], [t4.bar_code(0x7f11856d0170)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t4.product_color(0x7f118571b880)], [t4.productid(0x7f1185657130)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)], [t5.user_type(0x7f1185721dc0)], [t3.customer_type(0x7f1185722670)], [t5.user_mobile(0x7f1185727900)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)], [t3.order_id(0x7f1185623bf0)], [t1.serial_number_mark(0x7f118565e190)], [t11.special_username(0x7f11857269d0)], [t3.order_parent_id(0x7f11856bb830)], [t2.examine_price(0x7f11856b0730)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)], [t5.real_name(0x7f1185726e10)], [vpcc.in_source_id(0x7f11856cef90)], [t1.statistics_price(0x7f118568b230)], [t1.inprice(0x7f1185694a70)], [t1.examine_price(0x7f11856b02f0)], [t1.modify_price(0x7f1185719830)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f118561e4b0)(:365)]), use_batch=true 359 - output([t2.id(0x7f118561e4b0)], [t1.insource_id(0x7f11856ceb50)], [t6.return_price(0x7f118569fea0)], [t6.return_count(0x7f11856a02e0)], [t7.check2_time(0x7f1185677860)], [t7.check2_user_name(0x7f1185733e40)], [t7.comment(0x7f1185729bc0)], [la.id(0x7f118565ada0)], [la.label_name(0x7f118572b190)], [t1.sample_product(0x7f118572e170)], [t1.counts(0x7f118568b670)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.is_mobile(0x7f1185674590)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [t16.channel(0x7f11856cf8c0)], [t4.bar_code(0x7f11856d0170)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t4.product_color(0x7f118571b880)], [t4.productid(0x7f1185657130)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)], [t5.user_type(0x7f1185721dc0)], [t3.customer_type(0x7f1185722670)], [t5.user_mobile(0x7f1185727900)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)], [t3.order_id(0x7f1185623bf0)], [t1.serial_number_mark(0x7f118565e190)], [t11.special_username(0x7f11857269d0)], [t3.order_parent_id(0x7f11856bb830)], [t2.examine_price(0x7f11856b0730)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)], [t5.real_name(0x7f1185726e10)], [vpcc.in_source_id(0x7f11856cef90)], [t1.statistics_price(0x7f118568b230)], [t1.inprice(0x7f1185694a70)], [t1.examine_price(0x7f11856b02f0)], [t1.modify_price(0x7f1185719830)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f118561e4b0)(:364)]), use_batch=true 360 - output([t2.id(0x7f118561e4b0)], [t1.insource_id(0x7f11856ceb50)], [t6.return_price(0x7f118569fea0)], [t6.return_count(0x7f11856a02e0)], [t7.check2_time(0x7f1185677860)], [t7.check2_user_name(0x7f1185733e40)], [t7.comment(0x7f1185729bc0)], [la.id(0x7f118565ada0)], [la.label_name(0x7f118572b190)], [t1.sample_product(0x7f118572e170)], [t1.counts(0x7f118568b670)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.is_mobile(0x7f1185674590)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [t4.bar_code(0x7f11856d0170)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t4.product_color(0x7f118571b880)], [t4.productid(0x7f1185657130)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)], [t5.user_type(0x7f1185721dc0)], [t3.customer_type(0x7f1185722670)], [t5.user_mobile(0x7f1185727900)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)], [t3.order_id(0x7f1185623bf0)], [t1.serial_number_mark(0x7f118565e190)], [t11.special_username(0x7f11857269d0)], [t3.order_parent_id(0x7f11856bb830)], [t2.examine_price(0x7f11856b0730)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)], [t5.real_name(0x7f1185726e10)], [vpcc.in_source_id(0x7f11856cef90)], [t1.statistics_price(0x7f118568b230)], [t1.inprice(0x7f1185694a70)], [t1.examine_price(0x7f11856b02f0)], [t1.modify_price(0x7f1185719830)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f118561e4b0)(:358)]), use_batch=true 361 - output([t2.id(0x7f118561e4b0)], [t6.return_price(0x7f118569fea0)], [t6.return_count(0x7f11856a02e0)], [t7.check2_time(0x7f1185677860)], [t7.check2_user_name(0x7f1185733e40)], [t7.comment(0x7f1185729bc0)], [la.id(0x7f118565ada0)], [la.label_name(0x7f118572b190)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.is_mobile(0x7f1185674590)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [t4.bar_code(0x7f11856d0170)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t4.product_color(0x7f118571b880)], [t4.productid(0x7f1185657130)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)], [t5.user_type(0x7f1185721dc0)], [t3.customer_type(0x7f1185722670)], [t5.user_mobile(0x7f1185727900)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)], [t3.order_id(0x7f1185623bf0)], [t11.special_username(0x7f11857269d0)], [t3.order_parent_id(0x7f11856bb830)], [t2.examine_price(0x7f11856b0730)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)], [t5.real_name(0x7f1185726e10)], [vpcc.in_source_id(0x7f11856cef90)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f118561e4b0)(:366)]), use_batch=true 362 - output([t2.id(0x7f118561e4b0)], [t6.return_price(0x7f118569fea0)], [t6.return_count(0x7f11856a02e0)], [t7.check2_time(0x7f1185677860)], [t7.check2_user_name(0x7f1185733e40)], [t7.comment(0x7f1185729bc0)], [la.id(0x7f118565ada0)], [la.label_name(0x7f118572b190)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.is_mobile(0x7f1185674590)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [t4.bar_code(0x7f11856d0170)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t4.product_color(0x7f118571b880)], [t4.productid(0x7f1185657130)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)], [t5.user_type(0x7f1185721dc0)], [t3.customer_type(0x7f1185722670)], [t5.user_mobile(0x7f1185727900)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)], [t3.order_id(0x7f1185623bf0)], [t11.special_username(0x7f11857269d0)], [t3.order_parent_id(0x7f11856bb830)], [t2.examine_price(0x7f11856b0730)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)], [t5.real_name(0x7f1185726e10)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f1185629aa0)(:368)]), use_batch=true 363 - output([t2.id(0x7f118561e4b0)], [t6.return_price(0x7f118569fea0)], [t6.return_count(0x7f11856a02e0)], [t7.check2_time(0x7f1185677860)], [t7.check2_user_name(0x7f1185733e40)], [t7.comment(0x7f1185729bc0)], [la.id(0x7f118565ada0)], [la.label_name(0x7f118572b190)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.is_mobile(0x7f1185674590)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [t4.bar_code(0x7f11856d0170)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t4.product_color(0x7f118571b880)], [t4.productid(0x7f1185657130)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)], [t3.customer_type(0x7f1185722670)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)], [t3.order_id(0x7f1185623bf0)], [t11.special_username(0x7f11857269d0)], [t3.order_parent_id(0x7f11856bb830)], [t2.examine_price(0x7f11856b0730)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)]), filter(nil), rowset=256 conds(nil), nl_params_([t6.return_id(0x7f118564a750)(:373)]), use_batch=true 364 - output([t2.id(0x7f118561e4b0)], [t6.return_price(0x7f118569fea0)], [t6.return_count(0x7f11856a02e0)], [la.id(0x7f118565ada0)], [la.label_name(0x7f118572b190)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.is_mobile(0x7f1185674590)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [t4.bar_code(0x7f11856d0170)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t4.product_color(0x7f118571b880)], [t4.productid(0x7f1185657130)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)], [t3.customer_type(0x7f1185722670)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)], [t3.order_id(0x7f1185623bf0)], [t6.return_id(0x7f118564a750)], [t11.special_username(0x7f11857269d0)], [t3.order_parent_id(0x7f11856bb830)], [t2.examine_price(0x7f11856b0730)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)]), filter(nil), rowset=256 equal_conds([t2.id(0x7f118561e4b0) = t6.order_detail_id(0x7f1185648bc0)(0x7f1185648300)]), other_conds(nil) 365 - output([t2.id(0x7f118561e4b0)], [la.id(0x7f118565ada0)], [la.label_name(0x7f118572b190)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.is_mobile(0x7f1185674590)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [t4.bar_code(0x7f11856d0170)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t4.product_color(0x7f118571b880)], [t4.productid(0x7f1185657130)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)], [t3.customer_type(0x7f1185722670)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)], [t3.order_id(0x7f1185623bf0)], [t11.special_username(0x7f11857269d0)], [t3.order_parent_id(0x7f11856bb830)], [t2.examine_price(0x7f11856b0730)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)]), filter(nil), rowset=256 equal_conds([pl.label_id(0x7f118565a960) = la.id(0x7f118565ada0)(0x7f118565a0a0)]), other_conds(nil) 366 - output([la.id(0x7f118565ada0)], [la.label_name(0x7f118572b190)]), filter([la.is_delete(0x7f118565c600) = 0(0x7f118565bd40)]), rowset=256 access([la.id(0x7f118565ada0)], [la.is_delete(0x7f118565c600)], [la.label_name(0x7f118572b190)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([la.id(0x7f118565ada0)]), range(MIN ; MAX)always true 367 - output([t2.id(0x7f118561e4b0)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.is_mobile(0x7f1185674590)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [t4.bar_code(0x7f11856d0170)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t4.product_color(0x7f118571b880)], [t4.productid(0x7f1185657130)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)], [t3.customer_type(0x7f1185722670)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)], [t3.order_id(0x7f1185623bf0)], [pl.label_id(0x7f118565a960)], [t11.special_username(0x7f11857269d0)], [t3.order_parent_id(0x7f11856bb830)], [t2.examine_price(0x7f11856b0730)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f1185657130) = pl.product_id(0x7f1185657570)(0x7f1185656870)]), other_conds(nil) 368 - output([pl.product_id(0x7f1185657570)], [pl.label_id(0x7f118565a960)]), filter([pl.is_delete(0x7f1185658dd0) = 0(0x7f1185658510)]), rowset=256 access([pl.product_id(0x7f1185657570)], [pl.is_delete(0x7f1185658dd0)], [pl.label_id(0x7f118565a960)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f117a07d4b0)]), range(MIN ; MAX)always true 369 - output([t2.id(0x7f118561e4b0)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.is_mobile(0x7f1185674590)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [t4.bar_code(0x7f11856d0170)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t4.product_color(0x7f118571b880)], [t4.productid(0x7f1185657130)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)], [t3.customer_type(0x7f1185722670)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)], [t3.order_id(0x7f1185623bf0)], [t11.special_username(0x7f11857269d0)], [t3.order_parent_id(0x7f11856bb830)], [t2.examine_price(0x7f11856b0730)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.ppid(0x7f1185625780)(:361)]), use_batch=true 370 - output([t2.id(0x7f118561e4b0)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.is_mobile(0x7f1185674590)], [t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t2.ppid(0x7f1185625780)], [t2.detail_type(0x7f11856cd3f0)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t3.customer_type(0x7f1185722670)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)], [t3.order_id(0x7f1185623bf0)], [t11.special_username(0x7f11857269d0)], [t3.order_parent_id(0x7f11856bb830)], [t2.examine_price(0x7f11856b0730)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f1185623bf0)(:360)]), use_batch=true 371 - output([t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t3.customer_type(0x7f1185722670)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t3.order_id(0x7f1185623bf0)], [t11.special_username(0x7f11857269d0)], [t3.order_parent_id(0x7f11856bb830)]), filter(nil), rowset=256 equal_conds([t11.user_id(0x7f11856555a0) = t3.user_id(0x7f1185629aa0)(0x7f1185654ce0)]), other_conds(nil) 372 - output([t11.user_id(0x7f11856555a0)], [t11.special_username(0x7f11857269d0)]), filter(nil), rowset=256 access([t11.user_id(0x7f11856555a0)], [t11.special_username(0x7f11857269d0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t11.id(0x7f117a07d070)]), range(MIN ; MAX)always true 373 - output([t3.order_complete_time(0x7f11856b8f40)], [t3.area_id(0x7f118564c720)], [t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)], [t3.order_type(0x7f11856be950)], [t3.user_id(0x7f1185629aa0)], [t3.customer_type(0x7f1185722670)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)], [t3.order_id(0x7f1185623bf0)], [t3.order_parent_id(0x7f11856bb830)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 374 - output([t3.order_id(0x7f1185623bf0)], [t3.user_id(0x7f1185629aa0)], [t3.area_id(0x7f118564c720)], [t3.order_complete_time(0x7f11856b8f40)], [t3.order_parent_id(0x7f11856bb830)], [t3.order_type(0x7f11856be950)], [t3.customer_type(0x7f1185722670)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)]), filter([t3.order_state (0x7f1185668cb0) = 9(0x7f11856683f0)], [t3.is_delete(0x7f118566bd70) = 0(0x7f118566b4b0)]), rowset=256 access([t3.id(0x7f117a07c3b0)], [t3.order_id(0x7f1185623bf0)], [t3.user_id(0x7f1185629aa0)], [t3.area_id(0x7f118564c720)], [t3.order_state(0x7f1185668cb0)], [t3.is_delete(0x7f118566bd70)], [t3.order_complete_time(0x7f11856b8f40)], [t3.order_parent_id(0x7f11856bb830)], [t3.order_type(0x7f11856be950)], [t3.customer_type(0x7f1185722670)], [t3.contract_name(0x7f11857281b0)], [t3.contract_mobile(0x7f1185728a60)], [t3.trader_name(0x7f1185729310)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false], range_key([t3.area_id(0x7f118564c720)], [t3.id(0x7f117a07c3b0)]), range(216,MIN ; 216,MAX), range_cond([t3.area_id(0x7f118564c720) = 216(0x7f112191e3a0)]) 375 - output([t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)]), filter(nil), rowset=256 376 - output([t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)]), filter(nil), rowset=256 equal_conds([t40.id(0x7f1185663570) = t8.accounting_body_id(0x7f11856639b0)(0x7f1185662cb0)]), other_conds(nil) merge_directions([ASC]) 377 - output([t8.accounting_body_id(0x7f11856639b0)]), filter(nil), rowset=256 access([t8.accounting_body_id(0x7f11856639b0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f118564cb60)]), range[216 ; 216], range_cond([t8.id(0x7f118564cb60) = 216(0x7f112191f240)]) 378 - output([t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)]), filter(nil), rowset=256 access([t40.id(0x7f1185663570)], [t40.name(0x7f11856ba0d0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t40.id(0x7f1185663570)]), range(MIN ; MAX)always true 379 - output([t2.id(0x7f118561e4b0)], [t2.ppid(0x7f1185625780)], [t2.is_mobile(0x7f1185674590)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.examine_price(0x7f11856b0730)], [t2.detail_type(0x7f11856cd3f0)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)]), filter([t2.is_mobile(0x7f1185674590) = 0(0x7f1185673cd0)], [t2.is_delete(0x7f118566a510) = 0(0x7f1185669c50)], [t2.product_stock_type(0x7f11856828b0) IN (0, 1, 2, 6)(0x7f116c1690a0)(0x7f1185680050)]), rowset=256 access([GROUP_ID(0x7f10e7f67eb0)], [t2.id(0x7f118561e4b0)], [t2.ppid(0x7f1185625780)], [t2.is_delete(0x7f118566a510)], [t2.is_mobile(0x7f1185674590)], [t2.product_stock_type(0x7f11856828b0)], [t2.jiuxun_service_flag(0x7f118568bab0)], [t2.jiuxun_service_cost_price(0x7f118568bef0)], [t2.in_price(0x7f118568c330)], [t2.examine_price(0x7f11856b0730)], [t2.detail_type(0x7f11856cd3f0)], [t2.price(0x7f11856d7810)], [t2.sell_price(0x7f11856daf60)], [t2.gift_price(0x7f11856de6b0)], [t2.discount_price(0x7f11856e1e00)], [t2.point_price(0x7f11856e5550)], [t2.in_user_id(0x7f118571a720)], [t2.in_user_name(0x7f118571afd0)], [t2.comment(0x7f118572a470)], [t2.detail_parent_id(0x7f118572ba40)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t2.order_id(0x7f11856237b0)], [t2.id(0x7f118561e4b0)]), range(MIN ; MAX), range_cond([t2.order_id(0x7f11856237b0) = :360(0x7f11219200e0)]) 380 - output([t4.productid(0x7f1185657130)], [t4.bar_code(0x7f11856d0170)], [t4.product_color(0x7f118571b880)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7f72820)], [t4.productid(0x7f1185657130)], [t4.bar_code(0x7f11856d0170)], [t4.product_color(0x7f118571b880)], [t4.cid(0x7f118571c5a0)], [t4.brand_id(0x7f1185720c60)], [t4.product_name(0x7f1185721510)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f1185625bc0)]), range(MIN ; MAX), range_cond([:361 = t4.ppriceid(0x7f1185625bc0)(0x7f1121920af0)]) 381 - output([t6.order_detail_id(0x7f1185648bc0)], [t6.return_price(0x7f118569fea0)], [t6.return_id(0x7f118564a750)], [t6.return_count(0x7f11856a02e0)]), filter(nil), rowset=256 access([t6.order_detail_id(0x7f1185648bc0)], [t6.return_price(0x7f118569fea0)], [t6.return_id(0x7f118564a750)], [t6.return_count(0x7f11856a02e0)]) 382 - output([t_return_detail.order_detail_id(0x7f118563f9d0)], [cast(cast(T_FUN_SUM(t_return_detail.return_price(0x7f11856429e0))(0x7f117a0776b0), DECIMAL(32, 2))(0x7f117a078bb0) / cast(T_FUN_COUNT(t_return_detail.return_price(0x7f11856429e0))(0x7f117a077be0), DECIMAL(20, 0))(0x7f117a079ac0)(0x7f117a078110), DECIMAL(14, 6))(0x7f117a07a9d0)], [t_return_detail.return_id(0x7f1185643760)], [t_return_detail.return_count(0x7f1185644010)]), filter(nil), rowset=256 group([t_return_detail.order_detail_id(0x7f118563f9d0)], [t_return_detail.return_id(0x7f1185643760)], [t_return_detail.return_count(0x7f1185644010)]), agg_func([T_FUN_SUM(t_return_detail.return_price(0x7f11856429e0))(0x7f117a0776b0)], [T_FUN_COUNT(t_return_detail.return_price(0x7f11856429e0))(0x7f117a077be0)]) 383 - output([t_return_detail.order_detail_id(0x7f118563f9d0)], [t_return_detail.return_price(0x7f11856429e0)], [t_return_detail.return_id(0x7f1185643760)], [t_return_detail.return_count(0x7f1185644010)]), filter([t_return_detail.is_delete(0x7f118563d670) = 0(0x7f118563cdb0)], [t_return_detail.order_detail_type(0x7f118563eed0) = 1(0x7f118563e610)]), rowset=256 access([t_return_detail.is_delete(0x7f118563d670)], [t_return_detail.order_detail_type(0x7f118563eed0)], [t_return_detail.order_detail_id(0x7f118563f9d0)], [t_return_detail.return_price(0x7f11856429e0)], [t_return_detail.return_id(0x7f1185643760)], [t_return_detail.return_count(0x7f1185644010)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false], range_key([t_return_detail.id(0x7f117a077170)]), range(MIN ; MAX)always true 384 - output([t7.check2_time(0x7f1185677860)], [t7.comment(0x7f1185729bc0)], [t7.check2_user_name(0x7f1185733e40)]), filter([t7.is_delete(0x7f1185670690) = 0(0x7f118566fdd0)], [(T_OP_NOT_IN, t7.return_type(0x7f1185672c40), (7, 8)(0x7f116c168660))(0x7f1185670d40)], [t7.check2_time(0x7f1185677860) >= cast('2024-10-14 00:00:00', TIMESTAMP(-1, -1))(0x7f1185678070)(0x7f1185675e20)], [t7.check2_time(0x7f1185677860) <= cast('2024-10-31 23:59:59', TIMESTAMP(-1, -1))(0x7f11856790f0)(0x7f11856766a0)]), rowset=256 access([GROUP_ID(0x7f10e7f86430)], [t7.is_delete(0x7f1185670690)], [t7.return_type(0x7f1185672c40)], [t7.check2_time(0x7f1185677860)], [t7.comment(0x7f1185729bc0)], [t7.check2_user_name(0x7f1185733e40)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false,false,false], range_key([t7.id(0x7f118564ab90)]), range(MIN ; MAX), range_cond([:373 = t7.id(0x7f118564ab90)(0x7f1121921500)]) 385 - output([t5.user_type(0x7f1185721dc0)], [t5.real_name(0x7f1185726e10)], [t5.user_mobile(0x7f1185727900)]), filter([t5.is_delete(0x7f118566d5d0) = 0(0x7f118566cd10)]), rowset=256 access([GROUP_ID(0x7f10e7f8d9d0)], [t5.is_delete(0x7f118566d5d0)], [t5.user_type(0x7f1185721dc0)], [t5.real_name(0x7f1185726e10)], [t5.user_mobile(0x7f1185727900)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f1185629660)]), range(MIN ; MAX), range_cond([t5.id(0x7f1185629660) = :368(0x7f1121921f10)]) 386 - output([vpcc.in_source_id(0x7f11856cef90)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7f94f70)], [vpcc.in_source_id(0x7f11856cef90)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([vpcc.id(0x7f11856619d0)]), range(MIN ; MAX), range_cond([:366 = vpcc.id(0x7f11856619d0)(0x7f1121922920)]) 387 - output([t1.serial_number_mark(0x7f118565e190)], [t1.statistics_price(0x7f118568b230)], [t1.counts(0x7f118568b670)], [t1.inprice(0x7f1185694a70)], [t1.examine_price(0x7f11856b02f0)], [t1.insource_id(0x7f11856ceb50)], [t1.modify_price(0x7f1185719830)], [t1.sample_product(0x7f118572e170)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7f97230)], [t1.id(0x7f118561ca90)], [t1.serial_number_mark(0x7f118565e190)], [t1.statistics_price(0x7f118568b230)], [t1.counts(0x7f118568b670)], [t1.inprice(0x7f1185694a70)], [t1.examine_price(0x7f11856b02f0)], [t1.insource_id(0x7f11856ceb50)], [t1.modify_price(0x7f1185719830)], [t1.sample_product(0x7f118572e170)]), partitions(p[0-9]) is_index_back=true, is_global_index=false, range_key([t1.order_detail_id(0x7f118561e070)], [t1.order_detail_type(0x7f118561fd10)], [t1.id(0x7f118561ca90)]), range(MIN ; MAX), range_cond([t1.order_detail_type(0x7f118561fd10) = 1(0x7f1121923330)], [t1.order_detail_id(0x7f118561e070) = :358(0x7f11219241d0)]) 388 - output([t16.channel(0x7f11856cf8c0)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7f9f220)], [t16.id(0x7f117a07c7f0)], [t16.channel(0x7f11856cf8c0)]), partitions(p0) is_index_back=true, is_global_index=false, range_key([t16.order_detail_id(0x7f118564e700)], [t16.shadow_pk_0(0x7f15dbe09670)]), range(MIN ; MAX), range_cond([:364 = t16.order_detail_id(0x7f118564e700)(0x7f1121924be0)]) 389 - output(nil), filter([t17.is_delete(0x7f1185653a10) = 0(0x7f1185653150)]), rowset=256 access([GROUP_ID(0x7f10e7fa14e0)], [t17.id(0x7f117a07cc30)], [t17.is_delete(0x7f1185653a10)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t17.bind_order_detail_id(0x7f11856502a0)], [t17.id(0x7f117a07cc30)]), range(MIN ; MAX), range_cond([:365 = t17.bind_order_detail_id(0x7f11856502a0)(0x7f11219255f0)]) 390 - output([sysc.id(0x7f118565e5d0)], [sysc.name(0x7f118572c2f0)], [sysc.value(0x7f118572cba0)]), filter([sysc.is_delete(0x7f118565fe30) = 0(0x7f118565f570)]), rowset=256 access([GROUP_ID(0x7f10e7fa4c60)], [sysc.id(0x7f118565e5d0)], [sysc.is_delete(0x7f118565fe30)], [sysc.name(0x7f118572c2f0)], [sysc.value(0x7f118572cba0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([sysc.id(0x7f118565e5d0)]), range(MIN ; MAX), range_cond([:367 = sysc.id(0x7f118565e5d0)(0x7f1121926000)]) 391 - output([t36.aux_sale_man_names(0x7f118572d8c0)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7faa2f0)], [t36.id(0x7f117a07d8f0)], [t36.aux_sale_man_names(0x7f118572d8c0)]), partitions(p0) is_index_back=true, is_global_index=false, range_key([t36.order_id(0x7f1185667450)], [t36.id(0x7f117a07d8f0)]), range(MIN ; MAX), range_cond([:371 = t36.order_id(0x7f1185667450)(0x7f1121926a10)]) 392 - output([cast(0, DECIMAL_INT(77, 4))(0x7f10db561390)], [cast(0, DECIMAL_INT(75, 2))(0x7f10db562260)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f10db554690) - IFNULL(cast(b.deduction_price(0x7f10db4ec3f0), DECIMAL_INT(22, 2))(0x7f10db552710), cast(0, DECIMAL_INT(22, 2))(0x7f10db553600))(0x7f10db4ea7f0)(0x7f10db4ebaf0), DECIMAL(65, 6))(0x7f10db563130)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f10db554690) - IFNULL(cast(b.deduction_price(0x7f10db4ec3f0), DECIMAL_INT(22, 2))(0x7f10db552710), cast(0, DECIMAL_INT(22, 2))(0x7f10db553600))(0x7f10db4ea7f0)(0x7f10db4ebaf0), DECIMAL(65, 6))(0x7f10db564200)], [cast(0, DECIMAL_INT(75, 2))(0x7f10db5652d0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f10db554690) - IFNULL(cast(b.deduction_price(0x7f10db4ec3f0), DECIMAL_INT(22, 2))(0x7f10db552710), cast(0, DECIMAL_INT(22, 2))(0x7f10db553600))(0x7f10db4ea7f0)(0x7f10db4ebaf0), DECIMAL(65, 6))(0x7f10db5661a0)], [cast(0, VARCHAR(65))(0x7f10db56cb50)], [cast(0, DECIMAL_INT(78, 2))(0x7f10db56da20)], [cast(0, DECIMAL_INT(78, 2))(0x7f10db56f7c0)], [cast(0, DECIMAL_INT(76, 4))(0x7f10db570690)], [cast(0, DECIMAL_INT(76, 4))(0x7f10db571560)], [cast(0, DECIMAL_INT(76, 4))(0x7f10db572430)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f10db554690) - IFNULL(cast(b.deduction_price(0x7f10db4ec3f0), DECIMAL_INT(22, 2))(0x7f10db552710), cast(0, DECIMAL_INT(22, 2))(0x7f10db553600))(0x7f10db4ea7f0)(0x7f10db4ebaf0), DECIMAL(65, 6))(0x7f10db5741d0)], [cast(0, DECIMAL_INT(39, 4))(0x7f10db5752a0)], [t2.in_user_id(0x7f10db53cb00)], [t2.in_user_name(0x7f10db53d3b0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f10db4ac4d0)(:398)]), use_batch=true 393 - output([t3.order_id(0x7f10db4ac4d0)], [cast(0, DECIMAL_INT(23, 2))(0x7f10db554690) - IFNULL(cast(b.deduction_price(0x7f10db4ec3f0), DECIMAL_INT(22, 2))(0x7f10db552710), cast(0, DECIMAL_INT(22, 2))(0x7f10db553600))(0x7f10db4ea7f0)(0x7f10db4ebaf0)], [t2.in_user_id(0x7f10db53cb00)], [t2.in_user_name(0x7f10db53d3b0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f10db4a2200)(:395)]), use_batch=true 394 - output([t3.order_id(0x7f10db4ac4d0)], [t2.in_user_id(0x7f10db53cb00)], [t2.in_user_name(0x7f10db53d3b0)], [t2.id(0x7f10db4a2200)], [b.deduction_price(0x7f10db4ec3f0)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 395 - output([t3.order_id(0x7f10db4ac4d0)], [t2.in_user_id(0x7f10db53cb00)], [t2.in_user_name(0x7f10db53d3b0)], [t2.id(0x7f10db4a2200)], [b.deduction_price(0x7f10db4ec3f0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f10db4b2380)(:396)]), use_batch=true 396 - output([t3.order_id(0x7f10db4ac4d0)], [t2.in_user_id(0x7f10db53cb00)], [t2.in_user_name(0x7f10db53d3b0)], [t2.id(0x7f10db4a2200)], [t3.user_id(0x7f10db4b2380)], [b.deduction_price(0x7f10db4ec3f0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.order_id(0x7f10db4ac090)(:392)]), use_batch=true 397 - output([t2.in_user_id(0x7f10db53cb00)], [t2.in_user_name(0x7f10db53d3b0)], [t2.id(0x7f10db4a2200)], [t2.order_id(0x7f10db4ac090)], [b.deduction_price(0x7f10db4ec3f0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f10db4a2200)(:391)]), use_batch=true 398 - output([t2.in_user_id(0x7f10db53cb00)], [t2.in_user_name(0x7f10db53d3b0)], [t2.id(0x7f10db4a2200)], [t2.order_id(0x7f10db4ac090)], [b.deduction_price(0x7f10db4ec3f0)]), filter(nil), rowset=256 conds(nil), nl_params_([b.return_time(0x7f10db4d33d0)(:400)], [a.order_id(0x7f10db4a3e10)(:401)]), use_batch=true 399 - output([t2.in_user_id(0x7f10db53cb00)], [t2.in_user_name(0x7f10db53d3b0)], [t2.id(0x7f10db4a2200)], [t2.order_id(0x7f10db4ac090)], [b.return_time(0x7f10db4d33d0)], [a.order_id(0x7f10db4a3e10)], [b.deduction_price(0x7f10db4ec3f0)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f10db4c0940) = pl.product_id(0x7f10db4c0d80)(0x7f10db4c0080)]), other_conds(nil) 400 - output([pl.product_id(0x7f10db4c0d80)]), filter([pl.is_delete(0x7f10db4c25e0) = 0(0x7f10db4c1d20)]), rowset=256 access([pl.product_id(0x7f10db4c0d80)], [pl.is_delete(0x7f10db4c25e0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f117a0ba9f0)]), range(MIN ; MAX)always true 401 - output([t2.in_user_id(0x7f10db53cb00)], [t2.in_user_name(0x7f10db53d3b0)], [t2.id(0x7f10db4a2200)], [t2.order_id(0x7f10db4ac090)], [b.return_time(0x7f10db4d33d0)], [a.order_id(0x7f10db4a3e10)], [b.deduction_price(0x7f10db4ec3f0)], [t4.productid(0x7f10db4c0940)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.ppid(0x7f10db4ae060)(:394)]), use_batch=true 402 - output([t2.in_user_id(0x7f10db53cb00)], [t2.in_user_name(0x7f10db53d3b0)], [t2.id(0x7f10db4a2200)], [t2.order_id(0x7f10db4ac090)], [b.return_time(0x7f10db4d33d0)], [a.order_id(0x7f10db4a3e10)], [t2.ppid(0x7f10db4ae060)], [b.deduction_price(0x7f10db4ec3f0)]), filter(nil), rowset=256 conds(nil), nl_params_([a.detail_parent_id(0x7f10db4a1dc0)(:385)]), use_batch=true 403 - output([b.return_time(0x7f10db4d33d0)], [a.order_id(0x7f10db4a3e10)], [a.detail_parent_id(0x7f10db4a1dc0)], [b.deduction_price(0x7f10db4ec3f0)]), filter(nil), rowset=256 conds(nil), nl_params_([b.order_detail_id(0x7f10db49e320)(:384)]), use_batch=true 404 - output([b.order_detail_id(0x7f10db49e320)], [b.return_time(0x7f10db4d33d0)], [b.deduction_price(0x7f10db4ec3f0)]), filter([b.return_time(0x7f10db4d33d0) >= INTERNAL_FUNCTION('2024-10-14 00:00:00', 114, 17)(0x7f117a0be8d0)(0x7f10db4ded90)], [b.return_time(0x7f10db4d33d0) <= INTERNAL_FUNCTION('2024-10-31 23:59:59', 112, 17)(0x7f117a0bfaa0)(0x7f10db4df610)], [b.status(0x7f10db4d5b20) = 2(0x7f10db4d5260)], [b.is_delete(0x7f10db4d7380) = 0(0x7f10db4d6ac0)], [b.version(0x7f10db4dd500) = 0(0x7f10db4dcc40)]), rowset=256 access([b.order_detail_id(0x7f10db49e320)], [b.return_time(0x7f10db4d33d0)], [b.status(0x7f10db4d5b20)], [b.is_delete(0x7f10db4d7380)], [b.version(0x7f10db4dd500)], [b.deduction_price(0x7f10db4ec3f0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false,false,false,false], range_key([b.id(0x7f117a0b9070)]), range(MIN ; MAX)always true 405 - output([a.detail_parent_id(0x7f10db4a1dc0)], [a.order_id(0x7f10db4a3e10)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7fbb500)], [a.detail_parent_id(0x7f10db4a1dc0)], [a.order_id(0x7f10db4a3e10)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([a.id(0x7f10db49dee0)]), range(MIN ; MAX), range_cond([a.id(0x7f10db49dee0) = :384(0x7f1121927420)]) 406 - output([t2.id(0x7f10db4a2200)], [t2.order_id(0x7f10db4ac090)], [t2.ppid(0x7f10db4ae060)], [t2.in_user_id(0x7f10db53cb00)], [t2.in_user_name(0x7f10db53d3b0)]), filter([t2.is_delete(0x7f10db4d8be0) = 0(0x7f10db4d8320)], [t2.product_stock_type(0x7f10db4e8d10) IN (0, 1, 2, 6)(0x7f116c172210)(0x7f10db4e64b0)]), rowset=256 access([GROUP_ID(0x7f10e7fbb8b0)], [t2.id(0x7f10db4a2200)], [t2.order_id(0x7f10db4ac090)], [t2.ppid(0x7f10db4ae060)], [t2.is_delete(0x7f10db4d8be0)], [t2.product_stock_type(0x7f10db4e8d10)], [t2.in_user_id(0x7f10db53cb00)], [t2.in_user_name(0x7f10db53d3b0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false], range_key([t2.id(0x7f10db4a2200)]), range(MIN ; MAX), range_cond([:385 = t2.id(0x7f10db4a2200)(0x7f1121927e30)]) 407 - output([t4.productid(0x7f10db4c0940)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7fc0f40)], [t4.productid(0x7f10db4c0940)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f10db4ae4a0)]), range(MIN ; MAX), range_cond([:394 = t4.ppriceid(0x7f10db4ae4a0)(0x7f1121928840)]) 408 - output(nil), filter([cast(c.order_complete_time(0x7f10db4d2f90), DATETIME(19, 0))(0x7f10db4d3a60) <= :400(0x7f116910a670)]), rowset=256 access([GROUP_ID(0x7f10e7fc12f0)], [c.id(0x7f117a0b94b0)], [c.order_complete_time(0x7f10db4d2f90)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([c.order_id(0x7f10db4a4250)], [c.shadow_pk_0(0x7f126dcc83b0)]), range(MIN ; MAX), range_cond([:401 = c.order_id(0x7f10db4a4250)(0x7f1121929250)]) 409 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7fc16a0)]), partitions(p[0-9]) is_index_back=false, is_global_index=false, range_key([t1.order_detail_id(0x7f10db4a8ca0)], [t1.order_detail_type(0x7f10db4aa500)], [t1.id(0x7f10db4a76c0)]), range(MIN ; MAX), range_cond([t1.order_detail_type(0x7f10db4aa500) = 1(0x7f10db4a9c40)], [t1.order_detail_id(0x7f10db4a8ca0) = :391(0x7f1137bdc300)]) 410 - output([t3.order_id(0x7f10db4ac4d0)], [t3.user_id(0x7f10db4b2380)]), filter([t3.area_id(0x7f10db4b3f10) = 216(0x7f10db4e2cc0)], [t3.order_state(0x7f10db4d1670) IN (3, 9)(0x7f116c1717d0)(0x7f10db4cf770)], [t3.is_delete(0x7f10db4da440) = 0(0x7f10db4d9b80)]), rowset=256 access([GROUP_ID(0x7f10e7fc1a50)], [t3.id(0x7f117a0b98f0)], [t3.order_id(0x7f10db4ac4d0)], [t3.user_id(0x7f10db4b2380)], [t3.area_id(0x7f10db4b3f10)], [t3.order_state(0x7f10db4d1670)], [t3.is_delete(0x7f10db4da440)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t3.order_id(0x7f10db4ac4d0)], [t3.shadow_pk_0(0x7f126dd17120)]), range(MIN ; MAX), range_cond([:392 = t3.order_id(0x7f10db4ac4d0)(0x7f1121929c60)]) 411 - output(nil), filter([t5.is_delete(0x7f10db4dbca0) = 0(0x7f10db4db3e0)]), rowset=256 access([GROUP_ID(0x7f10e7fc85a0)], [t5.is_delete(0x7f10db4dbca0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f10db4b1f40)]), range(MIN ; MAX), range_cond([t5.id(0x7f10db4b1f40) = :396(0x7f112192a670)]) 412 - output(nil), filter(nil), rowset=256 413 - output(nil), filter(nil), rowset=256 access(nil), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f10db4b4350)]), range[216 ; 216], range_cond([t8.id(0x7f10db4b4350) = 216(0x7f112192b080)]) 414 - output(nil), filter([t17.is_delete(0x7f10db4bb200) = 0(0x7f10db4ba940)]), rowset=256 access([GROUP_ID(0x7f10e7fc9e10)], [t17.id(0x7f117a0ba170)], [t17.is_delete(0x7f10db4bb200)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t17.bind_order_detail_id(0x7f10db4b99a0)], [t17.id(0x7f117a0ba170)]), range(MIN ; MAX), range_cond([:395 = t17.bind_order_detail_id(0x7f10db4b99a0)(0x7f112192bf20)]) 415 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7fcb680)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f10db4cf0c0)], [t36.id(0x7f117a0bae30)]), range(MIN ; MAX), range_cond([:398 = t36.order_id(0x7f10db4cf0c0)(0x7f116907a550)]) 416 - output([cast(0, DECIMAL_INT(77, 4))(0x7f111625dc40)], [cast(0, DECIMAL_INT(75, 2))(0x7f111625eb10)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f1116257c60) - t6.return_price(0x7f10db5df120) * cast(t6.return_count(0x7f10db5df560), DECIMAL_INT(11, 0))(0x7f1116256bd0)(0x7f10db5ddfa0)(0x7f10db5de820), DECIMAL(65, 6))(0x7f111625f9e0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f1116257c60) - t6.return_price(0x7f10db5df120) * cast(t6.return_count(0x7f10db5df560), DECIMAL_INT(11, 0))(0x7f1116256bd0)(0x7f10db5ddfa0)(0x7f10db5de820), DECIMAL(65, 6))(0x7f1116260aa0)], [cast(0, DECIMAL_INT(75, 2))(0x7f1116261b60)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f1116257c60) - t6.return_price(0x7f10db5df120) * cast(t6.return_count(0x7f10db5df560), DECIMAL_INT(11, 0))(0x7f1116256bd0)(0x7f10db5ddfa0)(0x7f10db5de820), DECIMAL(65, 6))(0x7f1116262a30)], [cast(0, VARCHAR(65))(0x7f1116266760)], [cast(0, DECIMAL_INT(78, 2))(0x7f1116267630)], [cast(0, DECIMAL_INT(78, 2))(0x7f11162693d0)], [cast(0, DECIMAL_INT(76, 4))(0x7f111626a2a0)], [cast(0, DECIMAL_INT(76, 4))(0x7f111626b170)], [cast(0, DECIMAL_INT(76, 4))(0x7f111626c040)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f1116257c60) - t6.return_price(0x7f10db5df120) * cast(t6.return_count(0x7f10db5df560), DECIMAL_INT(11, 0))(0x7f1116256bd0)(0x7f10db5ddfa0)(0x7f10db5de820), DECIMAL(65, 6))(0x7f111626dfd0)], [cast(0, DECIMAL_INT(39, 4))(0x7f111626f090)], [t2.in_user_id(0x7f111623eb30)], [t2.in_user_name(0x7f111623f3e0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f10db598c10)(:424)]), use_batch=true 417 - output([t3.order_id(0x7f10db598c10)], [cast(0, DECIMAL_INT(23, 2))(0x7f1116257c60) - t6.return_price(0x7f10db5df120) * cast(t6.return_count(0x7f10db5df560), DECIMAL_INT(11, 0))(0x7f1116256bd0)(0x7f10db5ddfa0)(0x7f10db5de820)], [t2.in_user_id(0x7f111623eb30)], [t2.in_user_name(0x7f111623f3e0)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 418 - output([t3.order_id(0x7f10db598c10)], [t2.in_user_id(0x7f111623eb30)], [t2.in_user_name(0x7f111623f3e0)], [t6.return_price(0x7f10db5df120)], [t6.return_count(0x7f10db5df560)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f10db5934d0)(:415)]), use_batch=true 419 - output([t3.order_id(0x7f10db598c10)], [t2.in_user_id(0x7f111623eb30)], [t2.in_user_name(0x7f111623f3e0)], [t2.id(0x7f10db5934d0)], [t6.return_price(0x7f10db5df120)], [t6.return_count(0x7f10db5df560)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f10db5934d0)(:421)]), use_batch=true 420 - output([t3.order_id(0x7f10db598c10)], [t2.in_user_id(0x7f111623eb30)], [t2.in_user_name(0x7f111623f3e0)], [t2.id(0x7f10db5934d0)], [t6.return_price(0x7f10db5df120)], [t6.return_count(0x7f10db5df560)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f10db59eac0)(:422)]), use_batch=true 421 - output([t3.order_id(0x7f10db598c10)], [t2.in_user_id(0x7f111623eb30)], [t2.in_user_name(0x7f111623f3e0)], [t2.id(0x7f10db5934d0)], [t3.user_id(0x7f10db59eac0)], [t6.return_price(0x7f10db5df120)], [t6.return_count(0x7f10db5df560)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f10db5b2330) = pl.product_id(0x7f10db5b2770)(0x7f10db5b1a70)]), other_conds(nil) 422 - output([t3.order_id(0x7f10db598c10)], [t2.in_user_id(0x7f111623eb30)], [t2.in_user_name(0x7f111623f3e0)], [t2.id(0x7f10db5934d0)], [t3.user_id(0x7f10db59eac0)], [t6.return_price(0x7f10db5df120)], [t6.return_count(0x7f10db5df560)], [t4.productid(0x7f10db5b2330)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.ppid(0x7f10db59a7a0)(:418)]), use_batch=true 423 - output([t3.order_id(0x7f10db598c10)], [t2.in_user_id(0x7f111623eb30)], [t2.in_user_name(0x7f111623f3e0)], [t2.id(0x7f10db5934d0)], [t3.user_id(0x7f10db59eac0)], [t2.ppid(0x7f10db59a7a0)], [t6.return_price(0x7f10db5df120)], [t6.return_count(0x7f10db5df560)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.order_id(0x7f10db5987d0)(:416)]), use_batch=true 424 - output([t2.in_user_id(0x7f111623eb30)], [t2.in_user_name(0x7f111623f3e0)], [t2.id(0x7f10db5934d0)], [t2.ppid(0x7f10db59a7a0)], [t2.order_id(0x7f10db5987d0)], [t6.return_price(0x7f10db5df120)], [t6.return_count(0x7f10db5df560)]), filter(nil), rowset=256 conds(nil), nl_params_([t6.order_detail_id(0x7f10db5a2560)(:420)]), use_batch=true 425 - output([t6.order_detail_id(0x7f10db5a2560)], [t6.return_price(0x7f10db5df120)], [t6.return_count(0x7f10db5df560)]), filter(nil), rowset=256 conds(nil), nl_params_([t7.id(0x7f10db5a5d90)(:427)]), use_batch=true 426 - output([t7.id(0x7f10db5a5d90)]), filter([t7.is_delete(0x7f10db5ce750) = 0(0x7f10db5cde90)], [t7.check2_time(0x7f10db5d3280) >= cast('2024-10-14 00:00:00', TIMESTAMP(-1, -1))(0x7f10db5d3a90)(0x7f10db5d1840)], [t7.check2_time(0x7f10db5d3280) <= cast('2024-10-31 23:59:59', TIMESTAMP(-1, -1))(0x7f10db5d4b10)(0x7f10db5d20c0)]), rowset=256 access([t7.id(0x7f10db5a5d90)], [t7.is_delete(0x7f10db5ce750)], [t7.check2_time(0x7f10db5d3280)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t7.return_type(0x7f10db5cffb0)], [t7.id(0x7f10db5a5d90)]), range(8,MIN ; 8,MAX), range_cond([t7.return_type(0x7f10db5cffb0) = 8(0x7f112192c930)]) 427 - output([t6.order_detail_id(0x7f10db5a2560)], [t6.return_price(0x7f10db5df120)], [t6.return_count(0x7f10db5df560)]), filter([t6.mkc_id(0x7f10db5a3dc0) IS NULL(0x7f10db5a3500)], [t6.is_delete(0x7f10db5ccef0) = 0(0x7f10db5cc630)]), rowset=256 access([GROUP_ID(0x7f10e7fcee00)], [t6.id(0x7f117a0ccd30)], [t6.order_detail_id(0x7f10db5a2560)], [t6.mkc_id(0x7f10db5a3dc0)], [t6.is_delete(0x7f10db5ccef0)], [t6.return_price(0x7f10db5df120)], [t6.return_count(0x7f10db5df560)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false], range_key([t6.return_id(0x7f10db5a5950)], [t6.id(0x7f117a0ccd30)]), range(MIN ; MAX), range_cond([t6.return_id(0x7f10db5a5950) = :427(0x7f112192d7d0)]) 428 - output([t2.id(0x7f10db5934d0)], [t2.order_id(0x7f10db5987d0)], [t2.ppid(0x7f10db59a7a0)], [t2.in_user_id(0x7f111623eb30)], [t2.in_user_name(0x7f111623f3e0)]), filter([t2.is_delete(0x7f10db5c85d0) = 0(0x7f10db5c7d10)], [t2.product_stock_type(0x7f10db5dbc00) IN (0, 1, 2, 6)(0x7f116c178050)(0x7f10db5d93a0)]), rowset=256 access([GROUP_ID(0x7f10e7fd4490)], [t2.id(0x7f10db5934d0)], [t2.order_id(0x7f10db5987d0)], [t2.ppid(0x7f10db59a7a0)], [t2.is_delete(0x7f10db5c85d0)], [t2.product_stock_type(0x7f10db5dbc00)], [t2.in_user_id(0x7f111623eb30)], [t2.in_user_name(0x7f111623f3e0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false], range_key([t2.id(0x7f10db5934d0)]), range(MIN ; MAX), range_cond([t2.id(0x7f10db5934d0) = :420(0x7f112192e1e0)]) 429 - output([t3.order_id(0x7f10db598c10)], [t3.user_id(0x7f10db59eac0)]), filter([t3.area_id(0x7f10db5a7920) = 216(0x7f10db5d5bb0)], [t3.order_state(0x7f10db5c6c80) IN (3, 9)(0x7f116c175320)(0x7f10db5c4d80)], [t3.is_delete(0x7f10db5c9e30) = 0(0x7f10db5c9570)]), rowset=256 access([GROUP_ID(0x7f10e7fd9b20)], [t3.id(0x7f117a0cc8f0)], [t3.order_id(0x7f10db598c10)], [t3.user_id(0x7f10db59eac0)], [t3.area_id(0x7f10db5a7920)], [t3.order_state(0x7f10db5c6c80)], [t3.is_delete(0x7f10db5c9e30)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t3.order_id(0x7f10db598c10)], [t3.shadow_pk_0(0x7f1103ef1590)]), range(MIN ; MAX), range_cond([:416 = t3.order_id(0x7f10db598c10)(0x7f112192ebf0)]) 430 - output([t4.productid(0x7f10db5b2330)]), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7fe0670)], [t4.productid(0x7f10db5b2330)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f10db59abe0)]), range(MIN ; MAX), range_cond([:418 = t4.ppriceid(0x7f10db59abe0)(0x7f112192f600)]) 431 - output([pl.product_id(0x7f10db5b2770)]), filter([pl.is_delete(0x7f10db5b6050) = 0(0x7f10db5b3710)]), rowset=256 access([pl.product_id(0x7f10db5b2770)], [pl.is_delete(0x7f10db5b6050)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f117a0cde30)]), range(MIN ; MAX)always true 432 - output(nil), filter([t5.is_delete(0x7f10db5cb690) = 0(0x7f10db5cadd0)]), rowset=256 access([GROUP_ID(0x7f10e7fe1ee0)], [t5.is_delete(0x7f10db5cb690)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f10db59e680)]), range(MIN ; MAX), range_cond([t5.id(0x7f10db59e680) = :422(0x7f1121930010)]) 433 - output(nil), filter([t17.is_delete(0x7f10db5aec10) = 0(0x7f10db5ae350)]), rowset=256 access([GROUP_ID(0x7f10e7fe3750)], [t17.id(0x7f117a0cd5b0)], [t17.is_delete(0x7f10db5aec10)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t17.bind_order_detail_id(0x7f10db5ad3b0)], [t17.id(0x7f117a0cd5b0)]), range(MIN ; MAX), range_cond([:421 = t17.bind_order_detail_id(0x7f10db5ad3b0)(0x7f1121930a20)]) 434 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7fe4fc0)]), partitions(p[0-9]) is_index_back=false, is_global_index=false, range_key([t1.order_detail_id(0x7f10db593090)], [t1.order_detail_type(0x7f10db594d30)], [t1.id(0x7f10db591ab0)]), range(MIN ; MAX), range_cond([t1.order_detail_type(0x7f10db594d30) = 1(0x7f10db594470)], [t1.order_detail_id(0x7f10db593090) = :415(0x7f130e8577f0)]) 435 - output(nil), filter(nil), rowset=256 436 - output(nil), filter(nil), rowset=256 access(nil), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f10db5a7d60)]), range[216 ; 216], range_cond([t8.id(0x7f10db5a7d60) = 216(0x7f1121931430)]) 437 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f10e7fe5370)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f10db5c46d0)], [t36.id(0x7f117a0ce270)]), range(MIN ; MAX), range_cond([:424 = t36.order_id(0x7f10db5c46d0)(0x7f110c8099e0)]) 438 - output([cast(0, DECIMAL_INT(77, 4))(0x7f1116357630)], [cast(0, DECIMAL_INT(75, 2))(0x7f1116358500)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f111634f740) - t6.return_price(0x7f11162e4c70) * cast(t6.return_count(0x7f11162e50b0), DECIMAL_INT(11, 0))(0x7f111634e6b0)(0x7f11162e3af0)(0x7f11162e4370), DECIMAL(65, 6))(0x7f11163593d0)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f111634f740) - t6.return_price(0x7f11162e4c70) * cast(t6.return_count(0x7f11162e50b0), DECIMAL_INT(11, 0))(0x7f111634e6b0)(0x7f11162e3af0)(0x7f11162e4370), DECIMAL(65, 6))(0x7f111635a490)], [cast(0, DECIMAL_INT(75, 2))(0x7f111635b550)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f111634f740) - t6.return_price(0x7f11162e4c70) * cast(t6.return_count(0x7f11162e50b0), DECIMAL_INT(11, 0))(0x7f111634e6b0)(0x7f11162e3af0)(0x7f11162e4370), DECIMAL(65, 6))(0x7f111635c420)], [cast(0, VARCHAR(65))(0x7f1116360150)], [cast(0, DECIMAL_INT(78, 2))(0x7f1116361020)], [cast(0, DECIMAL_INT(78, 2))(0x7f1116362dc0)], [cast(0, DECIMAL_INT(76, 4))(0x7f1116363c90)], [cast(0, DECIMAL_INT(76, 4))(0x7f1116364b60)], [cast(0, DECIMAL_INT(76, 4))(0x7f1116365a30)], [cast(cast(0, DECIMAL_INT(23, 2))(0x7f111634f740) - t6.return_price(0x7f11162e4c70) * cast(t6.return_count(0x7f11162e50b0), DECIMAL_INT(11, 0))(0x7f111634e6b0)(0x7f11162e3af0)(0x7f11162e4370), DECIMAL(65, 6))(0x7f11163679c0)], [cast(0, DECIMAL_INT(39, 4))(0x7f1116368a80)], [t2.in_user_id(0x7f11163366f0)], [t2.in_user_name(0x7f1116336fa0)]), filter(nil), rowset=256 equal_conds([t4.productid(0x7f11162b7ef0) = pl.product_id(0x7f11162b8330)(0x7f11162b7630)]), other_conds(nil) 439 - output([cast(0, DECIMAL_INT(23, 2))(0x7f111634f740) - t6.return_price(0x7f11162e4c70) * cast(t6.return_count(0x7f11162e50b0), DECIMAL_INT(11, 0))(0x7f111634e6b0)(0x7f11162e3af0)(0x7f11162e4370)], [t2.in_user_id(0x7f11163366f0)], [t2.in_user_name(0x7f1116336fa0)], [t4.productid(0x7f11162b7ef0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.order_id(0x7f111629fbf0)(:444)]), use_batch=true 440 - output([t2.in_user_id(0x7f11163366f0)], [t2.in_user_name(0x7f1116336fa0)], [t3.order_id(0x7f111629fbf0)], [t6.return_price(0x7f11162e4c70)], [t6.return_count(0x7f11162e50b0)], [t4.productid(0x7f11162b7ef0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.id(0x7f111629a4b0)(:439)]), use_batch=true 441 - output([t2.in_user_id(0x7f11163366f0)], [t2.in_user_name(0x7f1116336fa0)], [t3.order_id(0x7f111629fbf0)], [t2.id(0x7f111629a4b0)], [t6.return_price(0x7f11162e4c70)], [t6.return_count(0x7f11162e50b0)], [t4.productid(0x7f11162b7ef0)]), filter(nil), rowset=256 conds(nil), nl_params_(nil), use_batch=false 442 - output([t2.in_user_id(0x7f11163366f0)], [t2.in_user_name(0x7f1116336fa0)], [t3.order_id(0x7f111629fbf0)], [t2.id(0x7f111629a4b0)], [t6.return_price(0x7f11162e4c70)], [t6.return_count(0x7f11162e50b0)], [t4.productid(0x7f11162b7ef0)]), filter(nil), rowset=256 conds(nil), nl_params_([t3.user_id(0x7f11162a5aa0)(:442)]), use_batch=true 443 - output([t2.in_user_id(0x7f11163366f0)], [t2.in_user_name(0x7f1116336fa0)], [t3.order_id(0x7f111629fbf0)], [t2.id(0x7f111629a4b0)], [t3.user_id(0x7f11162a5aa0)], [t6.return_price(0x7f11162e4c70)], [t6.return_count(0x7f11162e50b0)], [t4.productid(0x7f11162b7ef0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.order_id(0x7f111629f7b0)(:436)]), use_batch=true 444 - output([t2.in_user_id(0x7f11163366f0)], [t2.in_user_name(0x7f1116336fa0)], [t2.id(0x7f111629a4b0)], [t2.order_id(0x7f111629f7b0)], [t6.return_price(0x7f11162e4c70)], [t6.return_count(0x7f11162e50b0)], [t4.productid(0x7f11162b7ef0)]), filter(nil), rowset=256 conds(nil), nl_params_([t2.ppid(0x7f11162a1780)(:438)]), use_batch=true 445 - output([t2.in_user_id(0x7f11163366f0)], [t2.in_user_name(0x7f1116336fa0)], [t2.id(0x7f111629a4b0)], [t2.order_id(0x7f111629f7b0)], [t2.ppid(0x7f11162a1780)], [t6.return_price(0x7f11162e4c70)], [t6.return_count(0x7f11162e50b0)]), filter(nil), rowset=256 conds(nil), nl_params_([t1.order_detail_id(0x7f111629a070)(:435)]), use_batch=true 446 - output([t1.order_detail_id(0x7f111629a070)], [t6.return_price(0x7f11162e4c70)], [t6.return_count(0x7f11162e50b0)]), filter(nil), rowset=256 conds(nil), nl_params_([t6.mkc_id(0x7f11162a9540)(:441)]), use_batch=true 447 - output([t6.mkc_id(0x7f11162a9540)], [t6.return_price(0x7f11162e4c70)], [t6.return_count(0x7f11162e50b0)]), filter(nil), rowset=256 conds(nil), nl_params_([t7.id(0x7f11162ab950)(:447)]), use_batch=true 448 - output([t7.id(0x7f11162ab950)]), filter([t7.is_delete(0x7f11162d42a0) = 0(0x7f11162d39e0)], [t7.check2_time(0x7f11162d8dd0) >= cast('2024-10-14 00:00:00', TIMESTAMP(-1, -1))(0x7f11162d95e0)(0x7f11162d7390)], [t7.check2_time(0x7f11162d8dd0) <= cast('2024-10-31 23:59:59', TIMESTAMP(-1, -1))(0x7f11162da660)(0x7f11162d7c10)]), rowset=256 access([t7.id(0x7f11162ab950)], [t7.is_delete(0x7f11162d42a0)], [t7.check2_time(0x7f11162d8dd0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t7.return_type(0x7f11162d5b00)], [t7.id(0x7f11162ab950)]), range(8,MIN ; 8,MAX), range_cond([t7.return_type(0x7f11162d5b00) = 8(0x7f11219322d0)]) 449 - output([t6.mkc_id(0x7f11162a9540)], [t6.return_price(0x7f11162e4c70)], [t6.return_count(0x7f11162e50b0)]), filter([t6.is_delete(0x7f11162d2a40) = 0(0x7f11162d2180)]), rowset=256 access([GROUP_ID(0x7f10e7fe8af0)], [t6.id(0x7f117a0da4d0)], [t6.mkc_id(0x7f11162a9540)], [t6.is_delete(0x7f11162d2a40)], [t6.return_price(0x7f11162e4c70)], [t6.return_count(0x7f11162e50b0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t6.return_id(0x7f11162ab510)], [t6.id(0x7f117a0da4d0)]), range(MIN ; MAX), range_cond([t6.return_id(0x7f11162ab510) = :447(0x7f1121933170)]) 450 - output([t1.order_detail_id(0x7f111629a070)]), filter([t1.order_detail_type(0x7f111629bd10) = 1(0x7f111629b450)]), rowset=256 access([GROUP_ID(0x7f10e7fee180)], [t1.id(0x7f1116298a90)], [t1.order_detail_id(0x7f111629a070)], [t1.order_detail_type(0x7f111629bd10)]), partitions(p[0-9]) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t1.mkc_id(0x7f11162a9980)], [t1.id(0x7f1116298a90)]), range(MIN ; MAX), range_cond([:441 = t1.mkc_id(0x7f11162a9980)(0x7f1121933b80)]) 451 - output([t2.id(0x7f111629a4b0)], [t2.order_id(0x7f111629f7b0)], [t2.ppid(0x7f11162a1780)], [t2.in_user_id(0x7f11163366f0)], [t2.in_user_name(0x7f1116336fa0)]), filter([t2.is_delete(0x7f11162ce120) = 0(0x7f11162cd860)], [t2.product_stock_type(0x7f11162e1750) IN (0, 1, 2, 6)(0x7f116c17bae0)(0x7f11162deef0)]), rowset=256 access([GROUP_ID(0x7f10e7ff1900)], [t2.id(0x7f111629a4b0)], [t2.order_id(0x7f111629f7b0)], [t2.ppid(0x7f11162a1780)], [t2.is_delete(0x7f11162ce120)], [t2.product_stock_type(0x7f11162e1750)], [t2.in_user_id(0x7f11163366f0)], [t2.in_user_name(0x7f1116336fa0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false,false], range_key([t2.id(0x7f111629a4b0)]), range(MIN ; MAX), range_cond([:435 = t2.id(0x7f111629a4b0)(0x7f1121934590)]) 452 - output([t4.productid(0x7f11162b7ef0)]), filter(nil), rowset=256 access([GROUP_ID(0x7f1121809330)], [t4.productid(0x7f11162b7ef0)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t4.ppriceid(0x7f11162a1bc0)]), range(MIN ; MAX), range_cond([:438 = t4.ppriceid(0x7f11162a1bc0)(0x7f1121934fa0)]) 453 - output([t3.order_id(0x7f111629fbf0)], [t3.user_id(0x7f11162a5aa0)]), filter([t3.area_id(0x7f11162ad4e0) = 216(0x7f11162db700)], [t3.order_state(0x7f11162cc7d0) IN (3, 9)(0x7f116c17b0a0)(0x7f11162ca8d0)], [t3.is_delete(0x7f11162cf980) = 0(0x7f11162cf0c0)]), rowset=256 access([GROUP_ID(0x7f11218096e0)], [t3.id(0x7f117a0da090)], [t3.order_id(0x7f111629fbf0)], [t3.user_id(0x7f11162a5aa0)], [t3.area_id(0x7f11162ad4e0)], [t3.order_state(0x7f11162cc7d0)], [t3.is_delete(0x7f11162cf980)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false,false,false], range_key([t3.order_id(0x7f111629fbf0)], [t3.shadow_pk_0(0x7f12d269b3b0)]), range(MIN ; MAX), range_cond([:436 = t3.order_id(0x7f111629fbf0)(0x7f11219359b0)]) 454 - output(nil), filter([t5.is_delete(0x7f11162d11e0) = 0(0x7f11162d0920)]), rowset=256 access([GROUP_ID(0x7f1121810230)], [t5.is_delete(0x7f11162d11e0)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([t5.id(0x7f11162a5660)]), range(MIN ; MAX), range_cond([t5.id(0x7f11162a5660) = :442(0x7f11219363c0)]) 455 - output(nil), filter(nil), rowset=256 456 - output(nil), filter(nil), rowset=256 access(nil), partitions(p0) is_index_back=false, is_global_index=false, range_key([t8.id(0x7f11162ad920)]), range[216 ; 216], range_cond([t8.id(0x7f11162ad920) = 216(0x7f1121936dd0)]) 457 - output(nil), filter([t17.is_delete(0x7f11162b47d0) = 0(0x7f11162b3f10)]), rowset=256 access([GROUP_ID(0x7f1121811aa0)], [t17.id(0x7f117a0dad50)], [t17.is_delete(0x7f11162b47d0)]), partitions(p0) is_index_back=true, is_global_index=false, filter_before_indexback[false], range_key([t17.bind_order_detail_id(0x7f11162b2f70)], [t17.id(0x7f117a0dad50)]), range(MIN ; MAX), range_cond([:439 = t17.bind_order_detail_id(0x7f11162b2f70)(0x7f112193a050)]) 458 - output(nil), filter(nil), rowset=256 access([GROUP_ID(0x7f1121813310)]), partitions(p0) is_index_back=false, is_global_index=false, range_key([t36.order_id(0x7f11162ca220)], [t36.id(0x7f117a0dba10)]), range(MIN ; MAX), range_cond([:444 = t36.order_id(0x7f11162ca220)(0x7f10e4fb19b0)]) 459 - output([pl.product_id(0x7f11162b8330)]), filter([pl.is_delete(0x7f11162b9b90) = 0(0x7f11162b92d0)]), rowset=256 access([pl.product_id(0x7f11162b8330)], [pl.is_delete(0x7f11162b9b90)]), partitions(p0) is_index_back=false, is_global_index=false, filter_before_indexback[false], range_key([pl.id(0x7f117a0db5d0)]), range(MIN ; MAX)always true Used Hint: ------------------------------------- /*+ INDEX("c" "torder_ix_order_id") INDEX("c" "torder_ix_order_id") */ Qb name trace: ------------------------------------- stmt_id:0, stmt_type:T_EXPLAIN stmt_id:1, SEL$1 stmt_id:2, SET$1 stmt_id:3, SEL$2 stmt_id:4, SEL$3 > SEL$B79ED4F0 > SEL$E2DEB254 > SEL$4F95CB2B stmt_id:5, SET$2 > SET$88FD1BD0 > SET$74809C2C stmt_id:6, SEL$4 > SEL$862290CF > SEL$C76E4651 > SEL$8A8B749C > SEL$C06ACC3F > SEL$FCD86959 > SEL$C33E59DA > SEL$0208448F stmt_id:7, SEL$5 > SEL$F24DB159 > SEL$5EA95256 > SEL$61C2283B > SEL$196784F1 > SEL$F80F06DA stmt_id:8, SEL$6 > SEL$B9E273FB > SEL$93E64733 > SEL$D24DF724 > SEL$D1FFEEF5 > SEL$AC250E02 stmt_id:9, SEL$7 > SEL$CE775F8B > SEL$50D9F667 > SEL$952FCADF > SEL$66B23311 > SEL$760540EC stmt_id:10, SEL$8 > SEL$13B9B645 > SEL$B7F9ED44 > SEL$2D670F11 > SEL$AB24FD10 stmt_id:11, SET$3 > SET$A2FE34C6 > SET$3AC7973E stmt_id:12, SEL$9 > SEL$73FAD0A0 > SEL$99721548 > SEL$4E8173E8 > SEL$D9013B37 stmt_id:13, SEL$10 > SEL$AF708CD9 > SEL$4D7C757A > SEL$1A7BD1D6 > SEL$59C2EB8A stmt_id:14, SEL$11 > SEL$741F3C49 > SEL$DCCC18DB stmt_id:15, SEL$12 > SEL$FA6B9F5B > SEL$B8156664 > SEL$5BE1C888 > SEL$36B16BD6 > SEL$3FF01289 stmt_id:16, SEL$13 > SEL$B221DBE9 > SEL$13CE72C8 > SEL$BA8AE57E > SEL$088B1144 > SEL$14A7C2E5 stmt_id:17, SEL$14 > SEL$A25B6356 > SEL$5FB4010A > SEL$E141C615 > SEL$244FD6EB > SEL$2DAB2C8D stmt_id:18, SEL$15 stmt_id:19, SEL$16 > SEL$66463637 > SEL$78120F8F > SEL$042E8615 stmt_id:20, SET$4 > SET$160621EA > SET$C9540096 stmt_id:21, SEL$17 > SEL$FB8528D7 > SEL$94987E40 > SEL$9FD47EB6 > SEL$A002AFBF > SEL$367430D6 > SEL$8AD6E1EC > SEL$DB91801A stmt_id:22, SEL$18 > SEL$4E0AE1CC > SEL$A650D3B1 > SEL$AE171B57 > SEL$3866D546 > SEL$71062874 stmt_id:23, SEL$19 > SEL$246369DB > SEL$E89CF8D9 > SEL$A4E7009A > SEL$EF748854 > SEL$C3998036 stmt_id:24, SEL$20 > SEL$19C25DAA > SEL$69BC3CCC > SEL$400B4033 > SEL$26E9AA48 > SEL$F629010C stmt_id:25, SEL$21 > SEL$8BE873B1 > SEL$9AFFA2B6 > SEL$1B837888 > SEL$1DCBCB95 stmt_id:26, SET$5 > SET$864848B3 > SET$01AEF586 stmt_id:27, SEL$22 > SEL$EDD46CB0 > SEL$E35530EB > SEL$CAA01D87 > SEL$322BDBB0 stmt_id:28, SEL$23 > SEL$649BD5DB > SEL$645B1D0B > SEL$D76B789F > SEL$8EEBF155 stmt_id:29, SEL$24 > SEL$78780CA4 > SEL$39F03FB4 stmt_id:30, SEL$25 > SEL$B42BAF61 > SEL$BA9DD79C > SEL$015B026D > SEL$E2A0CD93 > SEL$0073597A stmt_id:31, SEL$26 > SEL$737A3E40 > SEL$54759E71 > SEL$ACEB2114 > SEL$EB492156 > SEL$C07C80F8 stmt_id:32, SEL$27 > SEL$1318DBE3 > SEL$69A230FE > SEL$813B6A0C > SEL$8A211AD1 > SEL$0E6161A9 Outline Data: ------------------------------------- /*+ BEGIN_OUTLINE_DATA USE_HASH_AGGREGATION(@"SEL$1") USE_HASH_SET(@"SET$1") USE_HASH_AGGREGATION(@"SEL$4F95CB2B") LEADING(@"SEL$F80F06DA" (((((("t6"@"SEL$5" ("t7"@"SEL$5" ((("t3"@"SEL$5" "t8"@"SEL$5") "t5"@"SEL$5") "t36"@"SEL$5"))) "t1"@"SEL$5") "t2"@"SEL$5") "t4"@"SEL$5") "pl"@"SEL$5") "t16"@"SEL$5")) USE_NL(@"SEL$F80F06DA" "t16"@"SEL$5") USE_HASH(@"SEL$F80F06DA" "pl"@"SEL$5") USE_NL(@"SEL$F80F06DA" "t4"@"SEL$5") USE_HASH(@"SEL$F80F06DA" "t2"@"SEL$5") USE_HASH(@"SEL$F80F06DA" "t1"@"SEL$5") PQ_DISTRIBUTE(@"SEL$F80F06DA" "t1"@"SEL$5" LOCAL LOCAL) USE_HASH(@"SEL$F80F06DA" ("t8"@"SEL$5" "t7"@"SEL$5" "t5"@"SEL$5" "t36"@"SEL$5" "t3"@"SEL$5")) FULL(@"SEL$F80F06DA" "t6"@"SEL$5") USE_NL(@"SEL$F80F06DA" ("t8"@"SEL$5" "t5"@"SEL$5" "t36"@"SEL$5" "t3"@"SEL$5")) USE_NL_MATERIALIZATION(@"SEL$F80F06DA" ("t8"@"SEL$5" "t5"@"SEL$5" "t36"@"SEL$5" "t3"@"SEL$5")) INDEX(@"SEL$F80F06DA" "t7"@"SEL$5" "treturn_ix_check2_time") USE_MERGE(@"SEL$F80F06DA" "t36"@"SEL$5") USE_NL(@"SEL$F80F06DA" "t5"@"SEL$5") USE_NL(@"SEL$F80F06DA" "t8"@"SEL$5") USE_NL_MATERIALIZATION(@"SEL$F80F06DA" "t8"@"SEL$5") INDEX(@"SEL$F80F06DA" "t3"@"SEL$5" "torder_ix_area_id") FULL(@"SEL$F80F06DA" "t8"@"SEL$5") FULL(@"SEL$F80F06DA" "t5"@"SEL$5") USE_DAS(@"SEL$F80F06DA" "t5"@"SEL$5") INDEX(@"SEL$F80F06DA" "t36"@"SEL$5" "idx_order_id") FULL(@"SEL$F80F06DA" "t1"@"SEL$5") USE_COLUMN_TABLE(@"SEL$F80F06DA" "t1"@"SEL$5") FULL(@"SEL$F80F06DA" "t2"@"SEL$5") USE_COLUMN_TABLE(@"SEL$F80F06DA" "t2"@"SEL$5") FULL(@"SEL$F80F06DA" "t4"@"SEL$5") USE_DAS(@"SEL$F80F06DA" "t4"@"SEL$5") FULL(@"SEL$F80F06DA" "pl"@"SEL$5") LEADING(@"SEL$0208448F" (((((((((("t1"@"SEL$4" "t2"@"SEL$4") "t3"@"SEL$4") "t4"@"SEL$4") "pl"@"SEL$4") "t5"@"SEL$4") "t6"@"SEL$4") "t7"@"SEL$4") "t36"@"SEL$4") "t16"@"SEL$4") "t17"@"SEL$4")) USE_NL(@"SEL$0208448F" "t17"@"SEL$4") USE_NL(@"SEL$0208448F" "t16"@"SEL$4") USE_NL(@"SEL$0208448F" "t36"@"SEL$4") USE_NL(@"SEL$0208448F" "t7"@"SEL$4") USE_NL(@"SEL$0208448F" "t6"@"SEL$4") USE_NL(@"SEL$0208448F" "t5"@"SEL$4") USE_HASH(@"SEL$0208448F" "pl"@"SEL$4") USE_NL(@"SEL$0208448F" "t4"@"SEL$4") USE_NL(@"SEL$0208448F" "t3"@"SEL$4") USE_NL(@"SEL$0208448F" "t2"@"SEL$4") INDEX(@"SEL$0208448F" "t1"@"SEL$4" "index_mck_id") USE_DAS(@"SEL$0208448F" "t1"@"SEL$4") FULL(@"SEL$0208448F" "t2"@"SEL$4") USE_DAS(@"SEL$0208448F" "t2"@"SEL$4") INDEX(@"SEL$0208448F" "t3"@"SEL$4" "torder_ix_order_id") USE_DAS(@"SEL$0208448F" "t3"@"SEL$4") FULL(@"SEL$0208448F" "t4"@"SEL$4") USE_DAS(@"SEL$0208448F" "t4"@"SEL$4") FULL(@"SEL$0208448F" "pl"@"SEL$4") FULL(@"SEL$0208448F" "t5"@"SEL$4") USE_DAS(@"SEL$0208448F" "t5"@"SEL$4") INDEX(@"SEL$0208448F" "t6"@"SEL$4" "idx_mkc_id") USE_DAS(@"SEL$0208448F" "t6"@"SEL$4") FULL(@"SEL$0208448F" "t7"@"SEL$4") USE_DAS(@"SEL$0208448F" "t7"@"SEL$4") INDEX(@"SEL$0208448F" "t36"@"SEL$4" "idx_order_id") USE_DAS(@"SEL$0208448F" "t36"@"SEL$4") INDEX(@"SEL$0208448F" "t16"@"SEL$4" "trebate_detail_mkc_id") USE_DAS(@"SEL$0208448F" "t16"@"SEL$4") FULL(@"SEL$0208448F" "t17"@"SEL$4") USE_DAS(@"SEL$0208448F" "t17"@"SEL$4") LEADING(@"SEL$AC250E02" ("t36"@"SEL$6" ("pl"@"SEL$6" ((((("t3"@"SEL$6" "t8"@"SEL$6") "t5"@"SEL$6") "t2"@"SEL$6") "t1"@"SEL$6") "t4"@"SEL$6")))) USE_MERGE(@"SEL$AC250E02" ("t8"@"SEL$6" "t5"@"SEL$6" "t4"@"SEL$6" "t3"@"SEL$6" "t2"@"SEL$6" "t1"@"SEL$6" "pl"@"SEL$6")) INDEX(@"SEL$AC250E02" "t36"@"SEL$6" "idx_order_id") USE_HASH(@"SEL$AC250E02" ("t8"@"SEL$6" "t5"@"SEL$6" "t4"@"SEL$6" "t3"@"SEL$6" "t2"@"SEL$6" "t1"@"SEL$6")) FULL(@"SEL$AC250E02" "pl"@"SEL$6") USE_NL(@"SEL$AC250E02" "t4"@"SEL$6") USE_NL(@"SEL$AC250E02" "t1"@"SEL$6") USE_NL(@"SEL$AC250E02" "t2"@"SEL$6") USE_NL(@"SEL$AC250E02" "t5"@"SEL$6") USE_NL(@"SEL$AC250E02" "t8"@"SEL$6") USE_NL_MATERIALIZATION(@"SEL$AC250E02" "t8"@"SEL$6") INDEX(@"SEL$AC250E02" "t3"@"SEL$6" "torder_ix_area_id") FULL(@"SEL$AC250E02" "t8"@"SEL$6") FULL(@"SEL$AC250E02" "t5"@"SEL$6") USE_DAS(@"SEL$AC250E02" "t5"@"SEL$6") INDEX(@"SEL$AC250E02" "t2"@"SEL$6" "index_orderId") USE_DAS(@"SEL$AC250E02" "t2"@"SEL$6") INDEX(@"SEL$AC250E02" "t1"@"SEL$6" "tproductstockdetail_ix_order_detail_id") USE_DAS(@"SEL$AC250E02" "t1"@"SEL$6") FULL(@"SEL$AC250E02" "t4"@"SEL$6") USE_DAS(@"SEL$AC250E02" "t4"@"SEL$6") LEADING(@"SEL$760540EC" ((("pl"@"SEL$7" (((((("t17"@"SEL$7" "t16"@"SEL$7") "t1"@"SEL$7") "t2"@"SEL$7") "t3"@"SEL$7") "t4"@"SEL$7") "t8"@"SEL$7")) "t36"@"SEL$7") "t5"@"SEL$7")) USE_NL(@"SEL$760540EC" "t5"@"SEL$7") USE_NL(@"SEL$760540EC" "t36"@"SEL$7") USE_HASH(@"SEL$760540EC" ("t8"@"SEL$7" "t4"@"SEL$7" "t3"@"SEL$7" "t2"@"SEL$7" "t17"@"SEL$7" "t16"@"SEL$7" "t1"@"SEL$7")) FULL(@"SEL$760540EC" "pl"@"SEL$7") USE_NL(@"SEL$760540EC" "t8"@"SEL$7") USE_NL_MATERIALIZATION(@"SEL$760540EC" "t8"@"SEL$7") USE_NL(@"SEL$760540EC" "t4"@"SEL$7") USE_HASH(@"SEL$760540EC" "t3"@"SEL$7") USE_NL(@"SEL$760540EC" "t2"@"SEL$7") USE_NL(@"SEL$760540EC" "t1"@"SEL$7") USE_NL(@"SEL$760540EC" "t16"@"SEL$7") INDEX(@"SEL$760540EC" "t17"@"SEL$7" "table_index") INDEX(@"SEL$760540EC" "t16"@"SEL$7" "idx_adjust_price_id") USE_DAS(@"SEL$760540EC" "t16"@"SEL$7") INDEX(@"SEL$760540EC" "t1"@"SEL$7" "index_mck_id") USE_DAS(@"SEL$760540EC" "t1"@"SEL$7") FULL(@"SEL$760540EC" "t2"@"SEL$7") USE_DAS(@"SEL$760540EC" "t2"@"SEL$7") INDEX(@"SEL$760540EC" "t3"@"SEL$7" "torder_ix_area_id") FULL(@"SEL$760540EC" "t4"@"SEL$7") USE_DAS(@"SEL$760540EC" "t4"@"SEL$7") FULL(@"SEL$760540EC" "t8"@"SEL$7") INDEX(@"SEL$760540EC" "t36"@"SEL$7" "idx_order_id") USE_DAS(@"SEL$760540EC" "t36"@"SEL$7") FULL(@"SEL$760540EC" "t5"@"SEL$7") USE_DAS(@"SEL$760540EC" "t5"@"SEL$7") USE_HASH_AGGREGATION(@"SEL$AB24FD10") USE_HASH_AGGREGATION(@"SEL$D9013B37") LEADING(@"SEL$D9013B37" ("sysc"@"SEL$9" ((("la"@"SEL$9" ("pl"@"SEL$9" (((((("t11"@"SEL$9" (("t3"@"SEL$9" ("t8"@"SEL$9" "t40"@"SEL$9")) "t36"@"SEL$9")) "t5"@"SEL$9") "t2"@"SEL$9") "t17"@"SEL$9") "t16"@"SEL$9") "t4"@"SEL$9"))) "vpcc"@"SEL$9") "t1"@"SEL$9"))) USE_HASH(@"SEL$D9013B37" ("vpcc"@"SEL$9" "t8"@"SEL$9" "t5"@"SEL$9" "t40"@"SEL$9" "t4"@"SEL$9" "t36"@"SEL$9" "t3"@"SEL$9" "t2"@"SEL$9" "t17"@"SEL$9" "t16"@"SEL$9" "t11"@"SEL$9" "t1"@"SEL$9" "pl"@"SEL$9" "la"@"SEL$9")) FULL(@"SEL$D9013B37" "sysc"@"SEL$9") USE_NL(@"SEL$D9013B37" "t1"@"SEL$9") USE_NL(@"SEL$D9013B37" "vpcc"@"SEL$9") USE_HASH(@"SEL$D9013B37" ("t8"@"SEL$9" "t5"@"SEL$9" "t40"@"SEL$9" "t4"@"SEL$9" "t36"@"SEL$9" "t3"@"SEL$9" "t2"@"SEL$9" "t17"@"SEL$9" "t16"@"SEL$9" "t11"@"SEL$9" "pl"@"SEL$9")) FULL(@"SEL$D9013B37" "la"@"SEL$9") USE_HASH(@"SEL$D9013B37" ("t8"@"SEL$9" "t5"@"SEL$9" "t40"@"SEL$9" "t4"@"SEL$9" "t36"@"SEL$9" "t3"@"SEL$9" "t2"@"SEL$9" "t17"@"SEL$9" "t16"@"SEL$9" "t11"@"SEL$9")) FULL(@"SEL$D9013B37" "pl"@"SEL$9") USE_NL(@"SEL$D9013B37" "t4"@"SEL$9") USE_HASH(@"SEL$D9013B37" "t16"@"SEL$9") USE_HASH(@"SEL$D9013B37" "t17"@"SEL$9") USE_NL(@"SEL$D9013B37" "t2"@"SEL$9") USE_NL(@"SEL$D9013B37" "t5"@"SEL$9") USE_HASH(@"SEL$D9013B37" ("t8"@"SEL$9" "t40"@"SEL$9" "t36"@"SEL$9" "t3"@"SEL$9")) FULL(@"SEL$D9013B37" "t11"@"SEL$9") USE_HASH(@"SEL$D9013B37" "t36"@"SEL$9") USE_NL(@"SEL$D9013B37" ("t8"@"SEL$9" "t40"@"SEL$9")) USE_NL_MATERIALIZATION(@"SEL$D9013B37" ("t8"@"SEL$9" "t40"@"SEL$9")) INDEX(@"SEL$D9013B37" "t3"@"SEL$9" "torder_ix_area_id") USE_MERGE(@"SEL$D9013B37" "t40"@"SEL$9") FULL(@"SEL$D9013B37" "t8"@"SEL$9") FULL(@"SEL$D9013B37" "t40"@"SEL$9") FULL(@"SEL$D9013B37" "t36"@"SEL$9") FULL(@"SEL$D9013B37" "t5"@"SEL$9") USE_DAS(@"SEL$D9013B37" "t5"@"SEL$9") INDEX(@"SEL$D9013B37" "t2"@"SEL$9" "index_orderId") USE_DAS(@"SEL$D9013B37" "t2"@"SEL$9") FULL(@"SEL$D9013B37" "t17"@"SEL$9") FULL(@"SEL$D9013B37" "t16"@"SEL$9") FULL(@"SEL$D9013B37" "t4"@"SEL$9") USE_DAS(@"SEL$D9013B37" "t4"@"SEL$9") FULL(@"SEL$D9013B37" "vpcc"@"SEL$9") USE_DAS(@"SEL$D9013B37" "vpcc"@"SEL$9") INDEX(@"SEL$D9013B37" "t1"@"SEL$9" "tproductstockdetail_ix_order_detail_id") USE_DAS(@"SEL$D9013B37" "t1"@"SEL$9") USE_HASH_AGGREGATION(@"SEL$59C2EB8A") LEADING(@"SEL$59C2EB8A" (((((((((("la"@"SEL$10" ("pl"@"SEL$10" ((("t11"@"SEL$10" ("t3"@"SEL$10" ("t8"@"SEL$10" "t40"@"SEL$10"))) "t2"@"SEL$10") "t4"@"SEL$10"))) "t6"@"SEL$10") "t7"@"SEL$10") "t5"@"SEL$10") "vpcc"@"SEL$10") "t1"@"SEL$10") "t16"@"SEL$10") "t17"@"SEL$10") "sysc"@"SEL$10") "t36"@"SEL$10")) USE_NL(@"SEL$59C2EB8A" "t36"@"SEL$10") USE_NL(@"SEL$59C2EB8A" "sysc"@"SEL$10") USE_NL(@"SEL$59C2EB8A" "t17"@"SEL$10") USE_NL(@"SEL$59C2EB8A" "t16"@"SEL$10") USE_NL(@"SEL$59C2EB8A" "t1"@"SEL$10") USE_NL(@"SEL$59C2EB8A" "vpcc"@"SEL$10") USE_NL(@"SEL$59C2EB8A" "t5"@"SEL$10") USE_NL(@"SEL$59C2EB8A" "t7"@"SEL$10") USE_HASH(@"SEL$59C2EB8A" "t6"@"SEL$10") USE_HASH(@"SEL$59C2EB8A" ("t8"@"SEL$10" "t40"@"SEL$10" "t4"@"SEL$10" "t3"@"SEL$10" "t2"@"SEL$10" "t11"@"SEL$10" "pl"@"SEL$10")) FULL(@"SEL$59C2EB8A" "la"@"SEL$10") USE_HASH(@"SEL$59C2EB8A" ("t8"@"SEL$10" "t40"@"SEL$10" "t4"@"SEL$10" "t3"@"SEL$10" "t2"@"SEL$10" "t11"@"SEL$10")) FULL(@"SEL$59C2EB8A" "pl"@"SEL$10") USE_NL(@"SEL$59C2EB8A" "t4"@"SEL$10") USE_NL(@"SEL$59C2EB8A" "t2"@"SEL$10") USE_HASH(@"SEL$59C2EB8A" ("t8"@"SEL$10" "t40"@"SEL$10" "t3"@"SEL$10")) FULL(@"SEL$59C2EB8A" "t11"@"SEL$10") USE_NL(@"SEL$59C2EB8A" ("t8"@"SEL$10" "t40"@"SEL$10")) USE_NL_MATERIALIZATION(@"SEL$59C2EB8A" ("t8"@"SEL$10" "t40"@"SEL$10")) INDEX(@"SEL$59C2EB8A" "t3"@"SEL$10" "torder_ix_area_id") USE_MERGE(@"SEL$59C2EB8A" "t40"@"SEL$10") FULL(@"SEL$59C2EB8A" "t8"@"SEL$10") FULL(@"SEL$59C2EB8A" "t40"@"SEL$10") INDEX(@"SEL$59C2EB8A" "t2"@"SEL$10" "index_orderId") USE_DAS(@"SEL$59C2EB8A" "t2"@"SEL$10") FULL(@"SEL$59C2EB8A" "t4"@"SEL$10") USE_DAS(@"SEL$59C2EB8A" "t4"@"SEL$10") USE_HASH_AGGREGATION(@"SEL$DCCC18DB") FULL(@"SEL$DCCC18DB" "small_oa_169"."t_return_detail"@"SEL$11") FULL(@"SEL$59C2EB8A" "t7"@"SEL$10") USE_DAS(@"SEL$59C2EB8A" "t7"@"SEL$10") FULL(@"SEL$59C2EB8A" "t5"@"SEL$10") USE_DAS(@"SEL$59C2EB8A" "t5"@"SEL$10") FULL(@"SEL$59C2EB8A" "vpcc"@"SEL$10") USE_DAS(@"SEL$59C2EB8A" "vpcc"@"SEL$10") INDEX(@"SEL$59C2EB8A" "t1"@"SEL$10" "tproductstockdetail_ix_order_detail_id") USE_DAS(@"SEL$59C2EB8A" "t1"@"SEL$10") INDEX(@"SEL$59C2EB8A" "t16"@"SEL$10" "index_orderDetailId") USE_DAS(@"SEL$59C2EB8A" "t16"@"SEL$10") INDEX(@"SEL$59C2EB8A" "t17"@"SEL$10" "IDX_BIND_DETAIL_ID") USE_DAS(@"SEL$59C2EB8A" "t17"@"SEL$10") FULL(@"SEL$59C2EB8A" "sysc"@"SEL$10") USE_DAS(@"SEL$59C2EB8A" "sysc"@"SEL$10") INDEX(@"SEL$59C2EB8A" "t36"@"SEL$10" "idx_order_id") USE_DAS(@"SEL$59C2EB8A" "t36"@"SEL$10") LEADING(@"SEL$3FF01289" (((((((("pl"@"SEL$12" ((("b"@"SEL$12" "a"@"SEL$12") "t2"@"SEL$12") "t4"@"SEL$12")) "c"@"SEL$12") "t1"@"SEL$12") "t3"@"SEL$12") "t5"@"SEL$12") "t8"@"SEL$12") "t17"@"SEL$12") "t36"@"SEL$12")) USE_NL(@"SEL$3FF01289" "t36"@"SEL$12") USE_NL(@"SEL$3FF01289" "t17"@"SEL$12") USE_NL(@"SEL$3FF01289" "t8"@"SEL$12") USE_NL_MATERIALIZATION(@"SEL$3FF01289" "t8"@"SEL$12") USE_NL(@"SEL$3FF01289" "t5"@"SEL$12") USE_NL(@"SEL$3FF01289" "t3"@"SEL$12") USE_NL(@"SEL$3FF01289" "t1"@"SEL$12") USE_NL(@"SEL$3FF01289" "c"@"SEL$12") USE_HASH(@"SEL$3FF01289" ("t4"@"SEL$12" "t2"@"SEL$12" "b"@"SEL$12" "a"@"SEL$12")) FULL(@"SEL$3FF01289" "pl"@"SEL$12") USE_NL(@"SEL$3FF01289" "t4"@"SEL$12") USE_NL(@"SEL$3FF01289" "t2"@"SEL$12") USE_NL(@"SEL$3FF01289" "a"@"SEL$12") FULL(@"SEL$3FF01289" "b"@"SEL$12") FULL(@"SEL$3FF01289" "a"@"SEL$12") USE_DAS(@"SEL$3FF01289" "a"@"SEL$12") FULL(@"SEL$3FF01289" "t2"@"SEL$12") USE_DAS(@"SEL$3FF01289" "t2"@"SEL$12") FULL(@"SEL$3FF01289" "t4"@"SEL$12") USE_DAS(@"SEL$3FF01289" "t4"@"SEL$12") INDEX(@"SEL$3FF01289" "c"@"SEL$12" "torder_ix_order_id") USE_DAS(@"SEL$3FF01289" "c"@"SEL$12") INDEX(@"SEL$3FF01289" "t1"@"SEL$12" "tproductstockdetail_ix_order_detail_id") USE_DAS(@"SEL$3FF01289" "t1"@"SEL$12") INDEX(@"SEL$3FF01289" "t3"@"SEL$12" "torder_ix_order_id") USE_DAS(@"SEL$3FF01289" "t3"@"SEL$12") FULL(@"SEL$3FF01289" "t5"@"SEL$12") USE_DAS(@"SEL$3FF01289" "t5"@"SEL$12") FULL(@"SEL$3FF01289" "t8"@"SEL$12") INDEX(@"SEL$3FF01289" "t17"@"SEL$12" "IDX_BIND_DETAIL_ID") USE_DAS(@"SEL$3FF01289" "t17"@"SEL$12") INDEX(@"SEL$3FF01289" "t36"@"SEL$12" "idx_order_id") USE_DAS(@"SEL$3FF01289" "t36"@"SEL$12") LEADING(@"SEL$14A7C2E5" (((((((((("t7"@"SEL$13" "t6"@"SEL$13") "t2"@"SEL$13") "t3"@"SEL$13") "t4"@"SEL$13") "pl"@"SEL$13") "t5"@"SEL$13") "t1"@"SEL$13") "t8"@"SEL$13") "t17"@"SEL$13") "t36"@"SEL$13")) USE_NL(@"SEL$14A7C2E5" "t36"@"SEL$13") USE_NL(@"SEL$14A7C2E5" "t17"@"SEL$13") USE_NL(@"SEL$14A7C2E5" "t8"@"SEL$13") USE_NL_MATERIALIZATION(@"SEL$14A7C2E5" "t8"@"SEL$13") USE_NL(@"SEL$14A7C2E5" "t1"@"SEL$13") USE_NL(@"SEL$14A7C2E5" "t5"@"SEL$13") USE_HASH(@"SEL$14A7C2E5" "pl"@"SEL$13") USE_NL(@"SEL$14A7C2E5" "t4"@"SEL$13") USE_NL(@"SEL$14A7C2E5" "t3"@"SEL$13") USE_NL(@"SEL$14A7C2E5" "t2"@"SEL$13") USE_NL(@"SEL$14A7C2E5" "t6"@"SEL$13") INDEX(@"SEL$14A7C2E5" "t7"@"SEL$13" "treturn_ix_return_type") INDEX(@"SEL$14A7C2E5" "t6"@"SEL$13" "idx_return_detail_return_id") USE_DAS(@"SEL$14A7C2E5" "t6"@"SEL$13") FULL(@"SEL$14A7C2E5" "t2"@"SEL$13") USE_DAS(@"SEL$14A7C2E5" "t2"@"SEL$13") INDEX(@"SEL$14A7C2E5" "t3"@"SEL$13" "torder_ix_order_id") USE_DAS(@"SEL$14A7C2E5" "t3"@"SEL$13") FULL(@"SEL$14A7C2E5" "t4"@"SEL$13") USE_DAS(@"SEL$14A7C2E5" "t4"@"SEL$13") FULL(@"SEL$14A7C2E5" "pl"@"SEL$13") FULL(@"SEL$14A7C2E5" "t5"@"SEL$13") USE_DAS(@"SEL$14A7C2E5" "t5"@"SEL$13") INDEX(@"SEL$14A7C2E5" "t1"@"SEL$13" "tproductstockdetail_ix_order_detail_id") USE_DAS(@"SEL$14A7C2E5" "t1"@"SEL$13") FULL(@"SEL$14A7C2E5" "t8"@"SEL$13") INDEX(@"SEL$14A7C2E5" "t17"@"SEL$13" "IDX_BIND_DETAIL_ID") USE_DAS(@"SEL$14A7C2E5" "t17"@"SEL$13") INDEX(@"SEL$14A7C2E5" "t36"@"SEL$13" "idx_order_id") USE_DAS(@"SEL$14A7C2E5" "t36"@"SEL$13") LEADING(@"SEL$2DAB2C8D" (((((((((("t7"@"SEL$14" "t6"@"SEL$14") "t1"@"SEL$14") "t2"@"SEL$14") "t4"@"SEL$14") "t3"@"SEL$14") "t5"@"SEL$14") "t8"@"SEL$14") "t17"@"SEL$14") "t36"@"SEL$14") "pl"@"SEL$14")) USE_HASH(@"SEL$2DAB2C8D" "pl"@"SEL$14") USE_NL(@"SEL$2DAB2C8D" "t36"@"SEL$14") USE_NL(@"SEL$2DAB2C8D" "t17"@"SEL$14") USE_NL(@"SEL$2DAB2C8D" "t8"@"SEL$14") USE_NL_MATERIALIZATION(@"SEL$2DAB2C8D" "t8"@"SEL$14") USE_NL(@"SEL$2DAB2C8D" "t5"@"SEL$14") USE_NL(@"SEL$2DAB2C8D" "t3"@"SEL$14") USE_NL(@"SEL$2DAB2C8D" "t4"@"SEL$14") USE_NL(@"SEL$2DAB2C8D" "t2"@"SEL$14") USE_NL(@"SEL$2DAB2C8D" "t1"@"SEL$14") USE_NL(@"SEL$2DAB2C8D" "t6"@"SEL$14") INDEX(@"SEL$2DAB2C8D" "t7"@"SEL$14" "treturn_ix_return_type") INDEX(@"SEL$2DAB2C8D" "t6"@"SEL$14" "idx_return_detail_return_id") USE_DAS(@"SEL$2DAB2C8D" "t6"@"SEL$14") INDEX(@"SEL$2DAB2C8D" "t1"@"SEL$14" "index_mck_id") USE_DAS(@"SEL$2DAB2C8D" "t1"@"SEL$14") FULL(@"SEL$2DAB2C8D" "t2"@"SEL$14") USE_DAS(@"SEL$2DAB2C8D" "t2"@"SEL$14") FULL(@"SEL$2DAB2C8D" "t4"@"SEL$14") USE_DAS(@"SEL$2DAB2C8D" "t4"@"SEL$14") INDEX(@"SEL$2DAB2C8D" "t3"@"SEL$14" "torder_ix_order_id") USE_DAS(@"SEL$2DAB2C8D" "t3"@"SEL$14") FULL(@"SEL$2DAB2C8D" "t5"@"SEL$14") USE_DAS(@"SEL$2DAB2C8D" "t5"@"SEL$14") FULL(@"SEL$2DAB2C8D" "t8"@"SEL$14") INDEX(@"SEL$2DAB2C8D" "t17"@"SEL$14" "IDX_BIND_DETAIL_ID") USE_DAS(@"SEL$2DAB2C8D" "t17"@"SEL$14") INDEX(@"SEL$2DAB2C8D" "t36"@"SEL$14" "idx_order_id") USE_DAS(@"SEL$2DAB2C8D" "t36"@"SEL$14") FULL(@"SEL$2DAB2C8D" "pl"@"SEL$14") USE_HASH_AGGREGATION(@"SEL$042E8615") LEADING(@"SEL$71062874" (((((("t6"@"SEL$18" ("t7"@"SEL$18" ((("t3"@"SEL$18" "t8"@"SEL$18") "t5"@"SEL$18") "t36"@"SEL$18"))) "t1"@"SEL$18") "t2"@"SEL$18") "t4"@"SEL$18") "pl"@"SEL$18") "t16"@"SEL$18")) USE_NL(@"SEL$71062874" "t16"@"SEL$18") USE_HASH(@"SEL$71062874" "pl"@"SEL$18") USE_NL(@"SEL$71062874" "t4"@"SEL$18") USE_HASH(@"SEL$71062874" "t2"@"SEL$18") USE_HASH(@"SEL$71062874" "t1"@"SEL$18") PQ_DISTRIBUTE(@"SEL$71062874" "t1"@"SEL$18" LOCAL LOCAL) USE_HASH(@"SEL$71062874" ("t8"@"SEL$18" "t7"@"SEL$18" "t5"@"SEL$18" "t36"@"SEL$18" "t3"@"SEL$18")) FULL(@"SEL$71062874" "t6"@"SEL$18") USE_NL(@"SEL$71062874" ("t8"@"SEL$18" "t5"@"SEL$18" "t36"@"SEL$18" "t3"@"SEL$18")) USE_NL_MATERIALIZATION(@"SEL$71062874" ("t8"@"SEL$18" "t5"@"SEL$18" "t36"@"SEL$18" "t3"@"SEL$18")) INDEX(@"SEL$71062874" "t7"@"SEL$18" "treturn_ix_check2_time") USE_MERGE(@"SEL$71062874" "t36"@"SEL$18") USE_NL(@"SEL$71062874" "t5"@"SEL$18") USE_NL(@"SEL$71062874" "t8"@"SEL$18") USE_NL_MATERIALIZATION(@"SEL$71062874" "t8"@"SEL$18") INDEX(@"SEL$71062874" "t3"@"SEL$18" "torder_ix_area_id") FULL(@"SEL$71062874" "t8"@"SEL$18") FULL(@"SEL$71062874" "t5"@"SEL$18") USE_DAS(@"SEL$71062874" "t5"@"SEL$18") INDEX(@"SEL$71062874" "t36"@"SEL$18" "idx_order_id") FULL(@"SEL$71062874" "t1"@"SEL$18") USE_COLUMN_TABLE(@"SEL$71062874" "t1"@"SEL$18") FULL(@"SEL$71062874" "t2"@"SEL$18") USE_COLUMN_TABLE(@"SEL$71062874" "t2"@"SEL$18") FULL(@"SEL$71062874" "t4"@"SEL$18") USE_DAS(@"SEL$71062874" "t4"@"SEL$18") FULL(@"SEL$71062874" "pl"@"SEL$18") LEADING(@"SEL$DB91801A" (((((((((("t1"@"SEL$17" "t2"@"SEL$17") "t3"@"SEL$17") "t4"@"SEL$17") "pl"@"SEL$17") "t5"@"SEL$17") "t6"@"SEL$17") "t7"@"SEL$17") "t36"@"SEL$17") "t16"@"SEL$17") "t17"@"SEL$17")) USE_NL(@"SEL$DB91801A" "t17"@"SEL$17") USE_NL(@"SEL$DB91801A" "t16"@"SEL$17") USE_NL(@"SEL$DB91801A" "t36"@"SEL$17") USE_NL(@"SEL$DB91801A" "t7"@"SEL$17") USE_NL(@"SEL$DB91801A" "t6"@"SEL$17") USE_NL(@"SEL$DB91801A" "t5"@"SEL$17") USE_HASH(@"SEL$DB91801A" "pl"@"SEL$17") USE_NL(@"SEL$DB91801A" "t4"@"SEL$17") USE_NL(@"SEL$DB91801A" "t3"@"SEL$17") USE_NL(@"SEL$DB91801A" "t2"@"SEL$17") INDEX(@"SEL$DB91801A" "t1"@"SEL$17" "index_mck_id") USE_DAS(@"SEL$DB91801A" "t1"@"SEL$17") FULL(@"SEL$DB91801A" "t2"@"SEL$17") USE_DAS(@"SEL$DB91801A" "t2"@"SEL$17") INDEX(@"SEL$DB91801A" "t3"@"SEL$17" "torder_ix_order_id") USE_DAS(@"SEL$DB91801A" "t3"@"SEL$17") FULL(@"SEL$DB91801A" "t4"@"SEL$17") USE_DAS(@"SEL$DB91801A" "t4"@"SEL$17") FULL(@"SEL$DB91801A" "pl"@"SEL$17") FULL(@"SEL$DB91801A" "t5"@"SEL$17") USE_DAS(@"SEL$DB91801A" "t5"@"SEL$17") INDEX(@"SEL$DB91801A" "t6"@"SEL$17" "idx_mkc_id") USE_DAS(@"SEL$DB91801A" "t6"@"SEL$17") FULL(@"SEL$DB91801A" "t7"@"SEL$17") USE_DAS(@"SEL$DB91801A" "t7"@"SEL$17") INDEX(@"SEL$DB91801A" "t36"@"SEL$17" "idx_order_id") USE_DAS(@"SEL$DB91801A" "t36"@"SEL$17") INDEX(@"SEL$DB91801A" "t16"@"SEL$17" "trebate_detail_mkc_id") USE_DAS(@"SEL$DB91801A" "t16"@"SEL$17") FULL(@"SEL$DB91801A" "t17"@"SEL$17") USE_DAS(@"SEL$DB91801A" "t17"@"SEL$17") LEADING(@"SEL$C3998036" ("t36"@"SEL$19" ("pl"@"SEL$19" ((((("t3"@"SEL$19" "t8"@"SEL$19") "t5"@"SEL$19") "t2"@"SEL$19") "t1"@"SEL$19") "t4"@"SEL$19")))) USE_HASH(@"SEL$C3998036" ("t8"@"SEL$19" "t5"@"SEL$19" "t4"@"SEL$19" "t3"@"SEL$19" "t2"@"SEL$19" "t1"@"SEL$19" "pl"@"SEL$19")) INDEX(@"SEL$C3998036" "t36"@"SEL$19" "idx_order_id") USE_HASH(@"SEL$C3998036" ("t8"@"SEL$19" "t5"@"SEL$19" "t4"@"SEL$19" "t3"@"SEL$19" "t2"@"SEL$19" "t1"@"SEL$19")) FULL(@"SEL$C3998036" "pl"@"SEL$19") USE_NL(@"SEL$C3998036" "t4"@"SEL$19") USE_NL(@"SEL$C3998036" "t1"@"SEL$19") USE_NL(@"SEL$C3998036" "t2"@"SEL$19") USE_NL(@"SEL$C3998036" "t5"@"SEL$19") USE_NL(@"SEL$C3998036" "t8"@"SEL$19") USE_NL_MATERIALIZATION(@"SEL$C3998036" "t8"@"SEL$19") INDEX(@"SEL$C3998036" "t3"@"SEL$19" "torder_ix_area_id") FULL(@"SEL$C3998036" "t8"@"SEL$19") FULL(@"SEL$C3998036" "t5"@"SEL$19") USE_DAS(@"SEL$C3998036" "t5"@"SEL$19") INDEX(@"SEL$C3998036" "t2"@"SEL$19" "index_orderId") USE_DAS(@"SEL$C3998036" "t2"@"SEL$19") INDEX(@"SEL$C3998036" "t1"@"SEL$19" "tproductstockdetail_ix_order_detail_id") USE_DAS(@"SEL$C3998036" "t1"@"SEL$19") FULL(@"SEL$C3998036" "t4"@"SEL$19") USE_DAS(@"SEL$C3998036" "t4"@"SEL$19") LEADING(@"SEL$F629010C" ((("pl"@"SEL$20" (((((("t17"@"SEL$20" "t16"@"SEL$20") "t1"@"SEL$20") "t2"@"SEL$20") "t3"@"SEL$20") "t4"@"SEL$20") "t8"@"SEL$20")) "t36"@"SEL$20") "t5"@"SEL$20")) USE_NL(@"SEL$F629010C" "t5"@"SEL$20") USE_NL(@"SEL$F629010C" "t36"@"SEL$20") USE_HASH(@"SEL$F629010C" ("t8"@"SEL$20" "t4"@"SEL$20" "t3"@"SEL$20" "t2"@"SEL$20" "t17"@"SEL$20" "t16"@"SEL$20" "t1"@"SEL$20")) FULL(@"SEL$F629010C" "pl"@"SEL$20") USE_NL(@"SEL$F629010C" "t8"@"SEL$20") USE_NL_MATERIALIZATION(@"SEL$F629010C" "t8"@"SEL$20") USE_NL(@"SEL$F629010C" "t4"@"SEL$20") USE_HASH(@"SEL$F629010C" "t3"@"SEL$20") USE_NL(@"SEL$F629010C" "t2"@"SEL$20") USE_NL(@"SEL$F629010C" "t1"@"SEL$20") USE_NL(@"SEL$F629010C" "t16"@"SEL$20") INDEX(@"SEL$F629010C" "t17"@"SEL$20" "table_index") INDEX(@"SEL$F629010C" "t16"@"SEL$20" "idx_adjust_price_id") USE_DAS(@"SEL$F629010C" "t16"@"SEL$20") INDEX(@"SEL$F629010C" "t1"@"SEL$20" "index_mck_id") USE_DAS(@"SEL$F629010C" "t1"@"SEL$20") FULL(@"SEL$F629010C" "t2"@"SEL$20") USE_DAS(@"SEL$F629010C" "t2"@"SEL$20") INDEX(@"SEL$F629010C" "t3"@"SEL$20" "torder_ix_area_id") FULL(@"SEL$F629010C" "t4"@"SEL$20") USE_DAS(@"SEL$F629010C" "t4"@"SEL$20") FULL(@"SEL$F629010C" "t8"@"SEL$20") INDEX(@"SEL$F629010C" "t36"@"SEL$20" "idx_order_id") USE_DAS(@"SEL$F629010C" "t36"@"SEL$20") FULL(@"SEL$F629010C" "t5"@"SEL$20") USE_DAS(@"SEL$F629010C" "t5"@"SEL$20") USE_HASH_AGGREGATION(@"SEL$1DCBCB95") USE_HASH_AGGREGATION(@"SEL$322BDBB0") LEADING(@"SEL$322BDBB0" ("sysc"@"SEL$22" ((("la"@"SEL$22" ("pl"@"SEL$22" (((((("t11"@"SEL$22" (("t3"@"SEL$22" ("t8"@"SEL$22" "t40"@"SEL$22")) "t36"@"SEL$22")) "t5"@"SEL$22") "t2"@"SEL$22") "t17"@"SEL$22") "t16"@"SEL$22") "t4"@"SEL$22"))) "vpcc"@"SEL$22") "t1"@"SEL$22"))) USE_HASH(@"SEL$322BDBB0" ("vpcc"@"SEL$22" "t8"@"SEL$22" "t5"@"SEL$22" "t40"@"SEL$22" "t4"@"SEL$22" "t36"@"SEL$22" "t3"@"SEL$22" "t2"@"SEL$22" "t17"@"SEL$22" "t16"@"SEL$22" "t11"@"SEL$22" "t1"@"SEL$22" "pl"@"SEL$22" "la"@"SEL$22")) FULL(@"SEL$322BDBB0" "sysc"@"SEL$22") USE_NL(@"SEL$322BDBB0" "t1"@"SEL$22") USE_NL(@"SEL$322BDBB0" "vpcc"@"SEL$22") USE_HASH(@"SEL$322BDBB0" ("t8"@"SEL$22" "t5"@"SEL$22" "t40"@"SEL$22" "t4"@"SEL$22" "t36"@"SEL$22" "t3"@"SEL$22" "t2"@"SEL$22" "t17"@"SEL$22" "t16"@"SEL$22" "t11"@"SEL$22" "pl"@"SEL$22")) FULL(@"SEL$322BDBB0" "la"@"SEL$22") USE_HASH(@"SEL$322BDBB0" ("t8"@"SEL$22" "t5"@"SEL$22" "t40"@"SEL$22" "t4"@"SEL$22" "t36"@"SEL$22" "t3"@"SEL$22" "t2"@"SEL$22" "t17"@"SEL$22" "t16"@"SEL$22" "t11"@"SEL$22")) FULL(@"SEL$322BDBB0" "pl"@"SEL$22") USE_NL(@"SEL$322BDBB0" "t4"@"SEL$22") USE_HASH(@"SEL$322BDBB0" "t16"@"SEL$22") USE_HASH(@"SEL$322BDBB0" "t17"@"SEL$22") USE_NL(@"SEL$322BDBB0" "t2"@"SEL$22") USE_NL(@"SEL$322BDBB0" "t5"@"SEL$22") USE_HASH(@"SEL$322BDBB0" ("t8"@"SEL$22" "t40"@"SEL$22" "t36"@"SEL$22" "t3"@"SEL$22")) FULL(@"SEL$322BDBB0" "t11"@"SEL$22") USE_HASH(@"SEL$322BDBB0" "t36"@"SEL$22") USE_NL(@"SEL$322BDBB0" ("t8"@"SEL$22" "t40"@"SEL$22")) USE_NL_MATERIALIZATION(@"SEL$322BDBB0" ("t8"@"SEL$22" "t40"@"SEL$22")) INDEX(@"SEL$322BDBB0" "t3"@"SEL$22" "torder_ix_area_id") USE_MERGE(@"SEL$322BDBB0" "t40"@"SEL$22") FULL(@"SEL$322BDBB0" "t8"@"SEL$22") FULL(@"SEL$322BDBB0" "t40"@"SEL$22") FULL(@"SEL$322BDBB0" "t36"@"SEL$22") FULL(@"SEL$322BDBB0" "t5"@"SEL$22") USE_DAS(@"SEL$322BDBB0" "t5"@"SEL$22") INDEX(@"SEL$322BDBB0" "t2"@"SEL$22" "index_orderId") USE_DAS(@"SEL$322BDBB0" "t2"@"SEL$22") FULL(@"SEL$322BDBB0" "t17"@"SEL$22") FULL(@"SEL$322BDBB0" "t16"@"SEL$22") FULL(@"SEL$322BDBB0" "t4"@"SEL$22") USE_DAS(@"SEL$322BDBB0" "t4"@"SEL$22") FULL(@"SEL$322BDBB0" "vpcc"@"SEL$22") USE_DAS(@"SEL$322BDBB0" "vpcc"@"SEL$22") INDEX(@"SEL$322BDBB0" "t1"@"SEL$22" "tproductstockdetail_ix_order_detail_id") USE_DAS(@"SEL$322BDBB0" "t1"@"SEL$22") USE_HASH_AGGREGATION(@"SEL$8EEBF155") LEADING(@"SEL$8EEBF155" (((((((((("la"@"SEL$23" ("pl"@"SEL$23" ((("t11"@"SEL$23" ("t3"@"SEL$23" ("t8"@"SEL$23" "t40"@"SEL$23"))) "t2"@"SEL$23") "t4"@"SEL$23"))) "t6"@"SEL$23") "t7"@"SEL$23") "t5"@"SEL$23") "vpcc"@"SEL$23") "t1"@"SEL$23") "t16"@"SEL$23") "t17"@"SEL$23") "sysc"@"SEL$23") "t36"@"SEL$23")) USE_NL(@"SEL$8EEBF155" "t36"@"SEL$23") USE_NL(@"SEL$8EEBF155" "sysc"@"SEL$23") USE_NL(@"SEL$8EEBF155" "t17"@"SEL$23") USE_NL(@"SEL$8EEBF155" "t16"@"SEL$23") USE_NL(@"SEL$8EEBF155" "t1"@"SEL$23") USE_NL(@"SEL$8EEBF155" "vpcc"@"SEL$23") USE_NL(@"SEL$8EEBF155" "t5"@"SEL$23") USE_NL(@"SEL$8EEBF155" "t7"@"SEL$23") USE_HASH(@"SEL$8EEBF155" "t6"@"SEL$23") USE_HASH(@"SEL$8EEBF155" ("t8"@"SEL$23" "t40"@"SEL$23" "t4"@"SEL$23" "t3"@"SEL$23" "t2"@"SEL$23" "t11"@"SEL$23" "pl"@"SEL$23")) FULL(@"SEL$8EEBF155" "la"@"SEL$23") USE_HASH(@"SEL$8EEBF155" ("t8"@"SEL$23" "t40"@"SEL$23" "t4"@"SEL$23" "t3"@"SEL$23" "t2"@"SEL$23" "t11"@"SEL$23")) FULL(@"SEL$8EEBF155" "pl"@"SEL$23") USE_NL(@"SEL$8EEBF155" "t4"@"SEL$23") USE_NL(@"SEL$8EEBF155" "t2"@"SEL$23") USE_HASH(@"SEL$8EEBF155" ("t8"@"SEL$23" "t40"@"SEL$23" "t3"@"SEL$23")) FULL(@"SEL$8EEBF155" "t11"@"SEL$23") USE_NL(@"SEL$8EEBF155" ("t8"@"SEL$23" "t40"@"SEL$23")) USE_NL_MATERIALIZATION(@"SEL$8EEBF155" ("t8"@"SEL$23" "t40"@"SEL$23")) INDEX(@"SEL$8EEBF155" "t3"@"SEL$23" "torder_ix_area_id") USE_MERGE(@"SEL$8EEBF155" "t40"@"SEL$23") FULL(@"SEL$8EEBF155" "t8"@"SEL$23") FULL(@"SEL$8EEBF155" "t40"@"SEL$23") INDEX(@"SEL$8EEBF155" "t2"@"SEL$23" "index_orderId") USE_DAS(@"SEL$8EEBF155" "t2"@"SEL$23") FULL(@"SEL$8EEBF155" "t4"@"SEL$23") USE_DAS(@"SEL$8EEBF155" "t4"@"SEL$23") USE_HASH_AGGREGATION(@"SEL$39F03FB4") FULL(@"SEL$39F03FB4" "small_oa_169"."t_return_detail"@"SEL$24") FULL(@"SEL$8EEBF155" "t7"@"SEL$23") USE_DAS(@"SEL$8EEBF155" "t7"@"SEL$23") FULL(@"SEL$8EEBF155" "t5"@"SEL$23") USE_DAS(@"SEL$8EEBF155" "t5"@"SEL$23") FULL(@"SEL$8EEBF155" "vpcc"@"SEL$23") USE_DAS(@"SEL$8EEBF155" "vpcc"@"SEL$23") INDEX(@"SEL$8EEBF155" "t1"@"SEL$23" "tproductstockdetail_ix_order_detail_id") USE_DAS(@"SEL$8EEBF155" "t1"@"SEL$23") INDEX(@"SEL$8EEBF155" "t16"@"SEL$23" "index_orderDetailId") USE_DAS(@"SEL$8EEBF155" "t16"@"SEL$23") INDEX(@"SEL$8EEBF155" "t17"@"SEL$23" "IDX_BIND_DETAIL_ID") USE_DAS(@"SEL$8EEBF155" "t17"@"SEL$23") FULL(@"SEL$8EEBF155" "sysc"@"SEL$23") USE_DAS(@"SEL$8EEBF155" "sysc"@"SEL$23") INDEX(@"SEL$8EEBF155" "t36"@"SEL$23" "idx_order_id") USE_DAS(@"SEL$8EEBF155" "t36"@"SEL$23") LEADING(@"SEL$0073597A" (((((((("pl"@"SEL$25" ((("b"@"SEL$25" "a"@"SEL$25") "t2"@"SEL$25") "t4"@"SEL$25")) "c"@"SEL$25") "t1"@"SEL$25") "t3"@"SEL$25") "t5"@"SEL$25") "t8"@"SEL$25") "t17"@"SEL$25") "t36"@"SEL$25")) USE_NL(@"SEL$0073597A" "t36"@"SEL$25") USE_NL(@"SEL$0073597A" "t17"@"SEL$25") USE_NL(@"SEL$0073597A" "t8"@"SEL$25") USE_NL_MATERIALIZATION(@"SEL$0073597A" "t8"@"SEL$25") USE_NL(@"SEL$0073597A" "t5"@"SEL$25") USE_NL(@"SEL$0073597A" "t3"@"SEL$25") USE_NL(@"SEL$0073597A" "t1"@"SEL$25") USE_NL(@"SEL$0073597A" "c"@"SEL$25") USE_HASH(@"SEL$0073597A" ("t4"@"SEL$25" "t2"@"SEL$25" "b"@"SEL$25" "a"@"SEL$25")) FULL(@"SEL$0073597A" "pl"@"SEL$25") USE_NL(@"SEL$0073597A" "t4"@"SEL$25") USE_NL(@"SEL$0073597A" "t2"@"SEL$25") USE_NL(@"SEL$0073597A" "a"@"SEL$25") FULL(@"SEL$0073597A" "b"@"SEL$25") FULL(@"SEL$0073597A" "a"@"SEL$25") USE_DAS(@"SEL$0073597A" "a"@"SEL$25") FULL(@"SEL$0073597A" "t2"@"SEL$25") USE_DAS(@"SEL$0073597A" "t2"@"SEL$25") FULL(@"SEL$0073597A" "t4"@"SEL$25") USE_DAS(@"SEL$0073597A" "t4"@"SEL$25") INDEX(@"SEL$0073597A" "c"@"SEL$25" "torder_ix_order_id") USE_DAS(@"SEL$0073597A" "c"@"SEL$25") INDEX(@"SEL$0073597A" "t1"@"SEL$25" "tproductstockdetail_ix_order_detail_id") USE_DAS(@"SEL$0073597A" "t1"@"SEL$25") INDEX(@"SEL$0073597A" "t3"@"SEL$25" "torder_ix_order_id") USE_DAS(@"SEL$0073597A" "t3"@"SEL$25") FULL(@"SEL$0073597A" "t5"@"SEL$25") USE_DAS(@"SEL$0073597A" "t5"@"SEL$25") FULL(@"SEL$0073597A" "t8"@"SEL$25") INDEX(@"SEL$0073597A" "t17"@"SEL$25" "IDX_BIND_DETAIL_ID") USE_DAS(@"SEL$0073597A" "t17"@"SEL$25") INDEX(@"SEL$0073597A" "t36"@"SEL$25" "idx_order_id") USE_DAS(@"SEL$0073597A" "t36"@"SEL$25") LEADING(@"SEL$C07C80F8" (((((((((("t7"@"SEL$26" "t6"@"SEL$26") "t2"@"SEL$26") "t3"@"SEL$26") "t4"@"SEL$26") "pl"@"SEL$26") "t5"@"SEL$26") "t17"@"SEL$26") "t1"@"SEL$26") "t8"@"SEL$26") "t36"@"SEL$26")) USE_NL(@"SEL$C07C80F8" "t36"@"SEL$26") USE_NL(@"SEL$C07C80F8" "t8"@"SEL$26") USE_NL_MATERIALIZATION(@"SEL$C07C80F8" "t8"@"SEL$26") USE_NL(@"SEL$C07C80F8" "t1"@"SEL$26") USE_NL(@"SEL$C07C80F8" "t17"@"SEL$26") USE_NL(@"SEL$C07C80F8" "t5"@"SEL$26") USE_HASH(@"SEL$C07C80F8" "pl"@"SEL$26") USE_NL(@"SEL$C07C80F8" "t4"@"SEL$26") USE_NL(@"SEL$C07C80F8" "t3"@"SEL$26") USE_NL(@"SEL$C07C80F8" "t2"@"SEL$26") USE_NL(@"SEL$C07C80F8" "t6"@"SEL$26") INDEX(@"SEL$C07C80F8" "t7"@"SEL$26" "treturn_ix_return_type") INDEX(@"SEL$C07C80F8" "t6"@"SEL$26" "idx_return_detail_return_id") USE_DAS(@"SEL$C07C80F8" "t6"@"SEL$26") FULL(@"SEL$C07C80F8" "t2"@"SEL$26") USE_DAS(@"SEL$C07C80F8" "t2"@"SEL$26") INDEX(@"SEL$C07C80F8" "t3"@"SEL$26" "torder_ix_order_id") USE_DAS(@"SEL$C07C80F8" "t3"@"SEL$26") FULL(@"SEL$C07C80F8" "t4"@"SEL$26") USE_DAS(@"SEL$C07C80F8" "t4"@"SEL$26") FULL(@"SEL$C07C80F8" "pl"@"SEL$26") FULL(@"SEL$C07C80F8" "t5"@"SEL$26") USE_DAS(@"SEL$C07C80F8" "t5"@"SEL$26") INDEX(@"SEL$C07C80F8" "t17"@"SEL$26" "IDX_BIND_DETAIL_ID") USE_DAS(@"SEL$C07C80F8" "t17"@"SEL$26") INDEX(@"SEL$C07C80F8" "t1"@"SEL$26" "tproductstockdetail_ix_order_detail_id") USE_DAS(@"SEL$C07C80F8" "t1"@"SEL$26") FULL(@"SEL$C07C80F8" "t8"@"SEL$26") INDEX(@"SEL$C07C80F8" "t36"@"SEL$26" "idx_order_id") USE_DAS(@"SEL$C07C80F8" "t36"@"SEL$26") LEADING(@"SEL$0E6161A9" (((((((((("t7"@"SEL$27" "t6"@"SEL$27") "t1"@"SEL$27") "t2"@"SEL$27") "t4"@"SEL$27") "t3"@"SEL$27") "t5"@"SEL$27") "t8"@"SEL$27") "t17"@"SEL$27") "t36"@"SEL$27") "pl"@"SEL$27")) USE_HASH(@"SEL$0E6161A9" "pl"@"SEL$27") USE_NL(@"SEL$0E6161A9" "t36"@"SEL$27") USE_NL(@"SEL$0E6161A9" "t17"@"SEL$27") USE_NL(@"SEL$0E6161A9" "t8"@"SEL$27") USE_NL_MATERIALIZATION(@"SEL$0E6161A9" "t8"@"SEL$27") USE_NL(@"SEL$0E6161A9" "t5"@"SEL$27") USE_NL(@"SEL$0E6161A9" "t3"@"SEL$27") USE_NL(@"SEL$0E6161A9" "t4"@"SEL$27") USE_NL(@"SEL$0E6161A9" "t2"@"SEL$27") USE_NL(@"SEL$0E6161A9" "t1"@"SEL$27") USE_NL(@"SEL$0E6161A9" "t6"@"SEL$27") INDEX(@"SEL$0E6161A9" "t7"@"SEL$27" "treturn_ix_return_type") INDEX(@"SEL$0E6161A9" "t6"@"SEL$27" "idx_return_detail_return_id") USE_DAS(@"SEL$0E6161A9" "t6"@"SEL$27") INDEX(@"SEL$0E6161A9" "t1"@"SEL$27" "index_mck_id") USE_DAS(@"SEL$0E6161A9" "t1"@"SEL$27") FULL(@"SEL$0E6161A9" "t2"@"SEL$27") USE_DAS(@"SEL$0E6161A9" "t2"@"SEL$27") FULL(@"SEL$0E6161A9" "t4"@"SEL$27") USE_DAS(@"SEL$0E6161A9" "t4"@"SEL$27") INDEX(@"SEL$0E6161A9" "t3"@"SEL$27" "torder_ix_order_id") USE_DAS(@"SEL$0E6161A9" "t3"@"SEL$27") FULL(@"SEL$0E6161A9" "t5"@"SEL$27") USE_DAS(@"SEL$0E6161A9" "t5"@"SEL$27") FULL(@"SEL$0E6161A9" "t8"@"SEL$27") INDEX(@"SEL$0E6161A9" "t17"@"SEL$27" "IDX_BIND_DETAIL_ID") USE_DAS(@"SEL$0E6161A9" "t17"@"SEL$27") INDEX(@"SEL$0E6161A9" "t36"@"SEL$27" "idx_order_id") USE_DAS(@"SEL$0E6161A9" "t36"@"SEL$27") FULL(@"SEL$0E6161A9" "pl"@"SEL$27") SIMPLIFY_EXPR(@"SEL$4") SIMPLIFY_EXPR(@"SEL$17") SIMPLIFY_EXPR(@"SEL$5") SIMPLIFY_EXPR(@"SEL$6") SIMPLIFY_EXPR(@"SEL$7") SIMPLIFY_EXPR(@"SEL$9") SIMPLIFY_EXPR(@"SEL$10") SIMPLIFY_EXPR(@"SEL$8") SIMPLIFY_EXPR(@"SEL$12") SIMPLIFY_EXPR(@"SEL$13") SIMPLIFY_EXPR(@"SEL$14") SIMPLIFY_EXPR(@"SEL$18") SIMPLIFY_EXPR(@"SEL$19") SIMPLIFY_EXPR(@"SEL$20") SIMPLIFY_EXPR(@"SEL$22") SIMPLIFY_EXPR(@"SEL$23") SIMPLIFY_EXPR(@"SEL$21") SIMPLIFY_EXPR(@"SEL$25") SIMPLIFY_EXPR(@"SEL$26") SIMPLIFY_EXPR(@"SEL$27") SIMPLIFY_ORDER_BY(@"SEL$3") SIMPLIFY_ORDER_BY(@"SEL$16") PROJECT_PRUNE(@"SEL$862290CF") PROJECT_PRUNE(@"SEL$FB8528D7") INLINE(@"SEL$C76E4651") INLINE(@"SEL$94987E40") PROJECT_PRUNE(@"SET$2") PROJECT_PRUNE(@"SEL$8A8B749C") PROJECT_PRUNE(@"SET$3") PROJECT_PRUNE(@"SET$4") PROJECT_PRUNE(@"SEL$9FD47EB6") PROJECT_PRUNE(@"SET$5") REPLACE_CONST(@"SEL$13B9B645") REPLACE_CONST(@"SEL$8BE873B1") MERGE(@"SEL$B79ED4F0" < "SEL$2") MERGE(@"SEL$66463637" < "SEL$15") OUTER_TO_INNER(@"SEL$C06ACC3F") OUTER_TO_INNER(@"SEL$F24DB159") OUTER_TO_INNER(@"SEL$B9E273FB") OUTER_TO_INNER(@"SEL$CE775F8B") OUTER_TO_INNER(@"SEL$73FAD0A0") OUTER_TO_INNER(@"SEL$AF708CD9") OUTER_TO_INNER(@"SEL$FA6B9F5B") OUTER_TO_INNER(@"SEL$B221DBE9") OUTER_TO_INNER(@"SEL$A25B6356") OUTER_TO_INNER(@"SEL$A002AFBF") OUTER_TO_INNER(@"SEL$4E0AE1CC") OUTER_TO_INNER(@"SEL$246369DB") OUTER_TO_INNER(@"SEL$19C25DAA") OUTER_TO_INNER(@"SEL$EDD46CB0") OUTER_TO_INNER(@"SEL$649BD5DB") OUTER_TO_INNER(@"SEL$B42BAF61") OUTER_TO_INNER(@"SEL$737A3E40") OUTER_TO_INNER(@"SEL$1318DBE3") ELIMINATE_JOIN(@"SEL$FCD86959" "t8"@"SEL$4" "t11"@"SEL$4" "la"@"SEL$4") ELIMINATE_JOIN(@"SEL$5EA95256" "t11"@"SEL$5" "la"@"SEL$5" "sysc"@"SEL$5" "t40"@"SEL$5") ELIMINATE_JOIN(@"SEL$93E64733" "t11"@"SEL$6" "la"@"SEL$6" "sysc"@"SEL$6" "t40"@"SEL$6") ELIMINATE_JOIN(@"SEL$50D9F667" "t11"@"SEL$7" "la"@"SEL$7" "sysc"@"SEL$7" "t40"@"SEL$7") ELIMINATE_JOIN(@"SEL$B8156664" "t16"@"SEL$12" "t11"@"SEL$12" "la"@"SEL$12" "sysc"@"SEL$12" "t40"@"SEL$12") ELIMINATE_JOIN(@"SEL$13CE72C8" "t16"@"SEL$13" "t11"@"SEL$13" "la"@"SEL$13" "sysc"@"SEL$13" "vpcc"@"SEL$13" "t40"@"SEL$13") ELIMINATE_JOIN(@"SEL$5FB4010A" "t16"@"SEL$14" "t11"@"SEL$14" "la"@"SEL$14" "sysc"@"SEL$14" "vpcc"@"SEL$14" "t40"@"SEL$14") ELIMINATE_JOIN(@"SEL$E2DEB254" "category"@"SEL$3" "t8"@"SEL$3") ELIMINATE_JOIN(@"SEL$367430D6" "t8"@"SEL$17" "t11"@"SEL$17" "la"@"SEL$17") ELIMINATE_JOIN(@"SEL$A650D3B1" "t11"@"SEL$18" "la"@"SEL$18" "sysc"@"SEL$18" "t40"@"SEL$18") ELIMINATE_JOIN(@"SEL$E89CF8D9" "t11"@"SEL$19" "la"@"SEL$19" "sysc"@"SEL$19" "t40"@"SEL$19") ELIMINATE_JOIN(@"SEL$69BC3CCC" "t11"@"SEL$20" "la"@"SEL$20" "sysc"@"SEL$20" "t40"@"SEL$20") ELIMINATE_JOIN(@"SEL$BA9DD79C" "t16"@"SEL$25" "t11"@"SEL$25" "la"@"SEL$25" "sysc"@"SEL$25" "t40"@"SEL$25") ELIMINATE_JOIN(@"SEL$54759E71" "t16"@"SEL$26" "t11"@"SEL$26" "la"@"SEL$26" "sysc"@"SEL$26" "vpcc"@"SEL$26" "t40"@"SEL$26") ELIMINATE_JOIN(@"SEL$69A230FE" "t16"@"SEL$27" "t11"@"SEL$27" "la"@"SEL$27" "sysc"@"SEL$27" "vpcc"@"SEL$27" "t40"@"SEL$27") ELIMINATE_JOIN(@"SEL$78120F8F" "category"@"SEL$16" "t8"@"SEL$16") PRED_DEDUCE(@"SEL$C33E59DA") PRED_DEDUCE(@"SEL$61C2283B") PRED_DEDUCE(@"SEL$D24DF724") PRED_DEDUCE(@"SEL$952FCADF") PRED_DEDUCE(@"SEL$B7F9ED44") PRED_DEDUCE(@"SEL$99721548") PRED_DEDUCE(@"SEL$4D7C757A") PRED_DEDUCE(@"SEL$5BE1C888") PRED_DEDUCE(@"SEL$BA8AE57E") PRED_DEDUCE(@"SEL$E141C615") PRED_DEDUCE(@"SEL$8AD6E1EC") PRED_DEDUCE(@"SEL$AE171B57") PRED_DEDUCE(@"SEL$A4E7009A") PRED_DEDUCE(@"SEL$400B4033") PRED_DEDUCE(@"SEL$9AFFA2B6") PRED_DEDUCE(@"SEL$E35530EB") PRED_DEDUCE(@"SEL$645B1D0B") PRED_DEDUCE(@"SEL$015B026D") PRED_DEDUCE(@"SEL$ACEB2114") PRED_DEDUCE(@"SEL$813B6A0C") SIMPLIFY_GROUP_BY(@"SEL$2D670F11") SIMPLIFY_GROUP_BY(@"SEL$1B837888") PROJECT_PRUNE(@"SET$88FD1BD0") PROJECT_PRUNE(@"SET$A2FE34C6") PROJECT_PRUNE(@"SEL$11") PROJECT_PRUNE(@"SET$160621EA") PROJECT_PRUNE(@"SET$864848B3") PROJECT_PRUNE(@"SEL$24") REPLACE_CONST(@"SEL$196784F1") REPLACE_CONST(@"SEL$D1FFEEF5") REPLACE_CONST(@"SEL$66B23311") REPLACE_CONST(@"SEL$4E8173E8") REPLACE_CONST(@"SEL$741F3C49") REPLACE_CONST(@"SEL$1A7BD1D6") REPLACE_CONST(@"SEL$36B16BD6") REPLACE_CONST(@"SEL$088B1144") REPLACE_CONST(@"SEL$244FD6EB") REPLACE_CONST(@"SEL$3866D546") REPLACE_CONST(@"SEL$EF748854") REPLACE_CONST(@"SEL$26E9AA48") REPLACE_CONST(@"SEL$CAA01D87") REPLACE_CONST(@"SEL$78780CA4") REPLACE_CONST(@"SEL$D76B789F") REPLACE_CONST(@"SEL$E2A0CD93") REPLACE_CONST(@"SEL$EB492156") REPLACE_CONST(@"SEL$8A211AD1") PARALLEL( AUTO ) OPTIMIZER_FEATURES_ENABLE('4.3.3.0') END_OUTLINE_DATA */ Optimization Info: ------------------------------------- t6: table_rows:15552 physical_range_rows:15552 logical_range_rows:15552 index_back_rows:0 output_rows:6349 table_dop:1 dop_method:Auto DOP avaiable_index_name:[idx_order_detail_id, idx_return_detail_return_id, idx_mkc_id, t_return_detail] pruned_index_name:[idx_order_detail_id] stats info:[version=1731313606359224, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t7: table_rows:15920 physical_range_rows:374 logical_range_rows:374 index_back_rows:374 output_rows:232 table_dop:1 dop_method:Auto DOP avaiable_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id, t_return] pruned_index_name:[treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id] unstable_index_name:[t_return] stats info:[version=1731313605928399, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t3: table_rows:428132 physical_range_rows:1485 logical_range_rows:1485 index_back_rows:1485 output_rows:227 table_dop:1 dop_method:Auto DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_complete_time, idx_order_parent_id, idx_in_user_id, idx_return_time, idx_trader_id, idx_contract_mobile] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1268 logical_range_rows:1268 index_back_rows:0 output_rows:1268 table_dop:1 dop_method:Auto DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t1: table_rows:920789 physical_range_rows:920789 logical_range_rows:920789 index_back_rows:0 output_rows:743749 table_dop:1 dop_method:Auto DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t2: table_rows:775732 physical_range_rows:775732 logical_range_rows:775732 index_back_rows:0 output_rows:364611 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid] unstable_index_name:[t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t3: table_rows:428132 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t6: table_rows:15552 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_detail_id, idx_return_detail_return_id, idx_mkc_id, t_return_detail] pruned_index_name:[idx_order_detail_id, idx_return_detail_return_id] unstable_index_name:[t_return_detail] stats info:[version=1731313606359224, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t7: table_rows:15920 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id, t_return] pruned_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id] stats info:[version=1731313605928399, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t16: table_rows:174768 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[trebate_detail_ppid, trebate_detail_mkc_id, idx_adjust_price_id, idx_in_stock_detail_id, t_product_adjust_price_detail] pruned_index_name:[trebate_detail_ppid, idx_adjust_price_id, idx_in_stock_detail_id] unstable_index_name:[t_product_adjust_price_detail] stats info:[version=1731311784635479, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t17: table_rows:9269 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[table_index, t_product_adjust_price] pruned_index_name:[table_index] stats info:[version=1731311784255726, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1268 logical_range_rows:1268 index_back_rows:0 output_rows:1268 table_dop:1 dop_method:Auto DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t3: table_rows:428132 physical_range_rows:1485 logical_range_rows:1485 index_back_rows:1485 output_rows:181 table_dop:1 dop_method:Auto DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[idx_order_parent_id, idx_in_user_id, idx_return_time, idx_trader_id, idx_contract_mobile] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_recover_stock_id] unstable_index_name:[t_order_detail] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id] unstable_index_name:[t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t17: table_rows:9269 physical_range_rows:78 logical_range_rows:78 index_back_rows:0 output_rows:78 table_dop:1 dop_method:Auto DOP avaiable_index_name:[table_index, t_product_adjust_price] unstable_index_name:[t_product_adjust_price] stats info:[version=1731311784255726, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t16: table_rows:174768 physical_range_rows:19 logical_range_rows:19 index_back_rows:19 output_rows:13 table_dop:1 dop_method:DAS DOP avaiable_index_name:[trebate_detail_ppid, trebate_detail_mkc_id, idx_adjust_price_id, idx_in_stock_detail_id, t_product_adjust_price_detail] pruned_index_name:[trebate_detail_ppid, trebate_detail_mkc_id, idx_in_stock_detail_id] unstable_index_name:[t_product_adjust_price_detail] stats info:[version=1731311784635479, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid] unstable_index_name:[t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t3: table_rows:428132 physical_range_rows:1485 logical_range_rows:1485 index_back_rows:1485 output_rows:1464 table_dop:1 dop_method:Auto DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_complete_time, idx_order_parent_id, idx_in_user_id, idx_return_time, idx_trader_id, idx_contract_mobile] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] sysc: table_rows:655 physical_range_rows:655 logical_range_rows:655 index_back_rows:0 output_rows:327 table_dop:1 dop_method:Auto DOP avaiable_index_name:[t_sys_config] stats info:[version=1731313613388044, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] la: table_rows:3 physical_range_rows:3 logical_range_rows:3 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[t_label] stats info:[version=1731333611029706, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t11: table_rows:320 physical_range_rows:320 logical_range_rows:320 index_back_rows:0 output_rows:320 table_dop:1 dop_method:Auto DOP avaiable_index_name:[un_idx_special_username, un_idx_special_user_id, t_special_user] pruned_index_name:[un_idx_special_username] stats info:[version=1731333670239114, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t3: table_rows:428132 physical_range_rows:1485 logical_range_rows:1485 index_back_rows:1485 output_rows:181 table_dop:1 dop_method:Auto DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[idx_order_parent_id, idx_in_user_id, idx_return_time, idx_trader_id, idx_contract_mobile] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t40: table_rows:1 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[t_finance_accounting_body] stats info:[version=1731333609995790, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t36: table_rows:1268 physical_range_rows:1268 logical_range_rows:1268 index_back_rows:0 output_rows:1268 table_dop:1 dop_method:Auto DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_recover_stock_id] unstable_index_name:[t_order_detail] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t17: table_rows:36983 physical_range_rows:36983 logical_range_rows:36983 index_back_rows:0 output_rows:18491 table_dop:1 dop_method:Auto DOP avaiable_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID, IDX_BIND_DETAIL_ID, t_after_services_buy] pruned_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID] stats info:[version=1731310867644183, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t16: table_rows:37334 physical_range_rows:37334 logical_range_rows:37334 index_back_rows:0 output_rows:37334 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_orderDetailId, t_operator_business] stats info:[version=1731310921084421, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] vpcc: table_rows:760721 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_huijb_original_detail_id, t_order_detail_extend] pruned_index_name:[idx_huijb_original_detail_id] stats info:[version=1731310929680610, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id] unstable_index_name:[t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] la: table_rows:3 physical_range_rows:3 logical_range_rows:3 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[t_label] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t11: table_rows:320 physical_range_rows:320 logical_range_rows:320 index_back_rows:0 output_rows:320 table_dop:1 dop_method:Auto DOP avaiable_index_name:[un_idx_special_username, un_idx_special_user_id, t_special_user] pruned_index_name:[un_idx_special_username] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t3: table_rows:428132 physical_range_rows:1485 logical_range_rows:1485 index_back_rows:1485 output_rows:227 table_dop:1 dop_method:Auto DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_complete_time, idx_order_parent_id, idx_in_user_id, idx_return_time, idx_trader_id, idx_contract_mobile] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t40: table_rows:1 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[t_finance_accounting_body] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_recover_stock_id] unstable_index_name:[t_order_detail] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t_return_detail: table_rows:15552 physical_range_rows:15552 logical_range_rows:15552 index_back_rows:0 output_rows:5498 table_dop:1 dop_method:Auto DOP avaiable_index_name:[idx_order_detail_id, idx_return_detail_return_id, idx_mkc_id, t_return_detail] pruned_index_name:[idx_mkc_id] stats info:[version=1731313606359224, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t7: table_rows:15920 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id, t_return] pruned_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] vpcc: table_rows:760721 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_huijb_original_detail_id, t_order_detail_extend] pruned_index_name:[idx_huijb_original_detail_id] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id] unstable_index_name:[t_product_stock_detail] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t16: table_rows:37334 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderDetailId, t_operator_business] pruned_index_name:[t_operator_business] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t17: table_rows:36983 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID, IDX_BIND_DETAIL_ID, t_after_services_buy] pruned_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID] unstable_index_name:[t_after_services_buy] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] sysc: table_rows:655 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_sys_config] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id] unstable_index_name:[t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] b: table_rows:37334 physical_range_rows:37334 logical_range_rows:37334 index_back_rows:0 output_rows:17 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_orderDetailId, t_operator_business] stats info:[version=1731310921084421, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] a: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] c: table_rows:428132 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t3: table_rows:428132 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t17: table_rows:36983 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID, IDX_BIND_DETAIL_ID, t_after_services_buy] pruned_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID] unstable_index_name:[t_after_services_buy] stats info:[version=1731310867644183, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t7: table_rows:15920 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:Auto DOP avaiable_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id, t_return] pruned_index_name:[treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id] unstable_index_name:[t_return] stats info:[version=1731313605928399, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t6: table_rows:15552 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_detail_id, idx_return_detail_return_id, idx_mkc_id, t_return_detail] pruned_index_name:[idx_order_detail_id] unstable_index_name:[t_return_detail] stats info:[version=1731313606359224, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t3: table_rows:428132 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t17: table_rows:36983 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID, IDX_BIND_DETAIL_ID, t_after_services_buy] pruned_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID] unstable_index_name:[t_after_services_buy] stats info:[version=1731310867644183, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t7: table_rows:15920 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:Auto DOP avaiable_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id, t_return] pruned_index_name:[treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id] unstable_index_name:[t_return] stats info:[version=1731313605928399, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t6: table_rows:15552 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_detail_id, idx_return_detail_return_id, idx_mkc_id, t_return_detail] pruned_index_name:[idx_order_detail_id, idx_mkc_id] unstable_index_name:[t_return_detail] stats info:[version=1731313606359224, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid] unstable_index_name:[t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t3: table_rows:428132 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t17: table_rows:36983 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID, IDX_BIND_DETAIL_ID, t_after_services_buy] pruned_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID] unstable_index_name:[t_after_services_buy] stats info:[version=1731310867644183, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t6: table_rows:15552 physical_range_rows:15552 logical_range_rows:15552 index_back_rows:0 output_rows:6349 table_dop:1 dop_method:Auto DOP avaiable_index_name:[idx_order_detail_id, idx_return_detail_return_id, idx_mkc_id, t_return_detail] pruned_index_name:[idx_order_detail_id] stats info:[version=1731313606359224, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t7: table_rows:15920 physical_range_rows:547 logical_range_rows:547 index_back_rows:547 output_rows:340 table_dop:1 dop_method:Auto DOP avaiable_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id, t_return] pruned_index_name:[treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id] unstable_index_name:[t_return] stats info:[version=1731313605928399, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t3: table_rows:428132 physical_range_rows:1485 logical_range_rows:1485 index_back_rows:1485 output_rows:227 table_dop:1 dop_method:Auto DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_complete_time, idx_order_parent_id, idx_in_user_id, idx_return_time, idx_trader_id, idx_contract_mobile] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1268 logical_range_rows:1268 index_back_rows:0 output_rows:1268 table_dop:1 dop_method:Auto DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t1: table_rows:920789 physical_range_rows:920789 logical_range_rows:920789 index_back_rows:0 output_rows:743749 table_dop:1 dop_method:Auto DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t2: table_rows:775732 physical_range_rows:775732 logical_range_rows:775732 index_back_rows:0 output_rows:364611 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid] unstable_index_name:[t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t3: table_rows:428132 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t6: table_rows:15552 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_detail_id, idx_return_detail_return_id, idx_mkc_id, t_return_detail] pruned_index_name:[idx_order_detail_id, idx_return_detail_return_id] unstable_index_name:[t_return_detail] stats info:[version=1731313606359224, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t7: table_rows:15920 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id, t_return] pruned_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id] stats info:[version=1731313605928399, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t16: table_rows:174768 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[trebate_detail_ppid, trebate_detail_mkc_id, idx_adjust_price_id, idx_in_stock_detail_id, t_product_adjust_price_detail] pruned_index_name:[trebate_detail_ppid, idx_adjust_price_id, idx_in_stock_detail_id] unstable_index_name:[t_product_adjust_price_detail] stats info:[version=1731311784635479, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t17: table_rows:9269 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[table_index, t_product_adjust_price] pruned_index_name:[table_index] stats info:[version=1731311784255726, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1268 logical_range_rows:1268 index_back_rows:0 output_rows:1268 table_dop:1 dop_method:Auto DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t3: table_rows:428132 physical_range_rows:1485 logical_range_rows:1485 index_back_rows:1485 output_rows:236 table_dop:1 dop_method:Auto DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[idx_order_parent_id, idx_in_user_id, idx_return_time, idx_trader_id, idx_contract_mobile] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_recover_stock_id] unstable_index_name:[t_order_detail] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id] unstable_index_name:[t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t17: table_rows:9269 physical_range_rows:160 logical_range_rows:160 index_back_rows:0 output_rows:160 table_dop:1 dop_method:Auto DOP avaiable_index_name:[table_index, t_product_adjust_price] unstable_index_name:[t_product_adjust_price] stats info:[version=1731311784255726, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t16: table_rows:174768 physical_range_rows:19 logical_range_rows:19 index_back_rows:19 output_rows:13 table_dop:1 dop_method:DAS DOP avaiable_index_name:[trebate_detail_ppid, trebate_detail_mkc_id, idx_adjust_price_id, idx_in_stock_detail_id, t_product_adjust_price_detail] pruned_index_name:[trebate_detail_ppid, trebate_detail_mkc_id, idx_in_stock_detail_id] unstable_index_name:[t_product_adjust_price_detail] stats info:[version=1731311784635479, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid] unstable_index_name:[t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t3: table_rows:428132 physical_range_rows:1485 logical_range_rows:1485 index_back_rows:1485 output_rows:1464 table_dop:1 dop_method:Auto DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_complete_time, idx_order_parent_id, idx_in_user_id, idx_return_time, idx_trader_id, idx_contract_mobile] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] sysc: table_rows:655 physical_range_rows:655 logical_range_rows:655 index_back_rows:0 output_rows:327 table_dop:1 dop_method:Auto DOP avaiable_index_name:[t_sys_config] stats info:[version=1731313613388044, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] la: table_rows:3 physical_range_rows:3 logical_range_rows:3 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[t_label] stats info:[version=1731333611029706, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t11: table_rows:320 physical_range_rows:320 logical_range_rows:320 index_back_rows:0 output_rows:320 table_dop:1 dop_method:Auto DOP avaiable_index_name:[un_idx_special_username, un_idx_special_user_id, t_special_user] pruned_index_name:[un_idx_special_username] stats info:[version=1731333670239114, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t3: table_rows:428132 physical_range_rows:1485 logical_range_rows:1485 index_back_rows:1485 output_rows:236 table_dop:1 dop_method:Auto DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[idx_order_parent_id, idx_in_user_id, idx_return_time, idx_trader_id, idx_contract_mobile] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t40: table_rows:1 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[t_finance_accounting_body] stats info:[version=1731333609995790, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t36: table_rows:1268 physical_range_rows:1268 logical_range_rows:1268 index_back_rows:0 output_rows:1268 table_dop:1 dop_method:Auto DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_recover_stock_id] unstable_index_name:[t_order_detail] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t17: table_rows:36983 physical_range_rows:36983 logical_range_rows:36983 index_back_rows:0 output_rows:18491 table_dop:1 dop_method:Auto DOP avaiable_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID, IDX_BIND_DETAIL_ID, t_after_services_buy] pruned_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID] stats info:[version=1731310867644183, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t16: table_rows:37334 physical_range_rows:37334 logical_range_rows:37334 index_back_rows:0 output_rows:37334 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_orderDetailId, t_operator_business] stats info:[version=1731310921084421, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] vpcc: table_rows:760721 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_huijb_original_detail_id, t_order_detail_extend] pruned_index_name:[idx_huijb_original_detail_id] stats info:[version=1731310929680610, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id] unstable_index_name:[t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] la: table_rows:3 physical_range_rows:3 logical_range_rows:3 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[t_label] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t11: table_rows:320 physical_range_rows:320 logical_range_rows:320 index_back_rows:0 output_rows:320 table_dop:1 dop_method:Auto DOP avaiable_index_name:[un_idx_special_username, un_idx_special_user_id, t_special_user] pruned_index_name:[un_idx_special_username] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t3: table_rows:428132 physical_range_rows:1485 logical_range_rows:1485 index_back_rows:1485 output_rows:227 table_dop:1 dop_method:Auto DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_complete_time, idx_order_parent_id, idx_in_user_id, idx_return_time, idx_trader_id, idx_contract_mobile] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t40: table_rows:1 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[t_finance_accounting_body] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_recover_stock_id] unstable_index_name:[t_order_detail] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t_return_detail: table_rows:15552 physical_range_rows:15552 logical_range_rows:15552 index_back_rows:0 output_rows:5498 table_dop:1 dop_method:Auto DOP avaiable_index_name:[idx_order_detail_id, idx_return_detail_return_id, idx_mkc_id, t_return_detail] pruned_index_name:[idx_mkc_id] stats info:[version=1731313606359224, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t7: table_rows:15920 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id, t_return] pruned_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] vpcc: table_rows:760721 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_huijb_original_detail_id, t_order_detail_extend] pruned_index_name:[idx_huijb_original_detail_id] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id] unstable_index_name:[t_product_stock_detail] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t16: table_rows:37334 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderDetailId, t_operator_business] pruned_index_name:[t_operator_business] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t17: table_rows:36983 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID, IDX_BIND_DETAIL_ID, t_after_services_buy] pruned_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID] unstable_index_name:[t_after_services_buy] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] sysc: table_rows:655 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_sys_config] stats info:[version=0, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id] unstable_index_name:[t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] b: table_rows:37334 physical_range_rows:37334 logical_range_rows:37334 index_back_rows:0 output_rows:30 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_orderDetailId, t_operator_business] stats info:[version=1731310921084421, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] a: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] c: table_rows:428132 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t3: table_rows:428132 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t17: table_rows:36983 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID, IDX_BIND_DETAIL_ID, t_after_services_buy] pruned_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID] unstable_index_name:[t_after_services_buy] stats info:[version=1731310867644183, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t7: table_rows:15920 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:Auto DOP avaiable_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id, t_return] pruned_index_name:[treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id] unstable_index_name:[t_return] stats info:[version=1731313605928399, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t6: table_rows:15552 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_detail_id, idx_return_detail_return_id, idx_mkc_id, t_return_detail] pruned_index_name:[idx_order_detail_id] unstable_index_name:[t_return_detail] stats info:[version=1731313606359224, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t3: table_rows:428132 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t17: table_rows:36983 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID, IDX_BIND_DETAIL_ID, t_after_services_buy] pruned_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID] unstable_index_name:[t_after_services_buy] stats info:[version=1731310867644183, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t7: table_rows:15920 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:Auto DOP avaiable_index_name:[treturn_ix_return_type, treturn_ix_check2_time, treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id, t_return] pruned_index_name:[treturn_ix_return_way, treturn_ix_create_time, treturn_ix_area_id, idx_orginal_order_id] unstable_index_name:[t_return] stats info:[version=1731313605928399, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] t6: table_rows:15552 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_detail_id, idx_return_detail_return_id, idx_mkc_id, t_return_detail] pruned_index_name:[idx_order_detail_id, idx_mkc_id] unstable_index_name:[t_return_detail] stats info:[version=1731313606359224, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t1: table_rows:920789 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid, index_mck_id, t_product_stock_detail] pruned_index_name:[productstockdetail_ppid, productstockdetail_instock_detail_id, index_area_id, tproductstockdetail_ix_related_id_related_type, tproductstockdetail_ix_order_detail_id, idx_insource_id, idx_imei, idx_imei_2, idx_imei_3, idx_imei_4, t_product_stock_detail_stock_state_IDX, t_product_stock_detail_is_mobile_IDX, t_product_stock_detail_arrive_shop_time_index, idx_areaid] unstable_index_name:[t_product_stock_detail] stats info:[version=1731915275067707, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t2: table_rows:775732 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id, t_order_detail] pruned_index_name:[index_orderId, torderdetail_ix_ppid, parent_index, idx_in_user_id, idx_detail_type, idx_product_stock_type, idx_is_delete, idx_recover_stock_id] stats info:[version=1731649764159773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t4: table_rows:426212 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id, t_product_info] pruned_index_name:[tproductinfo_productid, tproductinfo_cid, tproductinfo_ismobile, tproductinfo_ppriceid1, tproductinfo_barCode, product_name_IDX, tproductinfo_ix_views, idx_source, idx_brand_id] stats info:[version=1731311792274066, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t3: table_rows:428132 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[torder_ix_order_id, torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] pruned_index_name:[torder_ix_user_id, torder_ix_area_id, torder_ix_complete_time, idx_order_parent_id, idx_order_state, idx_in_user_id, idx_return_time, idx_trader_id, idx_is_delete, idx_contract_mobile, t_order] stats info:[version=1731649775467773, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t5: table_rows:236695 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index, t_user] pruned_index_name:[t_user_mobile_UN, t_user_name_UN, tuser_ix_user_level, regist_time_index] stats info:[version=1731313621216101, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t8: table_rows:236 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:Auto DOP avaiable_index_name:[tdepartinfo_ix1, t_depart_info] pruned_index_name:[tdepartinfo_ix1] stats info:[version=1731333608609378, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t17: table_rows:36983 physical_range_rows:1 logical_range_rows:1 index_back_rows:1 output_rows:0 table_dop:1 dop_method:DAS DOP avaiable_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID, IDX_BIND_DETAIL_ID, t_after_services_buy] pruned_index_name:[IDX_PPID, IDX_ORDER_DETAIL_ID, IDX_USER_ID, IDX_IMEI, IDX_SERVICE_PPID] unstable_index_name:[t_after_services_buy] stats info:[version=1731310867644183, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] t36: table_rows:1268 physical_range_rows:1 logical_range_rows:1 index_back_rows:0 output_rows:1 table_dop:1 dop_method:DAS DOP avaiable_index_name:[idx_order_id, idx_purchase_id, idx_purchase_in_area_id, t_order_extend] pruned_index_name:[idx_purchase_id, idx_purchase_in_area_id, t_order_extend] stats info:[version=1731311762662560, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS] pl: table_rows:2 physical_range_rows:2 logical_range_rows:2 index_back_rows:0 output_rows:2 table_dop:1 dop_method:Auto DOP avaiable_index_name:[index_label_id, product_index, t_product_label] pruned_index_name:[index_label_id] stats info:[version=1731333616395444, is_locked=0, is_expired=0] dynamic sampling level:0 estimation method:[OPTIMIZER STATISTICS, STORAGE] Plan Type: DISTRIBUTED Note: Degree of Parallelisim is 1 because of Auto DOP Expr Constraints: 1 AND 1 result is TRUE cast(0, TINYINT UNSIGNED(3, 0)) = 0 result is TRUE