|数据库名称|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 = ?|739|1399|19||0|0|3553606|20352|739|1|
|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|179|377|22||0|0|2884859|24541|1575|9|
|tenant|SELECT count(*) FROM sneak_guest WHERE tenant_app_id = ? AND create_shop_id = ? AND status = ? AND next_maintain_date >= ? AND next_maintain_date < ?|171|386|25||0|0|830728|12871|171|1|
|v4_coupon|SELECT count(*) FROM ( SELECT grant_id FROM v4_coupon.coupon WHERE put_id = ? AND member_id = ? AND tenant_id = ? AND tenant_app_id = ? GROUP BY grant_id ) c|161|387|25||0|0|24570452|186749|161|1|
|tenant|SELECT count(*) FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ?|151|342|25||0|0|769796|12871|151|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|151|229|8||0|0|330085|5261|252|5|
|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(?)|143|237|5||0|0|63828043|446405|143|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 ?|135|341|34||0|0|1861172|34735|133|1|
|v4_user|SELECT COUNT(*) AS total FROM reception_customer WHERE shop_id = ? AND (member_id = ? OR external_user_id = ?) AND tenant_id = ? AND tenant_app_id = ?|121|184|3||0|0|1205179|19095|121|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 = ?|118|316|20||0|0|1590545|139067|118|1|
|v4_coupon|SELECT COUNT(*) AS total FROM ( SELECT c.id, c.display_name, c.type AS couponType , round(c.face_value / ?, ?) AS faceValue , round(c.face_value / ?, ?) AS points , c.face_value AS discount, c.begin_time, c.end_time, c.template_id , round(c.use_threshold / ?) AS useThreshold, ce.exchange_goods , CASE  WHEN c.begin_time > now() AND c.coupon_status = ? THEN ? ELSE c.coupon_status END AS coupon_status FROM v4_coupon.coupon c JOIN v4_coupon.coupon_extend ce ON ce.id = c.id AND ce.tenant_id = ? AND ce.tenant_app_id = ? WHERE c.member_id = ? AND c.tenant_id = ? AND c.tenant_app_id = ? ) c|89|663|49||0|0|49754809|619059|89|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, NULL) 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 task_template_id = ? AND shop_id = ? AND employee_id = ? AND finish_time IS NULL AND t.end_time > now() AND t.tenant_id = ? AND t.tenant_app_id = ? ORDER BY t.id DESC LIMIT ?|85|167|8||0|0|32084410|414701|850|10|
|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 (?)|84|187|9||0|0|32945501|1292824|3868|216|
|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 ?|69|115|5||0|0|121374|4139|69|1|
|coupon_service|SELECT count(1) FROM coupon_service.coupon_expire_task WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND status = ? AND expire_time > now()|68|119|8||0|0|2580770|73798|68|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 = ?|61|98|8||0|0|3900919|63999|1526|73|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE member_id = ? AND scene = ? AND scene_id = ? AND tenant_id = ? AND tenant_app_id = ?|61|98|5||0|0|7133006|179798|61|1|
|v4_sales|SELECT ifnull(sum(integral), ?) AS points FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id = es.sales_erp_id AND esd.tenant_id = ? AND esd.tenant_app_id = ? WHERE es.member_erp_id IN (?) AND es.sales_status = ? AND es.is_sales = ? AND esd.sales_type = ? AND es.tenant_id = ? AND es.tenant_app_id = ?|53|165|6||0|0|1140583|29352|53|1|
|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 = ?|49|104|9||0|0|483767|9873|0|0|
|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 (|46|75|4||0|0|69153|1692|32330|790|
|coupon_service|SELECT count(*) FROM employee_give_coupon_log WHERE tenant_app_id = ? AND coupon_push_id = ?|43|109|17||0|0|740375|20952|43|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|42|82|3||0|0|541718|33841|42|1|
|v4_coupon|SELECT * FROM v4_coupon.sales_give_coupon_record WHERE sales_id = ? AND sales_detail_id IS NULL AND tenant_id = ? AND tenant_app_id = ?|37|88|9||0|0|6918994|187325|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 = ?|36|85|5||0|0|395036|11777|36|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 = ?|35|78|4||0|0|730459|20904|7|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|33|85|6||0|0|676648|27868|11|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 = ?|32|54|7||0|0|221208|14922|32|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 = ?|31|50|2||0|0|66088|5021|31|1|
|goods|SELECT * FROM goods_take_shop WHERE tenant_id = ? AND goods_id = ? AND activity_id = ? ORDER BY create_time DESC|30|59|9||0|0|3191877|106455|705|64|
|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|28|53|8||0|0|40525|2208|28|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, NULL) 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 task_template_id = ? AND shop_id = ? AND employee_id = ? AND (member_mobile_no = ? OR member_name LIKE concat(?, ?, ?)) AND finish_time IS NULL AND t.end_time > now() AND t.tenant_id = ? AND t.tenant_app_id = ? ORDER BY t.id DESC LIMIT ?|27|183|19||0|0|29648479|1754365|218|10|
|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 = ?|26|60|6||0|0|13013328|501704|26|1|
|gift_mail|SELECT ifnull(count(1), ?) AS amount FROM trade WHERE tenant_wechatapp_id = ? AND user_id = ? AND order_status IN (?)|25|52|11||0|0|169579|15404|25|1|
|corpwx|UPDATE external_user SET un_assign_flag = ? WHERE tenant_id = ? AND status = ? AND un_assign_flag = ?|22|78|9||0|0|615223|73498|0|0|
|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|21|48|8||0|0|91579|29865|2900|294|
|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|21|48|8||0|0|83302|29034|141|17|
|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 = ?|20|35|4||0|0|150614|24500|20|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|20|28|2||0|0|266745|27703|47|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 ?|19|59|12||0|0|288304|96232|190|10|
|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 ?|18|59|12||0|0|4384511|733159|8|1|
|corpwx|SELECT count(*) AS addedNum FROM external_user t WHERE t.tenant_id = ? AND t.corp_user_id = ? AND t.create_time >= ? AND t.create_time < ?|18|26|3||0|0|694174|78326|18|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 = ?)|17|32|6||0|0|7053616|533308|17|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 = ?|17|110|24||0|0|764306|90198|17|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 = ?|15|19|2||0|0|107543|8660|66|66|
|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 = ?|15|36|4||0|0|70132|8300|15|1|
|tenant|SELECT count(*) FROM tenant.sneak_guest_maintain s JOIN tenant.sneak_guest sg ON sg.id = s.sneak_guest_id WHERE s.tenant_id = ? AND s.tenant_app_id = ? AND s.shop_id = ? AND s.event_type = ? AND s.create_time BETWEEN ? AND ?|14|191|59||0|0|504500|97804|14|1|
|youzan|SELECT id, merchant_id, merchant_shop_id, sync_type, api_name , api_request, api_response, status, error_msg, retry_num , create_time, update_time FROM weimob_platform_sync_log WHERE status = ? AND sync_type IN (?) AND retry_num < ?|13|204|33||0|0|1488016|114465|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 = ?|13|43|8||0|0|3079655|858758|13|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|13|269|41||0|0|428414|48346|138|13|
|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 = ?|13|23|3||0|0|1574520|153708|13|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')|13|265|107||0|0|1852595|345676|6743|2365|
|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|101|21||0|0|6103954|886503|11|1|
|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 ?|11|14|1||0|0|5505549|500513|22|5|
|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 ?|11|21|3||0|0|378643|54281|11|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 = ?|11|53|14||0|0|317378|59240|11|1|
|employee|SELECT count(*) FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND status = ? AND finish_time BETWEEN ? AND ?|10|12|1||0|0|28040|3027|10|1|
|order|SELECT count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ?|10|19|3||0|0|1228941|153708|10|1|
|coupon_service|SELECT cmod.coupon_id, cmo.pay_type FROM coupon_service.coupon_market_order_detail cmod JOIN coupon_service.coupon_market_order cmo ON cmo.tenant_id = ? AND cmo.tenant_app_id = ? AND cmo.id = cmod.order_id WHERE cmod.tenant_id = ? AND cmod.tenant_app_id = ? AND cmod.coupon_id IN (?)|10|20|3||0|0|547547|99147|75|20|
|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 = ?|10|23|4||0|0|30852|7333|10|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 = ?|10|23|3||0|0|2021783|465684|10|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 = ?|10|31|5||0|0|186752|30057|10|1|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE coupon_status = ? AND member_id = ? AND tenant_id = ? AND tenant_app_id = ?|10|16|3||0|0|1262|461|10|1|
|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|9|12|2||0|0|792|88|9|1|
|employee|SELECT id, tenant_id, tenant_app_id, shop_id, employee_id , user_id, external_user_id, mobile_no, scene, status , begin_time, expire_time, create_time, update_time, directional_task_id , member_erp_id, finish_time, md5_str, tenant_open_id, data FROM backlog_system WHERE tenant_app_id = ? AND scene = ? AND status = ? AND create_time BETWEEN ? AND ?|9|25|12||0|0|4171808|559719|407|225|
|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|9|241|60||0|0|776522|98506|9|1|
|v4_employee|SELECT COUNT(*) AS total FROM task_task WHERE task_template_id = ? AND tenant_id = ? AND tenant_app_id = ?|8|14|4||0|0|1611832|201479|8|1|
|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 (?)|8|11|1||0|0|324|57|108|19|
|coupon_service|SELECT count(1) FROM coupon_service.coupon_expire_task WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND employee_id = ? AND status = ? AND expire_time > now()|8|12|3||0|0|9531|5123|8|1|
|v4_employee|SELECT task_template_id AS taskId, t.task_type, t2.name AS taskName , ifnull(sum(IF(finish_time IS NULL, ?, ?)), ?) AS num FROM task_task t JOIN task_invite_task_template t2 ON t.task_template_id = t2.id AND t2.STATUS = ? AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t.shop_id = ? AND t.`status` = ? AND t.end_time > CURRENT_DATE AND t.tenant_id = ? AND t.tenant_app_id = ? GROUP BY t.task_template_id, t.task_type, t2.name|8|11|1||0|0|201380|30060|8|1|
|v4_sales|SELECT COUNT(*) AS total FROM warranty WHERE member_id IN (?) AND is_disable = ? AND tenant_id = ? AND tenant_app_id = ?|8|10|1||0|0|52979|6642|8|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 = ?|7|19|6||0|0|40893|7254|7|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 status != ? AND scene NOT IN (?) ORDER BY id DESC LIMIT ?|7|35|10||0|0|4072491|649733|37|7|
|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|7|279|85||0|0|691134|99336|7|1|
|v4_employee|SELECT id, batch_no, task_type, system_task_type, task_frequency , task_name, task_template_id, business_id, shop_id, employee_id , member_id, start_time, end_time, finish_time, send_coupons , recv_coupons, recv_coupon_time, accept_time, plan_arrival_shop_time, arrival_shop_time , trade_nos, trade_num, trade_amount, trade_time, member_name , member_mobile_no, member_latest_birthday, member_sex, member_age, member_level_id , member_level, member_sales_amount, member_sales_count, member_integral_balance, member_integral_total , status, remark, tenant_id, tenant_app_id, create_time , update_time FROM task_task WHERE member_id = ? AND task_template_id IN (?) AND tenant_id = ? AND tenant_app_id = ?|7|14|5||0|0|5|1|5|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, NULL) 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 task_template_id = ? AND shop_id = ? AND employee_id = ? AND finish_time IS NULL AND t.end_time > now() AND t.tenant_id = ? AND t.tenant_app_id = ? ORDER BY t.id DESC LIMIT ?, ?|7|117|45||0|0|2589985|414786|70|10|
|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 = ?|7|28|13||0|0|34260|5347|1|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 = ?))|6|15|4||0|0|127331|21223|2|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 ?|6|7|1||0|0|2463513|533308|6|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 = ?|6|8|1||0|0|3540|811|6|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.tenant_id = ? AND t.tenant_app_id = ?|5|8|2||0|0|41185|15437|5|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 ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ...|5|39|13||0|0|8082283|1862714|1979|657|
|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()|5|6|1||0|0|112|76|30|27|
|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 = ?|5|6|1||0|0|48549|37268|5|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 ?|5|93|27||0|0|493200|98640|50|10|
|value_added|SELECT ? AS limitDayType, t.tenant_wechatapp_id AS tenantAppId, t.user_id AS userId, min(ue.employee_erp_id) AS employee_erp_id , ue.dept_erp_id, GROUP_CONCAT(t.product_barcode ORDER BY product_barcode ASC) AS productCode, GROUP_CONCAT(t.product_name ORDER BY product_barcode ASC) AS productName FROM value_added_user t INNER JOIN value_added_user_extend ue ON t.id = ue.id WHERE t.tenant_wechatapp_id = ? AND t.state = ? AND t.start_add_time >= date_add(DATE_FORMAT(?, '%Y-%m-%d'), INTERVAL ? * (t.add_days - ?) DAY) AND t.start_add_time < date_add(DATE_FORMAT(?, '%Y-%m-%d'), INTERVAL ? * (t.add_days - ?) + ? DAY) GROUP BY t.tenant_wechatapp_id, t.user_id, ue.dept_erp_id|5|13|7||0|0|1287805|450120|275|137|
|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 = ?|5|10|3||0|0|1257487|512665|5|1|
|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 = ?|5|12|4||0|0|55222|34734|5|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|4|11|6||0|0|41356|24665|18|7|
|tenant|SELECT count(*) FROM ( SELECT DISTINCT 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 ? ) a|4|66|27||0|0|391896|97974|4|1|
|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|4|24|8||0|0|107363|29018|59|17|
|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 = ?|4|5|1||0|0|68064|17093|4|1|
|order|SELECT max(create_time) FROM `order`.order_operator_log WHERE tenant_wechatapp_id = ? AND order_id = ?|4|17|4||0|0|4052356|1013240|4|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, NULL) 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 task_template_id = ? AND shop_id = ? AND employee_id = ? AND (member_mobile_no = ? OR member_name LIKE concat(?, ?, ?)) AND finish_time IS NULL AND t.end_time > now() AND t.tenant_id = ? AND t.tenant_app_id = ? ORDER BY t.id DESC LIMIT ?, ?|4|4|1||0|0|1589106|397318|40|10|
|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|38964|16440|4|1|
|warranty_service|SELECT count(*) FROM warranty WHERE user_id = ? AND tenant_wechatapp_id = ? AND is_disable = ?|4|19|8||0|0|25405|13770|4|1|
|tenant|SELECT count(*) FROM erp_sales es WHERE tenant_id = ? AND member_erp_id = ? AND tenant_wechatapp_id = ? AND sales_status = ? AND (comment_id IS NULL OR comment_id = ?) AND sales_date >= ? 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 )|4|5|1||0|0|20|15|4|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 = ?|4|5|1||0|0|1556|389|744|186|
|corpwx|SELECT id, tenant_id, params_key, params_value, group_id , create_time, update_time FROM corp_mini_qrcode_params WHERE group_id = ?|4|5|1||0|0|1794984|448784|18|5|
|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 = ?|4|6|2||0|0|311025|78085|4|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|4|12|3||0|0|2152235|539205|31|13|
|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 = ?)|4|4|1||0|0|9908|3147|4|1|
|employee|UPDATE backlog_system SET status = ?, finish_time = now() WHERE tenant_app_id = ? AND scene = ?|3|10|4||0|0|3903732|1301244|0|0|
|tenant|SELECT count(*) AS amount FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? AND create_time <= ?|3|7|3||0|0|32147|12103|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|9893|3952|9893|3952|
|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.scene = ? AND bg.mobile_no = ? AND bg.leave_flag = ? ORDER BY id DESC LIMIT ?|3|10|4||0|0|1949199|649733|3|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 ?|3|6|2||0|0|25164|8766|36|12|
|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.sales_date >= DATE_FORMAT(?, '%Y-%m-%d') AND t1.is_sales = ? AND t1.sales_status = ? AND t1.tenant_id = ? AND t1.tenant_app_id = ?|3|6|3||0|0|380|186|233|113|
|v4_coupon|UPDATE v4_coupon.coupon SET coupon_status = ? WHERE tenant_id = ? AND tenant_app_id = ? AND coupon_status = ? AND end_time < now()|3|4|2||0|0|450367|438120|0|0|
|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 = ?|3|5|2||0|0|71898|23966|0|0|
|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 (?)|3|3|1||0|0|19|9|19|9|
|tenant|SELECT count(DISTINCT sg.id) AS createNum, count(sgm.id) AS maintainCount FROM tenant.sneak_guest sg LEFT JOIN tenant.sneak_guest_maintain sgm ON sg.id = sgm.sneak_guest_id AND sgm.event_type = ? AND sgm.create_time >= ? AND sgm.create_time < ? WHERE sg.tenant_app_id = ? AND sg.create_time >= ? AND sg.create_time < ? AND sg.create_shop_id = ?|3|4|2||0|0|5095|2288|3|1|
|coupon_service|SELECT * FROM coupon_service.coupon_can_give WHERE coupon_id = ? LIMIT ?|3|4|1||0|0|855261|292941|3|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 ?|3|4|2||0|0|296468|112949|2|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|3|42|27||0|0|293484|97828|3|1|
|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|3|4|2||0|0|438585|146195|3|1|
|tenant|SELECT count(0) FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND EXISTS ( SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id = sgm.sneak_guest_id AND sgm.event_type = ? AND sgm.intention_info REGEXP ? ) AND sg.status = ?|3|21|10||0|0|77172|25726|3|1|
|v4_coupon|SELECT * FROM ( SELECT c.id, c.display_name, c.type AS couponType , round(c.face_value / ?, ?) AS faceValue , round(c.face_value / ?, ?) AS points , c.face_value AS discount, c.begin_time, c.end_time, c.template_id , round(c.use_threshold / ?) AS useThreshold, ce.exchange_goods , CASE  WHEN c.begin_time > now() AND c.coupon_status = ? THEN ? ELSE c.coupon_status END AS coupon_status FROM v4_coupon.coupon c JOIN v4_coupon.coupon_extend ce ON ce.id = c.id AND ce.tenant_id = ? AND ce.tenant_app_id = ? WHERE c.member_id = ? AND c.tenant_id = ? AND c.tenant_app_id = ? ) c ORDER BY field(coupon_status, ?, ?, ?, ?, ?, ?), id DESC LIMIT ?|3|9|6||0|0|1804654|619077|22|10|
|employee|SELECT count(0) FROM employee.backlog bg WHERE bg.tenant_app_id = ? AND bg.scene NOT IN (?) AND bg.scene = ? AND bg.mobile_no = ? AND bg.leave_flag = ?|3|7|2||0|0|598854|199618|3|1|
|tenant|SELECT count(*) 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 IN (?) AND s.create_time BETWEEN ? AND ?|2|12|6||0|0|196326|98163|2|1|
|user_service|SELECT * FROM user_employee WHERE tenant_wechatapp_id = ? AND employee_id = ?|2|2|1||0|0|6337|3517|6337|3517|
|employee|SELECT count(*) FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND status = ? AND expire_time BETWEEN ? AND ?|2|3|1||0|0|69207|63242|2|1|
|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_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|2|1||0|0|647615|512665|11|10|
|employee|SELECT id, scene, employee_id, member_user_name AS userName, finish_time , status FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND expire_time BETWEEN ? AND ? AND status != ? AND scene NOT IN (?) ORDER BY id DESC LIMIT ?, ?|2|45|30||0|0|6110492|3055246|10|5|
|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|2|1||0|0|4154|2211|2|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 = ?|2|2|1||0|0|9766|4883|0|0|
|coupon_service|SELECT egc.id, tmp.coupon_name, tmp.coupon_type, tmp.remark, cp.take_effect_way , cp.take_start_day, cp.take_effect_day, DATE_FORMAT(cp.begin_time, '%Y-%m-%d') AS begin_time , DATE_FORMAT(cp.end_time, '%Y-%m-%d') AS end_time, egc.limit_grant_time , DATE_FORMAT(egc.grant_begin_time, '%Y-%m-%d') AS grant_begin_time , DATE_FORMAT(egc.grant_end_time, '%Y-%m-%d') AS grant_end_time , ifnull(tmp.face_value, ?) / ? AS face_value , tmp.face_value AS point, ifnull(tmp.discount, ?) / ? AS discount , tmp.scope, tmp.product_name, tmp.product_image_url , if(egc.state = ?, ?, CASE  WHEN cp.end_time IS NOT NULL AND cp.end_time < now() THEN ? WHEN egc.limit_grant_time = ? AND egc.grant_end_time < now() THEN ? WHEN tgl.put_quantity <= ( SELECT count(*) FROM coupon_service.employee_give_coupon_log WHERE employee_give_coupon_id = egc.id ) THEN ? ELSE ? END) AS state , tr.type AS redpackType, ifnull(tr.min_price, ?) / ? AS minPrice FROM coupon_service.employee_give_coupon egc INNER JOIN coupon_service.coupon_push cp ON egc.template_id = cp.template_id AND cp.source = ? AND egc.id = cp.source_id AND cp.state = ? INNER JOIN coupon_service.template tmp ON egc.template_id = tmp.id INNER JOIN coupon_service.template_grant_limit tgl ON cp.id = tgl.coupon_push_id LEFT JOIN coupon_service.template_redpack tr ON tr.template_id = tmp.id WHERE egc.tenant_app_id = ? AND egc.state = ? AND (egc.limit_grant_time = ? OR egc.grant_begin_time <= now()) AND (egc.limit_shop = ? OR EXISTS ( SELECT ? FROM coupon_service.employee_give_coupon_shop cs WHERE egc.id = cs.employee_give_id AND cs.shop_id = ? )) AND egc.limit_role IN (?) ORDER BY state ASC, egc.id DESC LIMIT ?|2|2|1||0|0|217212|108606|16|8|
|v4_coupon|SELECT tenant_id, tenant_app_id, member_id, count(1) AS total FROM v4_coupon.coupon WHERE DATEDIFF(DATE_FORMAT(end_time, '%Y-%m-%d'), DATE_FORMAT(now(), '%Y-%m-%d')) = ? AND coupon_status IN (?) GROUP BY tenant_id, tenant_app_id, member_id|2|8|4||0|0|877471|439280|68|34|
|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 ?|2|16|11||0|0|1506630|753316|12|6|
|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|2|4|3||0|0|28202|14105|8158|4081|
|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, NULL) 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 task_template_id = ? AND shop_id = ? AND employee_id = ? AND finish_time IS NULL AND t.end_time > now() AND t.tenant_id = ? AND t.tenant_app_id = ? ) TOTAL|2|5|3||0|0|27070|14131|2|1|
|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 = ?|2|6|5||0|0|4144|2072|334|167|
|v4_employee|SELECT 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(member_integral_total = ?, ?)) AS `integral_total|等于0分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|1-4999分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|5000-19999分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|20000-49999分` , sum(ifnull(member_integral_total >= ?, ?)) AS `integral_total|大于等于50000分` , sum(ifnull(member_sales_amount = ?, ?)) AS `amount_total_consume|等于0元` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|1-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 >= ?, ?)) AS `amount_total_consume|大于等于50001元` , sum(ifnull(member_sex = ?, ?)) AS `sex|男` , sum(ifnull(member_sex = ?, ?)) AS `sex|女` , sum(ifnull(member_sex = ?, ?)) AS `sex|其他` , sum(ifnull(member_integral_balance = ?, ?)) AS `integral_balance|等于0分` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|1-1999分` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|2000-4999分` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|5000-19999分` , sum(ifnull(member_integral_balance >= ?, ?)) AS `integral_balance|大于等于20000分` , 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 = ?, ?))|2|18|17||0|0|3508694|1754347|2|1|
|v4_user|COMMIT ?|2|2|1||0|0|0|0|0|0|
|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|376615|293752|2|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|2|5|2||0|0|45435|22720|8797|4399|
|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 = ?|2|6|5||0|0|1738|869|2|1|
|warranty_service|SELECT * FROM warranty WHERE tenant_wechatapp_id = ? AND erp_sales_id = ? LIMIT ?|2|2|1||0|0|0|0|0|0|
|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 ?|2|3|1||0|0|25906|12953|0|0|
|goods|SELECT count(0) FROM ( SELECT gs.id, gs.category_id, gs.goods_name, gs.style_no, gs.status , gs.thumbnail_img, gs.express_type, gs.take_stock_day, gs.take_remark, gs.express_fee , ifnull(gs.base_sale_number, ?) + ifnull(t1.sales_volume, ?) AS total_sales_volume , ifnull(ifnull(t2.quantity, t3.quantity), ?) AS total_quantity , ifnull(ifnull(t2.price, t3.price), ?) AS min_price , gs.create_time, gs.exchange_money, ifnull(t2.number, ?) AS skuNumber , ifnull(t3.number, ?) AS activitySkuNumber FROM goods.goods gs LEFT JOIN goods.goods_category cg ON gs.category_id = cg.id INNER JOIN goods.goods_up_app t ON gs.id = t.goods_id AND t.tenant_app_id = ? LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(sales_volume) AS sales_volume FROM goods.goods_sku GROUP BY tenant_app_id, goods_id ) t1 ON t.tenant_app_id = t1.tenant_app_id AND t.goods_id = t1.goods_id LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(quantity) AS quantity , min(price) AS price, count(*) AS number FROM goods.goods_sku WHERE activity_id = ? GROUP BY tenant_app_id, goods_id ) t2 ON t.tenant_app_id = t2.tenant_app_id AND t.goods_id = t2.goods_id LEFT JOIN ( SELECT tenant_app_id, goods_id, sum(quantity) AS quantity , min(price) AS price, count(*) AS number FROM goods.goods_sku WHERE activity_id > ? GROUP BY tenant_app_id, goods_id ) t3 ON t.tenant_app_id = t3.tenant_app_id AND t.goods_id = t3.goods_id WHERE 1 = 1 AND gs.topping = ? ) tmp|2|5|3||0|0|255214|127607|2|1|
|v4_employee|SELECT 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(member_integral_total = ?, ?)) AS `integral_total|等于0分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|1-4999分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|5000-19999分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|20000-49999分` , sum(ifnull(member_integral_total >= ?, ?)) AS `integral_total|大于等于50000分` , sum(ifnull(member_sales_amount = ?, ?)) AS `amount_total_consume|等于0元` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|1-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 >= ?, ?)) AS `amount_total_consume|大于等于50001元` , sum(ifnull(member_sex = ?, ?)) AS `sex|男` , sum(ifnull(member_sex = ?, ?)) AS `sex|女` , sum(ifnull(member_sex = ?, ?)) AS `sex|其他` , sum(ifnull(member_integral_balance = ?, ?)) AS `integral_balance|等于0分` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|1-1999分` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|2000-4999分` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|5000-19999分` , sum(ifnull(member_integral_balance >= ?, ?)) AS `integral_balance|大于等于20000分` , 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 = ?, ?))|2|2|1||0|0|3508694|1754347|2|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 = ?|2|2|1||0|0|10424|9592|5212|4796|
|coupon_service|SELECT tenant_id, tenant_app_id, employee_id, count(DISTINCT user_id) AS count FROM coupon_service.coupon_expire_task WHERE tenant_id = ? AND tenant_app_id = ? AND status = ? AND expire_time > now() AND expire_time BETWEEN ? AND ? GROUP BY tenant_id, tenant_app_id, employee_id|2|8|6||0|0|174684|128449|41|24|
|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|998810|499405|20|10|
|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|3|1||0|0|10258|6140|2|1|
|user_service|UPDATE user_service.tenant_member_bind SET wx_user_id = NULL WHERE tenant_id = ? AND tenant_app_id = ? AND erp_member_id = ?|2|2|1||0|0|0|0|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 = ?|2|5|4||0|0|110806|83978|2|1|
|deliver|SELECT * FROM express_address WHERE user_id = ? AND type = ?|2|2|1||0|0|22928|11464|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 = ?|2|20|15||0|0|998718|499359|2|1|
|gift_mail|SELECT count(0) FROM ( SELECT p.*, sp.take_type , ifnull(pp.integral_price, ifnull(( SELECT min(inventory.price) FROM inventory WHERE inventory.product_id = p.id ), ?)) AS price , ifnull(t.quantity, ?) AS quantity, pt.partner_name AS vendorName , ? AS distance, c.categroy_name AS categroy_name, pp.partner_id FROM product p INNER JOIN category c ON c.id = p.category_id LEFT JOIN self_product sp ON p.id = sp.product_id LEFT JOIN partner_product pp ON p.id = pp.product_id LEFT JOIN partner pt ON pt.id = pp.partner_id LEFT JOIN ( SELECT product_id, sum(quantity) AS quantity FROM gift_mail.inventory GROUP BY product_id ) t ON p.id = t.product_id WHERE p.is_disable IS NULL OR p.is_disable = ? ) p LEFT JOIN product_status ps ON p.id = ps.product_id AND ps.tenant_wechatapp_id = ? WHERE p.tenant_id = ? AND p.product_type = ? AND (ps.id IS NOT NULL OR p.tenant_wechatapp_id = ?)|2|3|1||0|0|105650|52825|2|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 (|1|1|1||0|0|8731|8731|8731|8731|
|corpwx_license|DELETE FROM cwx_sync_active_info WHERE tenant_id = ? AND user_id = ? AND tenant_id = ?|1|1|1||0|0|25094|25094|0|0|
|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|20839|20839|417|417|
|coupon_service|SELECT count(0) FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id JOIN ( SELECT coupon_id FROM coupon_service.coupon_write_off_log wol WHERE wol.tenant_id = ? AND wol.tenant_app_id = ? AND wol.state = ? AND wol.create_time >= ? AND wol.create_time <= ? GROUP BY coupon_id ) w ON w.coupon_id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ? AND cu.coupon_type = ? AND (cu.coupon_state = ? OR (cu.coupon_state = ? AND ce.writeoff_time IS NOT NULL))|1|1|1||0|0|8403|8403|1|1|
|tenant|SELECT count(0) FROM ( SELECT shop.*, dept.dept_name, count(es.id) AS employeesCount FROM tenant_wechatapp_shop shop LEFT JOIN erp_department dept ON shop.dept_erp_id = dept.dept_erp_id AND shop.tenant_id = dept.tenant_id LEFT JOIN employee_shop es ON shop.id = es.shop_id AND es.status IN (?) WHERE shop.tenant_wechatapp_id = ? AND shop.status IN (?) GROUP BY shop.id ) table_count|1|2|2||0|0|89017|89017|1|1|
|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_id IN (?)|1|1|1||0|0|9|9|9|9|
|employee|SELECT count(*) FROM label_task_employee t1 JOIN label_task_setting t2 ON t1.label_task_id = t2.id AND t2.disabled = ? WHERE t2.tenant_id = ? AND t2.tenant_app_id = ? AND t2.task_status = ? AND t2.end_date >= CURRENT_DATE AND t1.shop_id = ? AND t1.employee_id = ? AND t1.visit_status = ?|1|1|1||0|0|117|117|1|1|
|goods|SELECT id, img_url, img_index FROM goods_img WHERE goods_id = ? ORDER BY update_time DESC|1|1|1||0|0|27259|27259|5|5|
|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|11568|11568|10|10|
|v4_user|SELECT COUNT(*) AS total FROM member_butler t1 JOIN member t2 ON t1.tenant_id = t2.tenant_id AND t1.member_id = t2.id AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t1.shop_id = ? AND t1.employee_id = ? AND t1.tenant_id = ? AND t1.tenant_app_id = ?|1|1|1||0|0|8518|8518|1|1|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail_extend WHERE create_time < ?|1|1|1||0|0|157839|157839|0|0|
|mysql|DELETE FROM wx_gateway.wx_template_msg WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|31|31||0|0|903645|903645|0|0|
|v4_employee|SELECT 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(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_level_id = ?, ?)) AS `member_level|钻石会员` , sum(ifnull(member_sex = ?, ?)) AS `sex|男` , sum(ifnull(member_sex = ?, ?)) AS `sex|女` , sum(ifnull(member_sex = ?, ?)) AS `sex|其他` , sum(ifnull(shop_id = ?, ?)) AS `shop|北票萃华金店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城萃华珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平萃华金店` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平萃华通胜店` , sum(ifnull(shop_id = ?, ?)) AS `shop|喀左萃华一店` , sum(ifnull(shop_id = ?, ?)) AS `shop|喀左萃华二店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城潮宏基珠宝二店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华专卖店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华形象店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华旗舰店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区六福珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|凌源南街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|凌源北街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平潮宏基珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|大和周大福店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城站前街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|北票周大福珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|鞍山青年街` , sum(ifnull(shop_id = ?, ?)) AS `shop|鞍山周大福景子街店`|1|1|1||0|0|1754347|1754347|1|1|
|v4_sales|SELECT COUNT(*) FROM ( SELECT c.order_id, c.id AS commentId, c.create_time AS commentTime, c.member_id, c.average_score AS average , if(c.average_score < c.low_score AND 1 = 1, ?, ?) AS hasHandle , if(cls.id IS NULL, ?, ?) AS handleLowScore FROM v4_sales.comment c LEFT JOIN v4_sales.comment_low_score_handle cls ON cls.comment_id = c.id AND cls.tenant_id = ? AND cls.tenant_app_id = ? WHERE c.erp_dept_id = ? AND c.create_time BETWEEN ? AND ? AND c.average_score < c.low_score AND cls.id IS NULL AND c.tenant_id = ? AND c.tenant_app_id = ? ) TOTAL|1|1|1||0|0|15571|15571|1|1|
|corpwx|SELECT id, tenant_id, tenant_app_id, external_user_id, wx_user_id FROM external_user_bind WHERE tenant_id = ? AND wx_user_id IN (?)|1|1|1||0|0|9|9|9|9|
|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|2025337|2025337|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 = ?)|1|1|1||0|0|219536|219536|1|1|
|v4_employee|SELECT 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(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_level_id = ?, ?)) AS `member_level|钻石会员` , sum(ifnull(member_sex = ?, ?)) AS `sex|男` , sum(ifnull(member_sex = ?, ?)) AS `sex|女` , sum(ifnull(member_sex = ?, ?)) AS `sex|其他` , sum(ifnull(shop_id = ?, ?)) AS `shop|北票萃华金店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城萃华珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平萃华金店` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平萃华通胜店` , sum(ifnull(shop_id = ?, ?)) AS `shop|喀左萃华一店` , sum(ifnull(shop_id = ?, ?)) AS `shop|喀左萃华二店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城潮宏基珠宝二店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华专卖店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华形象店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华旗舰店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区六福珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|凌源南街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|凌源北街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平潮宏基珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|大和周大福店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城站前街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|北票周大福珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|鞍山青年街` , sum(ifnull(shop_id = ?, ?)) AS `shop|鞍山周大福景子街店`|1|1|1||0|0|1754347|1754347|1|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 ?|1|1|1||0|0|1855|1855|0|0|
|goods|SELECT count(*) FROM goods.goods_sku WHERE tenant_id = ? AND tenant_app_id = ? AND goods_id = ? AND activity_id = ?|1|1|1||0|0|21183|21183|1|1|
|v4_user|SELECT tb0.shop_id, tb0.employee_id, tb0.visitor AS visitorNum, tb0.externalUser AS externalUserNum, tb0.member AS memberNum , ifnull(tb1.tryon, ?) AS tryonNum , ifnull(tb2.potential, ?) AS potentialNum , ifnull(tb3.dealed, ?) AS dealNum FROM ( SELECT t1.shop_id, t1.employee_id , count(CASE  WHEN t1.customer_type = ? THEN t1.id ELSE NULL END) AS visitor , count(DISTINCT CASE  WHEN t1.customer_type = ? THEN t1.member_id ELSE NULL END) AS member , count(DISTINCT CASE  WHEN t1.customer_type = ? THEN t1.external_user_id ELSE NULL END) AS externalUser FROM reception_customer t1 WHERE t1.recept_time >= ? AND t1.recept_time <= ? AND t1.tenant_id = ? AND t1.tenant_app_id = ? GROUP BY t1.shop_id, t1.employee_id ) tb0 LEFT JOIN ( SELECT t1.shop_id, t1.employee_id , ifnull(sum(CASE  WHEN t1.customer_type = ? THEN ? ELSE ? END), ?) + count(DISTINCT CASE  WHEN t1.customer_type = ? THEN t1.member_id ELSE NULL END) + count(DISTINCT CASE  WHEN t1.customer_type = ? THEN t1.external_user_id ELSE NULL END) AS tryon FROM reception_customer t1 WHERE t1.oper_status & ? > ? AND t1.recept_time >= ? AND t1.recept_time <= ? AND t1.tenant_id = ? AND t1.tenant_app_id = ? GROUP BY t1.shop_id, t1.employee_id ) tb1 ON tb0.shop_id = tb1.shop_id AND tb0.employee_id = tb1.employee_id LEFT JOIN ( SELECT t1.shop_id, t1.employee_id , ifnull(sum(CASE  WHEN t1.customer_type = ? THEN ? ELSE ? END), ?) + count(DISTINCT CASE  WHEN t1.customer_type = ? THEN t1.member_id ELSE NULL END) + count(DISTINCT CASE  WHEN t1.customer_type = ? THEN t1.external_user_id ELSE NULL END) AS potential FROM reception_customer t1 WHERE t1.oper_status & ? << ? > ? AND t1.recept_time >= ? AND t1.recept_time <= ? AND t1.tenant_id = ? AND t1.tenant_app_id = ? GROUP BY t1.shop_id, t1.employee_id ) tb2 ON tb0.shop_id = tb2.shop_id AND tb0.employee_id = tb2.employee_id LEFT JOIN ( SELECT t1.shop_id, t1.employee_id , ifnull(sum(CASE  WHEN t1.customer_type = ? THEN ? ELSE ? END), ?) + count(DISTINCT CASE  WHEN t1.customer_type = ? THEN t1.member_id ELSE NULL END) + count(DISTINCT CA|1|1|1||0|0|49924|49924|182|182|
|v4_employee|SELECT 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(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_level_id = ?, ?)) AS `member_level|钻石会员` , sum(ifnull(member_sex = ?, ?)) AS `sex|男` , sum(ifnull(member_sex = ?, ?)) AS `sex|女` , sum(ifnull(member_sex = ?, ?)) AS `sex|其他` , sum(ifnull(shop_id = ?, ?)) AS `shop|北票萃华金店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城萃华珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平萃华金店` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平萃华通胜店` , sum(ifnull(shop_id = ?, ?)) AS `shop|喀左萃华一店` , sum(ifnull(shop_id = ?, ?)) AS `shop|喀左萃华二店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城潮宏基珠宝二店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华专卖店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华形象店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华旗舰店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区六福珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|凌源南街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|凌源北街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平潮宏基珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|大和周大福店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城站前街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|北票周大福珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|鞍山青年街` , sum(ifnull(shop_id = ?, ?)) AS `shop|鞍山周大福景子街店`|1|4|4||0|0|1754347|1754347|1|1|
|v4_user|SELECT COUNT(*) AS total FROM member_import WHERE import_status = ? AND tenant_id = ?|1|1|1||0|0|40238|40238|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|245331|245331|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 keeping_days > ? AND state = ? AND start_add_time = date_add(CURDATE(), INTERVAL ? * (add_days - ?) DAY)|1|12|12||0|0|2025343|2025343|617|617|
|employee|INSERT INTO backlog (id, tenant_id, tenant_app_id, user_id, employee_id , status, scene, begin_time, expire_time, md5_str , shop_id, task_amount, finish_amount) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?) ON DUPLICATE KEY UPDATE update_time = now()|1|1|1||0|0|0|0|0|0|
|tenant|SELECT DISTINCT emp.id, emp.employee_name FROM tenant.sneak_guest sg JOIN tenant.employee emp ON emp.id = sg.maintain_employee_id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND sg.`status` = ? AND sg.next_maintain_date >= ? AND sg.next_maintain_date < ?|1|1|1||0|0|4714|4714|7|7|
|corpwx|SELECT user_id FROM external_user WHERE tenant_id = ? AND cwx_user_id = ?|1|1|1||0|0|4434|4434|4434|4434|
|authorization_service|update user_login_token set status=? where login_token in (|1|2|2||0|0|1813|1813|0|0|
|mysql|DELETE FROM message_push.message_log WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|81|81||0|0|2997451|2997451|0|0|
|v4_sales|SELECT erp_employee_id FROM comment WHERE erp_dept_id = ? AND create_time BETWEEN ? AND ? AND tenant_id = ? AND tenant_app_id = ? GROUP BY erp_employee_id|1|1|1||0|0|15571|15571|0|0|
|employee|SELECT count(0) FROM backlog WHERE tenant_app_id = ? AND employee_id = ? AND status IN (?) AND scene = ? AND shop_id = ? AND expire_time >= ?|1|1|1||0|0|213|213|1|1|
|order|SELECT od.id, od.order_no AS orderNo, od.status, od.take_type AS takeType, od.create_time AS createTime , od.remark, od.total_fee AS totalFee, od.freight_fee AS freightFee, od.discount_fee AS discountFee, od.take_id AS takeId , od.payment_fee AS paymentFee, dt.product_id AS productId, dt.price, dt.quantity, dt.sku_id AS skuId , dt.art_no AS artNo, dt.image_url AS imageUrl, dt.product_name AS productName, dt.take_remark AS takeRemark, dt.take_day AS takeDay , od.product_fee AS productFee, od.finish_type AS finishType, od.send_time AS sendTime, od.receive_time AS receiveTime, od.finish_time AS finishTime , od.child_status AS childStatus, od.send_good_remark AS sendGoodRemark, od.service_flag AS serviceFlag, od.coupon_id AS couponId, od.tenant_wechatapp_id AS tenantAppId , od.tenant_id AS tenantId, od.pay_id AS payId, od.user_id AS userId, od.user_name AS userName, od.mobile_no AS buyMobileNo , od.activity_id, od.offline_payment_fee, od.activity_type, dt.spec, od.take_shop_id , od.take_shop_name, od.take_employee_user_id, od.take_employee_user_name FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id WHERE od.status = ? AND od.receive_time <= ?|1|3|3||0|0|245461|245461|130|130|
|user_service|UPDATE user_service.tenant_member_bind SET external_user_id = NULL WHERE external_user_id = ? AND tenant_id = ? AND tenant_app_id = ? AND wx_user_id != ?|1|1|1||0|0|0|0|0|0|
|order|SELECT count(*) AS amount FROM order_detail WHERE tenant_wechatapp_id = ? AND sku_id = ?|1|6|6||0|0|245376|245376|1|1|
|order|SELECT od.id, od.order_no AS orderNo, od.status, od.take_type AS takeType, od.create_time AS createTime , od.remark, od.total_fee AS totalFee, od.freight_fee AS freightFee, od.discount_fee AS discountFee, od.take_id AS takeId , od.payment_fee AS paymentFee, dt.product_id AS productId, dt.price, dt.quantity, dt.sku_id AS skuId , dt.art_no AS artNo, dt.image_url AS imageUrl, dt.product_name AS productName, dt.take_remark AS takeRemark, dt.take_day AS takeDay , od.product_fee AS productFee, ad.user_name AS receiveName, ad.mobile_no AS mobileNo, ad.shop_name AS shopName, ad.address , ad.express_no AS expressNo, ad.express_company AS expressCompany, od.user_name AS userName, od.update_time AS updateTime, od.child_status AS childStatus , od.finish_type AS finishType, od.receive_time AS receiveTime, od.user_id AS userId, od.mobile_no AS buyMobileNo, od.edit_fee_flag AS editFeeFlag , dt.spec AS spec, od.source, od.take_shop_id, od.take_shop_name, od.take_employee_user_id , od.take_employee_user_name, od.activity_type, od.activity_id, od.offline_payment_fee, od.online_wait_fee , od.offline_wait_fee, od.pay_way, od.take_employee_id, od.pay_id FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND (od.mobile_no = ? OR ad.mobile_no = ?) ORDER BY od.create_time DESC LIMIT ?|1|1|1||0|0|153696|153696|3|3|
|wx_gateway|UPDATE wx_template_msg SET status = ?, err_msg = ? WHERE msg_id = ?|1|1|1||0|0|1|1|0|0|
|v4_user|SELECT t1.maintain_shop_id, t1.maintain_employee_id, t1.maintain_level, count(*) AS maintainNum FROM potential_customer t1 WHERE t1.tenant_app_id = ? AND t1.`status` IN (?) AND t1.next_maintain_time >= ? AND t1.tenant_id = ? AND t1.tenant_app_id = ? GROUP BY t1.maintain_shop_id, t1.maintain_employee_id, t1.maintain_level|1|3|3||0|0|21645|21645|403|403|
|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|1|1||0|0|3183|3183|12|12|
|order|SELECT id, type, operator_type AS operatorType, operator_result AS operatorResult, reason_label AS reasonLabel , reason_value AS reasonValue, remark, create_time AS createTime, status FROM order_service_log WHERE order_id = ? ORDER BY create_time DESC|1|1|1||0|0|24153|24153|0|0|
|gift_mail|SELECT count(0) FROM ( SELECT p.*, sp.take_type , ifnull(pp.integral_price, ifnull(( SELECT min(inventory.price) FROM inventory WHERE inventory.product_id = p.id ), ?)) AS price , ifnull(t.quantity, ?) AS quantity, pt.partner_name AS vendorName , ? AS distance, c.categroy_name AS categroy_name, pp.partner_id FROM product p INNER JOIN category c ON c.id = p.category_id LEFT JOIN self_product sp ON p.id = sp.product_id LEFT JOIN partner_product pp ON p.id = pp.product_id LEFT JOIN partner pt ON pt.id = pp.partner_id LEFT JOIN ( SELECT product_id, sum(quantity) AS quantity FROM gift_mail.inventory GROUP BY product_id ) t ON p.id = t.product_id WHERE p.is_disable IS NULL OR p.is_disable = ? ) p LEFT JOIN product_status ps ON p.id = ps.product_id AND ps.tenant_wechatapp_id = ? WHERE p.tenant_id = ? AND p.product_name LIKE ? AND p.product_type = ? AND (ps.id IS NOT NULL OR p.tenant_wechatapp_id = ?)|1|1|1||0|0|52806|52806|1|1|
|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|1|1|1||0|0|1956|1956|489|489|
|v4_user|SELECT DATE_FORMAT(t1.recept_time, '%H') AS `hour` , ifnull(sum(CASE  WHEN t1.customer_type = ? THEN ? ELSE ? END), ?) + count(DISTINCT CASE  WHEN t1.customer_type = ? THEN t1.member_id ELSE NULL END) + count(DISTINCT CASE  WHEN t1.customer_type = ? THEN t1.external_user_id ELSE NULL END) AS receptNum FROM reception_customer t1 WHERE t1.recept_time >= ? AND t1.recept_time <= ? AND t1.tenant_id = ? AND t1.tenant_app_id = ? GROUP BY DATE_FORMAT(t1.recept_time, '%H')|1|1|1||0|0|14644|14644|16|16|
|gift_mail|SELECT count(0) FROM ( SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE p.product_status = ? ORDER BY i.volume ASC, p.tag_price ASC, p.id DESC ) tmp_count|1|1|1||0|0|7262|7262|1|1|
|goods|SELECT count(0) FROM ( SELECT gs.id, gs.tenant_id, gs.tenant_app_id, gs.category_id, gs.activity_id , gs.goods_name, gs.style_no, gs.base_sale_number, gs.limit_sale , if(gs.status = ?, gs.status, if(t.id IS NULL, ?, ?)) AS status , gs.thumbnail_img, gs.express_type, gs.take_stock_day, gs.take_remark, gs.express_fee , gs.create_time, gs.update_time, gs.sale_type, gs.take_start_time, gs.page_id , gs.pay_way, gs.advance_payment, gs.exchange_money , ifnull(sku.minPrice, ?) AS minPrice , ifnull(sku.marketPrice, ?) AS marketPrice , ifnull(sku.totalSalesVolume, ?) AS totalSalesVolume , ifnull(sku.totalQuantity, ?) AS totalQuantity , ifnull(number, ?) AS skuNumber, gs.topping FROM goods.goods gs LEFT JOIN ( SELECT id, goods_id FROM goods.goods_up_app gu WHERE gu.tenant_app_id = ? ) t ON gs.id = t.goods_id LEFT JOIN ( SELECT goods_id, min(price) AS minPrice, max(market_price) AS marketPrice , sum(sales_volume) AS totalSalesVolume, sum(quantity) AS totalQuantity , count(*) AS number FROM goods.goods_sku WHERE activity_id = ? GROUP BY tenant_id, goods_id ) sku ON sku.goods_id = gs.id WHERE gs.tenant_id = ? AND gs.status < ? ORDER BY gs.topping DESC, sku.totalSalesVolume DESC, gs.id DESC ) tmp_count|1|1|1||0|0|65741|65741|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 wx_user_id = ? AND tenant_id = ? AND tenant_wx_app_id = ? AND login_way = ? AND expire_time > now() AND status = ? AND user_id = ?|1|1|1||0|0|0|0|0|0|
|gift_mail|SELECT ifnull(sum(quantity), ?) FROM gift_mail.trade WHERE tenant_wechatapp_id = ? AND user_id = ? AND product_id = ? AND trade_type = ? AND order_status IN (?) AND to_days(create_time) = to_days(now()) AND source = ?|1|1|1||0|0|7254|7254|1|1|
|v4_user|SELECT COUNT(*) AS total FROM member_import WHERE tenant_id = ? AND import_status = ? AND tenant_id = ?|1|2|2||0|0|40238|40238|1|1|
|v4_user|SELECT t2.id, t2.head_img_url, t2.mobile_no, t2.member_name, t2.sex FROM member_butler t1 JOIN member t2 ON t1.tenant_id = t2.tenant_id AND t1.member_id = t2.id AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t1.shop_id = ? AND t1.employee_id = ? AND t1.tenant_id = ? AND t1.tenant_app_id = ? ORDER BY t2.id LIMIT ?|1|1|1||0|0|262332|262332|10|10|
|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|27852|27852|1|1|
|v4_employee|SELECT 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(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_level_id = ?, ?)) AS `member_level|钻石会员` , sum(ifnull(member_sex = ?, ?)) AS `sex|男` , sum(ifnull(member_sex = ?, ?)) AS `sex|女` , sum(ifnull(member_sex = ?, ?)) AS `sex|其他` , sum(ifnull(shop_id = ?, ?)) AS `shop|北票萃华金店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城萃华珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平萃华金店` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平萃华通胜店` , sum(ifnull(shop_id = ?, ?)) AS `shop|喀左萃华一店` , sum(ifnull(shop_id = ?, ?)) AS `shop|喀左萃华二店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城潮宏基珠宝二店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华专卖店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华形象店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华旗舰店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区六福珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|凌源南街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|凌源北街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平潮宏基珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|大和周大福店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城站前街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|北票周大福珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|鞍山青年街` , sum(ifnull(shop_id = ?, ?)) AS `shop|鞍山周大福景子街店`|1|1|1||0|0|1754347|1754347|1|1|
|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|4|4||0|0|59276|59276|10|10|
|authorization_service|INSERT INTO user_login_token (id, platform_user_id, user_id, wx_user_id, wx_app_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) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?)|1|1|1||0|0|0|0|0|0|
|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|1|1||0|0|91781|91781|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|131|131||0|0|10887173|10887173|1099|1099|
|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|2025343|2025343|827|827|
|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|700|700|196|196|
|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|13599|13599|1|1|
|v4_employee|SELECT 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(member_integral_total = ?, ?)) AS `integral_total|等于0分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|1-4999分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|5000-19999分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|20000-49999分` , sum(ifnull(member_integral_total >= ?, ?)) AS `integral_total|大于等于50000分` , sum(ifnull(member_sales_amount = ?, ?)) AS `amount_total_consume|等于0元` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|1-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 >= ?, ?)) AS `amount_total_consume|大于等于50001元` , sum(ifnull(member_sex = ?, ?)) AS `sex|男` , sum(ifnull(member_sex = ?, ?)) AS `sex|女` , sum(ifnull(member_sex = ?, ?)) AS `sex|其他` , sum(ifnull(member_integral_balance = ?, ?)) AS `integral_balance|等于0分` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|1-1999分` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|2000-4999分` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|5000-19999分` , sum(ifnull(member_integral_balance >= ?, ?)) AS `integral_balance|大于等于20000分` , 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 = ?, ?))|1|1|1||0|0|1754347|1754347|1|1|
|goods|SELECT shop_id FROM goods.goods_take_shop WHERE goods_id = ? AND activity_id = ?|1|1|1||0|0|106391|106391|22|22|
|v4_employee|SELECT 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(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_level_id = ?, ?)) AS `member_level|钻石会员` , sum(ifnull(member_sex = ?, ?)) AS `sex|男` , sum(ifnull(member_sex = ?, ?)) AS `sex|女` , sum(ifnull(member_sex = ?, ?)) AS `sex|其他` , sum(ifnull(shop_id = ?, ?)) AS `shop|北票萃华金店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城萃华珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平萃华金店` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平萃华通胜店` , sum(ifnull(shop_id = ?, ?)) AS `shop|喀左萃华一店` , sum(ifnull(shop_id = ?, ?)) AS `shop|喀左萃华二店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城潮宏基珠宝二店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华专卖店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华形象店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华旗舰店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区六福珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|凌源南街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|凌源北街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平潮宏基珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|大和周大福店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城站前街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|北票周大福珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|鞍山青年街` , sum(ifnull(shop_id = ?, ?)) AS `shop|鞍山周大福景子街店`|1|5|5||0|0|1051215|1051215|1|1|
|employee|SELECT task_amount - finish_amount FROM backlog t WHERE t.tenant_app_id = ? AND t.shop_id = ? AND t.employee_id = ? AND t.status IN (?) AND t.scene = ? AND t.begin_time <= ? AND t.expire_time >= ?|1|1|1||0|0|132|132|0|0|
|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 = ?|1|2|2||0|0|77806|77806|1|1|
|corpwx_license|SELECT id, employee_id, corp_wx_user_id, lic_base_activated, lic_base_active_code , lic_base_expire_time, lic_external_activated, lic_external_active_code, lic_external_expire_time, tenant_id , create_time, update_time FROM active_employee WHERE corp_wx_user_id = ? AND tenant_id = ?|1|1|1||0|0|22809|22809|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|10|10||0|0|37830|37830|1|1|
|tenant|SELECT shop.*, dept.dept_name, count(es.id) AS employeesCount FROM tenant_wechatapp_shop shop LEFT JOIN erp_department dept ON shop.dept_erp_id = dept.dept_erp_id AND shop.tenant_id = dept.tenant_id LEFT JOIN employee_shop es ON shop.id = es.shop_id AND es.status IN (?) WHERE shop.tenant_wechatapp_id = ? AND shop.status IN (?) GROUP BY shop.id ORDER BY shop.create_time DESC LIMIT ?|1|2|2||0|0|88871|88871|20|20|
|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|25|25||0|0|152070|152070|11881|11881|
|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|
|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|1201397|1201397|489|489|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail WHERE create_time < ?|1|1|1||0|0|275432|275432|0|0|
|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|
|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|1201849|1201849|941|941|
|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 ?|1|6|6||0|0|127446|127446|10|10|
|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|2193|2193|1|1|
|gift_mail|SELECT c.id, c.categroy_name, c.parent_id, count(p.id) AS hasProducedCount FROM gift_mail.platform_category c LEFT JOIN gift_mail.platform_product p ON p.category_id = c.id GROUP BY c.id, c.categroy_name, c.parent_id ORDER BY c.parent_id ASC, c.update_time ASC|1|1|1||0|0|2280|2280|102|102|
|tenant|SELECT count(0) FROM sneak_guest WHERE tenant_app_id = ? AND create_shop_id = ? AND status = ? AND next_maintain_date >= ? AND next_maintain_date < ?|1|1|1||0|0|4698|4698|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|450453|450453|106|106|
|v4_user|SELECT id, shop_id, mobile_no, member_name, head_img_url , sex, birthday, birthday_is_lunar, memorial_name, memorial_day , memorial_day_is_lunar, address, interest, wx_union_id, mini_open_id , h5_open_id, wx_card_code, recommend_id, recommend_bind_time, external_user_id , status, combine_status, combine_id, tenant_id, tenant_app_id , create_time, update_time FROM member WHERE id IN (?) AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|8|8|8|8|
|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 = ?|1|3|3||0|0|3993|3993|1|1|
|corpwx|SELECT eu.id, eu.tenant_id, eu.user_id, eu.name, eu.avatar , eu.corp_user_id, eu.cwx_user_id, eu.sex, eu.un_assign_flag, eu.union_id , eub.wx_user_id FROM corpwx.external_user eu JOIN corpwx.external_user_bind eub ON eu.tenant_id = eub.tenant_id AND eu.user_id = eub.external_user_id WHERE eu.tenant_id = ? AND eu.status = ? AND eub.wx_user_id IN (?) AND eu.un_assign_flag = ?|1|1|1||0|0|2|2|1|1|
