|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|v4_user|SELECT t1.id AS memberId, t2.id AS potentialCustomerId, t2.checkin_time AS checkinTime FROM member t1 JOIN potential_customer t2 ON t1.tenant_app_id = t2.tenant_app_id AND (t1.id = t2.member_id OR (t2.external_user_id != ? AND t1.external_user_id = t2.external_user_id)) AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t2.maintain_shop_id = ? AND t2.id IN (?) AND t1.tenant_id = ? AND t1.tenant_app_id = ?|1200|2359|11||0|0|2371779065|2133940|9702|10|
|v4_sales|SELECT id, warranty_id, sales_detail_id, tenant_id, tenant_app_id , create_time, update_time FROM warranty_detail WHERE warranty_id = ? AND sales_detail_id = ? AND tenant_id = ? AND tenant_app_id = ?|920|1256|3||0|0|578742359|637199|912|1|
|v4_user|SELECT t1.id AS memberId, t2.id AS potentialCustomerId, t2.checkin_time AS checkinTime FROM member t1 JOIN potential_customer t2 ON t1.tenant_app_id = t2.tenant_app_id AND (t1.id = t2.member_id OR (t2.external_user_id != ? AND t1.external_user_id = t2.external_user_id)) AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t2.maintain_shop_id = ? AND t2.maintain_employee_id = ? AND t2.`status` IN (?) AND t1.tenant_id = ? AND t1.tenant_app_id = ?|674|7066|118||0|0|5456518499|27297934|25473|200|
|tenant|SELECT id, tenant_id, tenant_app_id, sneak_guest_maintain_id, sneak_guest_id , url, create_time, update_time FROM sneak_guest_maintain_file WHERE tenant_app_id = ? AND sneak_guest_maintain_id IN (?)|372|831|23||0|0|527736408|1419709|2099|33|
|user_service|SELECT ue.employee_id AS employeeId, count(*) AS quantity FROM user_service.user_employee ue WHERE ue.employee_id IN (?) AND ue.tenant_id = ? AND ue.tenant_wechatapp_id = ? AND ue.shop_id = ? GROUP BY ue.employee_id|347|505|8||0|0|1640072|69787|347|1|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY i.volume DESC, p.tag_price ASC, p.id DESC LIMIT ?|255|427|6||0|0|2099786|8239|1530|6|
|corpwx|SELECT id, tenant_id, tenant_app_id, external_user_id, wx_user_id FROM external_user_bind WHERE (tenant_id = ? AND tenant_app_id = ? AND external_user_id = ?) OR (tenant_id = ? AND tenant_app_id = ? AND wx_user_id = ?)|181|369|11||0|0|20894546|215766|108|2|
|corpwx|SELECT id, tenant_id, cwx_user_id, user_id, old_user_id , union_id, name, sex, avatar, tenant_user_id , un_assign_flag, corp_user_id, wx_user_id, create_time, update_time , status FROM external_user WHERE tenant_id = ? AND cwx_user_id = ?|150|215|5||0|0|320585|4885|320585|4885|
|gift_mail|SELECT count(0) FROM ( SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY i.volume DESC, p.tag_price ASC, p.id DESC ) tmp_count|130|193|3||0|0|944060|7262|130|1|
|tenant|SELECT sales_date FROM tenant.erp_sales WHERE tenant_id = ? AND tenant_wechatapp_id = ? AND member_erp_id = ? AND sales_erp_id < ? AND is_sales = ? AND sales_status = ? ORDER BY sales_erp_id ASC LIMIT ?|129|253|4||0|0|1666379|29015|129|1|
|comment_service|SELECT * FROM comment_service.comment_reward WHERE comment_id = ? LIMIT ?|103|149|3||0|0|41167750|404077|17|1|
|v4_user|SELECT id, shop_id, mobile_no, member_name, head_img_url , sex, birthday, birthday_is_lunar, memorial_name, memorial_day , memorial_day_is_lunar, address, interest, wx_union_id, mini_open_id , h5_open_id, wx_card_code, recommend_id, recommend_bind_time, external_user_id , status, combine_status, combine_id, tenant_id, tenant_app_id , create_time, update_time FROM member WHERE (mobile_no = ? OR wx_card_code = ?) AND tenant_id = ? AND tenant_app_id = ? LIMIT ?|93|134|3||0|0|12617798|213393|67|1|
|corpwx|select t.tenant_id as tenantId, t.wx_user_id as wxUserId, t.union_id as wxUnionId, t.user_id as externalUserId, ifnull(et.raw_external_user_id,t.old_user_id) as rawExternalUserId, t.corp_user_id as employeeCorpUserId from corpwx.external_user t left join corpwx.external_userid_transform et on t.tenant_id=et.tenant_id and t.user_id=et.external_user_id where t.tenant_id = ? and t.status=? and t.user_id in (|85|138|6||0|0|140661|1914|68120|941|
|v4_sales|SELECT COUNT(*) AS total FROM warranty WHERE member_id IN (?) AND is_disable = ? AND tenant_id = ? AND tenant_app_id = ?|83|170|6||0|0|10322882|143927|83|1|
|coupon_service|SELECT ifnull(sum(quantity), ?) FROM coupon_service.coupon_market_order WHERE market_id = ? AND user_id = ? AND order_state = ?|66|138|5||0|0|35293228|534960|66|1|
|activity_service|SELECT count(*) > ? FROM activity_service.online_sign_user_sign_log WHERE tenant_app_id = ? AND user_id = ? AND to_days(create_time) = to_days(?)|64|102|4||0|0|25942373|405478|64|1|
|coupon_service|SELECT count(*) FROM employee_give_coupon_log WHERE tenant_app_id = ? AND coupon_push_id = ?|61|93|5||0|0|1500962|34385|61|1|
|user_service|SELECT tu.user_id, tm.shop_id, mb.erp_member_id AS memberErpId, tu.mobile_no, tu.user_name , ue.employee_id, tm.grade_id FROM user_service.tenant_member tu INNER JOIN user_service.tenant_member_info tm ON tu.tenant_id = tm.tenant_id AND tu.id = tm.id INNER JOIN user_service.tenant_member_bind mb ON tu.tenant_id = mb.tenant_id AND tu.id = mb.id LEFT JOIN user_service.user_employee ue ON tu.tenant_app_id = ue.tenant_wechatapp_id AND tu.user_id = ue.user_id WHERE tu.tenant_id = ? AND tu.tenant_app_id = ? AND mb.erp_member_id IN (?)|40|78|8||0|0|15706100|1326654|4019|226|
|v4_user|SELECT COUNT(*) AS total FROM member_source WHERE source_id = ? AND tenant_id = ? AND tenant_app_id = ?|37|51|2||0|0|7538945|213391|37|1|
|tenant|SELECT sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, sg.maintain_level , sg.maintain_employee_id, sg.create_time, sg.last_maintain_date, ey.employee_name AS maintainEmployeeName, sg.status , sg.finish_date, sg.next_maintain_date FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND sg.maintain_employee_id = ? AND sg.next_maintain_date >= ? AND sg.next_maintain_date <= ? AND sg.status = ? ORDER BY sg.id DESC LIMIT ?|35|72|5||0|0|22256791|636320|102|8|
|user_service|SELECT count(0) FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? JOIN user_service.user_employee ue ON t1.tenant_id = ue.tenant_id AND t1.tenant_app_id = ue.tenant_wechatapp_id AND t1.user_id = ue.user_id AND ue.employee_id = ? AND ue.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ?|34|57|5||0|0|414709|92956|34|1|
|tenant|SELECT es.id, es.sales_no, es.sales_date, es.member_erp_id, es.sales_erp_id , es.is_sales FROM erp_sales es WHERE es.tenant_id = ? AND es.tenant_wechatapp_id = ? AND es.sales_status = ? AND es.sales_no LIKE concat(?, ?) ORDER BY es.sales_date DESC LIMIT ?|34|145|12||0|0|15810935|1121716|5|1|
|v4_sales|SELECT id, warranty_id, sales_detail_id, tenant_id, tenant_app_id , create_time, update_time FROM warranty_detail WHERE warranty_id = ? AND tenant_id = ? AND tenant_app_id = ?|33|57|4||0|0|20844695|637542|77|8|
|coupon_service|SELECT count(1) FROM coupon_service.coupon_expire_task WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND employee_id = ? AND status = ? AND expire_time > now()|30|41|2||0|0|1831680|67926|30|1|
|coupon_service|SELECT * FROM coupon_service.coupon_market_order WHERE pay_type IN (?) AND order_state = ? AND update_time <= DATE_SUB(NOW(), INTERVAL ? MINUTE)|29|69|5||0|0|15507337|534960|0|0|
|v4_employee|SELECT t.id AS task_id, task_type , if(task_type = ?, st.description, it.description) AS description , if(task_type = ?, st.quick_reply, it.quick_reply) AS quick_reply , task_name, member_id, member_name, member_mobile_no, member_sex , member_level, t.start_time, t.end_time , datediff(t.end_time, ?) AS left_days, send_coupons , recv_coupons, st.coupons, t.accept_time, t.plan_arrival_shop_time, t.arrival_shop_time , t.trade_time FROM task_task t LEFT JOIN task_system_task_template st ON st.id = t.task_template_id AND st.tenant_id = ? AND st.tenant_app_id = ? LEFT JOIN task_invite_task_template it ON it.id = t.task_template_id AND it.tenant_id = ? AND it.tenant_app_id = ? WHERE t.status = ? AND task_type = ? AND system_task_type = ? AND t.start_time <= ? AND t.end_time > ? AND shop_id = ? AND employee_id = ? AND finish_time IS NULL AND t.tenant_id = ? AND t.tenant_app_id = ? ORDER BY t.id DESC LIMIT ?|28|63|12||0|0|14823074|529404|77|7|
|tenant|SELECT count(0) FROM erp_sales es WHERE es.tenant_id = ? AND es.tenant_wechatapp_id = ? AND es.sales_date >= ? AND es.employee_erp_id = ? AND es.sales_status = ?|24|38|2||0|0|79060|5145|24|1|
|coupon_service|SELECT cmod.coupon_id, cmo.pay_type FROM coupon_service.coupon_market_order_detail cmod JOIN coupon_service.coupon_market_order cmo ON cmo.tenant_id = ? AND cmo.tenant_app_id = ? AND cmo.id = cmod.order_id WHERE cmod.tenant_id = ? AND cmod.tenant_app_id = ? AND cmod.coupon_id IN (?)|24|49|4||0|0|1097225|117680|304|20|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY i.volume DESC, p.tag_price ASC, p.id DESC LIMIT ?, ?|23|40|4||0|0|190035|8335|138|6|
|v4_coupon|SELECT count(*) FROM ( SELECT grant_id FROM v4_coupon.coupon WHERE put_id = ? AND member_id = ? AND tenant_id = ? AND tenant_app_id = ? GROUP BY grant_id ) c|22|34|2||0|0|2014118|92005|22|1|
|tenant|SELECT count(*) FROM tenant.sneak_guest_maintain s JOIN tenant.sneak_guest sg ON sg.id = s.sneak_guest_id WHERE s.tenant_id = ? AND s.tenant_app_id = ? AND s.shop_id = ? AND s.event_type = ? AND s.create_time BETWEEN ? AND ?|19|25|1||0|0|38109|4258|19|1|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.warranty w JOIN v4_sales.erp_sales es ON es.id = w.sales_id AND es.tenant_id = ? AND es.tenant_app_id = ? WHERE w.member_id IN (?) AND is_disable = ? AND w.tenant_id = ? AND w.tenant_app_id = ?|19|31|3||0|0|2343570|143918|19|1|
|coupon_service|SELECT count(0) FROM coupon_service.employee_give_coupon_log egcl WHERE egcl.employee_give_coupon_id = ? AND egcl.shop_id = ? AND egcl.employee_id = ?|18|25|2||0|0|170356|13493|18|1|
|employee|SELECT count(*) FROM label_task_employee t1 JOIN label_task_setting t2 ON t1.label_task_id = t2.id AND t2.disabled = ? WHERE t1.tenant_app_id = ? AND t1.shop_id = ? AND t1.visit_status > ? AND t1.finish_time >= DATE_SUB(CURRENT_DATE, INTERVAL ? DAY) AND t1.finish_time < CURRENT_DATE|18|33|3||0|0|204201|28112|18|1|
|tenant|SELECT count(*) FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? AND maintain_employee_id = ?|16|21|2||0|0|117182|11321|16|1|
|tenant|SELECT count(*) FROM tenant.sneak_guest_maintain s JOIN tenant.sneak_guest sg ON sg.tenant_id = s.tenant_id AND sg.tenant_app_id = s.tenant_app_id AND sg.id = s.sneak_guest_id JOIN tenant.employee e ON e.tenant_id = s.tenant_id AND e.id = s.employee_id WHERE s.tenant_id = ? AND s.tenant_app_id = ? AND sg.create_shop_id = ? AND (sg.fail_type IS NULL OR sg.fail_type = ?) AND s.event_type = ? AND s.create_time BETWEEN ? AND ?|16|23|3||0|0|28625|2540|16|1|
|tenant|SELECT count(*) FROM sneak_guest WHERE tenant_app_id = ? AND create_shop_id = ? AND maintain_employee_id = ? AND status = ? AND next_maintain_date BETWEEN ? AND ?|16|21|2||0|0|117182|11321|16|1|
|tenant|SELECT count(*) FROM ( SELECT s.sneak_guest_id FROM tenant.sneak_guest_maintain s JOIN tenant.sneak_guest sg ON sg.id = s.sneak_guest_id AND (sg.fail_type IS NULL OR sg.fail_type = ?) WHERE s.tenant_id = ? AND s.tenant_app_id = ? AND s.shop_id = ? AND s.event_type = ? AND s.create_time BETWEEN ? AND ? GROUP BY s.sneak_guest_id ) a|15|169|18||0|0|878188|74130|15|1|
|user_service|SELECT count(0) FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ?|14|35|7||0|0|3071905|827368|14|1|
|v4_sales|SELECT ifnull(sum(integral), ?) AS points FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id = es.sales_erp_id AND esd.tenant_id = ? AND esd.tenant_app_id = ? WHERE es.member_erp_id = ? AND es.sales_status = ? AND es.is_sales = ? AND esd.sales_type = ? AND es.tenant_id = ? AND es.tenant_app_id = ?|14|24|2||0|0|232013|22396|14|1|
|tenant|SELECT count(*) AS amount FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? AND maintain_employee_id = ? AND create_time <= ?|14|19|2||0|0|101586|11321|14|1|
|youzan|SELECT id, merchant_id, merchant_shop_id, sync_type, api_name , api_request, api_response, status, error_msg, retry_num , create_time, update_time FROM weimob_platform_sync_log WHERE status = ? AND sync_type IN (?) AND retry_num < ?|14|16|1||0|0|1578388|112742|0|0|
|corpwx|UPDATE external_user SET un_assign_flag = ? WHERE tenant_id = ? AND status = ? AND un_assign_flag = ?|14|33|7||0|0|428506|57346|0|0|
|goods|SELECT count(0) FROM ( SELECT gs.id, gs.category_id, gs.goods_name, gs.style_no, gs.status , gs.thumbnail_img, gs.express_type, gs.take_stock_day, gs.take_remark, gs.express_fee , ifnull(gs.base_sale_number, ?) + ifnull(t1.sales_volume, ?) AS total_sales_volume , ifnull(ifnull(t2.quantity, t3.quantity), ?) AS total_quantity , ifnull(ifnull(t2.price, t3.price), ?) AS min_price , gs.create_time, gs.exchange_money, ifnull(t2.number, ?) AS skuNumber , ifnull(t3.number, ?) AS activitySkuNumber FROM goods.goods gs LEFT JOIN goods.goods_category cg ON gs.category_id = cg.id INNER JOIN goods.goods_up_app t ON gs.id = t.goods_id AND t.tenant_app_id = ? LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(sales_volume) AS sales_volume FROM goods.goods_sku GROUP BY tenant_app_id, goods_id ) t1 ON t.tenant_app_id = t1.tenant_app_id AND t.goods_id = t1.goods_id LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(quantity) AS quantity , min(price) AS price, count(*) AS number FROM goods.goods_sku WHERE activity_id = ? GROUP BY tenant_app_id, goods_id ) t2 ON t.tenant_app_id = t2.tenant_app_id AND t.goods_id = t2.goods_id LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(quantity) AS quantity , min(price) AS price, count(*) AS number FROM goods.goods_sku WHERE activity_id > ? GROUP BY tenant_app_id, goods_id ) t3 ON t.tenant_app_id = t3.tenant_app_id AND t.goods_id = t3.goods_id WHERE 1 = 1 AND gs.topping = ? ) tmp|13|14|1||0|0|1577424|122354|13|1|
|tenant|SELECT count(0) FROM ( SELECT sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, ey.employee_name AS maintainEmployeeName , sg.last_maintain_date, ws.shop_name AS createShopName, sg.status, sg.create_time, t1.employee_name AS createEmployeeName , sg.finish_date, sg.fail_type, gs.sales_id, gs.sales_no, w1.shop_name AS salesShopName , gs.sales_date, gs.product_name, gs.product_quantity, gs.amount AS salesAmount , if(sg.status = ?, CASE  WHEN sg.fail_type = ? THEN ? WHEN sg.fail_type = ? THEN ? ELSE ifnull(emp.employee_name, ?) END, ?) AS operFailEmployeeName FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id LEFT JOIN tenant_wechatapp_shop ws ON sg.create_shop_id = ws.id LEFT JOIN employee t1 ON sg.create_employee_id = t1.id LEFT JOIN sneak_guest_sales gs ON sg.tenant_app_id = gs.tenant_app_id AND sg.id = gs.sneak_guest_id LEFT JOIN tenant_wechatapp_shop w1 ON gs.shop_id = w1.id LEFT JOIN tenant.sneak_guest_maintain gm ON gm.sneak_guest_id = sg.id AND gm.event_type = ? LEFT JOIN employee emp ON gm.employee_id = emp.id WHERE sg.tenant_app_id = ? ORDER BY sg.id DESC ) tmp_count|13|67|9||0|0|9609748|815009|13|1|
|employee|SELECT count(*) FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND status = ? AND finish_time BETWEEN ? AND ?|13|17|1||0|0|81196|6932|13|1|
|tenant|SELECT esd.id, esd.sales_erp_id, es.employee_name, esd.product_barcode, es.sales_no , es.member_erp_id, esd.category_name, es.sales_date, esd.category_erp_id, esd.product_name , esd.cert_no, esd.amount_pay, esd.sales_index , ifnull(ee.not_add_value_plan, ?) AS not_add_value_plan FROM erp_sales_detail esd JOIN erp_sales es ON es.tenant_id = esd.tenant_id AND es.tenant_wechatapp_id = esd.tenant_wechatapp_id AND es.sales_erp_id = esd.sales_erp_id LEFT JOIN erp_sales_extend ee ON ee.tenant_id = es.tenant_id AND es.tenant_wechatapp_id = ee.tenant_wechatapp_id AND es.sales_erp_id = ee.sales_erp_id AND esd.sales_index = ee.sales_index WHERE esd.tenant_id = ? AND es.sales_status = ? AND es.tenant_wechatapp_id = ? AND esd.product_barcode = ? ORDER BY es.sales_date DESC|12|39|7||0|0|275629|31768|52613|6010|
|tenant|SELECT sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, sg.maintain_level , sg.maintain_employee_id, sg.create_time, sg.last_maintain_date, ey.employee_name AS maintainEmployeeName, sg.status , sg.finish_date, sg.next_maintain_date FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND sg.maintain_employee_id = ? AND sg.status = ? ORDER BY sg.id DESC LIMIT ?, ?|11|25|8||0|0|6258124|636280|63|10|
|v4_employee|SELECT ? AS task_type, t1.id AS invite_task_id, t1.name , ifnull(t2.undo_count, ?) AS undo_count, t1.invite_time AS invite_task_start_time , ifnull(t1.interrupt_time, t1.end_time) AS invite_task_end_time FROM task_invite_task_template t1 LEFT JOIN ( SELECT t.task_template_id AS id , sum(if(t.finish_time IS NULL, ?, ?)) AS undo_count FROM task_task t WHERE t.task_type = ? AND t.`status` = ? AND t.end_time > ? AND t.shop_id = ? AND t.employee_id = ? AND t.tenant_id = ? AND t.tenant_app_id = ? GROUP BY t.task_template_id ) t2 ON t1.id = t2.id WHERE t1.status IN (?) AND t1.tenant_id = ? AND t1.tenant_app_id = ? ORDER BY t1.id DESC|11|14|1||0|0|70925|8539|55|5|
|tenant|SELECT e.id, e.employee_name FROM ( SELECT DISTINCT sgm.employee_id FROM tenant.sneak_guest sg JOIN tenant.sneak_guest_maintain sgm ON sgm.sneak_guest_id = sg.id WHERE sg.tenant_id = ? AND sg.tenant_app_id = ? AND sg.update_shop_id = ? AND sgm.event_type IN (?) AND (sg.fail_type IS NULL OR sg.fail_type = ?) AND sgm.create_time BETWEEN ? AND ? ) t JOIN tenant.employee e ON e.id = t.employee_id|11|18|2||0|0|315426|37342|70|9|
|user_service|SELECT t1.id, t1.user_id AS userId, t1.user_name AS userName, t1.sex, t1.mobile_no AS mobileNo , t1.head_img_url AS headImg FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? JOIN user_service.user_employee ue ON t1.tenant_id = ue.tenant_id AND t1.tenant_app_id = ue.tenant_wechatapp_id AND t1.user_id = ue.user_id AND ue.employee_id = ? AND ue.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? ORDER BY ue.update_time DESC, t1.id DESC LIMIT ?|11|16|2||0|0|103062|16078|110|10|
|order|SELECT count(0) FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ?|11|16|2||0|0|827295|105708|11|1|
|employee|SELECT id, tenant_id, tenant_app_id, shop_id, employee_id , user_id, external_user_id, mobile_no, scene, status , begin_time, expire_time, create_time, update_time, directional_task_id , member_erp_id, finish_time, md5_str, tenant_open_id, data FROM backlog_system WHERE tenant_app_id = ? AND scene = ? AND status = ? AND create_time BETWEEN ? AND ?|11|26|8||0|0|3754944|493471|656|251|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id = es.id AND wca.tenant_id = ? AND wca.tenant_app_id = ? LEFT JOIN v4_sales.warranty w ON w.sales_id = es.id AND w.tenant_id = ? AND w.tenant_app_id = ? WHERE is_sales = ? AND sales_status = ? AND (es.sales_no LIKE concat(?, ?) OR es.member_erp_id = ?) AND es.tenant_id = ? AND es.tenant_app_id = ?|10|27|4||0|0|4599705|494374|10|1|
|user_service|SELECT count(0) FROM user_service.tenant_member tm JOIN user_service.tenant_member_info tmi ON tm.tenant_id = tmi.tenant_id AND tm.id = tmi.id LEFT JOIN user_service.user_employee t3 ON tm.user_id = t3.user_id AND tm.tenant_id = t3.tenant_id AND tm.tenant_app_id = t3.tenant_wechatapp_id WHERE t3.id IS NULL AND tmi.shop_id = ? AND tmi.tenant_id = ? AND tmi.tenant_app_id = ?|10|18|2||0|0|516885|197561|10|1|
|order|SELECT count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ?|10|14|2||0|0|795918|105708|10|1|
|v4_sales|SELECT count(es.id) FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id = es.id AND wca.tenant_id = ? AND wca.tenant_app_id = ? LEFT JOIN v4_sales.warranty w ON w.sales_id = es.id AND w.tenant_id = ? AND w.tenant_app_id = ? WHERE es.sales_status = ? AND is_sales = ? AND es.sales_date >= ? AND es.employee_erp_id = ? AND dept_erp_id = ? AND w.id IS NULL AND es.tenant_id = ? AND es.tenant_app_id = ?|10|12|1||0|0|18692|2935|10|1|
|v4_sales|SELECT w.id, es.dept_erp_id AS shopId, es.employee_erp_id AS employeeId, w.create_time, w.warranty_no FROM v4_sales.warranty w JOIN v4_sales.erp_sales es ON es.id = w.sales_id AND es.tenant_id = ? AND es.tenant_app_id = ? WHERE w.member_id IN (?) AND is_disable = ? AND w.tenant_id = ? AND w.tenant_app_id = ? ORDER BY w.create_time DESC LIMIT ?|10|18|3||0|0|1256462|143893|22|5|
|user_service|SELECT count(0) FROM user_service.tenant_member tm WHERE tm.tenant_id = ? AND tm.tenant_app_id = ? AND (tm.user_name LIKE CONCAT(?, ?, ?) OR tm.mobile_no = ?)|10|17|3||0|0|4354092|455703|10|1|
|v4_user|SELECT id, member_id, external_user_id, serial_number, checkin_shop_id , checkin_employee_id, checkin_employee_name, checkin_time, maintain_shop_id, maintain_employee_id , maintain_employee_name, first_maintain_time, last_maintain_time, next_maintain_time, maintain_num , intention_num, latest_intention, status, finish_time, finish_shop_id , deal_employee_id, deal_employee_name, deal_sale_amount, fail_employee_id, fail_employee_name , fail_reason, remark, sex, cutomer_grade, maintain_level , tenant_id, tenant_app_id, create_time, update_time FROM potential_customer WHERE (member_id = ? OR external_user_id = ?) AND status IN (?) AND tenant_id = ? AND tenant_app_id = ?|9|13|2||0|0|107077|21947|3|1|
|tenant|SELECT sp.id AS shopId, sp.shop_name AS shopName , ifnull(sum(tt.maintainCount), ?) AS maintainCount , ifnull(sum(tt.maintainNum), ?) AS maintainNum , ifnull(sum(tt.successNum), ?) AS successNum , ifnull(sum(tt.failNum), ?) AS failNum , ifnull(sum(tt.saleMoney), ?) AS saleMoney FROM tenant.tenant_wechatapp_shop sp LEFT JOIN ( SELECT g.create_shop_id AS shop_id, count(1) AS maintainCount, count(DISTINCT t.sneak_guest_id) AS maintainNum , ? AS successNum, ? AS failNum, ? AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id = g.id WHERE g.tenant_app_id = ? AND (g.fail_type IS NULL OR g.fail_type = ?) AND t.event_type IN (?) AND t.create_time >= ? AND t.create_time < ? GROUP BY g.create_shop_id UNION ALL SELECT g.create_shop_id AS shop_id, ? AS maintainCount, ? AS maintainNum, count(DISTINCT t.sneak_guest_id) AS successNum , ? AS failNum, sum(sgs.`amount`) AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id = g.id JOIN tenant.sneak_guest_sales sgs ON g.id = sgs.sneak_guest_id WHERE g.tenant_app_id = ? AND t.event_type IN (?) AND t.create_time >= ? AND t.create_time < ? GROUP BY g.create_shop_id UNION ALL SELECT g.create_shop_id AS shop_id, ? AS maintainCount, ? AS maintainNum, ? AS successNum , count(DISTINCT t.sneak_guest_id) AS failNum, ? AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id = g.id WHERE g.tenant_app_id = ? AND g.fail_type = ? AND t.event_type IN (?) AND t.create_time >= ? AND t.create_time < ? GROUP BY g.create_shop_id ) tt ON sp.id = tt.shop_id WHERE sp.status = ? AND sp.tenant_wechatapp_id = ? GROUP BY sp.id, sp.shop_name ORDER BY sp.id|9|11|1||0|0|8557564|1001692|241|33|
|v4_sales|SELECT count(*) FROM v4_sales.erp_sales WHERE employee_erp_id = ? AND sales_status = ? AND is_sales = ? AND tenant_id = ? AND tenant_app_id = ?|9|11|1||0|0|28424|5434|9|1|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE member_id = ? AND scene = ? AND scene_id = ? AND tenant_id = ? AND tenant_app_id = ?|8|11|2||0|0|828291|123616|8|1|
|coupon_service|SELECT * FROM coupon_service.coupon_can_give WHERE coupon_id = ? LIMIT ?|8|11|2||0|0|1972053|249972|8|1|
|warranty_service|SELECT count(*) FROM warranty WHERE user_id = ? AND tenant_wechatapp_id = ? AND is_disable = ?|8|55|11||0|0|67803|10702|8|1|
|tenant|SELECT sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, sg.maintain_level , sg.maintain_employee_id, sg.create_time, sg.last_maintain_date, ey.employee_name AS maintainEmployeeName, sg.status , sg.finish_date, sg.next_maintain_date FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND sg.maintain_employee_id = ? AND sg.next_maintain_date >= ? AND sg.next_maintain_date <= ? AND sg.status = ? ORDER BY sg.id DESC LIMIT ?, ?|7|19|7||0|0|4451769|636213|20|7|
|tenant|SELECT sum(tt.maintainCount) AS maintainCount, sum(tt.maintainNum) AS maintainNum , sum(tt.successNum) AS successNum, sum(tt.failNum) AS failNum , sum(tt.saleMoney) AS saleMoney FROM ( SELECT count(1) AS maintainCount, count(DISTINCT t.sneak_guest_id) AS maintainNum, ? AS successNum , ? AS failNum, ? AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id = g.id WHERE g.tenant_app_id = ? AND (g.fail_type IS NULL OR g.fail_type = ?) AND t.event_type IN (?) AND t.create_time >= ? AND t.create_time < ? UNION ALL SELECT ? AS maintainCount, ? AS maintainNum, count(DISTINCT t.sneak_guest_id) AS successNum, ? AS failNum , sum(sgs.`amount`) AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id = g.id JOIN tenant.sneak_guest_sales sgs ON g.id = sgs.sneak_guest_id WHERE g.tenant_app_id = ? AND t.event_type IN (?) AND t.create_time >= ? AND t.create_time < ? UNION ALL SELECT ? AS maintainCount, ? AS maintainNum, ? AS successNum, count(DISTINCT t.sneak_guest_id) AS failNum , ? AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id = g.id WHERE g.tenant_app_id = ? AND g.fail_type = ? AND t.event_type IN (?) AND t.create_time >= ? AND t.create_time < ? ) tt|7|17|5||0|0|5587569|808360|7|1|
|order|SELECT max(create_time) FROM `order`.order_operator_log WHERE tenant_wechatapp_id = ? AND order_id = ?|7|35|11||0|0|6196597|885686|7|1|
|tenant|SELECT count(0) FROM ( SELECT es.id, es.sales_no, es.sales_date, es.sales_erp_id, es.amount , ifnull(shop.shop_name, ed.dept_name) AS dept_name, es.employee_name FROM tenant.erp_sales es JOIN tenant.erp_department ed ON ed.dept_erp_id = es.dept_erp_id AND ed.tenant_id = ? LEFT JOIN tenant.tenant_wechatapp_shop shop ON shop.dept_erp_id = ed.dept_erp_id AND shop.tenant_wechatapp_id = ? WHERE es.member_erp_id = ? AND es.tenant_id = ? AND es.tenant_wechatapp_id = ? AND es.sales_status = ? AND NOT EXISTS ( SELECT i.id FROM tenant.erp_sales_ignore i WHERE i.tenant_id = ? AND i.tenant_app_id = ? AND es.sales_erp_id = i.erp_sales_id ) ) table_count|6|11|5||0|0|27980081|18529215|6|1|
|coupon_service|SELECT count(0) FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ? AND cu.coupon_name LIKE CONCAT(CONCAT(?, ?), ?)|6|239|53||0|0|1561580|260295|6|1|
|v4_sales|SELECT ifnull(count(*), ?) AS sales_count , ifnull(sum(amount), ?) AS sales_amount FROM erp_sales WHERE member_erp_id IN (?) AND is_sales = ? AND sales_status = ? AND tenant_id = ? AND tenant_app_id = ?|6|9|2||0|0|52845|8811|6|1|
|user_service|SELECT * FROM user_service.user_employee WHERE employee_erp_id = ? AND tenant_id = ? AND tenant_wechatapp_id = ? AND date_format(update_time, '%Y-%m-%d %H') = date_format(now(), '%Y-%m-%d %H')|6|19|4||0|0|388465|98072|2867|1366|
|tenant|SELECT count(DISTINCT concat(dept_erp_id, ?, sales_date)) AS total FROM tenant.erp_sales WHERE tenant_id = ? AND tenant_wechatapp_id = ? AND member_erp_id = ? AND sales_status = ? AND is_sales = ?|6|27|6||0|0|146440|29012|6|1|
|v4_coupon|SELECT * FROM v4_coupon.coupon WHERE coupon_no = ? LIMIT ?|6|11|3||0|0|1404720|234503|6|1|
|v4_sales|SELECT count(DISTINCT es.id) FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id = es.sales_erp_id AND esd.sales_type IN (?) AND member_erp_id IN (?) AND esd.tenant_id = ? AND esd.tenant_app_id = ? WHERE es.tenant_id = ? AND es.tenant_app_id = ?|6|13|3||0|0|39336|8632|6|1|
|goods|SELECT tmp.id, tmp.category_id, tmp.goods_name, tmp.style_no, tmp.status , tmp.thumbnail_img, tmp.express_type, tmp.take_stock_day, tmp.take_remark, tmp.express_fee , tmp.total_quantity, tmp.total_sales_volume, tmp.min_price, tmp.create_time, tmp.exchange_money , skuNumber FROM ( SELECT gs.id, gs.category_id, gs.goods_name, gs.style_no, gs.status , gs.thumbnail_img, gs.express_type, gs.take_stock_day, gs.take_remark, gs.express_fee , ifnull(gs.base_sale_number, ?) + ifnull(t1.sales_volume, ?) AS total_sales_volume , ifnull(ifnull(t2.quantity, t3.quantity), ?) AS total_quantity , ifnull(ifnull(t2.price, t3.price), ?) AS min_price , gs.create_time, gs.exchange_money, ifnull(t2.number, ?) AS skuNumber , ifnull(t3.number, ?) AS activitySkuNumber FROM goods.goods gs LEFT JOIN goods.goods_category cg ON gs.category_id = cg.id INNER JOIN goods.goods_up_app t ON gs.id = t.goods_id AND t.tenant_app_id = ? LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(sales_volume) AS sales_volume FROM goods.goods_sku GROUP BY tenant_app_id, goods_id ) t1 ON t.tenant_app_id = t1.tenant_app_id AND t.goods_id = t1.goods_id LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(quantity) AS quantity , min(price) AS price, count(*) AS number FROM goods.goods_sku WHERE activity_id = ? GROUP BY tenant_app_id, goods_id ) t2 ON t.tenant_app_id = t2.tenant_app_id AND t.goods_id = t2.goods_id LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(quantity) AS quantity , min(price) AS price, count(*) AS number FROM goods.goods_sku WHERE activity_id > ? GROUP BY tenant_app_id, goods_id ) t3 ON t.tenant_app_id = t3.tenant_app_id AND t.goods_id = t3.goods_id WHERE 1 = 1 AND gs.topping = ? ) tmp ORDER BY tmp.create_time DESC LIMIT ?|6|7|1||0|0|726818|121297|42|10|
|v4_sales|SELECT es.id AS salesId, es.sales_no, es.sales_date, es.member_erp_id AS memberId, w.warranty_no FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id = es.id AND wca.tenant_id = ? AND wca.tenant_app_id = ? LEFT JOIN v4_sales.warranty w ON w.sales_id = es.id AND w.tenant_id = ? AND w.tenant_app_id = ? WHERE is_sales = ? AND sales_status = ? AND (es.sales_no LIKE concat(?, ?) OR es.member_erp_id = ?) AND es.tenant_id = ? AND es.tenant_app_id = ? ORDER BY es.sales_date DESC, es.id DESC LIMIT ?|5|11|3||0|0|2128311|494378|11|3|
|gift_mail|SELECT ifnull(count(1), ?) AS amount FROM trade WHERE tenant_wechatapp_id = ? AND user_id = ? AND order_status IN (?)|5|7|2||0|0|50853|12400|5|1|
|value_added|SELECT ? AS limitDayType, t.tenant_wechatapp_id AS tenantAppId, t.user_id AS userId, min(ue.employee_erp_id) AS employee_erp_id , ue.dept_erp_id, GROUP_CONCAT(t.product_barcode ORDER BY product_barcode ASC) AS productCode, GROUP_CONCAT(t.product_name ORDER BY product_barcode ASC) AS productName FROM value_added_user t INNER JOIN value_added_user_extend ue ON t.id = ue.id WHERE t.tenant_wechatapp_id = ? AND t.state = ? AND t.start_add_time >= date_add(DATE_FORMAT(?, '%Y-%m-%d'), INTERVAL ? * (t.add_days - ?) DAY) AND t.start_add_time < date_add(DATE_FORMAT(?, '%Y-%m-%d'), INTERVAL ? * (t.add_days - ?) + ? DAY) GROUP BY t.tenant_wechatapp_id, t.user_id, ue.dept_erp_id|5|12|7||0|0|1168847|420242|212|76|
|order|SELECT id FROM order_operator_log WHERE tenant_wechatapp_id = ? AND order_id = ? AND (src_child_status = ? AND dst_child_status = ?) ORDER BY create_time DESC LIMIT ?|5|25|5||0|0|4426050|885495|0|0|
|employee|UPDATE backlog_system SET status = ?, finish_time = now() WHERE tenant_app_id = ? AND scene = ?|5|14|6||0|0|4617669|1143048|0|0|
|goods|SELECT * FROM goods_take_shop WHERE tenant_id = ? AND goods_id = ? AND activity_id = ? ORDER BY create_time DESC|5|7|2||0|0|512956|102630|186|76|
|coupon_service|SELECT count(0) FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ? AND cu.coupon_type = ?|4|97|43||0|0|357768|89442|4|1|
|v4_employee|SELECT COUNT(*) AS total FROM task_task t JOIN employee e ON e.employee_id = t.employee_id AND e.shop_id = t.shop_id AND e.tenant_id = ? AND e.tenant_app_id = ? LEFT JOIN ( SELECT task_id, GROUP_CONCAT(file_url SEPARATOR '|') AS task_attaches FROM task_task_attach WHERE tenant_id = ? AND tenant_app_id = ? GROUP BY task_id ) tta ON t.id = tta.task_id WHERE t.status = ? AND system_task_type = ? AND t.shop_id = ? AND finish_time >= ? AND finish_time < ? AND t.employee_id = ? AND t.tenant_id = ? AND t.tenant_app_id = ?|4|10|2||0|0|473899|118476|4|1|
|v4_coupon|SELECT * FROM v4_coupon.sales_give_coupon_record WHERE put_id = ? AND sales_id = ? AND rule_id = ? AND tenant_id = ? AND tenant_app_id = ? LIMIT ?|4|4|1||0|0|366761|91777|0|0|
|coupon_service|SELECT cu.id, cu.coupon_name, cu.coupon_type, cu.coupon_no, cu.source AS couponChannel , cu.coupon_state, ce.user_name, ce.creator_user_name AS creatorName , if(coupon_type IN (?), cu.face_value, round(cu.face_value / ?, ?)) AS faceValue , cu.begin_time, cu.end_time, ce.remark, ce.mobile_no, ce.creator_mobile_no , cu.create_time, cu.user_id , round(cu.balance / ?, ?) AS balance , ce.source_user_id, ce.source_user_type, ce.member_source_shop FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ? AND cu.coupon_name LIKE CONCAT(CONCAT(?, ?), ?) LIMIT ?|4|42|15||0|0|1029616|257404|80|20|
|coupon_service|SELECT count(0) FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ? AND cu.coupon_no = ?|4|70|26||0|0|510876|176849|4|1|
|user_service|SELECT count(0) FROM user_service.tenant_member tm JOIN user_service.tenant_member_info tmi ON tmi.tenant_id = ? AND tmi.tenant_app_id = ? AND tm.id = tmi.id WHERE tm.tenant_id = ? AND tm.tenant_app_id = ? AND (tm.user_name LIKE concat(?, ?, ?) OR tm.mobile_no = ?)|4|6|2||0|0|524321|273655|4|1|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ...|3|10|3||0|0|2471062|869284|1303|706|
|authorization_service|update user_login_token set status=? where login_token in (|3|6|4||0|0|4870|3704|0|0|
|employee|SELECT DATE_FORMAT(t.create_time, '%d') AS monthDay , ifnull(sum(task_amount), ?) AS shouldMarkNum , ifnull(sum(if(t.`status` = ?, finish_amount, ?)), ?) AS markLabelNum FROM backlog t WHERE t.tenant_id = ? AND t.tenant_app_id = ? AND t.employee_id IN (?) AND t.scene = ? AND t.begin_time >= ? AND t.expire_time < ? GROUP BY DATE_FORMAT(t.create_time, '%d')|3|12|8||0|0|43376|20596|64|31|
|v4_employee|SELECT t.id AS task_id, t.employee_id, e.employee_name, t.member_id, t.member_name , t.finish_time, t.plan_arrival_shop_time, tta.task_attaches FROM task_task t JOIN employee e ON e.employee_id = t.employee_id AND e.shop_id = t.shop_id AND e.tenant_id = ? AND e.tenant_app_id = ? LEFT JOIN ( SELECT task_id, GROUP_CONCAT(file_url SEPARATOR '|') AS task_attaches FROM task_task_attach WHERE tenant_id = ? AND tenant_app_id = ? GROUP BY task_id ) tta ON t.id = tta.task_id WHERE t.status = ? AND system_task_type = ? AND t.shop_id = ? AND finish_time >= ? AND finish_time < ? AND t.employee_id = ? AND t.tenant_id = ? AND t.tenant_app_id = ? ORDER BY t.finish_time DESC, t.id DESC LIMIT ?|3|7|3||0|0|355429|118479|5|3|
|order|SELECT od.id, od.order_no AS orderNo, od.status, od.take_type AS takeType, od.create_time AS createTime , od.remark, od.total_fee AS totalFee, od.freight_fee AS freightFee, od.discount_fee AS discountFee, od.take_id AS takeId , od.payment_fee AS paymentFee, dt.product_id AS productId, dt.price, dt.quantity, dt.sku_id AS skuId , dt.art_no AS artNo, dt.image_url AS imageUrl, dt.product_name AS productName, dt.take_remark AS takeRemark, dt.take_day AS takeDay , od.product_fee AS productFee, ad.user_name AS receiveName, ad.mobile_no AS mobileNo, ad.shop_name AS shopName, ad.address , ad.express_no AS expressNo, ad.express_company AS expressCompany, od.user_name AS userName, od.update_time AS updateTime, od.child_status AS childStatus , od.finish_type AS finishType, od.receive_time AS receiveTime, od.user_id AS userId, od.mobile_no AS buyMobileNo, od.edit_fee_flag AS editFeeFlag , dt.spec AS spec, od.source, od.take_shop_id, od.take_shop_name, od.take_employee_user_id , od.take_employee_user_name, od.activity_type, od.activity_id, od.offline_payment_fee, od.online_wait_fee , od.offline_wait_fee, od.pay_way, od.take_employee_id, od.pay_id FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND (od.mobile_no = ? OR ad.mobile_no = ?) AND (od.status = ?) ORDER BY od.create_time DESC LIMIT ?|3|5|2||0|0|255563|85195|4|2|
|activity_service|SELECT id, tenant_id, tenant_app_id, activity_id, user_id , day, continuous_day, has_subscribe, user_name, create_time , update_time, first_sign_time, mobile_no FROM online_sign_user WHERE tenant_app_id = ? AND user_id = ?|3|3|1||0|0|363254|121093|1|1|
|tenant|SELECT count(0) FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND EXISTS ( SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id = sgm.sneak_guest_id AND sgm.event_type = ? AND sgm.intention_info REGEXP ? ) AND sg.status = ?|3|21|15||0|0|71916|23972|3|1|
|goods|SELECT tmp.id, tmp.category_id, tmp.goods_name, tmp.style_no, tmp.status , tmp.thumbnail_img, tmp.express_type, tmp.take_stock_day, tmp.take_remark, tmp.express_fee , tmp.total_quantity, tmp.total_sales_volume, tmp.min_price, tmp.create_time, tmp.exchange_money , skuNumber FROM ( SELECT gs.id, gs.category_id, gs.goods_name, gs.style_no, gs.status , gs.thumbnail_img, gs.express_type, gs.take_stock_day, gs.take_remark, gs.express_fee , ifnull(gs.base_sale_number, ?) + ifnull(t1.sales_volume, ?) AS total_sales_volume , ifnull(ifnull(t2.quantity, t3.quantity), ?) AS total_quantity , ifnull(ifnull(t2.price, t3.price), ?) AS min_price , gs.create_time, gs.exchange_money, ifnull(t2.number, ?) AS skuNumber , ifnull(t3.number, ?) AS activitySkuNumber FROM goods.goods gs LEFT JOIN goods.goods_category cg ON gs.category_id = cg.id INNER JOIN goods.goods_up_app t ON gs.id = t.goods_id AND t.tenant_app_id = ? LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(sales_volume) AS sales_volume FROM goods.goods_sku GROUP BY tenant_app_id, goods_id ) t1 ON t.tenant_app_id = t1.tenant_app_id AND t.goods_id = t1.goods_id LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(quantity) AS quantity , min(price) AS price, count(*) AS number FROM goods.goods_sku WHERE activity_id = ? GROUP BY tenant_app_id, goods_id ) t2 ON t.tenant_app_id = t2.tenant_app_id AND t.goods_id = t2.goods_id LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(quantity) AS quantity , min(price) AS price, count(*) AS number FROM goods.goods_sku WHERE activity_id > ? GROUP BY tenant_app_id, goods_id ) t3 ON t.tenant_app_id = t3.tenant_app_id AND t.goods_id = t3.goods_id WHERE 1 = 1 AND (cg.id = ? OR cg.parent_id = ?) AND gs.topping = ? ) tmp ORDER BY tmp.create_time DESC LIMIT ?|3|3|1||0|0|363219|121073|30|10|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in (|3|13|5||0|0|3089903|1327050|1410|589|
|tenant|SELECT count(0) FROM ( SELECT sg.employee_id AS employeeId, sg._actual AS actualNum, sg._maintain AS continueNum, sg._failure AS failNum, sg._success AS dealNum , e.employee_name, e.head_img_url FROM ( SELECT sgm.employee_id, count(DISTINCT sneak_guest_id) AS _actual, sum(_maintain) AS _maintain , sum(_success) AS _success, sum(_failure) AS _failure , max(sgm.create_time) AS create_time FROM ( SELECT sgm.employee_id, sneak_guest_id , if(event_type = ?, ?, ?) AS _maintain , if(event_type = ?, ?, ?) AS _success , if(event_type = ?, ?, ?) AS _failure , sgm.create_time AS create_time FROM tenant.sneak_guest_maintain sgm JOIN tenant.sneak_guest sg ON sgm.sneak_guest_id = sg.id WHERE sgm.tenant_id = ? AND sgm.tenant_app_id = ? AND sgm.shop_id = ? AND sgm.create_time BETWEEN ? AND ? AND sgm.event_type IN (?) AND (sg.fail_type IS NULL OR sg.fail_type = ?) ) sgm WHERE 1 = 1 GROUP BY sgm.employee_id ) sg JOIN tenant.employee e ON e.id = sg.employee_id ORDER BY sg.create_time DESC ) tmp_count|3|47|25||0|0|181520|74574|3|1|
|gift_mail|SELECT count(0) FROM ( SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY p.tag_price ASC, p.id DESC ) tmp_count|3|4|1||0|0|21786|7262|3|1|
|employee|SELECT count(DISTINCT t.user_id) AS shouldMarkNum , count(DISTINCT if(t.`status` = ?, t.user_id, NULL)) AS markLabelNum FROM backlog t WHERE t.tenant_id = ? AND t.tenant_app_id = ? AND t.employee_id IN (?) AND t.scene = ? AND t.begin_time >= ? AND t.expire_time < ?|3|12|8||0|0|43248|20592|3|1|
|coupon_service|SELECT count(0) FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id JOIN ( SELECT coupon_id FROM coupon_service.coupon_write_off_log wol WHERE wol.tenant_id = ? AND wol.tenant_app_id = ? AND wol.state = ? AND wol.shop_id = ? GROUP BY coupon_id ) w ON w.coupon_id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ? AND cu.template_id = ?|3|18|16||0|0|382196|127400|3|1|
|tenant|SELECT count(0) FROM ( SELECT shop.*, dept.dept_name, count(es.id) AS employeesCount FROM tenant_wechatapp_shop shop LEFT JOIN erp_department dept ON shop.dept_erp_id = dept.dept_erp_id AND shop.tenant_id = dept.tenant_id LEFT JOIN employee_shop es ON shop.id = es.shop_id AND es.status IN (?) WHERE shop.tenant_wechatapp_id = ? AND shop.status IN (?) GROUP BY shop.id ) table_count|3|4|1||0|0|251633|83931|3|1|
|v4_user|SELECT id, member_id, external_user_id, serial_number, checkin_shop_id , checkin_employee_id, checkin_employee_name, checkin_time, maintain_shop_id, maintain_employee_id , maintain_employee_name, first_maintain_time, last_maintain_time, next_maintain_time, maintain_num , intention_num, latest_intention, status, finish_time, finish_shop_id , deal_employee_id, deal_employee_name, deal_sale_amount, fail_employee_id, fail_employee_name , fail_reason, remark, sex, cutomer_grade, maintain_level , tenant_id, tenant_app_id, create_time, update_time FROM potential_customer WHERE member_id = ? AND status IN (?) AND tenant_id = ? AND tenant_app_id = ?|3|4|2||0|0|65805|21945|1|1|
|coupon_service|SELECT count(0) FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id JOIN ( SELECT coupon_id FROM coupon_service.coupon_write_off_log wol WHERE wol.tenant_id = ? AND wol.tenant_app_id = ? AND wol.state = ? AND wol.create_time >= ? AND wol.create_time <= ? GROUP BY coupon_id ) w ON w.coupon_id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ? AND cu.coupon_type = ?|3|6|2||0|0|33115|12755|3|1|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY p.tag_price ASC, p.id DESC LIMIT ?, ?|3|6|3||0|0|24777|8269|18|6|
|v4_sales|SELECT id, warranty_detail_id, media_id, wx_img_url, img_url , tenant_id, tenant_app_id, create_time, update_time FROM warranty_detail_img WHERE warranty_detail_id IN (?) AND tenant_id = ? AND tenant_app_id = ?|2|2|1||0|0|64667|32433|1|1|
|authorization_service|SELECT id, platform_user_id, user_id, wx_user_id, employee_id , shop_id, tenant_id, tenant_wx_app_id, account_id, login_way , login_code, login_token, roles, status, expire_time , create_time, update_time, login_ip, login_time, login_data , wx_app_user_id FROM user_login_token WHERE tenant_id = ? AND employee_id = ? AND status = ?|2|3|1||0|0|4406|3704|4406|3704|
|order|SELECT count(0) FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND (od.mobile_no = ? OR ad.mobile_no = ?) AND (od.status = ?)|2|2|1||0|0|149910|74961|2|1|
|gift_mail|SELECT tt.shop_id FROM gift_mail.trade t JOIN gift_mail.trade_take tt ON tt.tenant_wechatapp_id = t.tenant_wechatapp_id AND tt.trade_id = t.id WHERE t.tenant_id = ? AND t.tenant_wechatapp_id = ? AND tt.shop_id IS NOT NULL|2|2|1||0|0|21802|11026|10897|5509|
|tenant|SELECT shop.*, dept.dept_name, count(es.id) AS employeesCount FROM tenant_wechatapp_shop shop LEFT JOIN erp_department dept ON shop.dept_erp_id = dept.dept_erp_id AND shop.tenant_id = dept.tenant_id LEFT JOIN employee_shop es ON shop.id = es.shop_id AND es.status IN (?) WHERE shop.tenant_wechatapp_id = ? AND shop.status IN (?) GROUP BY shop.id ORDER BY shop.create_time DESC LIMIT ?|2|2|1||0|0|167766|83883|40|20|
|employee|SELECT id, scene, employee_id, member_user_name AS userName, finish_time , status FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND expire_time BETWEEN ? AND ? AND status != ? AND scene NOT IN (?) ORDER BY id DESC LIMIT ?, ?|2|8|5||0|0|589648|294825|8|4|
|order|SELECT count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND od.activity_id = ?|2|2|1||0|0|42726|21376|2|1|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY p.tag_price ASC, p.id DESC LIMIT ?|2|5|3||0|0|16478|8239|12|6|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ...|2|5|2||0|0|1188148|640057|797|436|
|user_service|SELECT obj.id, obj.shop_id, obj.total , CASE  WHEN @rowtotal = obj.total THEN @rownum WHEN @rowtotal := obj.total THEN @rownum := @rownum + ? WHEN @rowtotal = ? THEN @rownum := @rownum + ? END AS rank_idx FROM ( SELECT us.from_id AS id, us.shop_id, count(1) AS total FROM user_source us WHERE us.tenant_id = ? AND us.tenant_wechatapp_id = ? AND us.create_time >= ? AND us.create_time < ? AND us.source_type = ? AND us.from_id IS NOT NULL AND us.shop_id IS NOT NULL GROUP BY us.from_id, us.shop_id ORDER BY count(1) DESC ) obj, ( SELECT @rownum := ?, @rowtotal := NULL ) r|2|3|2||0|0|15301|13840|239|191|
|wx_gateway|SELECT id, tenant_id, tenant_app_id, wx_template_id, employee_id , busi_id, busi_type, url, push_time, category , title, content, status, retry_amount, remark , create_time, update_time, del_flag FROM wx_template_push WHERE push_time <= ? AND status = ? AND category = ? AND del_flag = ?|2|3|2||0|0|16838|8419|0|0|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY p.tag_price DESC, p.id DESC LIMIT ?|2|3|2||0|0|16478|8239|12|6|
|user_service|select tenant_id, id, tenant_app_id, user_id, shop_id, birthday, birthday_is_lunar, address, memorial_name, memorial_day, memorial_day_is_lunar, interest, grade_id, create_time, update_time from tenant_member_info where tenant_id = ? and tenant_app_id = ? and user_id in (|2|2|1||0|0|5971|3098|5971|3098|
|order|SELECT count(0) FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND od.activity_id = ?|2|2|1||0|0|42726|21376|2|1|
|user_service|SELECT count(0) FROM ( SELECT us.from_id AS id, count(1) AS total FROM user_source us WHERE us.tenant_id = ? AND us.tenant_wechatapp_id = ? AND us.shop_id = ? AND us.source_type = ? AND us.create_time >= ? AND us.create_time < ? AND us.from_id IS NOT NULL AND us.shop_id IS NOT NULL GROUP BY us.from_id ) table_count|2|5|3||0|0|3052|1526|2|1|
|order|SELECT count(0) FROM ( SELECT o.id, o.order_no, o.user_name, o.take_type, o.mobile_no , od.product_name, od.image_url , if(take_shop_id IS NULL, wait_take_shop_id, take_shop_id) AS takeShopId , take_employee_user_name, o.receive_time, o.cancel_time, od.take_start_date, o.refund_start_time AS refundTime , o.user_name AS refundUserName, o.status, oa.express_company, oa.express_no, om.mark FROM `order`.order_info o JOIN `order`.order_detail od ON od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND od.order_id = o.id LEFT JOIN `order`.order_mark om ON om.tenant_id = ? AND om.tenant_app_id = ? AND om.order_id = o.id AND om.status = ? LEFT JOIN `order`.order_address oa ON oa.tenant_id = ? AND oa.tenant_app_id = ? AND oa.order_id = o.id WHERE o.tenant_id = ? AND o.tenant_wechatapp_id = ? AND o.take_type = ? AND (o.wait_take_shop_id = ? OR o.take_shop_id = ?) AND o.status NOT IN (?) ORDER BY o.id ) tmp_count|2|2|1||0|0|23360|11937|2|1|
|coupon_service|SELECT cu.id, cu.coupon_name, cu.coupon_type, cu.coupon_no, cu.source AS couponChannel , cu.coupon_state, ce.user_name, ce.creator_user_name AS creatorName , if(coupon_type IN (?), cu.face_value, round(cu.face_value / ?, ?)) AS faceValue , cu.begin_time, cu.end_time, ce.remark, ce.mobile_no, ce.creator_mobile_no , cu.create_time, cu.user_id , round(cu.balance / ?, ?) AS balance , ce.source_user_id, ce.source_user_type, ce.member_source_shop FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ? AND cu.coupon_no = ? LIMIT ?|2|2|1||0|0|255438|176849|2|1|
|user_service|SELECT obj.id, obj.total , CASE  WHEN @rowtotal = obj.total THEN @rownum WHEN @rowtotal := obj.total THEN @rownum := @rownum + ? WHEN @rowtotal = ? THEN @rownum := @rownum + ? END AS rank_idx FROM ( SELECT us.shop_id AS id, count(1) AS total FROM user_source us WHERE us.tenant_id = ? AND us.tenant_wechatapp_id = ? AND us.create_time >= ? AND us.create_time < ? AND us.source_type = ? AND us.from_id IS NOT NULL AND us.shop_id IS NOT NULL GROUP BY us.shop_id ORDER BY count(1) DESC ) obj, ( SELECT @rownum := ?, @rowtotal := NULL ) r|2|5|3||0|0|3064|1532|16|8|
|v4_coupon|SELECT tenant_id, tenant_app_id, member_id, count(1) AS total FROM v4_coupon.coupon WHERE DATEDIFF(DATE_FORMAT(end_time, '%Y-%m-%d'), DATE_FORMAT(now(), '%Y-%m-%d')) = ? AND coupon_status IN (?) GROUP BY tenant_id, tenant_app_id, member_id|2|4|2||0|0|465608|234854|128|64|
|corpwx|SELECT t.tenant_id AS tenantId, t.wx_user_id AS wxUserId, t.union_id AS wxUnionId, t.user_id AS externalUserId , ifnull(et.raw_external_user_id, t.old_user_id) AS rawExternalUserId, t.corp_user_id AS employeeCorpUserId FROM corpwx.external_user t LEFT JOIN corpwx.external_userid_transform et ON t.tenant_id = et.tenant_id AND t.user_id = et.external_user_id WHERE t.tenant_id = ? AND t.status = ? AND t.user_id IN (?) AND t.un_assign_flag = ?|2|3|2||0|0|570|352|276|171|
|coupon_service|SELECT count(1) FROM coupon_service.coupon_expire_task WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND status = ? AND expire_time > now()|2|2|1||0|0|135852|67926|2|1|
|user_service|SELECT obj.id, obj.total , CASE  WHEN @rowtotal = obj.total THEN @rownum WHEN @rowtotal := obj.total THEN @rownum := @rownum + ? WHEN @rowtotal = ? THEN @rownum := @rownum + ? END AS rank_idx FROM ( SELECT us.from_id AS id, count(1) AS total FROM user_source us WHERE us.tenant_id = ? AND us.tenant_wechatapp_id = ? AND us.shop_id = ? AND us.create_time >= ? AND us.create_time < ? AND us.source_type = ? AND us.from_id IS NOT NULL AND us.shop_id IS NOT NULL GROUP BY us.from_id ORDER BY count(1) DESC ) obj, ( SELECT @rownum := ?, @rowtotal := NULL ) r|2|3|2||0|0|14635|13303|17|12|
|employee|UPDATE backlog SET status = ?, finish_time = now() WHERE tenant_app_id = ? AND employee_id = ? AND status IN (?) AND shop_id = ?|2|2|1||0|0|8007|5385|0|0|
|user_service|SELECT count(1) FROM user_source us WHERE us.tenant_id = ? AND us.tenant_wechatapp_id = ? AND us.shop_id = ? AND us.create_time >= ? AND us.create_time < ? AND us.source_type = ? AND us.from_id IS NOT NULL AND us.shop_id IS NOT NULL|2|5|3||0|0|3016|1508|2|1|
|coupon_service|SELECT count(0) FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ?|2|134|74||0|0|1040998|520500|2|1|
|order|SELECT count(0) FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND dt.product_name LIKE concat(?, ?, ?)|2|9|7||0|0|99563|70482|2|1|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ...|2|5|3||0|0|2153981|1327483|1478|1022|
|tenant|SELECT es.id, es.sales_no, es.sales_date, es.sales_erp_id, es.amount , ifnull(shop.shop_name, ed.dept_name) AS dept_name, es.employee_name FROM tenant.erp_sales es JOIN tenant.erp_department ed ON ed.dept_erp_id = es.dept_erp_id AND ed.tenant_id = ? LEFT JOIN tenant.tenant_wechatapp_shop shop ON shop.dept_erp_id = ed.dept_erp_id AND shop.tenant_wechatapp_id = ? WHERE es.member_erp_id = ? AND es.tenant_id = ? AND es.tenant_wechatapp_id = ? AND es.sales_status = ? AND NOT EXISTS ( SELECT i.id FROM tenant.erp_sales_ignore i WHERE i.tenant_id = ? AND i.tenant_app_id = ? AND es.sales_erp_id = i.erp_sales_id ) ORDER BY es.sales_date DESC LIMIT ?|2|6|5||0|0|20954839|18523135|20|10|
|order|SELECT count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND dt.product_name LIKE concat(?, ?, ?)|2|8|7||0|0|99563|70482|2|1|
|tenant|SELECT sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, sg.maintain_level , sg.maintain_employee_id, sg.create_time, sg.last_maintain_date, ey.employee_name AS maintainEmployeeName, sg.status , sg.finish_date, sg.next_maintain_date FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND sg.maintain_employee_id = ? AND sg.status = ? ORDER BY sg.id DESC LIMIT ?|2|2|1||0|0|1272073|636053|18|9|
|tenant|SELECT count(0) FROM tenant.erp_sales es LEFT JOIN tenant.tenant_wechatapp_shop shop ON shop.tenant_wechatapp_id = es.tenant_wechatapp_id AND shop.dept_erp_id = es.dept_erp_id LEFT JOIN tenant.employee e ON e.tenant_id = es.tenant_id AND e.employee_erp_id = es.employee_erp_id LEFT JOIN tenant.employee_shop esh ON esh.tenant_app_id = es.tenant_wechatapp_id AND esh.employee_id = e.id AND esh.dept_erp_id = es.dept_erp_id WHERE es.tenant_id = ? AND es.tenant_wechatapp_id = ? AND es.dept_erp_id = ? AND es.comment_id > ? AND es.sales_status IN (?) AND es.is_sales = ?|1|1|1||0|0|188827|188827|1|1|
|user_service|SELECT count(0) FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? JOIN user_service.user_employee ue ON t1.tenant_id = ue.tenant_id AND t1.tenant_app_id = ue.tenant_wechatapp_id AND t1.user_id = ue.user_id AND ue.employee_id = ? AND ue.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? AND (t1.mobile_no LIKE concat(?, ?) OR t1.user_name LIKE concat(?, ?, ?))|1|1|1||0|0|1927|1927|1|1|
|goods|SELECT tmp.id, tmp.category_id, tmp.goods_name, tmp.style_no, tmp.status , tmp.thumbnail_img, tmp.express_type, tmp.take_stock_day, tmp.take_remark, tmp.express_fee , tmp.total_quantity, tmp.total_sales_volume, tmp.min_price, tmp.create_time, tmp.exchange_money , skuNumber FROM ( SELECT gs.id, gs.category_id, gs.goods_name, gs.style_no, gs.status , gs.thumbnail_img, gs.express_type, gs.take_stock_day, gs.take_remark, gs.express_fee , ifnull(gs.base_sale_number, ?) + ifnull(t1.sales_volume, ?) AS total_sales_volume , ifnull(ifnull(t2.quantity, t3.quantity), ?) AS total_quantity , ifnull(ifnull(t2.price, t3.price), ?) AS min_price , gs.create_time, gs.exchange_money, ifnull(t2.number, ?) AS skuNumber , ifnull(t3.number, ?) AS activitySkuNumber FROM goods.goods gs LEFT JOIN goods.goods_category cg ON gs.category_id = cg.id INNER JOIN goods.goods_up_app t ON gs.id = t.goods_id AND t.tenant_app_id = ? LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(sales_volume) AS sales_volume FROM goods.goods_sku GROUP BY tenant_app_id, goods_id ) t1 ON t.tenant_app_id = t1.tenant_app_id AND t.goods_id = t1.goods_id LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(quantity) AS quantity , min(price) AS price, count(*) AS number FROM goods.goods_sku WHERE activity_id = ? GROUP BY tenant_app_id, goods_id ) t2 ON t.tenant_app_id = t2.tenant_app_id AND t.goods_id = t2.goods_id LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(quantity) AS quantity , min(price) AS price, count(*) AS number FROM goods.goods_sku WHERE activity_id > ? GROUP BY tenant_app_id, goods_id ) t3 ON t.tenant_app_id = t3.tenant_app_id AND t.goods_id = t3.goods_id WHERE 1 = 1 AND gs.topping = ? ) tmp ORDER BY tmp.create_time DESC LIMIT ?, ?|1|1|1||0|0|122709|122709|10|10|
|goods|DELETE FROM goods_take_shop WHERE goods_id = ? AND tenant_app_id = ? AND activity_id = ?|1|1|1||0|0|102553|102553|0|0|
|export|select od.coupon_id, case o.pay_type when ? then ? when ? then ? when ? then ? when ? then ? else ? end payTypeText from coupon_service.coupon_market_order_detail od join coupon_service.coupon_market_order o on o.tenant_id = ? and o.tenant_app_id = ? and o.id = od.order_id where od.tenant_id = ? and od.tenant_app_id = ? and od.coupon_id in (|1|1|1||0|0|46804|46804|170|170|
|coupon_service|SELECT * FROM coupon_service.coupon WHERE DATEDIFF(DATE_FORMAT(end_time, '%Y-%m-%d'), DATE_FORMAT(now(), '%Y-%m-%d')) = ? AND coupon_state IN (?)|1|196|196||0|0|9708395|9708395|1907|1907|
|v4_user|SELECT id FROM potential_customer WHERE status IN (?) AND next_maintain_time < ? AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|8976|8976|157|157|
|v4_employee|SELECT count(1) AS total_count, count(finish_time) AS finish_count FROM task_task t JOIN task_system_task_template t2 ON t.task_template_id = t2.id AND t2.status = ? AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t.task_type = ? AND t.status = ? AND t.start_time >= ? AND t.start_time < ? AND t.shop_id = ? AND t.tenant_id = ? AND t.tenant_app_id = ?|1|1|1||0|0|3026|3026|1|1|
|timer|UPDATE task_info SET next_time = ? WHERE id = ?|1|1|1||0|0|1|1|0|0|
|employee|SELECT count(0) FROM employee.backlog bg WHERE bg.tenant_app_id = ? AND bg.scene NOT IN (?) AND bg.shop_id = ? AND bg.leave_flag = ?|1|2|2||0|0|12880|12880|1|1|
|user_service|SELECT count(0) FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? AND (t1.mobile_no LIKE concat(?, ?) OR t1.user_name LIKE concat(?, ?, ?))|1|2|2||0|0|497018|497018|1|1|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY p.tag_price DESC, p.id DESC LIMIT ?, ?|1|1|1||0|0|8582|8582|6|6|
|order|SELECT count(0) FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND (od.mobile_no = ? OR ad.mobile_no = ?)|1|3|3||0|0|105663|105663|1|1|
|order|SELECT count(0) FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND dt.product_name LIKE concat(?, ?, ?) AND od.take_type = ? AND (od.status = ?)|1|2|2||0|0|25504|25504|1|1|
|order|SELECT ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "2" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "3" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "4" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "5" , count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND (od.mobile_no = ? OR ad.mobile_no = ?) AND (od.status = ?)|1|1|1||0|0|74961|74961|1|1|
|order|SELECT od.id, od.order_no AS orderNo, od.status, od.take_type AS takeType, od.create_time AS createTime , od.remark, od.total_fee AS totalFee, od.freight_fee AS freightFee, od.discount_fee AS discountFee, od.take_id AS takeId , od.payment_fee AS paymentFee, dt.product_id AS productId, dt.price, dt.quantity, dt.sku_id AS skuId , dt.art_no AS artNo, dt.image_url AS imageUrl, dt.product_name AS productName, dt.take_remark AS takeRemark, dt.take_day AS takeDay , od.product_fee AS productFee, ad.user_name AS receiveName, ad.mobile_no AS mobileNo, ad.shop_name AS shopName, ad.address , ad.express_no AS expressNo, ad.express_company AS expressCompany, od.finish_type AS finishType, od.send_time AS sendTime, od.receive_time AS receiveTime , od.finish_time AS finishTime, od.child_status AS childStatus, od.send_good_remark AS sendGoodRemark, od.service_flag AS serviceFlag, od.coupon_id AS couponId , od.tenant_wechatapp_id AS tenantAppId, od.tenant_id FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.status = ? AND od.send_time <= ? AND od.take_type = ?|1|2|2||0|0|217792|217792|0|0|
|value_added|UPDATE value_added_user SET amount_added = IF(? > (added_percent_per_day / ? * IF(? >= TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ? - add_days, TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ?, add_days) - devalue_percent_per_day / ? * IF(? >= TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ? - add_days - keeping_days, ?, TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ? - add_days - keeping_days)) * amount_pay, ?, (added_percent_per_day / ? * IF(? >= TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ? - add_days, TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ?, add_days) - devalue_percent_per_day / ? * IF(? >= TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ? - add_days - keeping_days, ?, TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ? - add_days - keeping_days)) * amount_pay), update_time = now() WHERE state = ? AND update_time <= CURDATE() AND (start_add_time >= DATE_ADD(CURDATE(), INTERVAL -(add_days + keeping_days - ?) DAY) OR (amount_added > ? AND start_add_time < DATE_ADD(CURDATE(), INTERVAL -(add_days + keeping_days - ?) DAY)))|1|21|21||0|0|1861760|1861760|0|0|
|order|SELECT count(*) AS amount FROM `order`.order_info od LEFT JOIN `order`.order_detail dt ON od.id = dt.order_id LEFT JOIN order.order_address ad ON od.id = ad.order_id WHERE od.tenant_wechatapp_id = ? AND od.take_type = ? AND od.type = ? AND od.status = ? AND ad.shop_id = ? AND dt.take_start_date = ?|1|1|1||0|0|7570|7570|1|1|
||SELECT * FROM v4_user.member WHERE mobile_no = ?|1|3|3||0|0|930369|930369|1|1|
|v4_coupon|UPDATE v4_coupon.coupon SET coupon_status = ? WHERE tenant_id = ? AND tenant_app_id = ? AND coupon_status = ? AND end_time < now()|1|1|1||0|0|230621|230621|0|0|
|user_service|SELECT id, tenant_id, wechat_app_id, open_id, union_id , nick_name, head_img_url, sex, wx_mobile_no, create_time , update_time FROM mini_app_user WHERE wechat_app_id = ? AND wx_mobile_no = ? AND id <> ?|1|1|1||0|0|28621|28621|0|0|
|coupon_service|SELECT cet.id, cet.coupon_id, cet.user_id, cet.coupon_type, cet.expire_time , if(cet.expire_time < now() AND cet.status = ?, ?, cet.status) AS status FROM coupon_service.coupon_expire_task cet JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.coupon_id = cet.coupon_id WHERE cet.tenant_id = ? AND cet.tenant_app_id = ? AND cet.employee_id = ? AND cet.shop_id = ?|1|1|1||0|0|68454|68454|528|528|
|authorization_service|SELECT id, tenant_id, account_id, type, login_name , hash_password, salt, user_id, employee_id, tenant_app_id , status, create_time, update_time FROM login_account WHERE type = ? AND login_name = ?|1|1|1||0|0|60575|60575|1|1|
|order|SELECT count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND (od.mobile_no = ? OR ad.mobile_no = ?)|1|3|3||0|0|105663|105663|1|1|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , \...|1|1|1||0|0|869210|869210|305|305|
|order|SELECT ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "2" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "3" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "4" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "5" , count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND dt.product_name LIKE concat(?, ?, ?) AND (od.status = ?)|1|3|3||0|0|50018|50018|1|1|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail_extend WHERE create_time < ?|1|1|1||0|0|246176|246176|0|0|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail WHERE create_time < ?|1|2|2||0|0|443103|443103|0|0|
|goods|SELECT count(0) FROM ( SELECT gs.id, gs.category_id, gs.goods_name, gs.style_no, gs.status , gs.thumbnail_img, gs.express_type, gs.take_stock_day, gs.take_remark, gs.express_fee , ifnull(gs.base_sale_number, ?) + ifnull(t1.sales_volume, ?) AS total_sales_volume , ifnull(ifnull(t2.quantity, t3.quantity), ?) AS total_quantity , ifnull(ifnull(t2.price, t3.price), ?) AS min_price , gs.create_time, gs.exchange_money, ifnull(t2.number, ?) AS skuNumber , ifnull(t3.number, ?) AS activitySkuNumber FROM goods.goods gs LEFT JOIN goods.goods_category cg ON gs.category_id = cg.id INNER JOIN goods.goods_up_app t ON gs.id = t.goods_id AND t.tenant_app_id = ? LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(sales_volume) AS sales_volume FROM goods.goods_sku GROUP BY tenant_app_id, goods_id ) t1 ON t.tenant_app_id = t1.tenant_app_id AND t.goods_id = t1.goods_id LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(quantity) AS quantity , min(price) AS price, count(*) AS number FROM goods.goods_sku WHERE activity_id = ? GROUP BY tenant_app_id, goods_id ) t2 ON t.tenant_app_id = t2.tenant_app_id AND t.goods_id = t2.goods_id LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(quantity) AS quantity , min(price) AS price, count(*) AS number FROM goods.goods_sku WHERE activity_id > ? GROUP BY tenant_app_id, goods_id ) t3 ON t.tenant_app_id = t3.tenant_app_id AND t.goods_id = t3.goods_id WHERE 1 = 1 AND (cg.id = ? OR cg.parent_id = ?) AND gs.topping = ? ) tmp|1|1|1||0|0|121050|121050|1|1|
|mysql|DELETE FROM wx_gateway.wx_template_msg WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|36|36||0|0|1001253|1001253|0|0|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE coupon_status = ? AND member_id = ? AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|0|0|1|1|
|v4_user|SELECT t1.maintain_shop_id, t1.maintain_employee_id, t1.maintain_level, count(*) AS maintainNum FROM potential_customer t1 WHERE t1.tenant_app_id = ? AND t1.`status` IN (?) AND t1.next_maintain_time >= ? AND t1.tenant_id = ? AND t1.tenant_app_id = ? GROUP BY t1.maintain_shop_id, t1.maintain_employee_id, t1.maintain_level|1|1|1||0|0|9631|9631|326|326|
|tenant|SELECT count(0) FROM ( SELECT sg.id, sneak_guest_no, sg.status, user_id, smg.time , if(sg.status = ?, e.employee_name, ?) AS maintainEmployeeName , smg._count AS maintainNum, sg.update_employee_id FROM tenant.sneak_guest sg JOIN tenant.employee e ON e.id = sg.maintain_employee_id JOIN ( SELECT sneak_guest_id, count(*) AS _count, min(create_time) AS time FROM tenant.sneak_guest_maintain WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND employee_id = ? AND event_type IN (?) AND create_time BETWEEN ? AND ? GROUP BY sneak_guest_id ) smg ON smg.sneak_guest_id = sg.id WHERE sg.tenant_id = ? AND sg.tenant_app_id = ? AND (sg.fail_type IS NULL OR sg.fail_type = ?) ) tmp_count|1|13|13||0|0|52767|52767|1|1|
|goods|SELECT count(0) FROM ( SELECT gs.id, gs.tenant_id, gs.tenant_app_id, gs.category_id, gs.activity_id , gs.goods_name, gs.style_no, gs.base_sale_number, gs.limit_sale , if(gs.status = ?, gs.status, if(t.id IS NULL, ?, ?)) AS status , gs.thumbnail_img, gs.express_type, gs.take_stock_day, gs.take_remark, gs.express_fee , gs.create_time, gs.update_time, gs.sale_type, gs.take_start_time, gs.page_id , gs.pay_way, gs.advance_payment, gs.exchange_money , ifnull(sku.minPrice, ?) AS minPrice , ifnull(sku.marketPrice, ?) AS marketPrice , ifnull(sku.totalSalesVolume, ?) AS totalSalesVolume , ifnull(sku.totalQuantity, ?) AS totalQuantity , ifnull(number, ?) AS skuNumber, gs.topping FROM goods.goods gs LEFT JOIN ( SELECT id, goods_id FROM goods.goods_up_app gu WHERE gu.tenant_app_id = ? ) t ON gs.id = t.goods_id LEFT JOIN ( SELECT goods_id, min(price) AS minPrice, max(market_price) AS marketPrice , sum(sales_volume) AS totalSalesVolume, sum(quantity) AS totalQuantity , count(*) AS number FROM goods.goods_sku WHERE activity_id = ? GROUP BY tenant_id, goods_id ) sku ON sku.goods_id = gs.id WHERE gs.tenant_id = ? AND gs.goods_name LIKE concat(?, ?, ?) AND gs.status < ? ORDER BY gs.topping DESC, sku.totalSalesVolume DESC, gs.id DESC ) tmp_count|1|1|1||0|0|62128|62128|1|1|
|user_service|SELECT count(?) FROM user_service.tenant_member tm JOIN user_service.tenant_member_info tmi ON tmi.tenant_id = ? AND tmi.tenant_app_id = ? AND tm.id = tmi.id WHERE tm.tenant_id = ? AND tm.tenant_app_id = ? AND tm.user_id NOT IN (?) AND tm.user_id IN (|1|1|1||0|0|1028|1028|1|1|
|timer|INSERT INTO task_execute_log (id, task_id, task_name, task_params, success , error_msg, create_time) VALUES (?, ?, ?, ?, ? , ?, ?)|1|1|1||0|0|0|0|0|0|
|v4_employee|SELECT ? AS task_type, t.system_task_type, count(*) AS undo_count FROM task_task t JOIN task_system_task_template st ON t.task_template_id = st.id AND st.status = ? AND st.tenant_id = ? AND st.tenant_app_id = ? WHERE t.`status` = ? AND t.finish_time IS NULL AND t.end_time > ? AND shop_id = ? AND employee_id = ? AND t.task_template_id IN (?) AND t.tenant_id = ? AND t.tenant_app_id = ? GROUP BY t.system_task_type|1|1|1||0|0|792|792|3|3|
|tenant|SELECT count(0) FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND EXISTS ( SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id = sgm.sneak_guest_id AND sgm.event_type = ? AND sgm.intention_info REGEXP ? ) AND EXISTS ( SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id = sgm.sneak_guest_id AND sgm.event_type = ? AND sgm.intention_info REGEXP ? ) AND sg.status = ?|1|9|9||0|0|35026|35026|1|1|
|order|SELECT od.id, od.order_no AS orderNo, od.status, od.take_type AS takeType, od.create_time AS createTime , od.remark, od.total_fee AS totalFee, od.freight_fee AS freightFee, od.discount_fee AS discountFee, od.take_id AS takeId , od.payment_fee AS paymentFee, dt.product_id AS productId, dt.price, dt.quantity, dt.sku_id AS skuId , dt.art_no AS artNo, dt.image_url AS imageUrl, dt.product_name AS productName, dt.take_remark AS takeRemark, dt.take_day AS takeDay , od.product_fee AS productFee, od.finish_type AS finishType, od.send_time AS sendTime, od.receive_time AS receiveTime, od.finish_time AS finishTime , od.child_status AS childStatus, od.send_good_remark AS sendGoodRemark, od.service_flag AS serviceFlag, od.coupon_id AS couponId, od.tenant_wechatapp_id AS tenantAppId , od.tenant_id AS tenantId, od.pay_id AS payId, od.user_id AS userId, od.user_name AS userName, od.mobile_no AS buyMobileNo , od.activity_id, od.offline_payment_fee, od.activity_type, dt.spec, od.take_shop_id , od.take_shop_name, od.take_employee_user_id, od.take_employee_user_name FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id WHERE od.status = ? AND od.receive_time <= ?|1|2|2||0|0|218007|218007|215|215|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ...|1|3|3||0|0|789202|789202|636|636|
|gift_mail|SELECT count(0) FROM ( SELECT p.*, sp.take_type , ifnull(pp.integral_price, ifnull(( SELECT min(inventory.price) FROM inventory WHERE inventory.product_id = p.id ), ?)) AS price , ifnull(t.quantity, ?) AS quantity, pt.partner_name AS vendorName , ? AS distance, c.categroy_name AS categroy_name, pp.partner_id FROM product p INNER JOIN category c ON c.id = p.category_id LEFT JOIN self_product sp ON p.id = sp.product_id LEFT JOIN partner_product pp ON p.id = pp.product_id LEFT JOIN partner pt ON pt.id = pp.partner_id LEFT JOIN ( SELECT product_id, sum(quantity) AS quantity FROM gift_mail.inventory GROUP BY product_id ) t ON p.id = t.product_id WHERE p.is_disable IS NULL OR p.is_disable = ? ) p LEFT JOIN product_status ps ON p.id = ps.product_id AND ps.tenant_wechatapp_id = ? WHERE p.product_status = ? AND p.topping = ? AND p.tenant_id = ? AND (ps.id IS NOT NULL OR p.tenant_wechatapp_id = ?)|1|1|1||0|0|51772|51772|1|1|
|mysql|DELETE FROM message_push.message_log WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|77|77||0|0|2832471|2832471|0|0|
|v4_coupon|SELECT COUNT(*) AS total FROM ( SELECT c.id, c.display_name, c.type AS couponType , round(c.face_value / ?, ?) AS faceValue , round(c.face_value / ?, ?) AS points , c.face_value AS discount, c.begin_time, c.end_time, c.template_id , round(c.use_threshold / ?) AS useThreshold, ce.exchange_goods , CASE  WHEN c.begin_time > now() AND c.coupon_status = ? THEN ? ELSE c.coupon_status END AS coupon_status FROM v4_coupon.coupon c JOIN v4_coupon.coupon_extend ce ON ce.id = c.id AND ce.tenant_id = ? AND ce.tenant_app_id = ? WHERE c.member_id = ? AND c.tenant_id = ? AND c.tenant_app_id = ? ) c|1|1|1||0|0|91896|91896|1|1|
|sms|SELECT count(0) FROM ( SELECT a.phone_numbers AS phoneNo , CONCAT(?, a.sign_name, ?, CASE  WHEN b.content IS NOT NULL THEN b.content WHEN stc.content IS NOT NULL THEN stc.content ELSE a.template_param END) AS content , a.template_code, a.out_id AS outId, a.template_param, a.create_time AS sendTime, a.create_time AS recevieTime , a.code AS state , ifnull(ifnull(e.sms_size, ?) * if(a.code = ?, a.send_count, ?), ?) AS send_count , a.message, a.source_type FROM sms_send a LEFT JOIN sms.sms_send_extend e ON a.biz_id = e.biz_id LEFT JOIN sms_template b ON a.template_code = b.code LEFT JOIN sms_template_custom stc ON a.tenant_app_id = stc.tenant_app_id AND a.template_code = stc.code AND stc.status = ? WHERE a.tenant_id = ? AND a.tenant_app_id = ? AND a.create_time >= ? AND a.create_time < ? ORDER BY a.create_time DESC ) tmp_count|1|1|1||0|0|3730|3730|1|1|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY i.volume ASC, p.id DESC LIMIT ?|1|1|1||0|0|8239|8239|6|6|
|employee|UPDATE backlog SET status = ?, finish_time = ? WHERE tenant_app_id = ? AND (expire_time >= ? AND expire_time < ?) AND status IN (?)|1|1|1||0|0|16773|16773|0|0|
|employee|UPDATE backlog SET leave_flag = ? WHERE tenant_app_id = ? AND employee_id = ?|1|2|2||0|0|3505|3505|0|0|
|order|SELECT count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND od.order_no LIKE concat(?, ?, ?)|1|3|3||0|0|2973|2973|1|1|
|order|SELECT od.id, od.order_no AS orderNo, od.status, od.take_type AS takeType, od.create_time AS createTime , od.remark, od.total_fee AS totalFee, od.freight_fee AS freightFee, od.discount_fee AS discountFee, od.take_id AS takeId , od.payment_fee AS paymentFee, dt.product_id AS productId, dt.price, dt.quantity, dt.sku_id AS skuId , dt.art_no AS artNo, dt.image_url AS imageUrl, dt.product_name AS productName, dt.take_remark AS takeRemark, dt.take_day AS takeDay , od.product_fee AS productFee, ad.user_name AS receiveName, ad.mobile_no AS mobileNo, ad.shop_name AS shopName, ad.address , ad.express_no AS expressNo, ad.express_company AS expressCompany, od.user_name AS userName, od.update_time AS updateTime, od.child_status AS childStatus , od.finish_type AS finishType, od.receive_time AS receiveTime, od.user_id AS userId, od.mobile_no AS buyMobileNo, od.edit_fee_flag AS editFeeFlag , dt.spec AS spec, od.source, od.take_shop_id, od.take_shop_name, od.take_employee_user_id , od.take_employee_user_name, od.activity_type, od.activity_id, od.offline_payment_fee, od.online_wait_fee , od.offline_wait_fee, od.pay_way, od.take_employee_id, od.pay_id FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND (od.mobile_no = ? OR ad.mobile_no = ?) ORDER BY od.create_time DESC LIMIT ?|1|1|1||0|0|105663|105663|3|3|
|v4_user|SELECT member_id FROM member_source WHERE source_id = ? AND tenant_id = ? AND tenant_app_id = ? ORDER BY create_time DESC LIMIT ?|1|1|1||0|0|213373|213373|100|100|
|v4_employee|SELECT COUNT(*) AS total FROM task_task WHERE task_template_id = ? AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|139021|139021|1|1|
|order|SELECT count(0) FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND dt.product_name LIKE concat(?, ?, ?) AND (od.status = ?)|1|3|3||0|0|50018|50018|1|1|
||SELECT count(*) FROM v4_sales.warranty_can_added wca JOIN v4_sales.erp_sales es ON es.tenant_id = ? AND es.tenant_app_id = ? AND wca.sales_id = es.id LEFT JOIN tenant.employee e ON e.tenant_id = ? AND e.employee_erp_id = es.employee_erp_id LEFT JOIN v4_sales.warranty w ON w.tenant_id = ? AND w.tenant_app_id = ? AND w.sales_id = wca.sales_id WHERE wca.tenant_id = ? AND wca.tenant_app_id = ? AND es.is_sales = ? AND es.sales_status = ? AND sales_date BETWEEN ? AND ? AND w.id IS NULL|1|1|1||0|0|28207|28207|1|1|
|employee|SELECT * FROM backlog WHERE tenant_app_id = ? AND employee_id = ? AND status IN (?) AND scene = ? AND shop_id = ? AND expire_time >= ? ORDER BY id DESC LIMIT ?|1|2|2||0|0|216314|216314|4|4|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ,...|1|4|4||0|0|528735|528735|263|263|
|coupon_service|SELECT t.id FROM coupon_service.template t LEFT JOIN coupon_service.coupon_scope s ON s.tenant_id = t.tenant_id AND s.tenant_app_id = t.tenant_app_id AND s.template_id = t.id WHERE t.coupon_type = ? AND t.tenant_id = ? AND t.tenant_app_id = ? AND (t.scope = ? OR (s.scope = ? AND s.product_id = ?) OR (s.scope = ? AND s.classify_id = ?))|1|1|1||0|0|20434|20434|1|1|
|erp_app|INSERT INTO app_status (id, tenant_id, app_name, version, pid) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE version = ?, pid = ?, online_status_time = ?|1|1|1||0|0|0|0|0|0|
|sms|COMMIT ?|1|1|1||0|0|0|0|0|0|
|order|SELECT count(0) FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND od.order_no LIKE concat(?, ?, ?)|1|3|3||0|0|2973|2973|1|1|
|coupon_service|SELECT count(0) FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ? AND cu.create_time >= ? AND cu.create_time <= ?|1|1|1||0|0|6586|6586|1|1|
|v4_coupon|SELECT * FROM v4_coupon.sales_give_coupon_record WHERE sales_id = ? AND sales_detail_id IS NULL AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|92094|92094|0|0|
|tenant|SELECT shop.*, dept.dept_name, count(es.id) AS employeesCount FROM tenant_wechatapp_shop shop LEFT JOIN erp_department dept ON shop.dept_erp_id = dept.dept_erp_id AND shop.tenant_id = dept.tenant_id LEFT JOIN employee_shop es ON shop.id = es.shop_id AND es.status IN (?) WHERE shop.tenant_wechatapp_id = ? AND shop.status IN (?) GROUP BY shop.id ORDER BY shop.create_time DESC LIMIT ?, ?|1|1|1||0|0|83897|83897|14|14|
|user_service|SELECT tm.user_id AS id, tm.user_name AS userName, tm.head_img_url AS headImgUrl, tm.user_name AS nickName, tm.mobile_no AS mobile , tm.sex FROM user_service.tenant_member tm WHERE tm.tenant_id = ? AND tm.tenant_app_id = ? AND (tm.user_name LIKE CONCAT(?, ?, ?) OR tm.mobile_no = ?) ORDER BY tm.id DESC LIMIT ?|1|1|1||0|0|366504|366504|1|1|
|tenant|SELECT count(0) FROM tenant.erp_sales es LEFT JOIN tenant.tenant_wechatapp_shop shop ON shop.tenant_wechatapp_id = es.tenant_wechatapp_id AND shop.dept_erp_id = es.dept_erp_id LEFT JOIN tenant.employee e ON e.tenant_id = es.tenant_id AND e.employee_erp_id = es.employee_erp_id LEFT JOIN tenant.employee_shop esh ON esh.tenant_app_id = es.tenant_wechatapp_id AND esh.employee_id = e.id AND esh.dept_erp_id = es.dept_erp_id WHERE es.tenant_id = ? AND es.tenant_wechatapp_id = ? AND es.sales_date >= ? AND es.sales_date <= ? AND es.dept_erp_id = ? AND es.comment_id > ? AND es.sales_status IN (?) AND es.is_sales = ?|1|2|2||0|0|188489|188489|1|1|
|tenant|SELECT DISTINCT s.employee_id AS id, e.employee_name FROM tenant.sneak_guest_maintain s JOIN tenant.sneak_guest sg ON sg.id = s.sneak_guest_id JOIN tenant.employee e ON s.tenant_id = e.tenant_id AND s.employee_id = e.id WHERE s.tenant_id = ? AND s.tenant_app_id = ? AND sg.create_shop_id = ? AND (sg.fail_type IS NULL OR sg.fail_type = ?) AND s.event_type = ? AND s.create_time BETWEEN ? AND ?|1|12|12||0|0|62262|62262|7|7|
|value_added|SELECT ID, tenant_wechatapp_id AS tenantWechatappId, user_id AS userId, template_id AS templateId, sales_erp_id AS saleserpid , product_name AS productName, shop_name AS shopName, product_barcode AS productBarcode, amount_total AS amountTotal, amount_pay AS amountPay , amount_added AS amountAdded, state AS state, add_days, added_percent_per_day AS addedPercentPerDay, devalue_percent_per_day AS devaluePercentPerDay , keeping_days AS keepingDays, exchange_days AS exchangeDays, coupon_user_id AS couponUserId, sales_index AS salesIndex, start_add_time AS createtime , DATE_ADD(start_add_time, INTERVAL add_days - ? DAY) , DATE_ADD(start_add_time, INTERVAL add_days + keeping_days - ? DAY) FROM value_added_user WHERE keeping_days > ? AND state = ? AND start_add_time = date_add(CURDATE(), INTERVAL ? * (add_days - ?) DAY)|1|13|13||0|0|1861831|1861831|519|519|
|v4_coupon|SELECT COUNT(*) AS total FROM ( SELECT DISTINCT c.id, c.activity_name, c.push_time, c.tag_id, c.butler_call_member FROM v4_coupon.tag_push_coupon c JOIN v4_coupon.tag_push_coupon_log l ON l.tag_push_coupon_id = c.id AND l.push_coupon_state = ? AND l.tenant_id = ? AND l.tenant_app_id = ? WHERE c.push_state = ? AND c.butler_visible = ? AND l.shop_id = ? AND l.employee_id = ? AND c.push_time >= ? AND c.tenant_id = ? AND c.tenant_app_id = ? ORDER BY c.push_time DESC ) c|1|1|1||0|0|123572|123572|1|1|
|user_service|SELECT t1.id, t1.user_id AS userId, t1.user_name AS userName, t1.sex, t1.mobile_no AS mobileNo , t1.head_img_url AS headImg FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? JOIN user_service.user_employee ue ON t1.tenant_id = ue.tenant_id AND t1.tenant_app_id = ue.tenant_wechatapp_id AND t1.user_id = ue.user_id AND ue.employee_id = ? AND ue.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? ORDER BY ue.update_time DESC, t1.id DESC LIMIT ?, ?|1|1|1||0|0|16088|16088|10|10|
|payment|SELECT id, tenant_id, tenant_app_id, goods_order_source, goods_order_no , pay_order_id, transaction_id, goods_amount, refund_amount, fee_type , refund_reason, refund_account, request_ip, user_id, user_identify , user_sub_identify, order_start_time, refund_id, settlement_refund_amount, refund_recv_accout , refund_request_source, refund_finish_time, refund_status, refund_status_desc, error_msg , wxappid, sub_wxappid, mch_id, sub_mch_id, callback_tag , callback_result, create_time, update_time FROM refund_order WHERE callback_result IN (?) AND refund_status IN (?) ORDER BY id ASC LIMIT ?|1|1|1||0|0|10630|10630|0|0|
|user_service|SELECT count(0) FROM user_service.tenant_member tm JOIN user_service.user_employee ue ON ue.tenant_id = ? AND ue.tenant_wechatapp_id = ? AND tm.user_id = ue.user_id AND ue.employee_id = ? AND ue.shop_id = ? WHERE tm.tenant_id = ? AND tm.tenant_app_id = ?|1|4|4||0|0|80690|80690|1|1|
|value_added|SELECT ID, tenant_wechatapp_id AS tenantWechatappId, user_id AS userId, template_id AS templateId, sales_erp_id AS saleserpid , product_name AS productName, shop_name AS shopName, product_barcode AS productBarcode, amount_total AS amountTotal, amount_pay AS amountPay , amount_added AS amountAdded, state AS state, add_days, added_percent_per_day AS addedPercentPerDay, devalue_percent_per_day AS devaluePercentPerDay , keeping_days AS keepingDays, exchange_days AS exchangeDays, coupon_user_id AS couponUserId, sales_index AS salesIndex, start_add_time AS createtime , DATE_ADD(start_add_time, INTERVAL add_days - ? DAY) , DATE_ADD(start_add_time, INTERVAL add_days + keeping_days - ? DAY) FROM value_added_user WHERE state = ? AND start_add_time = date_add(CURDATE(), INTERVAL ? * (add_days + keeping_days - ?) DAY)|1|1|1||0|0|1861831|1861831|974|974|
|employee|SELECT bg.id, bg.employee_id, bg.shop_id, bg.scene, bg.status , bg.create_time, bg.begin_time, bg.expire_time, bg.member_user_name, bg.mobile_no AS member_mobile_no FROM employee.backlog bg WHERE bg.tenant_app_id = ? AND bg.scene NOT IN (?) AND bg.expire_time BETWEEN ? AND ? AND bg.shop_id = ? AND bg.status IN (?) AND bg.scene = ? AND bg.leave_flag = ? ORDER BY id DESC LIMIT ?|1|1|1||0|0|180851|180851|18|18|
|v4_employee|SELECT t.id AS task_id, task_type , if(task_type = ?, st.description, it.description) AS description , if(task_type = ?, st.quick_reply, it.quick_reply) AS quick_reply , task_name, member_id, member_name, member_mobile_no, member_sex , member_level, t.start_time, t.end_time , datediff(t.end_time, ?) AS left_days, send_coupons , recv_coupons, st.coupons, t.accept_time, t.plan_arrival_shop_time, t.arrival_shop_time , t.trade_time FROM task_task t LEFT JOIN task_system_task_template st ON st.id = t.task_template_id AND st.tenant_id = ? AND st.tenant_app_id = ? LEFT JOIN task_invite_task_template it ON it.id = t.task_template_id AND it.tenant_id = ? AND it.tenant_app_id = ? WHERE t.status = ? AND task_type = ? AND system_task_type = ? AND t.start_time <= ? AND t.end_time > ? AND t.finish_time >= ? AND t.finish_time < ? AND shop_id = ? AND employee_id = ? AND finish_time IS NOT NULL AND t.tenant_id = ? AND t.tenant_app_id = ? ORDER BY t.id DESC LIMIT ?|1|6|6||0|0|529392|529392|1|1|
|comment_service|SELECT c.*, cr.busi_id, cr.give_prize, cr.give_type FROM comment_service.comment c LEFT JOIN comment_service.comment_reward cr ON cr.comment_id = c.id WHERE c.id IN (?)|1|1|1||0|0|403867|403867|20|20|
|value_added|SELECT ? AS limitDayType, t.tenant_wechatapp_id, t.user_id, min(ue.employee_erp_id) AS employee_erp_id , ue.dept_erp_id, GROUP_CONCAT(t.product_barcode ORDER BY product_barcode ASC) AS productCode, GROUP_CONCAT(t.product_name ORDER BY product_barcode ASC) AS productName FROM value_added_user t INNER JOIN value_added_user_extend ue ON t.id = ue.id WHERE t.tenant_wechatapp_id = ? AND t.state = ? AND t.start_add_time >= date_add(DATE_FORMAT(?, '%Y-%m-%d'), INTERVAL ? * (t.add_days + t.keeping_days - ?) DAY) AND t.start_add_time < date_add(DATE_FORMAT(?, '%Y-%m-%d'), INTERVAL ? * (t.add_days + t.keeping_days - ?) + ? DAY) GROUP BY t.tenant_wechatapp_id, t.user_id, ue.dept_erp_id|1|1|1||0|0|420374|420374|67|67|
|order|SELECT id, tenant_id, tenant_wechatapp_id, order_id, user_id , user_name, shop_id, shop_name, operator_type, src_status , dst_status, full_message, remark, create_time, update_time , src_child_status, dst_child_status FROM order_operator_log WHERE tenant_wechatapp_id = ? AND order_id = ? AND dst_status = ? ORDER BY create_time DESC|1|2|2||0|0|885040|885040|1|1|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id = es.id AND wca.tenant_id = ? AND wca.tenant_app_id = ? LEFT JOIN v4_sales.warranty w ON w.sales_id = es.id AND w.tenant_id = ? AND w.tenant_app_id = ? WHERE is_sales = ? AND sales_status = ? AND es.employee_erp_id = ? AND es.dept_erp_id = ? AND es.sales_date >= ? AND es.tenant_id = ? AND es.tenant_app_id = ?|1|1|1||0|0|2345|2345|1|1|
|v4_sales|SELECT member_erp_id FROM v4_sales.erp_sales WHERE sales_status = ? AND sales_date < ? AND member_erp_id IN (?) AND tenant_id = ? AND tenant_app_id = ? GROUP BY member_erp_id|1|1|1||0|0|12281|12281|208|208|
