|数据库名称|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 = ?|898|1356|7||0|0|1790312290|2136260|7392|10|
|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 = ?|547|3180|19||0|0|4606508637|28396179|22922|203|
|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|284|457|5||0|0|1165976|21110|294|11|
|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 = ?|117|166|3||0|0|252023|5903|252023|5903|
|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 (?)|116|319|18||0|0|164983543|1423233|717|23|
|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 = ?)|112|229|7||0|0|12980286|215939|66|2|
|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 ?|92|170|4||0|0|1362650|29114|92|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(?)|65|103|7||0|0|26386647|406061|65|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 ?|59|135|24||0|0|26790545|1122379|4|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 ?|56|82|3||0|0|8494543|213621|50|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 (|53|75|3||0|0|82471|1865|39878|918|
|coupon_service|SELECT count(*) FROM employee_give_coupon_log WHERE tenant_app_id = ? AND coupon_push_id = ?|51|69|3||0|0|1263825|49858|51|1|
|coupon_service|SELECT ifnull(sum(quantity), ?) FROM coupon_service.coupon_market_order WHERE market_id = ? AND user_id = ? AND order_state = ?|44|102|10||0|0|23558850|535501|44|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|14579711|1327303|3731|227|
|v4_sales|SELECT COUNT(*) AS total FROM warranty WHERE member_id IN (?) AND is_disable = ? AND tenant_id = ? AND tenant_app_id = ?|39|61|4||0|0|4757261|144142|39|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 = ?|32|75|17||0|0|1726719|291061|32|1|
|v4_user|SELECT COUNT(*) AS total FROM member_source WHERE source_id = ? AND tenant_id = ? AND tenant_app_id = ?|32|50|3||0|0|6583005|213610|32|1|
|comment_service|SELECT * FROM comment_service.comment_reward WHERE comment_id = ? LIMIT ?|31|54|5||0|0|12419682|404707|9|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)|28|80|8||0|0|14991335|535497|2|1|
|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 = ?|22|33|2||0|0|72792|5148|22|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 <= ?|21|42|6||0|0|125329|11337|21|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 ?|21|24|1||0|0|172779|8238|126|6|
|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 ?|20|43|6||0|0|115020|11337|20|1|
|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()|20|35|3||0|0|1039216|68333|20|1|
|tenant|SELECT count(*) FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? AND maintain_employee_id = ?|20|43|6||0|0|115020|11337|20|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 ?, ?|19|22|1||0|0|157262|8486|114|6|
|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|17|52|6||0|0|370004|31822|70599|6020|
|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 = ?|16|21|1||0|0|168548|13577|16|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 sales_detail_id = ? AND tenant_id = ? AND tenant_app_id = ?|16|30|3||0|0|10245546|640872|10|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|2||0|0|28863|2440|16|1|
|corpwx|SELECT msg_type FROM corpwx.mini_app_msg WHERE tenant_id = ? GROUP BY msg_type UNION SELECT ? FROM corpwx.task_card_send_record WHERE tenant_id = ?|15|245|49||0|0|8241279|562623|45|3|
|corpwx|SELECT template_id, name FROM corpwx.app_template WHERE template_id IN ( SELECT template_id FROM corpwx.mini_app_msg WHERE tenant_id = ? AND template_id IS NOT NULL GROUP BY template_id UNION ALL SELECT templateId FROM ( SELECT REPLACE(JSON_EXTRACT(msg_content, ?), ?, ?) AS templateId FROM corpwx.task_card_send_record WHERE tenant_id = ? ) a WHERE templateId IS NOT NULL GROUP BY templateId )|15|668|95||0|0|319613926|21323141|62|5|
|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|13|19|2||0|0|80378|8573|65|5|
|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|13|18|2||0|0|1201061|92517|13|1|
|v4_coupon|SELECT * FROM v4_coupon.coupon WHERE coupon_no = ? LIMIT ?|12|18|2||0|0|2800792|235866|12|1|
|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 = ?)|12|17|1||0|0|5334051|455864|12|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 = ?|12|27|4||0|0|7678388|641027|21|4|
|corpwx|SELECT count(0) FROM ( SELECT template_id, msg_type, msg_content, err_msg, create_time , to_user FROM corpwx.mini_app_msg WHERE tenant_id = ? UNION SELECT REPLACE(JSON_EXTRACT(msg_content, ?), ?, ?) AS templateId , ?, msg_content, err_msg, create_time, to_user FROM corpwx.task_card_send_record WHERE tenant_id = ? ) a WHERE 1 = 1|12|247|50||0|0|7268284|649838|12|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 = ?|11|20|2||0|0|195918|22429|11|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 ?|11|31|11||0|0|7008648|637414|31|8|
|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')|11|61|8||0|0|2353515|331244|506|272|
|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|11|19|2||0|0|122159|28112|11|1|
|corpwx|UPDATE external_user SET un_assign_flag = ? WHERE tenant_id = ? AND status = ? AND un_assign_flag = ?|11|32|7||0|0|404938|58934|0|0|
|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 = ?|11|21|3||0|0|100603|9192|0|0|
|corpwx|SELECT * FROM ( SELECT template_id, msg_type, msg_content, err_msg, create_time , to_user FROM corpwx.mini_app_msg WHERE tenant_id = ? UNION SELECT REPLACE(JSON_EXTRACT(msg_content, ?), ?, ?) AS templateId , ?, msg_content, err_msg, create_time, to_user FROM corpwx.task_card_send_record WHERE tenant_id = ? ) a WHERE 1 = 1 ORDER BY create_time DESC LIMIT ?|10|38|7||0|0|6074759|649858|200|20|
|goods|SELECT * FROM goods_take_shop WHERE tenant_id = ? AND goods_id = ? AND activity_id = ? ORDER BY create_time DESC|10|14|2||0|0|1026045|102648|280|73|
|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 ?|9|13|2||0|0|956447|298547|90|10|
|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 ?, ?|9|10|1||0|0|76308|8700|54|6|
|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 ?|9|12|1||0|0|19433|3099|9|1|
|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 ?|9|25|5||0|0|4822281|535811|18|3|
|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 ?, ?|9|20|5||0|0|4958345|637179|35|10|
|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 ?|9|20|6||0|0|3716605|494690|605|295|
|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|8|89|20||0|0|582120|86645|8|1|
|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|8|16|3||0|0|263993|37456|59|9|
|order|SELECT max(create_time) FROM `order`.order_operator_log WHERE tenant_wechatapp_id = ? AND order_id = ?|8|36|6||0|0|7094681|886933|8|1|
|warranty_service|SELECT count(*) FROM warranty WHERE user_id = ? AND tenant_wechatapp_id = ? AND is_disable = ?|8|55|9||0|0|78577|13782|8|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|8|38|7||0|0|3878991|816316|8|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.id DESC LIMIT ?, ?|8|9|1||0|0|66846|8400|48|6|
|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 = ?|7|24|4||0|0|162555|29113|7|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 = ?) AND (od.status = ?) ORDER BY od.create_time DESC LIMIT ?|7|11|2||0|0|597184|85314|11|2|
|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 = ?|7|9|1||0|0|61758|8826|7|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 = ?)|7|11|4||0|0|775615|273869|7|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.template_id = ? AND cu.source = ?|6|14|5||0|0|16772|3540|6|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 ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ...|6|15|3||0|0|5090300|1327846|2411|713|
|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 ?|6|10|2||0|0|1842726|307121|6|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 i.volume DESC, p.tag_price ASC, p.id DESC ) tmp_count|6|6|1||0|0|43572|7262|6|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.sales_no LIKE concat(?, ?) OR es.member_erp_id = ?) AND es.tenant_id = ? AND es.tenant_app_id = ?|6|13|3||0|0|2515730|495150|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_no = ?|6|121|35||0|0|1842726|307121|6|1|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE member_id = ? AND scene = ? AND scene_id = ? AND tenant_id = ? AND tenant_app_id = ?|6|7|1||0|0|648335|123616|6|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 = ?|6|9|2||0|0|9624|2032|6|1|
|coupon_service|SELECT * FROM coupon_service.coupon_can_give WHERE coupon_id = ? LIMIT ?|5|7|1||0|0|1195663|249956|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|13|8||0|0|1170935|420607|223|103|
|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 (?)|5|21|5||0|0|303738|88584|43|13|
|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 = ?|5|6|1||0|0|211796|64498|5|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 ?|5|5|1||0|0|463456|92837|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 ?|5|5|1||0|0|41190|8238|30|6|
|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 = ?|5|13|5||0|0|169271|69478|5|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 (od.mobile_no = ? OR ad.mobile_no = ?) AND (od.status = ?)|5|8|2||0|0|375306|75063|5|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 ?|4|11|4||0|0|2548296|637325|13|9|
|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 = ?|4|5|1||0|0|33748|8437|0|0|
|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 (|4|4|1||0|0|83227|75907|83227|75907|
|corpwx|COMMIT ?|4|5|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 = ?|4|6|2||0|0|137796|43479|4|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 = ?|4|20|16||0|0|264832|66208|4|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 = ?|3|4|2||0|0|19742|8636|3|1|
|order|SELECT count(*) FROM `order`.order_info WHERE tenant_id = ? AND tenant_wechatapp_id = ? AND take_type = ? AND status = ? AND (wait_take_shop_id = ? OR take_shop_id = ?)|3|3|1||0|0|16675|5574|3|1|
|employee|SELECT count(*) FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND status = ? AND finish_time BETWEEN ? AND ?|3|3|1||0|0|3399|1133|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|251648|83898|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|3|3|1||0|0|3008166|1002887|75|25|
|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 = ?)|3|5|2||0|0|225189|75063|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|3|1||0|0|24744|8250|18|6|
|user_service|SELECT * FROM v4_employee.task_task WHERE employee_id = ? AND tenant_id = ?|3|10|4||0|0|1063482|354494|93|31|
|employee|UPDATE backlog_system SET status = ?, finish_time = now() WHERE tenant_app_id = ? AND scene = ?|3|7|3||0|0|3436695|1145565|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 = ?|3|5|2||0|0|106350|43479|3|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 = ?|3|5|3||0|0|396060|144135|3|1|
|gift_mail|SELECT ifnull(count(1), ?) AS amount FROM trade WHERE tenant_wechatapp_id = ? AND user_id = ? AND order_status IN (?)|3|6|3||0|0|37221|12407|3|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 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|23|9||0|0|95209|35056|3|1|
|user_service|SELECT tm.tenant_id, tm.tenant_app_id, tm.user_id, tm.mobile_no, tm.sex , tm.user_name, tm.head_img_url, tmi.birthday, tmi.birthday_is_lunar, tmi.shop_id , tmi.memorial_day_is_lunar, tmi.memorial_day, tmi.memorial_name, tmi.interest, tmi.address 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 = ?) ORDER BY tm.id LIMIT ?|3|9|6||0|0|854323|284818|22|20|
|user_service|SELECT * FROM v4_user.member_change_log WHERE tenant_id = ? AND member_id = ?|2|2|1||0|0|214141|107088|8|4|
|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(?, ?), ?)|2|144|79||0|0|525452|262726|2|1|
|goods|SELECT shop_id FROM goods.goods_take_shop WHERE goods_id = ? AND activity_id = ?|2|3|1||0|0|205179|102590|7|7|
|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|4|2||0|0|593162|296581|8|4|
|erp_app|INSERT INTO app_status (id, tenant_id, app_name, version, pid) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE version = ?, pid = ?, online_status_time = ?|2|2|1||0|0|0|0|0|0|
|employee|SELECT count(*) FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND status = ? AND expire_time BETWEEN ? AND ?|2|3|2||0|0|11479|8426|2|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|2|7|6||0|0|19640147|16700082|2|1|
|v4_sales|SELECT s.* , if(va.id IS NOT NULL, ?, ?) AS hasAdded FROM ( SELECT max(es.sales_no) AS sales_no, max(es.id) AS id , max(es.sales_date) AS sales_date, max(es.member_erp_id) AS memberId , max(es.sales_erp_id) AS erpSalesId, esd.product_barcode , max(esd.product_name) AS product_name, max(category_erp_id) AS category_erp_id , max(category_name) AS category_name, sum(amount_total) AS amount_total , sum(amount_pay) AS amount_pay, count(esd.id) AS quantity 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 = ? LEFT JOIN v4_sales.value_added_ignore i ON i.erp_sales_id = es.sales_erp_id AND i.product_barcode = esd.product_barcode AND i.tenant_id = ? AND i.tenant_app_id = ? WHERE es.sales_status = ? AND is_sales = ? AND i.id IS NULL AND es.tenant_id = ? AND es.tenant_app_id = ? GROUP BY esd.product_barcode ) s LEFT JOIN v4_sales.value_added va ON va.product_barcode = s.product_barcode AND va.tenant_id = ? AND va.tenant_app_id = ? WHERE s.sales_no LIKE concat(?, ?) OR s.memberId = ? ORDER BY s.sales_date DESC, s.id DESC LIMIT ?|2|15|9||0|0|3746996|1873498|10|5|
|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 = ?))|2|2|1||0|0|40835|20444|1|1|
|gift_mail|SELECT count(*) FROM gift_mail.trade t LEFT JOIN gift_mail.trade_take tt ON tt.trade_id = t.id WHERE t.tenant_id = ? AND t.tenant_wechatapp_id = ? AND t.trade_type = ? AND t.order_status = ? AND t.take_type = ? AND tt.shop_id = ?|2|2|1||0|0|11401|5822|2|1|
|user_service|SELECT * FROM tenant_member_bind tmb JOIN corpwx.external_user_bind eub ON tmb.tenant_id = eub.tenant_id AND tmb.wx_user_id = eub.wx_user_id WHERE tmb.external_user_id != eub.external_user_id|2|223|214||0|0|20650494|19733119|501|501|
|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|277|146||0|0|1044464|522232|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.next_maintain_date >= ? AND sg.next_maintain_date <= ? AND sg.status = ? ORDER BY sg.id DESC LIMIT ?, ?|2|3|2||0|0|1274283|637281|5|4|
|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|471537|236032|128|64|
|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 ?|2|137|68||0|0|496818|248409|40|20|
|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 = ?)|2|4|2||0|0|100230|50165|2|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 dt.product_name LIKE concat(?, ?, ?) AND (od.status = ?)|2|4|2||0|0|100230|50165|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|4|3||0|0|1617204|826799|1302|1055|
|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 = ?|2|2|1||0|0|7206|5443|2|1|
|v4_sales|SELECT COUNT(*) AS total FROM ( SELECT max(es.sales_no) AS sales_no, max(es.id) AS id , max(es.sales_date) AS sales_date, max(es.member_erp_id) AS memberId , max(es.sales_erp_id) AS erpSalesId, esd.product_barcode , max(esd.product_name) AS product_name, max(category_erp_id) AS category_erp_id , max(category_name) AS category_name, sum(amount_total) AS amount_total , sum(amount_pay) AS amount_pay, count(esd.id) AS quantity 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 = ? LEFT JOIN v4_sales.value_added_ignore i ON i.erp_sales_id = es.sales_erp_id AND i.product_barcode = esd.product_barcode AND i.tenant_id = ? AND i.tenant_app_id = ? WHERE es.sales_status = ? AND is_sales = ? AND i.id IS NULL AND es.tenant_id = ? AND es.tenant_app_id = ? GROUP BY esd.product_barcode ) s WHERE s.sales_no LIKE concat(?, ?) OR s.memberId = ?|2|23|13||0|0|3746976|1873488|2|1|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE coupon_status = ? AND member_id = ? AND tenant_id = ? AND tenant_app_id = ?|2|2|1||0|0|0|0|2|1|
|user_service|SELECT * FROM tenant_member_bind tmb LEFT JOIN corpwx.external_user_bind eub ON tmb.tenant_id = eub.tenant_id AND tmb.wx_user_id = eub.wx_user_id WHERE tmb.tenant_id = ? AND tmb.wx_user_id IS NOT NULL AND tmb.external_user_id IS NOT NULL AND tmb.external_user_id != ? AND eub.id IS NULL ORDER BY tmb.id DESC|1|2|2||0|0|62305|62305|0|0|
|tenant|SELECT count(*) FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ?|1|1|1||0|0|1524|1524|1|1|
|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|1|1|1||0|0|808967|808967|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|2|2||0|0|775886|775886|288|288|
|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|5|5||0|0|1328015|1328015|882|882|
|v4_user|SELECT COUNT(*) AS total FROM member WHERE status = ? AND member_name LIKE ? AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|213616|213616|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|1|1|1||0|0|218|218|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|885|885|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 od.take_type = ?|1|1|1||0|0|39026|39026|1|1|
|authorization_service|UPDATE user_login_token SET login_code = ? WHERE id = ?|1|1|1||0|0|1|1|0|0|
|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 ?|1|5|5||0|0|886799|886799|0|0|
||DELETE FROM v4_sales.sjfx_dct_erp_sales_extend1 WHERE create_time < ?|1|4|4||0|0|168624|168624|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.take_type = ?|1|1|1||0|0|39026|39026|1|1|
|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|1|10|10||0|0|34821|34821|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|1|1||0|0|497239|497239|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.activity_id = ?|1|1|1||0|0|35280|35280|1|1|
|corpwx|UPDATE token SET type = ?, corp_id = ?, suite_id = ?, suite_ticket = ?, agent_id = ?, agent_auth_code = ?, agent_ticket = ?, token = ?, expire_time = ?, status = ?, create_time = ?, update_time = ?, failed_times = ?, failed_reason = ? WHERE id = ?|1|1|1||0|0|1|1|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|1864457|1864457|0|0|
|gift_mail|SELECT count(*) FROM gift_mail.trade t LEFT JOIN gift_mail.trade_take tt ON tt.trade_id = t.id WHERE t.tenant_id = ? AND t.tenant_wechatapp_id = ? AND t.trade_type IN (?) AND t.order_status = ? AND t.take_type = ? AND tt.shop_id = ?|1|1|1||0|0|5521|5521|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 od.activity_id = ?|1|1|1||0|0|35280|35280|1|1|
|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|68669|68669|336|336|
|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|217919|217919|0|0|
|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|828400|828400|376|376|
|user_service|SELECT tmb.tenant_id, tmb.user_id, tmb.external_user_id, eub.external_user_id FROM tenant_member_bind tmb JOIN corpwx.external_user_bind eub ON tmb.tenant_id = eub.tenant_id AND tmb.wx_user_id = eub.wx_user_id AND tmb.external_user_id != eub.external_user_id|1|8|8||0|0|917374|917374|501|501|
|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|218044|218044|125|125|
|user_service|SELECT * FROM user_service.tenant_member_bind WHERE wx_user_id IN (?)|1|15|15||0|0|3234562|3234562|0|0|
|user_service|SELECT tmb.erp_member_id AS member_erp_id, tm.tenant_id, tm.tenant_app_id, tm.mobile_no, tm.user_name , tmi.grade_id AS grade_erp_id FROM user_service.tenant_member tm JOIN user_service.tenant_member_bind tmb ON tm.tenant_id = tmb.tenant_id AND tm.id = tmb.id JOIN user_service.tenant_member_info tmi ON tm.tenant_id = tmi.tenant_id AND tm.id = tmi.id WHERE tmb.tenant_id = ? AND tmb.tenant_app_id = ? AND tmb.erp_member_id IN (?)|1|1|1||0|0|39|39|13|13|
|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 DESC, p.id DESC ) tmp_count|1|1|1||0|0|7262|7262|1|1|
|user_service|SELECT * FROM user_employee WHERE tenant_wechatapp_id = ? AND employee_id = ?|1|1|1||0|0|75907|75907|75907|75907|
|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|9711|9711|77|77|
|mysql|DELETE FROM message_push.message_log WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|79|79||0|0|2938307|2938307|0|0|
|mysql|DELETE FROM wx_gateway.wx_template_msg WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|35|35||0|0|1036596|1036596|0|0|
|user_service|UPDATE v4_employee.task_task SET finish_time = start_time, update_time = now() WHERE employee_id = ? AND tenant_id = ?|1|5|5||0|0|535805|535805|0|0|
|warranty_service|INSERT INTO warranty (id, tenant_wechatapp_id, user_id, erp_sales_id, warranty_no , is_disable, warranty_data, update_employee_id, employee_erp_id, dept_erp_id , sales_no, sales_date, style_id) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?)|1|1|1||0|0|0|0|0|0|
|order|SELECT id, type, operator_type AS operatorType, operator_result AS operatorResult, reason_label AS reasonLabel , reason_value AS reasonValue, remark, create_time AS createTime, status FROM order_service_log WHERE order_id = ? ORDER BY create_time DESC|1|1|1||0|0|20587|20587|0|0|
|user_service|SELECT tu.user_name AS memberName, tu.mobile_no AS mobile, emg.grade_name as gradeLevel, tu.user_id as memberUserId, tu.tenant_id as tenantId, tu.tenant_app_id as tenantAppId, ue.employee_id as employeeId, ue.employee_erp_id as employeeErpId, tmb.erp_member_id as memberErpId, tmi.shop_id FROM user_service.tenant_member tu JOIN user_service.tenant_member_info tmi on tu.tenant_id=tmi.tenant_id and tu.id=tmi.id LEFT JOIN user_service.tenant_member_bind tmb on tu.tenant_id=tmb.tenant_id and tu.id=tmb.id LEFT JOIN user_service.erp_member_grade emg ON tu.tenant_id = emg.tenant_id AND tmi.grade_id = emg.grade_erp_id left join user_service.user_employee ue ON tu.tenant_id=ue.tenant_id and 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 tu.user_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ...|1|1|1||0|0|2205|2205|441|441|
|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 ?|1|1|1||0|0|494935|494935|1|1|
|employee|SELECT count(0) FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND expire_time BETWEEN ? AND ? AND status != ? AND scene NOT IN (?)|1|1|1||0|0|3053|3053|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|2|2||0|0|637242|637242|9|9|
|value_added|SELECT count(0) FROM ( SELECT t1.id, t2.sales_no AS salesNo, DATE_FORMAT(t2.sales_date, '%Y-%m-%d') AS salesDate , DATE_FORMAT(t1.start_add_time, '%Y-%m-%d') AS valueAddDate, t2.dept_erp_id AS shopId , t1.shop_name AS shopName, t2.employee_erp_id AS userId, t2.employee_name AS userName, t1.product_name AS productName, t1.amount_pay AS amountPay , t1.id AS valueAddNo, t1.amount_added AS valueAddAmount, t1.state , if(t1.state = ?, t1.coupon_user_id, NULL) AS valueAddCoupon , t1.user_id AS memberUserId , CASE  WHEN start_add_time > ? THEN ? WHEN DATE_ADD(start_add_time, INTERVAL add_days DAY) > ? AND state = ? THEN ? WHEN DATE_ADD(start_add_time, INTERVAL add_days + keeping_days DAY) > ? AND DATE_ADD(start_add_time, INTERVAL add_days DAY) < ? AND state = ? THEN ? WHEN DATE_ADD(start_add_time, INTERVAL add_days + keeping_days DAY) < ? AND amount_added > ? AND state = ? THEN ? ELSE ? END AS addedStatus FROM value_added.value_added_user t1 JOIN value_added.`value_added_user_extend` t2 ON t1.id = t2.id WHERE t1.tenant_wechatapp_id = ? AND EXISTS ( SELECT NULL FROM value_added.value_added_category t3 JOIN value_added.value_added_template t4 ON t3.template_id = t4.id AND t4.is_disable = ? WHERE t1.tenant_wechatapp_id = t3.tenant_wechatapp_id AND t2.category_erp_id = t3.erp_product_category_id ) AND t2.sales_date >= ? AND t2.sales_date < ? AND t1.state != ? ) tmp_count|1|2|2||0|0|37540|37540|1|1|
|user_service|UPDATE tenant_member_bind tmb JOIN corpwx.external_user_bind eub ON tmb.tenant_id = eub.tenant_id AND tmb.wx_user_id = eub.wx_user_id SET tmb.external_user_id = eub.external_user_id WHERE tmb.external_user_id != eub.external_user_id|1|166|166||0|0|19733482|19733482|0|0|
|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()|1|1|1||0|0|68333|68333|1|1|
|authorization_service|SELECT r.* , ( SELECT count(*) FROM authorization_service.account a JOIN authorization_service.account_role2 ar ON a.id = ar.account_id WHERE (ar.tenant_id = ? OR 1214388314719760384 = 0) AND (ar.tenant_app_id = ? OR 1214746418149961728 = 0) AND ar.role_code = r.role_code ) AS count FROM authorization_service.role r WHERE 1 = 1 AND r.role_code IN (?) ORDER BY field(r.role_code, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|1|1|1||0|0|184571|184571|3|3|
|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|184|184||0|0|9720392|9720392|1627|1627|
|user_service|SELECT * FROM corpwx.corpwx_external_user WHERE external_user_id = ?|1|22|22||0|0|2858206|2858206|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 dt.product_name LIKE concat(?, ?, ?) AND (od.status = ?) AND ad.shop_id = ?|1|1|1||0|0|50065|50065|1|1|
|v4_employee|SELECT id, batch_no, task_type, system_task_type, task_frequency , task_name, task_template_id, business_id, shop_id, employee_id , member_id, start_time, end_time, finish_time, send_coupons , recv_coupons, recv_coupon_time, accept_time, plan_arrival_shop_time, arrival_shop_time , trade_nos, trade_num, trade_amount, trade_time, member_name , member_mobile_no, member_latest_birthday, member_sex, member_age, member_level_id , member_level, member_sales_amount, member_sales_count, member_integral_balance, member_integral_total , status, tenant_id, tenant_app_id, create_time, update_time FROM task_task WHERE task_template_id = ? AND member_id = ? AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|1|1|1|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 < ?|1|7|7||0|0|112763|112763|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|28935|28935|0|0|
|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|9773|9773|325|325|
|employee|SELECT count(0) FROM employee.backlog bg WHERE bg.tenant_app_id = ? AND bg.scene NOT IN (?) AND bg.leave_flag = ?|1|4|4||0|0|483996|483996|1|1|
||DELETE FROM v4_user.sjfx_dct_member_source WHERE create_time < ?|1|2|2||0|0|92060|92060|0|0|
|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 = ?|1|1|1||0|0|6854|6854|1|1|
|order|SELECT ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "2" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "5" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "3" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "4" , 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|75057|75057|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|1864458|1864458|796|796|
||DELETE FROM v4_user.sjfx_dct_member WHERE create_time < ?|1|1|1||0|0|102001|102001|0|0|
|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 sg.maintain_employee_id = ? AND sg.status = ?|1|2|2||0|0|8933|8933|1|1|
|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|6|6||0|0|80772|80772|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 = ?|1|1|1||0|0|12226|12226|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|3|3||0|0|827068|827068|516|516|
|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|7162|7162|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.coupon_type = ? AND (cu.coupon_state = ? OR (cu.coupon_state = ? AND ce.writeoff_time IS NOT NULL))|1|1|1||0|0|6854|6854|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 keeping_days > ? AND state = ? AND start_add_time = date_add(CURDATE(), INTERVAL ? * (add_days - ?) DAY)|1|13|13||0|0|1864458|1864458|653|653|
|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|366742|366742|2|2|
|user_service|SELECT count(*) FROM tenant_member_bind tmb JOIN corpwx.external_user_bind eub ON tmb.tenant_id = eub.tenant_id AND tmb.wx_user_id = eub.wx_user_id AND tmb.external_user_id != eub.external_user_id|1|73|73||0|0|19733073|19733073|1|1|
|employee|UPDATE backlog SET status = ?, finish_time = now() WHERE tenant_app_id = ? AND employee_id = ? AND status IN (?) AND shop_id = ?|1|1|1||0|0|2692|2692|0|0|
|user_service|UPDATE tenant_member_bind tmb LEFT JOIN corpwx.external_user_bind eub ON tmb.tenant_id = eub.tenant_id AND tmb.wx_user_id = eub.wx_user_id SET tmb.external_user_id = NULL, tmb.update_time = now() WHERE tmb.wx_user_id IS NOT NULL AND tmb.external_user_id IS NOT NULL AND tmb.external_user_id != ? AND eub.id IS NULL|1|108|108||0|0|17159041|17159041|0|0|
|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_name LIKE CONCAT(CONCAT(?, ?), ?)|1|5|5||0|0|58748|58748|1|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 (?) AND t.un_assign_flag = ?|1|1|1||0|0|340|340|165|165|
|user_service|SELECT count(*) FROM tenant_member_bind tmb LEFT JOIN corpwx.external_user_bind eub ON tmb.tenant_id = eub.tenant_id AND tmb.wx_user_id = eub.wx_user_id WHERE tmb.wx_user_id IS NOT NULL AND tmb.external_user_id IS NOT NULL AND tmb.external_user_id != ? AND eub.id IS NULL ORDER BY tmb.id DESC|1|99|99||0|0|17158856|17158856|1|1|
|timer|UPDATE task_info SET service = ?, name = ?, callback = ?, params = ?, cron = ?, delay = NULL, next_time = ?, status = ?, create_time = ?, update_time = ? WHERE id = ?|1|1|1||0|0|1|1|0|0|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail WHERE create_time < ?|1|1|1||0|0|435586|435586|0|0|
|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|235377|235377|0|0|
|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.tenant_id = ? AND p.product_type = ? AND (ps.id IS NOT NULL OR p.tenant_wechatapp_id = ?)|1|1|1||0|0|51828|51828|1|1|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail_extend WHERE create_time < ?|1|1|1||0|0|242888|242888|0|0|
|employee|SELECT scene FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND expire_time BETWEEN ? AND ? AND status != ? AND scene NOT IN (?) GROUP BY scene|1|1|1||0|0|3063|3063|5|5|
|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 = ?) AND ad.shop_id = ?|1|1|1||0|0|50065|50065|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.create_time >= ? AND od.create_time <= ? AND (od.status = ?) AND od.id IN ( SELECT order_id FROM order_discount WHERE tenant_app_id = ? AND real_discount >= ? ) ORDER BY od.create_time DESC LIMIT ?|1|1|1||0|0|49954|49954|80|80|
|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|1|1||0|0|35276|35276|1|1|
|user_service|select * from user_service.tenant_member_info where tenant_id=? and tenant_app_id=? and user_id in (|1|5|5||0|0|5707|5707|5707|5707|
|goods|SELECT id, img_url, img_index FROM goods_img WHERE goods_id = ? ORDER BY update_time DESC|1|1|1||0|0|26169|26169|3|3|
|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|870154|870154|668|668|
|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|421096|421096|112|112|
|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 ?|1|5|5||0|0|16694624|16694624|10|10|
|user_service|SELECT * FROM v4_user.member WHERE mobile_no = ?|1|4|4||0|0|934572|934572|1|1|
|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|51765|51765|1|1|
|v4_user|SELECT COUNT(*) AS total FROM member_butler t1 JOIN member t2 ON t1.tenant_id = t2.tenant_id AND t1.member_id = t2.id AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t1.shop_id = ? AND t1.employee_id = ? AND t1.tenant_id = ? AND t1.tenant_app_id = ?|1|1|1||0|0|253024|253024|1|1|
