|数据库名称|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 = ?|730|1285|7||0|0|3468764|28160|730|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 ?|299|699|9||0|0|4790136|36661|299|1|
|v4_employee|SELECT ? AS task_type, t.system_task_type, count(*) AS undo_count FROM task_task t JOIN task_system_task_template st ON t.task_template_id = st.id AND st.status = ? AND st.tenant_id = ? AND st.tenant_app_id = ? WHERE t.`status` = ? AND t.finish_time IS NULL AND t.end_time > ? AND shop_id = ? AND employee_id = ? AND t.task_template_id IN (?) AND t.tenant_id = ? AND t.tenant_app_id = ? GROUP BY t.system_task_type|172|315|4||0|0|477837|6105|280|5|
|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 = ?|101|177|8||0|0|596638|16926|101|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|84|131|4||0|0|123748|1788|56483|807|
|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 (?)|70|171|11||0|0|28665710|1315678|3657|225|
|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|63|91|5||0|0|235694|17936|344|38|
|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')|62|690|31||0|0|15108247|323184|9205|3043|
|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 = ?|52|79|3||0|0|136346|5605|52|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.dept_erp_id = ? AND es.employee_erp_id = ? 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 = ? 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 vat.id IS NOT NULL|44|383|29||0|0|1031286813|77947562|44|1|
|v4_user|SELECT id, member_id, external_user_id, serial_number, checkin_shop_id , checkin_employee_id, checkin_employee_name, checkin_time, maintain_shop_id, maintain_employee_id , maintain_employee_name, first_maintain_time, last_maintain_time, next_maintain_time, maintain_num , intention_num, latest_intention, status, finish_time, finish_shop_id , deal_employee_id, deal_employee_name, deal_sale_amount, fail_employee_id, fail_employee_name , fail_reason, remark, sex, cutomer_grade, maintain_level , tenant_id, tenant_app_id, create_time, update_time FROM potential_customer WHERE (member_id = ? OR external_user_id = ?) AND status IN (?) AND tenant_id = ? AND tenant_app_id = ?|37|73|5||0|0|270022|7676|6|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 = ?|37|58|5||0|0|254831|15102|37|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 = ?|37|58|5||0|0|228089|13191|37|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|37|78|8||0|0|252498|7675|13|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.dept_erp_id = ? AND es.employee_erp_id = ? 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 = ? 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 vat.id IS NOT NULL ORDER BY s.sales_date DESC, s.id DESC LIMIT ?|36|349|29||0|0|956883489|77947749|360|10|
|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 = ?|36|110|11||0|0|693124|32777|36|1|
|tenant|SELECT es.id, es.sales_no, es.sales_date, es.member_erp_id, es.sales_erp_id , es.is_sales FROM erp_sales es WHERE es.tenant_id = ? AND es.tenant_wechatapp_id = ? AND es.sales_status = ? AND es.sales_no LIKE concat(?, ?) ORDER BY es.sales_date DESC LIMIT ?|34|123|12||0|0|13585138|1159801|10|1|
|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|3||0|0|445286|28915|69|5|
|corpwx|UPDATE external_user SET un_assign_flag = ? WHERE tenant_id = ? AND status = ? AND un_assign_flag = ?|24|93|10||0|0|765406|76606|0|0|
|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|23|30|2||0|0|37031|2585|23|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 = ?|20|35|4||0|0|98010|15410|20|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 = ?|20|169|31||0|0|989638|94174|20|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 = ?|18|30|3||0|0|2454200|181655|18|1|
|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 = ?|17|34|4||0|0|174575|13307|17|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 = ?)|15|32|4||0|0|5635718|544958|15|1|
|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 = ?|15|17|1||0|0|969727|64687|402|67|
|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 ?|14|39|7||0|0|541718|54281|14|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|13|21|3||0|0|243062|41819|13|1|
|warranty_service|SELECT count(*) FROM warranty WHERE user_id = ? AND tenant_wechatapp_id = ? AND is_disable = ?|12|130|25||0|0|185512|26184|12|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 ?|12|19|4||0|0|4696908|391484|12|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 NOT NULL AND es.tenant_id = ? AND es.tenant_app_id = ?|11|14|2||0|0|49616|7833|11|1|
|coupon_service|SELECT * FROM coupon_service.coupon_can_give WHERE coupon_id = ? LIMIT ?|11|22|3||0|0|3456117|314833|11|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 = ?|10|15|2||0|0|40078|5354|35|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 = ?|10|50|14||0|0|325563|36660|10|1|
|user_service|SELECT t1.id, t1.user_id AS userId, t1.user_name AS userName, t1.sex, t1.mobile_no AS mobileNo , t1.head_img_url AS headImg FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? JOIN user_service.user_employee ue ON t1.tenant_id = ue.tenant_id AND t1.tenant_app_id = ue.tenant_wechatapp_id AND t1.user_id = ue.user_id AND ue.employee_id = ? AND ue.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? ORDER BY ue.update_time DESC, t1.id DESC LIMIT ?|10|17|4||0|0|106665|21091|100|10|
|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 = ?|8|9|1||0|0|6663|1429|8|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 = ?|7|31|9||0|0|471863|236664|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 = ?|7|16|5||0|0|1087980|868856|7|1|
|v4_sales|SELECT id, template_id, no, member_id, erp_sales_id , product_barcode, product_name, dept_id, amount_total, amount_pay , added_amount, added_rate, added_days, keep_days, impairment_rate , exchange_days, added_time, status, coupon_id, tenant_id , tenant_app_id, create_time, update_time FROM value_added WHERE member_id = ? AND status <> ? AND tenant_id = ? AND tenant_app_id = ?|7|11|2||0|0|416177|59463|26|17|
|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 = ?|7|11|2||0|0|27282|6118|7|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|7|21|6||0|0|7587526|1235567|2561|504|
|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 ?, ?|7|26|8||0|0|2786606|483101|18|3|
|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 = ?)|7|10|2||0|0|19561|2800|7|1|
|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 = ?|7|8|1||0|0|928740|133000|35|5|
|v4_user|SELECT maintain_employee_id, id FROM potential_customer WHERE maintain_shop_id = ? AND status IN (?) AND tenant_id = ? AND tenant_app_id = ?|7|10|1||0|0|15686|2784|2172|630|
|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|6|9|2||0|0|20972|8744|47|11|
|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|6|9|2||0|0|22586|8903|585|163|
|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|6|7|1||0|0|28343|17975|6|1|
|v4_coupon|UPDATE v4_coupon.coupon SET coupon_status = ? WHERE tenant_id = ? AND tenant_app_id = ? AND coupon_status = ? AND end_time < now()|5|7|2||0|0|697146|659037|0|0|
|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 = ?)|5|6|1||0|0|186141|37236|5|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(?, ?, ?))|5|6|1||0|0|15973|6943|5|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 = ?|5|8|2||0|0|484084|112742|5|1|
|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 = ?|5|6|1||0|0|3480|982|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|14|8||0|0|1320491|459495|325|140|
|employee|SELECT count(*) FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND status = ? AND expire_time BETWEEN ? AND ?|4|9|4||0|0|30182|12464|4|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|4|6|2||0|0|9716461|3716837|4|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|4|5|2||0|0|25882|8220|12941|4110|
|v4_coupon|SELECT COUNT(*) AS total FROM ( SELECT DISTINCT c.id, c.activity_name, c.push_time, c.tag_id, c.butler_call_member FROM v4_coupon.tag_push_coupon c JOIN v4_coupon.tag_push_coupon_log l ON l.tag_push_coupon_id = c.id AND l.push_coupon_state = ? AND l.tenant_id = ? AND l.tenant_app_id = ? WHERE c.push_state = ? AND c.butler_visible = ? AND l.shop_id = ? AND l.employee_id = ? AND c.push_time >= ? AND c.tenant_id = ? AND c.tenant_app_id = ? ORDER BY c.push_time DESC ) c|4|10|5||0|0|953381|238452|4|1|
|employee|UPDATE backlog_system SET status = ?, finish_time = now() WHERE tenant_app_id = ? AND scene = ?|4|21|16||0|0|1811035|1357899|0|0|
|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 < ?|4|8|4||0|0|459827|114959|0|0|
|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 ?|4|8|3||0|0|37092|9921|48|12|
|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 = ?|4|7|2||0|0|42261|18777|4|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 = ?|4|6|1||0|0|8837|2210|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 = ?|4|5|1||0|0|8418|2784|1570|630|
|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.dept_erp_id = ? AND es.employee_erp_id = ? 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 = ? 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 vat.id IS NOT NULL|3|20|7||0|0|64049316|21349772|3|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.dept_erp_id = ? AND es.employee_erp_id = ? 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 = ? 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 vat.id IS NOT NULL ORDER BY s.sales_date DESC, s.id DESC LIMIT ?|3|22|7||0|0|64050660|21350220|30|10|
|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|9918|3991|9918|3991|
|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 = ?|3|7|2||0|0|788523|355586|3|1|
|tenant|SELECT count(*) AS amount FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? AND create_time <= ?|2|3|2||0|0|8220|4110|2|1|
|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|304359|171942|2|1|
|tenant|COMMIT ?|2|2|1||0|0|0|0|0|0|
|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|5|4||0|0|935480|580664|3|2|
|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 = ?|2|3|1||0|0|321990|161001|2|1|
|gift_mail|SELECT count(*) FROM gift_mail.trade t WHERE t.tenant_wechatapp_id = ? AND t.trade_type = ? AND t.order_status = ?|2|3|2||0|0|17994|8997|2|1|
|user_service|SELECT count(0) FROM user_service.user_source us LEFT JOIN user_service.tenant_member m ON m.user_id = us.user_id LEFT JOIN user_service.user_employee ue ON ue.user_id = m.user_id WHERE m.tenant_id = ? AND m.tenant_app_id = ? AND us.tenant_id = ? AND us.tenant_wechatapp_id = ? AND ue.tenant_id = ? AND ue.tenant_wechatapp_id = ? AND us.shop_id = ? AND us.from_id = ? AND us.create_time >= ? AND us.create_time < ? AND us.source_type = ? AND us.from_id IS NOT NULL AND us.shop_id IS NOT NULL|2|4|2||0|0|20446|10226|2|1|
|user_service|SELECT * FROM user_employee WHERE tenant_wechatapp_id = ? AND employee_id = ?|2|2|1||0|0|6359|3532|6359|3532|
|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 = ?|2|3|1||0|0|7665|4296|2|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 = ?|2|3|1||0|0|321990|161001|2|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|2|7|4||0|0|55303|27656|15|9|
|employee|UPDATE backlog SET status = ?, finish_time = now() WHERE tenant_app_id = ? AND employee_id = ? AND status IN (?) AND shop_id = ?|2|4|2||0|0|7755|5621|0|0|
|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(?, ?, ?))|2|4|2||0|0|90690|45346|2|1|
|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 = ? AND t2.tenant_id = ? AND t2.tenant_app_id = ? ORDER BY t2.id LIMIT ?|2|20|14||0|0|726844|363422|20|10|
|authorization_service|update user_login_token set status=? where login_token in|2|3|2||0|0|3802|2249|0|0|
|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|2|1||0|0|249330|160275|2|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|2|3|1||0|0|11871|6608|7|7|
|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|19|10||0|0|1322369|661832|1488|747|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE coupon_status = ? AND member_id = ? AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|6189|6189|1|1|
|mysql|DELETE FROM message_push.message_log WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|78|78||0|0|2848608|2848608|0|0|
|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 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 = ?) AND va.id IS NOT NULL|1|1|1||0|0|756865|756865|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|5428|5428|2714|2714|
|gift_mail|SELECT count(0) FROM gift_mail.trade t LEFT JOIN gift_mail.product p ON p.id = t.product_id LEFT JOIN gift_mail.trade_take tt ON tt.trade_id = t.id WHERE t.tenant_wechatapp_id = ? AND t.trade_type = ? AND t.order_status = ?|1|1|1||0|0|17001|17001|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|252635|252635|0|0|
|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|3|3||0|0|2249|2249|2249|2249|
|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|2073102|2073102|1238|1238|
|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|968|968|1|1|
|user_service|SELECT t1.id, t1.user_id AS userId, t1.user_name AS userName, t1.sex, t1.mobile_no AS mobileNo , t1.head_img_url AS headImg FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? JOIN user_service.user_employee ue ON t1.tenant_id = ue.tenant_id AND t1.tenant_app_id = ue.tenant_wechatapp_id AND t1.user_id = ue.user_id AND ue.employee_id = ? AND ue.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? ORDER BY ue.update_time DESC, t1.id DESC LIMIT ?, ?|1|1|1||0|0|12792|12792|10|10|
|employee|UPDATE backlog SET leave_flag = ? WHERE tenant_app_id = ? AND employee_id = ?|1|1|1||0|0|3110|3110|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 = ? AND status IN (?) AND maintain_shop_id = ? AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|2213|2213|0|0|
|mysql|DELETE FROM wx_gateway.wx_template_msg WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|28|28||0|0|809576|809576|0|0|
|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|3|3||0|0|252772|252772|137|137|
|order|SELECT count(*) FROM order_info WHERE tenant_wechatapp_id = ? AND status = ? AND payment_time BETWEEN ? AND ? AND confirm_time IS NULL|1|1|1||0|0|2787|2787|1|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(?)|1|1|1||0|0|801|801|1|1|
|v4_sales|SELECT COUNT(*) AS total FROM warranty WHERE member_id IN (?) AND is_disable = ? AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|7975|7975|1|1|
|v4_sales|SELECT * FROM v4_sales.value_added WHERE date_format(date_add(added_time, INTERVAL added_days + ? DAY), '%Y-%m-%d') = ? AND status = ? AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|59433|59433|0|0|
|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.dept_erp_id = ? AND es.employee_erp_id = ? 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 va.id IS NOT NULL|1|6|6||0|0|18307454|18307454|1|1|
|v4_user|SELECT id FROM potential_customer WHERE status IN (?) AND next_maintain_time < ? AND tenant_id = ? AND tenant_app_id = ?|1|4|4||0|0|7676|7676|401|401|
|order|SELECT max(create_time) FROM `order`.order_operator_log WHERE tenant_wechatapp_id = ? AND order_id = ?|1|5|5||0|0|1045945|1045945|1|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 = ?) AND va.id IS NOT NULL ORDER BY s.sales_date DESC, s.id DESC LIMIT ?|1|1|1||0|0|505271|505271|1|1|
|v4_user|SELECT t1.maintain_shop_id, t1.maintain_employee_id, t1.maintain_level, count(*) AS maintainNum FROM potential_customer t1 WHERE t1.tenant_app_id = ? AND t1.`status` IN (?) AND t1.next_maintain_time >= ? AND t1.tenant_id = ? AND t1.tenant_app_id = ? GROUP BY t1.maintain_shop_id, t1.maintain_employee_id, t1.maintain_level|1|3|3||0|0|8377|8377|351|351|
|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 >= ? AND create_time <= ?|1|1|1||0|0|718|718|1|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 ?|1|1|1||0|0|355585|355585|3|3|
|employee|SELECT count(*) FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND status = ? AND finish_time BETWEEN ? AND ?|1|1|1||0|0|1660|1660|1|1|
||DELETE FROM v4_user.sjfx_dct_member_grade WHERE create_time < ?|1|3|3||0|0|157279|157279|0|0|
|timer|INSERT INTO task_execute_log (id, task_id, task_name, task_params, success , error_msg, create_time) VALUES (?, ?, ?, ?, ? , ?, ?)|1|1|1||0|0|0|0|0|0|
|tenant|SELECT count(*) FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? AND maintain_employee_id = ?|1|1|1||0|0|718|718|1|1|
|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|459354|459354|54|54|
|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.dept_erp_id = ? AND t1.member_erp_id IN (?) AND t1.post_time >= ? AND t1.is_sales = ? AND t1.sales_status = ? AND t1.tenant_id = ? AND t1.tenant_app_id = ?|1|1|1||0|0|1035|1035|172|172|
|tenant|SELECT count(*) AS amount FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? AND create_time >= ? AND create_time <= ?|1|1|1||0|0|1380|1380|1|1|
|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 scene = ? AND scene NOT IN (?) ORDER BY id DESC LIMIT ?|1|4|4||0|0|450710|450710|8|8|
|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|2073084|2073084|0|0|
|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 = ?|1|2|2||0|0|355585|355585|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|3728|3728|6|6|
|user_service|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|1|2|2||0|0|5467|5467|5|5|
|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|2073102|2073102|1114|1114|
|activity_service|SELECT id FROM activity_service.activity_qualified WHERE tenant_app_id = ? AND activity_id = ? AND (user_id = ? OR open_id = ?) AND invalid = ? AND (business_id = ? OR business_id IS NULL) ORDER BY id DESC LIMIT ?|1|1|1||0|0|106494|106494|0|0|
||DELETE FROM v4_sales.sjfx_dct_erp_sales_extend1 WHERE create_time < ?|1|6|6||0|0|303241|303241|0|0|
|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 = ?|1|5|5||0|0|33802|33802|1|1|
|v4_employee|SELECT COUNT(*) AS total FROM task_task t JOIN employee e ON e.employee_id = t.employee_id AND e.shop_id = t.shop_id AND e.tenant_id = ? AND e.tenant_app_id = ? LEFT JOIN ( SELECT task_id, GROUP_CONCAT(file_url SEPARATOR '|') AS task_attaches FROM task_task_attach WHERE tenant_id = ? AND tenant_app_id = ? GROUP BY task_id ) tta ON t.id = tta.task_id WHERE t.status = ? AND system_task_type = ? AND t.shop_id = ? AND finish_time >= ? AND finish_time < ? AND t.employee_id = ? AND t.tenant_id = ? AND t.tenant_app_id = ?|1|1|1||0|0|16802|16802|1|1|
|tenant|SELECT count(0) FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND EXISTS ( SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id = sgm.sneak_guest_id AND sgm.event_type = ? AND sgm.intention_info REGEXP ? ) AND sg.status = ?|1|4|4||0|0|4137|4137|1|1|
|tenant|SELECT count(0) FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND EXISTS ( SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id = sgm.sneak_guest_id AND sgm.event_type = ? AND sgm.intention_info REGEXP ? ) AND EXISTS ( SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id = sgm.sneak_guest_id AND sgm.event_type = ? AND sgm.intention_info REGEXP ? ) AND sg.status = ?|1|1|1||0|0|5499|5499|1|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|1|1|1||0|0|2214|2214|0|0|
|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 = ?|1|1|1||0|0|3109|3109|1|1|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail WHERE create_time < ?|1|1|1||0|0|244822|244822|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|25|25||0|0|1883846|1883846|317|317|
|v4_user|SELECT COUNT(*) AS total FROM potential_customer t1 WHERE t1.maintain_shop_id = ? AND t1.maintain_employee_id = ? AND t1.status IN (?) AND t1.tenant_id = ? AND t1.tenant_app_id = ?|1|1|1||0|0|1430|1430|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|133|133||0|0|11300375|11300375|12516|12516|
|timer|UPDATE task_info SET service = ?, name = ?, callback = ?, params = ?, cron = ?, delay = NULL, next_time = NULL, status = ?, create_time = ?, update_time = ? WHERE id = ?|1|1|1||0|0|1|1|0|0|
|v4_user|SELECT t2.id AS memberId, t1.id AS potentialCustomerId, t1.checkin_time AS checkinTime FROM potential_customer t1 JOIN member t2 ON t2.id = t1.member_id AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t1.maintain_shop_id = ? AND t1.maintain_employee_id = ? AND t1.`status` IN (?) AND t1.tenant_id = ? AND t1.tenant_app_id = ? UNION SELECT t2.id AS memberId, t1.id AS potentialCustomerId, t1.checkin_time AS checkinTime FROM potential_customer t1 JOIN member t2 ON t2.external_user_id = t1.external_user_id AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t1.maintain_shop_id = ? AND t1.maintain_employee_id = ? AND t1.`status` IN (?) AND t1.member_id = ? AND t1.tenant_id = ? AND t1.tenant_app_id = ?|1|1|1||0|0|3058|3058|99|99|
|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|1|1||0|0|3570|3570|1|1|
