|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|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 if(wca.source = ?, es.sales_date >= ?, date_format(wca.create_time, '%Y-%m-%d') >= ?) AND es.employee_erp_id = ? AND dept_erp_id = ? AND w.id IS NULL AND es.tenant_id = ? AND es.tenant_app_id = ?|595|1029|8||0|0|2718475|20606|595|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 ?|181|408|9||0|0|2436897|35745|181|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 = ?|166|335|11||0|0|1561168|140205|166|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 (|152|227|3||0|0|280369|2797|130818|1339|
|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 (?)|82|188|8||0|0|34446387|1307578|5030|225|
|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 ?|76|149|7||0|0|126883|3331|76|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 ?|59|549|27||0|0|121984957|2067767|112|6|
|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|51|84|3||0|0|234635|16031|226|20|
|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 IN (?) AND es.sales_status = ? AND es.is_sales = ? AND esd.sales_type = ? AND es.tenant_id = ? AND es.tenant_app_id = ?|45|143|17||0|0|848438|31573|45|1|
|v4_user|SELECT id, checkin_employee_name, maintain_employee_name FROM potential_customer WHERE (external_user_id = ? OR member_id = ?) AND status IN (?) AND tenant_id = ? AND tenant_app_id = ? ORDER BY id ASC|39|137|20||0|0|821176|29343|14|1|
|order|SELECT max(create_time) FROM `order`.order_operator_log WHERE tenant_wechatapp_id = ? AND order_id = ?|39|227|16||0|0|40271333|1032643|39|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')|30|534|55||0|0|5770926|302249|13747|4313|
|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 = ?|28|90|8||0|0|652937|23355|9|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 = ?|28|35|1||0|0|81895|4452|28|1|
|v4_employee|SELECT LEFT(start_time, ?) AS day, count(*) AS undo_count , datediff(end_time, ?) AS left_days FROM task_task WHERE task_type = ? AND status = ? AND system_task_type = ? AND finish_time IS NULL AND end_time > ? AND shop_id = ? AND employee_id = ? AND tenant_id = ? AND tenant_app_id = ? GROUP BY LEFT(start_time, ?), end_time|27|39|2||0|0|285326|15619|31|3|
|v4_employee|SELECT tt.task_template_id AS taskId, tt.task_name AS taskName, tt.task_type, tt.system_task_type , count(*) AS num FROM v4_employee.task_task tt JOIN v4_employee.task_system_task_template st ON tt.task_template_id = st.id AND st.`status` = ? AND st.tenant_id = ? AND st.tenant_app_id = ? WHERE tt.task_type = ? AND tt.shop_id = ? AND tt.`status` = ? AND tt.start_time <= ? AND tt.end_time > ? AND tt.finish_time IS NULL AND tt.tenant_id = ? AND tt.tenant_app_id = ? GROUP BY tt.task_template_id, tt.task_name, tt.system_task_type, tt.task_type|27|54|4||0|0|453393|31884|38|4|
|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 ?|26|39|3||0|0|286696|15330|260|10|
|corpwx|UPDATE external_user SET un_assign_flag = ? WHERE tenant_id = ? AND status = ? AND un_assign_flag = ?|25|88|8||0|0|726627|75368|0|0|
|v4_sales|SELECT count(DISTINCT sales_date) FROM v4_sales.erp_sales WHERE member_erp_id IN (?) AND is_sales = ? AND sales_status = ? AND tenant_id = ? AND tenant_app_id = ?|25|54|8||0|0|260713|12762|25|1|
|gift_mail|SELECT ifnull(count(1), ?) AS amount FROM trade WHERE tenant_wechatapp_id = ? AND user_id = ? AND order_status IN (?)|25|45|3||0|0|222525|13106|25|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|24|39|3||0|0|438020|41819|24|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 ?|23|71|9||0|0|8118035|693303|6|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|18|97|18||0|0|815215|112729|113|10|
|v4_sales|SELECT * FROM erp_sales WHERE member_erp_id = ? AND is_sales = ? AND sales_status = ? AND id < ? AND tenant_id = ? AND tenant_app_id = ? ORDER BY sales_date ASC, sales_erp_id ASC LIMIT ?|18|43|6||0|0|772529|54281|18|1|
|v4_employee|INSERT LOW_PRIORITY IGNORE INTO `v4_employee`.`_task_task_new` (`id`, `tenant_id`, `tenant_app_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` , `task_status`, `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`, `member_level_id`, `member_sales_amount` , `member_sales_count`, `member_integral_balance`, `member_integral_total`, `status`, `remark` , `create_time`, `update_time`) SELECT `id`, `tenant_id`, `tenant_app_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` , `task_status`, `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`, `member_level_id`, `member_sales_amount` , `member_sales_count`, `member_integral_balance`, `member_integral_total`, `status`, `remark` , `create_time`, `update_time` FROM `v4_employee`.`task_task` FORCE INDEX (`PRIMARY`) WHERE (`id` > ? OR (`id` = ? AND `tenant_id` >= ?)) AND (`id` < ? OR (`id` = ? AND `tenant_id` <= ?)) LOCK IN SHARE MODE|18|23|2||0|0|128090|13887|0|0|
|authorization_service|SELECT ar.tenant_id, ar.tenant_app_id, a.employee_id, ar.shop_id, ar.role_code , ar.role_name, a.status AS account_status, ar.status AS role_status FROM authorization_service.account_role2 ar JOIN authorization_service.account a ON ar.account_id = a.id WHERE ar.tenant_id = ? AND ar.tenant_app_id = ? AND ar.shop_id = ?|18|22|1||0|0|1160601|64493|333|28|
|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 ?|17|66|18||0|0|419125|80281|17|1|
|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 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 w.id IS NOT NULL AND es.tenant_id = ? AND es.tenant_app_id = ? ORDER BY es.sales_date DESC, es.id DESC LIMIT ?|16|23|3||0|0|9057274|566295|31|5|
|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 = ?|16|27|2||0|0|165343|10336|0|0|
|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|16|269|38||0|0|1271621|80893|16|1|
|v4_sales|SELECT round(avg(cd.score), ?) FROM comment c JOIN comment_detail cd ON cd.comment_id = c.id AND cd.tenant_id = ? AND cd.tenant_app_id = ? WHERE c.erp_dept_id = ? AND c.erp_employee_id = ? AND c.create_time BETWEEN ? AND ? AND c.tenant_id = ? AND c.tenant_app_id = ?|14|16|1||0|0|1570520|145010|14|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 = ?|14|90|19||0|0|774958|92243|14|1|
|wx_gateway|SELECT media_id FROM wx_gateway.wx_image WHERE tenant_app_id = ? AND state = ?|13|41|4||0|0|2852096|219397|10102|819|
|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 = ?)|11|21|5||0|0|3287692|472381|11|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.create_time AS salesDate, 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|11|58|12||0|0|5005541|923800|11|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 if(wca.source = ?, es.sales_date >= ?, date_format(wca.create_time, '%Y-%m-%d') >= ?) AND w.id IS NULL AND es.tenant_id = ? AND es.tenant_app_id = ?|11|18|3||0|0|40236|9923|11|1|
|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 ?|10|17|3||0|0|3890068|389027|20|11|
|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 = ?|10|26|6||0|0|111235|24880|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 = ?|9|57|23||0|0|229583|46644|9|1|
|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|12|1||0|0|30923|4296|9|1|
|v4_user|SELECT COUNT(*) AS total FROM potential_customer WHERE maintain_shop_id = ? AND maintain_employee_id = ? AND status IN (?) AND tenant_id = ? AND tenant_app_id = ?|9|10|1||0|0|8869|1385|9|1|
|employee|UPDATE backlog SET status = ?, finish_time = now() WHERE tenant_app_id = ? AND employee_id = ? AND status IN (?) AND shop_id = ?|9|32|6||0|0|59362|11196|0|0|
|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 = ?)|8|10|2||0|0|19580|2896|8|1|
|v4_sales|SELECT t1.sales_erp_id AS salesErpId, t1.sales_no AS salesNo, DATE_FORMAT(t1.sales_date, '%Y-%m-%d') AS salesDate , t1.member_erp_id AS memberId, t1.employee_erp_id AS employeeErpId, t1.employee_name AS employeeName, t1.assist_employee_erp_id AS assistEmployeeErpId, t1.assist_employee_name AS assistEmployeeName , t1.dept_erp_id AS deptErpId, t1.amount FROM erp_sales t1 WHERE t1.employee_erp_id = ? AND t1.post_time >= ? AND t1.post_time <= ? AND t1.is_sales = ? AND t1.sales_status = ? AND t1.tenant_id = ? AND t1.tenant_app_id = ?|8|12|2||0|0|23942|5308|13|3|
|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 = ?|7|14|4||0|0|4625001|661211|7|1|
|employee|SELECT count(0) FROM employee.backlog t WHERE t.tenant_id = ? AND t.tenant_app_id = ? AND t.employee_id = ? AND t.begin_time >= ? AND t.expire_time < ? AND t.`status` != ? AND t.scene = ?|7|19|3||0|0|40679|6307|7|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 < ?|7|76|21||0|0|803309|114759|0|0|
|v4_user|SELECT COUNT(*) AS total FROM potential_customer WHERE maintain_shop_id = ? AND status IN (?) AND tenant_id = ? AND tenant_app_id = ?|7|11|3||0|0|14577|4378|7|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(?, ?, ?))|6|10|3||0|0|1369452|523373|6|1|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es 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 w.id IS NOT NULL AND es.tenant_id = ? AND es.tenant_app_id = ?|6|13|2||0|0|388359|96564|6|1|
|tenant|SELECT count(0) FROM ( SELECT sg.id, sneak_guest_no, sg.status, sg.user_id, sg.user_type , 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|6|146|43||0|0|482018|80337|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|31|9||0|0|156812|46504|6|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(sgs.sneak_guest_id) AS successNum, ? AS failNum , sum(sgs.`amount`) AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_sales sgs ON g.id = sgs.sneak_guest_id WHERE g.tenant_app_id = ? AND sgs.create_time >= ? AND sgs.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|6|27|10||0|0|1761513|683277|6|1|
|v4_employee|SELECT sum(ifnull(member_integral_total <= ?, ?)) AS `integral_total|2000分以下` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|2001-10000分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|10001-50000分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|50001-99999分` , sum(ifnull(member_integral_total >= ?, ?)) AS `integral_total|100000分以上` , sum(ifnull(member_age <= ?, ?)) AS `age|25岁以下` , sum(ifnull(member_age BETWEEN ? AND ?, ?)) AS `age|26-35岁` , sum(ifnull(member_age BETWEEN ? AND ?, ?)) AS `age|36-40岁` , sum(ifnull(member_age BETWEEN ? AND ?, ?)) AS `age|41-55岁` , sum(ifnull(member_age >= ?, ?)) AS `age|56岁以上` , sum(ifnull(shop_id = ?, ?)) AS `shop|周大生万达店` , sum(ifnull(member_integral_balance <= ?, ?)) AS `integral_balance|2000分以下` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|2001-10000分` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|10001-30000分` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|30001-50000分` , sum(ifnull(member_integral_balance >= ?, ?)) AS `integral_balance|50001分以上` , sum(ifnull(member_sales_amount <= ?, ?)) AS `amount_total_consume|2000元以下` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|2001-10000元` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|10001-50000元` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|50001-99999元` , sum(ifnull(member_sales_amount >= ?, ?)) AS `amount_total_consume|100000元以上` , sum(ifnull(member_sales_count = ?, ?)) AS `consume_num|0次` , sum(ifnull(member_sales_count = ?, ?)) AS `consume_num|1次` , sum(ifnull(member_sales_count = ?, ?)) AS `consume_num|2次` , sum(ifnull(member_sales_count BETWEEN ? AND ?, ?)) AS `consume_num|3-5次` , sum(ifnull(member_sales_count >= ?, ?)) AS `consume_num|6次以上` , sum(ifnull(m|6|34|27||0|0|12405102|2067517|6|1|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es 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 w.id IS NULL AND es.tenant_id = ? AND es.tenant_app_id = ?|6|15|6||0|0|2048874|565939|6|1|
|v4_employee|SELECT sum(ifnull(member_sales_amount <= ?, ?)) AS `amount_total_consume|2000元以下` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|2001-10000元` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|10001-50000元` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|50001-99999元` , sum(ifnull(member_sales_amount >= ?, ?)) AS `amount_total_consume|100000元以上` , sum(ifnull(member_integral_total <= ?, ?)) AS `integral_total|2000分以下` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|2001-10000分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|10001-50000分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|50001-99999分` , sum(ifnull(member_integral_total >= ?, ?)) AS `integral_total|100000分以上` , sum(ifnull(member_sex = ?, ?)) AS `sex|男` , sum(ifnull(member_sex = ?, ?)) AS `sex|女` , sum(ifnull(member_sex = ?, ?)) AS `sex|其他` , sum(ifnull(member_age <= ?, ?)) AS `age|25岁以下` , sum(ifnull(member_age BETWEEN ? AND ?, ?)) AS `age|26-35岁` , sum(ifnull(member_age BETWEEN ? AND ?, ?)) AS `age|36-40岁` , sum(ifnull(member_age BETWEEN ? AND ?, ?)) AS `age|41-55岁` , sum(ifnull(member_age >= ?, ?)) AS `age|56岁以上` , sum(ifnull(member_level_id = ?, ?)) AS `member_level|粉丝会员` , sum(ifnull(member_level_id = ?, ?)) AS `member_level|黄金会员` , sum(ifnull(member_level_id = ?, ?)) AS `member_level|铂金会员` , sum(ifnull(member_level_id = ?, ?)) AS `member_level|钻石会员` , sum(ifnull(member_sales_count = ?, ?)) AS `consume_num|0次` , sum(ifnull(member_sales_count = ?, ?)) AS `consume_num|1次` , sum(ifnull(member_sales_count = ?, ?)) AS `consume_num|2次` , sum(ifnull(member_sales_count BETWEEN ? AND ?, ?)) AS `consume_num|3-5次` , sum(ifnull(member_sales_count >= ?, ?)) AS `consume_num|6次以上` , sum(ifnull(shop_id = ?, ?)) AS `shop|周大生万达店` , sum(ifnull(member_integral_balance <= ?, ?)) A|5|25|20||0|0|10337585|2067517|5|1|
|tenant|SELECT count(*) AS amount FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? AND create_time <= ?|5|6|1||0|0|17712|4048|5|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 maintain_shop_id = ? AND tenant_id = ? AND tenant_app_id = ?|5|10|2||0|0|17342|3863|0|0|
|authorization_service|update user_login_token set status=? where login_token in (|5|13|4||0|0|9048|4766|0|0|
|erp_app|COMMIT ?|5|6|1||0|0|0|0|0|0|
|employee|UPDATE backlog_system SET status = ?, finish_time = now() WHERE tenant_app_id = ? AND scene = ?|5|23|16||0|0|2964050|1337822|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 = ?|5|8|2||0|0|337446|156762|5|1|
|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 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 = ? ORDER BY tm.id DESC LIMIT ?|5|7|3||0|0|47457|10491|60|12|
|v4_employee|SELECT count(*) AS total_count, count(finish_time) AS finish_count , ifnull(sum(if(finish_time >= ? AND finish_time < ?, ?, ?)), ?) AS todayFinishCount , count(send_coupons) AS coupon_send_count, count(recv_coupons) AS coupon_recv_count , count(accept_time) AS accept_count, count(arrival_shop_time) AS arrival_shop_count , count(trade_time) AS trade_count FROM task_task WHERE task_type = ? AND status = ? AND shop_id = ? AND employee_id = ? AND system_task_type = ? AND start_time <= ? AND end_time > ? AND tenant_id = ? AND tenant_app_id = ?|5|8|2||0|0|21698|15992|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|18|11||0|0|1308026|455762|243|89|
|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 = ?|5|8|2||0|0|337446|156762|5|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|5|15|4||0|0|76636|23736|14800|4597|
|wx_gateway|SELECT DISTINCT t1.news_id FROM wx_news_articles t1 WHERE t1.tenant_app_id = ? AND t1.title LIKE concat(?, ?, ?)|5|8|2||0|0|67650|13530|5|1|
|tenant|SELECT id, tenant_id, tenant_app_id, user_id, status , group_label, maintain_level, remark, create_time, create_shop_id , create_employee_id, update_time, update_shop_id, update_employee_id, sales_amount , next_maintain_date, maintain_employee_id, sneak_guest_no, last_maintain_date, finish_date , fail_type, oid, user_type FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? ORDER BY id DESC|5|6|1||0|0|35424|8096|17712|4048|
|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 = ?|4|7|3||0|0|1059859|864657|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 ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ...|4|12|6||0|0|4318065|1406800|1157|344|
|user_service|SELECT count(*) FROM user_service.user_employee ue WHERE ue.tenant_id = ? AND ue.employee_id = ? AND ue.tenant_wechatapp_id = ? AND ue.shop_id = ?|4|6|2||0|0|14805|4313|4|1|
|v4_sales|SELECT COUNT(*) AS total FROM warranty WHERE member_id IN (?) AND is_disable = ? AND tenant_id = ? AND tenant_app_id = ?|4|11|3||0|0|30078|7524|4|1|
|v4_employee|SELECT COUNT(*) FROM ( 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 = ? ) TOTAL|4|7|2||0|0|38836|10190|4|1|
|user_service|SELECT ue.id AS userEmployeeId, ue.tenant_id AS tenantId, ue.tenant_wechatapp_id AS tenantAppId, ue.shop_id AS shopId, tu.user_id AS userId , tu.user_name AS nickName, tu.user_name AS userName, tu.mobile_no AS mobileNo, tu.head_img_url AS headImgUrl FROM user_service.user_employee ue JOIN user_service.tenant_member tu ON tu.tenant_id = ue.tenant_id AND ue.tenant_wechatapp_id = tu.tenant_app_id AND ue.user_id = tu.user_id WHERE ue.tenant_id = ? AND ue.tenant_wechatapp_id = ? AND ue.employee_id = ? AND ue.shop_id = ?|4|5|1||0|0|20662|5944|10331|2972|
|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, t.remark, 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 ?|4|4|1||0|0|2642138|661181|25|10|
|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 = ?|4|4|1||0|0|30320|14985|4|1|
|v4_employee|SELECT count(*) AS total_count, count(finish_time) AS finish_count FROM task_task t JOIN task_invite_task_template t2 ON t.task_template_id = t2.id AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t2.invite_time < ? AND t.end_time > ? AND t2.status IN (?) AND t.task_type = ? AND t.status = ? AND t.shop_id = ? AND t.tenant_id = ? AND t.tenant_app_id = ?|3|7|3||0|0|285812|136081|3|1|
|tenant|SELECT sales_erp_id FROM tenant.erp_sales es JOIN tenant.erp_sales_ignore ei ON ei.tenant_id = ? AND ei.tenant_app_id = ? AND es.sales_erp_id = ei.erp_sales_id WHERE es.tenant_id = ? AND es.tenant_wechatapp_id = ? AND member_erp_id = ?|3|3|1||0|0|25996|8928|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()|3|5|2||0|0|557527|544543|0|0|
|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.tenant_id = ? AND t.tenant_app_id = ?|3|8|4||0|0|1984537|661519|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 = ? OR external_user_id = ?) AND status IN (?) AND maintain_shop_id = ? AND tenant_id = ? AND tenant_app_id = ?|3|3|1||0|0|13623|5169|0|0|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE coupon_status = ? AND member_id = ? AND tenant_id = ? AND tenant_app_id = ?|3|7|3||0|0|17209|5743|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(sgs.sneak_guest_id) AS successNum , ? AS failNum, sum(sgs.`amount`) AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_sales sgs ON g.tenant_app_id = sgs.tenant_app_id AND g.id = sgs.sneak_guest_id WHERE g.tenant_app_id = ? AND sgs.create_time >= ? AND sgs.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|1243588|807575|35|17|
|gift_mail|SELECT count(0) FROM trade WHERE tenant_wechatapp_id = ? AND user_id = ?|3|4|1||0|0|21900|8946|3|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|3|86|43||0|0|243602|81201|3|1|
|tenant|SELECT sg.tenant_app_id AS tenantAppId, sg.create_shop_id AS shopId, sg.maintain_employee_id AS employeeId, emp.corp_wx_user_id AS corpwxUserId , count(*) AS waitMaintainNum FROM tenant.sneak_guest sg JOIN tenant.employee emp ON sg.maintain_employee_id = emp.id WHERE sg.tenant_app_id = ? AND sg.status = ? AND sg.next_maintain_date >= CURRENT_DATE AND sg.next_maintain_date < DATE_ADD(CURRENT_DATE, INTERVAL ? DAY) GROUP BY sg.tenant_app_id, sg.create_shop_id, sg.maintain_employee_id, emp.corp_wx_user_id|3|4|1||0|0|37520|25421|15|10|
|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 = ?)|3|4|2||0|0|159401|53159|3|1|
|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 (|3|3|1||0|0|9917|3987|9917|3987|
|activity_service|SELECT count(DISTINCT user_id) FROM user_trace WHERE tenant_app_id = ? AND activity_id = ? AND status != ?|3|3|1||0|0|10545|3515|3|1|
|tenant|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 LIMIT ?|2|33|16||0|0|162414|81207|12|6|
|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|2|1||0|0|404092|334153|2|1|
|wx_gateway|SELECT count(*) FROM wx_gateway.wx_image WHERE tenant_app_id = ? AND state = ?|2|6|4||0|0|438794|219397|2|1|
|user_service|UPDATE user_service.tenant_member_info t1 JOIN user_service.user_employee t2 ON t1.tenant_id = t2.tenant_id AND t1.tenant_app_id = t2.tenant_wechatapp_id AND t1.user_id = t2.user_id SET t1.shop_id = ?, t2.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? AND t2.employee_id = ? AND t1.shop_id = ?|2|4|2||0|0|11266|5798|0|0|
|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(?)|2|3|1||0|0|1766|978|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|8|6||0|0|53932|43973|15|8|
|v4_sales|SELECT ifnull(round(avg(cd.score), ?), ?) FROM comment c JOIN comment_detail cd ON cd.comment_id = c.id AND cd.subject_type = ? AND cd.tenant_id = ? AND cd.tenant_app_id = ? WHERE c.erp_dept_id = ? AND c.create_time BETWEEN ? AND ? AND c.tenant_id = ? AND c.tenant_app_id = ?|2|2|1||0|0|217193|108798|2|1|
|coupon_service|SELECT * FROM coupon_service.coupon_can_give WHERE coupon_id = ? LIMIT ?|2|5|3||0|0|612704|306352|2|1|
|gift_mail|SELECT count(0) FROM ( SELECT p.id, p.default_image_url, p.product_name, p.product_type, p.tag_price , ifnull(pp.integral_price, ifnull(( SELECT min(inventory.price) FROM gift_mail.inventory WHERE inventory.product_id = p.id ), ?)) AS price , p.volume, p.category_id, p.product_status, ? AS quantity, pp.partner_id AS partner_id , p.topping FROM gift_mail.product p LEFT JOIN gift_mail.partner_product pp ON p.id = pp.product_id LEFT JOIN gift_mail.product_status ps ON ps.product_id = p.id WHERE p.tenant_id = ? AND product_status = ? AND (p.is_disable IS NULL OR p.is_disable = ?) AND (ps.tenant_wechatapp_id = ? OR p.product_type = ?) ) p WHERE p.topping = ?|2|4|2||0|0|34410|17233|2|1|
|user_service|SELECT count(*) FROM user_service.tenant_member_info t WHERE t.tenant_id = ? AND t.tenant_app_id = ? AND t.shop_id = ?|2|2|1||0|0|48620|24310|2|1|
|v4_user|SELECT id FROM member_points_detail WHERE member_points_id = ? AND oper_biz_id = ? AND oper_biz_type = ? AND status = ? AND tenant_id = ? AND tenant_app_id = ? LIMIT ?|2|2|1||0|0|5588|2795|0|0|
|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|
|v4_employee|SELECT COUNT(*) AS total FROM mark_label_task WHERE employee_id = ? AND start_time >= ? AND end_time < ? AND status = ? AND tenant_id = ? AND tenant_app_id = ?|2|3|1||0|0|907|565|2|1|
|wx_gateway|SELECT count(0) FROM wx_gateway.wx_image WHERE tenant_app_id = ? AND state = ?|2|6|4||0|0|438794|219397|2|1|
|v4_user|SELECT id, checkin_employee_name, maintain_employee_name FROM potential_customer WHERE member_id = ? AND status IN (?) AND tenant_id = ? AND tenant_app_id = ? ORDER BY id ASC|2|4|2||0|0|52656|29345|1|1|
|goods|SELECT id, img_url, img_index FROM goods_img WHERE goods_id = ? ORDER BY update_time DESC|2|3|1||0|0|54711|27356|3|2|
|employee|SELECT count(*) FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND status = ? AND expire_time BETWEEN ? AND ?|2|13|9||0|0|70749|59158|2|1|
|user_service|SELECT * FROM user_employee WHERE tenant_wechatapp_id = ? AND employee_id = ?|2|2|1||0|0|6350|3525|6350|3525|
|v4_sales|SELECT count(s.sales_erp_id) FROM ( SELECT esd.product_barcode, max(esd.sales_erp_id) AS sales_erp_id, max(esd.category_erp_id) AS category_erp_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.tenant_id = ? AND esd.tenant_app_id = ? WHERE dept_erp_id = ? AND employee_erp_id = ? AND es.sales_status = ? AND es.is_sales = ? AND es.tenant_id = ? AND es.tenant_app_id = ? GROUP BY esd.product_barcode ) s LEFT JOIN v4_sales.value_added_ignore i ON i.erp_sales_id = s.sales_erp_id AND i.product_barcode = s.product_barcode AND i.tenant_id = ? AND i.tenant_app_id = ? LEFT JOIN v4_sales.value_added va ON va.erp_sales_id = s.sales_erp_id AND va.product_barcode = s.product_barcode AND va.tenant_id = ? AND va.tenant_app_id = ? LEFT JOIN v4_sales.value_added_category vac ON vac.erp_category_id = s.category_erp_id AND vac.status = ? AND vac.tenant_id = ? AND vac.tenant_app_id = ? LEFT JOIN v4_sales.value_added_template vat ON vat.id = vac.template_id AND vat.status = ? AND vat.tenant_id = ? AND vat.tenant_app_id = ? WHERE va.id IS NULL AND i.id IS NULL AND vat.id IS NOT NULL|2|2|1||0|0|176|88|2|1|
|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 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 w.id IS NULL AND es.tenant_id = ? AND es.tenant_app_id = ? ORDER BY es.sales_date DESC, es.id DESC LIMIT ?|2|3|2||0|0|916958|565939|4|3|
|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|14|7||0|0|1090393|545706|148|78|
|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, t.remark, 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.tenant_id = ? AND t.tenant_app_id = ? ORDER BY t.finish_time DESC, t.id DESC LIMIT ?|2|2|1||0|0|1323044|661527|8|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 (|2|7|6||0|0|2315679|1406872|637|364|
|user_service|SELECT count(0) FROM ( SELECT count(1) FROM user_source us WHERE us.tenant_id = ? AND us.tenant_wechatapp_id = ? AND us.from_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 ) table_count|2|2|1||0|0|4082|2092|2|1|
|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|8|6||0|0|55960|45701|691|583|
|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 if(wca.source = ?, es.sales_date >= ?, date_format(wca.create_time, '%Y-%m-%d') >= ?) AND w.id IS NOT NULL AND es.tenant_id = ? AND es.tenant_app_id = ?|2|4|2||0|0|24475|20626|2|1|
|v4_sales|SELECT id, sales_erp_id, sales_no, sales_date, member_erp_id , employee_erp_id, employee_name, assist_employee_erp_id, assist_employee_name, dept_erp_id , amount, sales_remark, receipts, sales_status, is_sales , busi_date, erp_create_time, recommend_id, post_time, tenant_id , tenant_app_id, create_time, update_time FROM erp_sales WHERE sales_no = ? AND tenant_id = ? AND tenant_app_id = ?|2|4|3||0|0|354794|177417|2|1|
|erp_sync|SELECT * FROM erp_sync.retry_data WHERE (need_erp_member_id = ? OR (need_erp_member_id = ? AND erp_member_id IS NOT NULL)) AND retry_times > ? ORDER BY id|2|2|1||0|0|16259|11910|1668|834|
|v4_user|SELECT t1.id, t1.external_user_id AS externalUserId, t1.checkin_time, t1.maintain_num AS maintainNum , if(t2.event_type = ?, t1.next_maintain_time, NULL) AS nextMaintainTime , t2.event_type AS `status` , CASE t2.event_type WHEN ? THEN ? WHEN ? THEN ? ELSE ? END AS statusName, t2.create_time AS maintainTime FROM potential_customer_maintain t2 JOIN potential_customer t1 ON t1.id = t2.potential_customer_id AND t1.tenant_id = ? AND t1.tenant_app_id = ? WHERE t2.maintain_shop_id = ? AND t2.maintain_employee_id = ? AND t2.create_time >= ? AND t2.create_time < ? AND t2.event_type IN (?) AND t2.tenant_id = ? AND t2.tenant_app_id = ? ORDER BY t2.id LIMIT ?|2|19|14||0|0|683922|341961|18|9|
|warranty_service|SELECT count(*) FROM warranty WHERE user_id = ? AND tenant_wechatapp_id = ? AND is_disable = ?|2|26|15||0|0|28596|14298|2|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(?, ?, ?))|2|4|3||0|0|5726|3856|2|1|
|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|5|2||0|0|42771|21423|1|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 >= ?|2|2|1||0|0|833|596|2|1|
|tenant|SELECT sg.id, sneak_guest_no, sg.status, sg.user_id, sg.user_type , 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 = ?) LIMIT ?|2|33|16||0|0|160542|80271|20|10|
|coupon_service|SELECT cmod.coupon_id, cmo.pay_type, cmo.id AS orderId, cmo.cash_flow_id AS payId 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 (?)|2|2|1||0|0|71180|35590|40|20|
|gift_mail|SELECT ifnull(sum(quantity), ?) FROM gift_mail.trade WHERE tenant_wechatapp_id = ? AND user_id = ? AND trade_type = ? AND product_id = ? AND order_status IN (?) AND source = ?|2|2|1||0|0|11386|7378|2|1|
|v4_user|SELECT id, member_name, mobile_no, head_img_url, combine_status , combine_id FROM member WHERE (mobile_no LIKE ? OR member_name LIKE ?) AND tenant_id = ? AND tenant_app_id = ? LIMIT ?|2|6|4||0|0|318281|159148|1|1|
|user_service|select tenant_id, id, tenant_app_id, user_id, wx_user_id, erp_member_id, customer_user_id, wx_union_id, create_time, update_time, external_user_id from tenant_member_bind WHERE ( tenant_id = ? and tenant_app_id = ? and user_id in (|2|2|1||0|0|8967|8504|8967|8504|
|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 = ?|2|13|7||0|0|71452|35728|2|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|198|198|97|97|
|v4_employee|SELECT count(*) AS total_count, count(finish_time) AS finish_count FROM task_task t JOIN task_invite_task_template t2 ON t.task_template_id = t2.id AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t2.invite_time < ? AND t.end_time > ? AND t2.status IN (?) AND t.task_type = ? AND t.status = ? AND t.shop_id = ? AND t.employee_id = ? AND t.tenant_id = ? AND t.tenant_app_id = ?|1|1|1||0|0|10483|10483|1|1|
|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.employee_id = ? AND t.tenant_id = ? AND t.tenant_app_id = ?|1|2|2||0|0|3528|3528|1|1|
|v4_user|INSERT INTO cwx_external_user (id, external_user_id, external_user_name, sex, create_time , update_time, tenant_id) VALUES (?, ?, ?, ?, ? , ?, ?)|1|1|1||0|0|0|0|0|0|
|v4_employee|SELECT count(*) FROM v4_employee.task_task|1|9|9||0|0|2067517|2067517|1|1|
|v4_user|SELECT count(*) FROM member_change_log t1 WHERE t1.change_type IN (?) AND t1.change_time >= ? AND t1.change_time < ? AND t1.new_shop_id = ? AND t1.tenant_id = ? AND t1.tenant_app_id = ?|1|4|4||0|0|334500|334500|1|1|
|v4_user|SELECT id, tenant_id, params_key, params_value, group_id , create_time, update_time FROM corpwx.corp_mini_qrcode_params WHERE group_id = ?|1|1|1||0|0|481659|481659|5|5|
|v4_sales|SELECT sum(amount_total) 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 IN (?) AND es.sales_status = ? AND es.is_sales = ? AND esd.sales_type IN (?) AND es.tenant_id = ? AND es.tenant_app_id = ?|1|1|1||0|0|31548|31548|1|1|
|wx_gateway|SELECT count(0) FROM wx_template_msg WHERE tenant_id = ? AND tenant_app_id = ? AND create_time BETWEEN ? AND ?|1|3|3||0|0|8494|8494|1|1|
|authorization_service|SELECT id, user_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, employee_id, shop_id, platform_user_id, wx_user_id , wx_app_user_id FROM user_login_token WHERE user_id = ? AND tenant_id = ? AND tenant_wx_app_id = ? AND login_way = ? AND status = ? AND expire_time > now()|1|1|1||0|0|321|321|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|6436|6436|3218|3218|
|mysql|DELETE FROM message_push.message_log WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|62|62||0|0|2237128|2237128|0|0|
||UPDATE v4_user.member_import SET birthday = NULL WHERE birthday = ? AND tenant_id = ?|1|9|9||0|0|1170581|1170581|0|0|
|user_service|SELECT ue.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.user_employee ue JOIN user_service.tenant_member tm ON tm.tenant_id = ue.tenant_id AND tm.tenant_app_id = ue.tenant_wechatapp_id AND tm.user_id = ue.user_id WHERE ue.employee_id = ? AND ue.tenant_id = ? AND ue.tenant_wechatapp_id = ? AND ue.shop_id = ? ORDER BY tm.id DESC LIMIT ?|1|1|1||0|0|2878|2878|10|10|
|coupon_service|SELECT id, tenant_id, tenant_app_id, template_id, shop_id , shop_name, create_time, update_time FROM coupon_limit_shop WHERE tenant_id = ? AND template_id = ?|1|1|1||0|0|24360|24360|0|0|
|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|1|1|1||0|0|464|464|1|1|
|tenant|SELECT id, tenant_id, tenant_app_id, user_id, status , group_label, maintain_level, remark, create_time, create_shop_id , create_employee_id, update_time, update_shop_id, update_employee_id, sales_amount , next_maintain_date, maintain_employee_id, sneak_guest_no, last_maintain_date, finish_date , fail_type, oid, user_type FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_time < ?|1|2|2||0|0|3038|3038|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|1|1||0|0|1406838|1406838|330|330|
|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 ?|1|1|1||0|0|188752|188752|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 IN (?) AND t.order_status = ? AND t.take_type = ? AND tt.shop_id = ?|1|1|1||0|0|7379|7379|1|1|
|export|SELECT count(0) FROM export_log el INNER JOIN export_file ef ON el.tenant_app_id = ef.tenant_app_id AND el.batch_no = ef.batch_no AND el.md5_key = ef.md5_key AND el.export_code = ef.export_code WHERE el.tenant_app_id = ? AND el.employee_id = ? AND el.batch_no BETWEEN ? AND ?|1|3|3||0|0|56786|56786|1|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|1|1|1||0|0|26212|26212|13106|13106|
|v4_employee|SELECT table_schema, table_name FROM information_schema.key_column_usage WHERE referenced_table_schema = ? AND referenced_table_name = ?|1|3|3||0|0|5272|5272|0|0|
|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|3|3||0|0|4873|4873|8|8|
|user_service|SELECT tenant_id, id, tenant_app_id, user_id, mobile_no , user_name, head_img_url, sex, status, create_time , update_time FROM tenant_member WHERE tenant_id = ? AND tenant_app_id = ? AND user_name LIKE ?|1|1|1||0|0|114308|114308|0|0|
|export|SELECT count(0) FROM export_log el INNER JOIN export_file ef ON el.tenant_app_id = ef.tenant_app_id AND el.batch_no = ef.batch_no AND el.md5_key = ef.md5_key AND el.export_code = ef.export_code WHERE el.tenant_app_id = ? AND el.employee_id = ? AND el.batch_no BETWEEN ? AND ? AND ef.export_code IN (?)|1|1|1||0|0|56756|56756|1|1|
|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|106948|106948|1|1|
|erp_sync|INSERT INTO retry_data (id, tenant_id, tenant_app_id, business_type, operation_type , data_id, user_id, erp_member_id, need_erp_member_id, retry_times , msg, send_time, create_time, data) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?, ?)|1|1|1||0|0|0|0|0|0|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail WHERE create_time < ?|1|1|1||0|0|235441|235441|0|0|
|activity_service|SELECT count(*) FROM activity_signup_user_apply WHERE activity_id = ? AND audit_status IN (?)|1|1|1||0|0|2449|2449|1|1|
|user_service|SELECT count(0) FROM ( SELECT count(1) FROM user_source us WHERE us.tenant_id = ? AND us.tenant_wechatapp_id = ? AND us.from_id = ? AND us.shop_id = ? AND us.source_type = ? AND us.from_id IS NOT NULL AND us.shop_id IS NOT NULL ) table_count|1|1|1||0|0|17938|17938|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|3|3||0|0|59158|59158|1|1|
|v4_user|SELECT checkin_time, id FROM potential_customer WHERE maintain_shop_id = ? AND status IN (?) AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|3243|3243|576|576|
|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|19|19||0|0|2055594|2055594|0|0|
|coupon_service|SELECT count(0) FROM coupon_service.template t LEFT JOIN coupon_service.template_redpack r ON r.template_id = t.id LEFT JOIN coupon_service.template_activity a ON a.template_id = t.id WHERE t.state != ? AND t.tenant_app_id = ? AND (t.tenant_app_id = ?)|1|1|1||0|0|21519|21519|1|1|
|coupon_service|SELECT market_id AS id, count(market_id) AS quantity FROM ( SELECT market_id FROM coupon_service.coupon_market_order WHERE market_id IN (?) AND order_state = ? GROUP BY user_id, market_id ) number GROUP BY market_id|1|3|3||0|0|543642|543642|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|4|4||0|0|865215|865215|287|287|
|v4_sales|SELECT id, comment_id, subject_id, subject_type, subject , score, labels, content, tenant_id, tenant_app_id , create_time, update_time FROM comment_detail WHERE comment_id = ? AND tenant_id = ? AND tenant_app_id = ?|1|2|2||0|0|108345|108345|5|5|
|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|21431|21431|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|3|3||0|0|249691|249691|0|0|
|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|2|2||0|0|2055599|2055599|854|854|
|authorization_service|SELECT ar.tenant_id, ar.tenant_app_id, a.employee_id, ar.shop_id, ar.role_code , ar.role_name, a.status AS account_status, ar.status AS role_status FROM authorization_service.account_role2 ar JOIN authorization_service.account a ON ar.account_id = a.id WHERE ar.tenant_id = ? AND ar.tenant_app_id = ?|1|1|1||0|0|64820|64820|364|364|
|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|249749|249749|58|58|
|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|455819|455819|36|36|
|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|6|6||0|0|1032643|1032643|1|1|
|tenant|SELECT t.id AS employeeid, t.tenant_id, t.employee_erp_id AS employeeerpid, t.employee_name AS employeename, t.employee_type_id AS employeetypeid , t.employee_type AS employeetype, t.shop_id, sp.shop_name, t.employee_no AS employeeno, t.sex , t.mobile_no AS mobileno, t.corp_wx_user_id, t.head_img_url AS headimgurl, t.dept_erp_id, ed.dept_name AS dept_erp_name , t.status FROM employee t LEFT JOIN tenant_wechatapp_shop sp ON sp.tenant_id = t.tenant_id AND t.shop_id = sp.id LEFT JOIN tenant.erp_department ed ON ed.tenant_id = t.tenant_id AND ed.dept_erp_id = t.dept_erp_id WHERE t.tenant_id = ? AND (t.employee_name LIKE concat(?, ?, ?) OR t.mobile_no LIKE concat(?, ?, ?)) AND t.status IN (?) ORDER BY t.id ASC LIMIT ?|1|1|1||0|0|87231|87231|2|2|
|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|2|2||0|0|25573|25573|669|669|
|user_service|SELECT tm.user_id AS userId, tm.head_img_url AS headImgUrl, tm.user_name AS nickName, tm.mobile_no AS mobileNo, tm.sex , DATE_FORMAT(tm.create_time, '%Y-%m-%d %H:%i:%s') AS registerTime, tm.id AS tenantUserId 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 = ? ORDER BY tm.id ASC LIMIT ?|1|5|5||0|0|38772|38772|10|10|
|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|5|5||0|0|24026|24026|363|363|
|tenant|SELECT t.id AS sneakGuestId, t.tenant_id, t.tenant_app_id, t.user_id, t.user_type , t.maintain_employee_id, t.create_shop_id AS shopId FROM tenant.sneak_guest t JOIN tenant.sneak_guest_maintain m ON m.tenant_app_id = ? AND t.id = m.sneak_guest_id AND m.event_type = ? WHERE t.tenant_app_id = ? AND t.status = ? AND t.create_time < ? GROUP BY t.id HAVING count(*) >= ?|1|24|24||0|0|156165|156165|11840|11840|
|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|3|3||0|0|59166|59166|4|4|
|tenant|SELECT es.id, es.sales_date AS saledate, es.sales_no AS saleno, es.amount FROM tenant.erp_sales es WHERE tenant_id = ? AND tenant_wechatapp_id = ? AND member_erp_id = ? AND dept_erp_id = ? AND employee_erp_id = ? AND sales_status = ? AND is_sales = ? AND create_time > ? AND NOT EXISTS ( SELECT ? FROM tenant.sneak_guest sg JOIN tenant.sneak_guest_sales sgn ON sgn.sneak_guest_id = sg.id WHERE sg.tenant_app_id = ? AND es.id = sgn.sales_id AND user_id = ? )|1|1|1||0|0|252|252|1|1|
|v4_user|SELECT id FROM potential_customer WHERE status IN (?) AND next_maintain_time < ? AND tenant_id = ? AND tenant_app_id = ?|1|5|5||0|0|23300|23300|318|318|
|v4_user|SELECT id, mobile_no FROM member WHERE (mobile_no IN (|1|1|1||0|0|999|999|999|999|
|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 = ?|1|9|9||0|0|48961|48961|1|1|
|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|1|1|1||0|0|431|431|1|1|
|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|63929|63929|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|21431|21431|1|1|
|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|
|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|1|1|1||0|0|452|452|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|2055599|2055599|717|717|
|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 = ?|1|2|2||0|0|4766|4766|4766|4766|
|mysql|DELETE FROM wx_gateway.wx_template_msg WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|28|28||0|0|797394|797394|0|0|
|v4_user|SELECT COUNT(*) AS total FROM potential_customer WHERE maintain_shop_id = ? AND maintain_employee_id IN (?) AND status IN (?) AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|914|914|1|1|
|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|125|125||0|0|11159043|11159043|1137|1137|
|coupon_service|SELECT id, tenant_id, tenant_app_id, template_id, coupon_id , give_user_id, user_id, create_time, update_time FROM user_coupon_give_record WHERE tenant_id = ? AND tenant_app_id = ? AND coupon_id = ? AND give_user_id = ? AND user_id = ?|1|1|1||0|0|1050|1050|0|0|
||DELETE FROM v4_user.member_import WHERE tenant_id = ?|1|33|33||0|0|1429317|1429317|0|0|
|v4_user|SELECT maintain_employee_id, id FROM potential_customer WHERE maintain_shop_id = ? AND status IN (?) AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|3243|3243|576|576|
|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|13497|13497|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|54|54|18|18|
