|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|user_service|SELECT ue.employee_id AS employeeId, count(*) AS quantity FROM user_service.user_employee ue WHERE ue.employee_id IN (?) AND ue.tenant_id = ? AND ue.tenant_wechatapp_id = ? AND ue.shop_id = ? GROUP BY ue.employee_id|2331|4446|16||0|0|6707586|46187|2331|1|
|v4_user|SELECT t1.id AS memberId, t2.id AS potentialCustomerId, t2.checkin_time AS checkinTime FROM member t1 JOIN potential_customer t2 ON t1.tenant_app_id = t2.tenant_app_id AND (t1.id = t2.member_id OR (t2.external_user_id != ? AND t1.external_user_id = t2.external_user_id)) AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t2.maintain_shop_id = ? AND t2.id IN (?) AND t1.tenant_id = ? AND t1.tenant_app_id = ?|1127|2249|14||0|0|2082350015|2132650|9583|10|
|v4_user|SELECT t1.id AS memberId, t2.id AS potentialCustomerId, t2.checkin_time AS checkinTime FROM member t1 JOIN potential_customer t2 ON t1.tenant_app_id = t2.tenant_app_id AND (t1.id = t2.member_id OR (t2.external_user_id != ? AND t1.external_user_id = t2.external_user_id)) AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t2.maintain_shop_id = ? AND t2.maintain_employee_id = ? AND t2.`status` IN (?) AND t1.tenant_id = ? AND t1.tenant_app_id = ?|815|6151|47||0|0|6534233178|26843810|35772|200|
|corpwx|SELECT id, tenant_id, tenant_app_id, external_user_id, wx_user_id FROM external_user_bind WHERE (tenant_id = ? AND tenant_app_id = ? AND external_user_id = ?) OR (tenant_id = ? AND tenant_app_id = ? AND wx_user_id = ?)|784|2051|39||0|0|72616692|215674|436|1|
|tenant|SELECT id, tenant_id, tenant_app_id, sneak_guest_maintain_id, sneak_guest_id , url, create_time, update_time FROM sneak_guest_maintain_file WHERE tenant_app_id = ? AND sneak_guest_maintain_id IN (?)|534|1479|69||0|0|756653068|1418070|2915|23|
|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 ?|498|1533|37||0|0|5045478|28953|491|1|
|corpwx|SELECT id, tenant_id, cwx_user_id, user_id, old_user_id , union_id, name, sex, avatar, tenant_user_id , un_assign_flag, corp_user_id, wx_user_id, create_time, update_time , status FROM external_user WHERE tenant_id = ? AND cwx_user_id = ?|479|946|21||0|0|752807|6001|752807|6001|
|v4_user|SELECT id, shop_id, mobile_no, member_name, head_img_url , sex, birthday, birthday_is_lunar, memorial_name, memorial_day , memorial_day_is_lunar, address, interest, wx_union_id, mini_open_id , h5_open_id, wx_card_code, recommend_id, recommend_bind_time, external_user_id , status, combine_status, combine_id, tenant_id, tenant_app_id , create_time, update_time FROM member WHERE (mobile_no = ? OR wx_card_code = ?) AND tenant_id = ? AND tenant_app_id = ? LIMIT ?|466|1133|26||0|0|51117138|213263|374|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 (|346|833|23||0|0|505140|5572|239719|2739|
|v4_sales|SELECT COUNT(*) AS total FROM warranty WHERE member_id IN (?) AND is_disable = ? AND tenant_id = ? AND tenant_app_id = ?|307|922|29||0|0|36115947|143835|307|1|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY i.volume DESC, p.tag_price ASC, p.id DESC LIMIT ?|237|326|3||0|0|1948238|8239|1422|6|
|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()|216|389|8||0|0|8031600|67926|216|1|
|coupon_service|SELECT count(*) FROM employee_give_coupon_log WHERE tenant_app_id = ? AND coupon_push_id = ?|193|456|10||0|0|4720287|49771|193|1|
|employee|SELECT count(DISTINCT t.user_id) AS shouldMarkNum , count(DISTINCT if(t.`status` = ?, t.user_id, NULL)) AS markLabelNum FROM backlog t WHERE t.tenant_id = ? AND t.tenant_app_id = ? AND t.employee_id = ? AND t.scene = ? AND t.begin_time >= ? AND t.expire_time < ?|166|1177|43||0|0|1402670|21055|166|1|
|employee|SELECT count(0) FROM ( SELECT DISTINCT t.user_id, t.user_type FROM backlog t WHERE t.tenant_id = ? AND t.tenant_app_id = ? AND t.employee_id = ? AND t.scene = ? AND t.begin_time >= ? AND t.expire_time < ? AND t.finish_amount = ? ) table_count|165|1168|43||0|0|1406819|21277|165|1|
|v4_user|SELECT COUNT(*) AS total FROM member_source WHERE source_id = ? AND tenant_id = ? AND tenant_app_id = ?|162|374|16||0|0|29622581|213260|162|1|
|tenant|SELECT count(*) FROM tenant.sneak_guest_maintain s JOIN tenant.sneak_guest sg ON sg.tenant_id = s.tenant_id AND sg.tenant_app_id = s.tenant_app_id AND sg.id = s.sneak_guest_id JOIN tenant.employee e ON e.tenant_id = s.tenant_id AND e.id = s.employee_id WHERE s.tenant_id = ? AND s.tenant_app_id = ? AND sg.create_shop_id = ? AND (sg.fail_type IS NULL OR sg.fail_type = ?) AND s.event_type = ? AND s.create_time BETWEEN ? AND ?|155|439|17||0|0|549617|7219|155|1|
|activity_service|SELECT count(*) > ? FROM activity_service.online_sign_user_sign_log WHERE tenant_app_id = ? AND user_id = ? AND to_days(create_time) = to_days(?)|149|423|18||0|0|60338947|405138|149|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 = ?|124|302|11||0|0|1042592|8408|0|0|
|tenant|SELECT count(*) FROM sneak_guest WHERE tenant_app_id = ? AND create_shop_id = ? AND maintain_employee_id = ? AND status = ? AND next_maintain_date BETWEEN ? AND ?|121|221|9||0|0|814489|11317|121|1|
|tenant|SELECT count(*) FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? AND maintain_employee_id = ?|119|218|9||0|0|800487|11317|119|1|
|comment_service|SELECT * FROM comment_service.comment_reward WHERE comment_id = ? LIMIT ?|115|368|22||0|0|45617668|403669|29|1|
|tenant|SELECT sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, sg.maintain_level , sg.maintain_employee_id, sg.create_time, sg.last_maintain_date, ey.employee_name AS maintainEmployeeName, sg.status , sg.finish_date, sg.next_maintain_date FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND sg.maintain_employee_id = ? AND sg.next_maintain_date >= ? AND sg.next_maintain_date <= ? AND sg.status = ? ORDER BY sg.id DESC LIMIT ?|107|250|10||0|0|66040039|635757|444|10|
|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 (?)|102|150|2||0|0|3735|60|1245|20|
|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 = ?|102|240|17||0|0|793720|133362|102|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|97|209|6||0|0|577222|8536|485|5|
|tenant|SELECT count(*) AS amount FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? AND maintain_employee_id = ? AND create_time <= ?|96|177|9||0|0|664291|11317|96|1|
|gift_mail|SELECT count(0) FROM ( SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY i.volume DESC, p.tag_price ASC, p.id DESC ) tmp_count|92|114|3||0|0|668104|7262|92|1|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY i.volume DESC, p.tag_price ASC, p.id DESC LIMIT ?, ?|85|111|2||0|0|703219|8443|510|6|
|tenant|SELECT count(*) FROM tenant.sneak_guest_maintain s JOIN tenant.sneak_guest sg ON sg.id = s.sneak_guest_id WHERE s.tenant_id = ? AND s.tenant_app_id = ? AND s.shop_id = ? AND s.event_type = ? AND s.create_time BETWEEN ? AND ?|80|203|10||0|0|297980|6896|80|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 = ?|75|149|9||0|0|160159|7635|75|1|
|v4_sales|SELECT count(es.id) FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id = es.id AND wca.tenant_id = ? AND wca.tenant_app_id = ? LEFT JOIN v4_sales.warranty w ON w.sales_id = es.id AND w.tenant_id = ? AND w.tenant_app_id = ? WHERE es.sales_status = ? AND is_sales = ? AND es.sales_date >= ? AND es.employee_erp_id = ? AND dept_erp_id = ? AND w.id IS NULL AND es.tenant_id = ? AND es.tenant_app_id = ?|69|121|5||0|0|96008|2935|69|1|
|coupon_service|SELECT ifnull(sum(quantity), ?) FROM coupon_service.coupon_market_order WHERE market_id = ? AND user_id = ? AND order_state = ?|67|362|28||0|0|35765859|534529|67|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|67|145|8||0|0|5993371|91310|67|1|
|tenant|SELECT id, tenant_id, tenant_app_id, sneak_guest_maintain_id, sneak_guest_id , url, create_time, update_time FROM sneak_guest_maintain_file WHERE tenant_app_id = ? AND sneak_guest_id = ? AND sneak_guest_maintain_id = ?|66|131|4||0|0|93501056|1416717|1|1|
|v4_coupon|SELECT * FROM v4_coupon.coupon WHERE coupon_no = ? LIMIT ?|60|184|18||0|0|13780129|230600|57|1|
|goods|SELECT * FROM goods_take_shop WHERE tenant_id = ? AND goods_id = ? AND activity_id = ? ORDER BY create_time DESC|60|146|12||0|0|6154481|102630|1301|77|
|coupon_service|SELECT count(0) FROM coupon_service.employee_give_coupon_log egcl WHERE egcl.employee_give_coupon_id = ? AND egcl.shop_id = ? AND egcl.employee_id = ?|59|114|5||0|0|510057|14959|59|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 = ?|57|144|11||0|0|729175|21920|11|1|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE member_id = ? AND scene = ? AND scene_id = ? AND tenant_id = ? AND tenant_app_id = ?|50|135|13||0|0|5154155|123616|50|1|
|user_service|SELECT t1.id, t1.user_id AS userId, t1.user_name AS userName, t1.sex, t1.mobile_no AS mobileNo , t1.head_img_url AS headImg FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? JOIN user_service.user_employee ue ON t1.tenant_id = ue.tenant_id AND t1.tenant_app_id = ue.tenant_wechatapp_id AND t1.user_id = ue.user_id AND ue.employee_id = ? AND ue.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? ORDER BY ue.update_time DESC, t1.id DESC LIMIT ?|47|114|8||0|0|459781|54070|470|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 ?|44|235|33||0|0|9990151|515585|11|1|
|coupon_service|SELECT * FROM coupon_service.coupon_can_give WHERE coupon_id = ? LIMIT ?|44|88|7||0|0|10974120|249801|44|1|
|tenant|SELECT sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, sg.maintain_level , sg.maintain_employee_id, sg.create_time, sg.last_maintain_date, ey.employee_name AS maintainEmployeeName, sg.status , sg.finish_date, sg.next_maintain_date FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND sg.maintain_employee_id = ? AND sg.status = ? ORDER BY sg.id DESC LIMIT ?, ?|42|80|7||0|0|22386834|635792|237|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 (?)|41|80|7||0|0|15668724|868608|3447|218|
|v4_sales|SELECT id, warranty_id, sales_detail_id, tenant_id, tenant_app_id , create_time, update_time FROM warranty_detail WHERE warranty_id = ? AND sales_detail_id = ? AND tenant_id = ? AND tenant_app_id = ?|40|144|23||0|0|24859987|624512|22|1|
|v4_coupon|SELECT * FROM v4_coupon.sales_give_coupon_record WHERE put_id = ? AND sales_id = ? AND rule_id = ? AND tenant_id = ? AND tenant_app_id = ? LIMIT ?|38|72|5||0|0|3327436|88135|0|0|
|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 = ?|36|68|10||0|0|89906|5422|36|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')|33|419|37||0|0|5991817|331035|8235|2177|
|gift_mail|SELECT ifnull(count(1), ?) AS amount FROM trade WHERE tenant_wechatapp_id = ? AND user_id = ? AND order_status IN (?)|29|50|3||0|0|260345|13682|29|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|27|215|47||0|0|565937|31748|108104|6006|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id = es.id AND wca.tenant_id = ? AND wca.tenant_app_id = ? LEFT JOIN v4_sales.warranty w ON w.sales_id = es.id AND w.tenant_id = ? AND w.tenant_app_id = ? WHERE is_sales = ? AND sales_status = ? AND (es.sales_no LIKE concat(?, ?) OR es.member_erp_id = ?) AND es.tenant_id = ? AND es.tenant_app_id = ?|27|245|64||0|0|12228924|494125|27|1|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.warranty w JOIN v4_sales.erp_sales es ON es.id = w.sales_id AND es.tenant_id = ? AND es.tenant_app_id = ? WHERE w.member_id IN (?) AND is_disable = ? AND w.tenant_id = ? AND w.tenant_app_id = ?|25|85|15||0|0|3018945|143818|25|1|
|warranty_service|SELECT count(*) FROM warranty WHERE user_id = ? AND tenant_wechatapp_id = ? AND is_disable = ?|25|379|83||0|0|222136|10690|25|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 = ?|24|161|26||0|0|515855|28951|24|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 = ?)|23|48|3||0|0|8121031|455604|23|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 = ?))|23|44|5||0|0|469553|20431|14|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|22|33|2||0|0|13956|1135|31|4|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE coupon_status = ? AND member_id = ? AND tenant_id = ? AND tenant_app_id = ?|22|39|3||0|0|5054|906|22|1|
|order|SELECT count(*) FROM `order`.order_info WHERE tenant_id = ? AND tenant_wechatapp_id = ? AND take_type = ? AND status = ? AND (wait_take_shop_id = ? OR take_shop_id = ?)|20|38|3||0|0|108685|5902|20|1|
|v4_sales|SELECT ifnull(sum(integral), ?) AS points FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id = es.sales_erp_id AND esd.tenant_id = ? AND esd.tenant_app_id = ? WHERE es.member_erp_id = ? AND es.sales_status = ? AND es.is_sales = ? AND esd.sales_type = ? AND es.tenant_id = ? AND es.tenant_app_id = ?|19|64|10||0|0|233985|22368|19|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 = ?|19|30|2||0|0|103218|14299|19|1|
|coupon_service|SELECT * FROM coupon_service.coupon_market_order WHERE pay_type IN (?) AND order_state = ? AND update_time <= DATE_SUB(NOW(), INTERVAL ? MINUTE)|18|58|8||0|0|9606639|534238|2|1|
|v4_employee|SELECT t.id AS task_id, task_type , if(task_type = ?, st.description, it.description) AS description , if(task_type = ?, st.quick_reply, it.quick_reply) AS quick_reply , task_name, member_id, member_name, member_mobile_no, member_sex , member_level, t.start_time, t.end_time , datediff(t.end_time, ?) AS left_days, send_coupons , recv_coupons, st.coupons, t.accept_time, t.plan_arrival_shop_time, t.arrival_shop_time , t.trade_time FROM task_task t LEFT JOIN task_system_task_template st ON st.id = t.task_template_id AND st.tenant_id = ? AND st.tenant_app_id = ? LEFT JOIN task_invite_task_template it ON it.id = t.task_template_id AND it.tenant_id = ? AND it.tenant_app_id = ? WHERE t.status = ? AND task_type = ? AND system_task_type = ? AND t.start_time <= ? AND t.end_time > ? AND shop_id = ? AND employee_id = ? AND finish_time IS NULL AND t.tenant_id = ? AND t.tenant_app_id = ? ORDER BY t.id DESC LIMIT ?|18|115|30||0|0|9444158|524680|49|5|
|v4_sales|SELECT id, warranty_id, sales_detail_id, tenant_id, tenant_app_id , create_time, update_time FROM warranty_detail WHERE warranty_id = ? AND tenant_id = ? AND tenant_app_id = ?|18|95|30||0|0|11189020|625093|34|6|
|v4_sales|SELECT es.id AS salesId, es.sales_no, es.sales_date, es.member_erp_id AS memberId, w.warranty_no FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id = es.id AND wca.tenant_id = ? AND wca.tenant_app_id = ? LEFT JOIN v4_sales.warranty w ON w.sales_id = es.id AND w.tenant_id = ? AND w.tenant_app_id = ? WHERE is_sales = ? AND sales_status = ? AND (es.sales_no LIKE concat(?, ?) OR es.member_erp_id = ?) AND es.tenant_id = ? AND es.tenant_app_id = ? ORDER BY es.sales_date DESC, es.id DESC LIMIT ?|17|78|18||0|0|7951968|494154|102|10|
|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()|16|23|3||0|0|483|242|7|1|
|tenant|SELECT sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, sg.maintain_level , sg.maintain_employee_id, sg.create_time, sg.last_maintain_date, ey.employee_name AS maintainEmployeeName, sg.status , sg.finish_date, sg.next_maintain_date FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND sg.maintain_employee_id = ? AND sg.status = ? ORDER BY sg.id DESC LIMIT ?|16|36|8||0|0|9733265|635619|99|10|
|v4_sales|SELECT id, warranty_detail_id, media_id, wx_img_url, img_url , tenant_id, tenant_app_id, create_time, update_time FROM warranty_detail_img WHERE warranty_detail_id IN (?) AND tenant_id = ? AND tenant_app_id = ?|15|30|3||0|0|450809|31342|17|4|
|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|15|30|3||0|0|8409234|2358908|15|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 = ?|15|23|3||0|0|3763|551|1824|264|
|user_service|SELECT count(0) FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ?|14|57|13||0|0|787737|148826|14|1|
|corpwx|UPDATE external_user SET un_assign_flag = ? WHERE tenant_id = ? AND status = ? AND un_assign_flag = ?|14|34|7||0|0|427666|57346|0|0|
|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 = ?|13|17|1||0|0|0|0|0|0|
|tenant|SELECT sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, sg.maintain_level , sg.maintain_employee_id, sg.create_time, sg.last_maintain_date, ey.employee_name AS maintainEmployeeName, sg.status , sg.finish_date, sg.next_maintain_date FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND sg.maintain_employee_id = ? AND sg.next_maintain_date >= ? AND sg.next_maintain_date <= ? AND sg.status = ? ORDER BY sg.id DESC LIMIT ?, ?|13|30|14||0|0|8202519|635592|36|10|
|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|13|19|2||0|0|26994|4230|1166|279|
|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|13|290|57||0|0|676449|74561|13|1|
|order|SELECT max(create_time) FROM `order`.order_operator_log WHERE tenant_wechatapp_id = ? AND order_id = ?|12|97|14||0|0|10612496|884565|12|1|
|user_service|SELECT obj.id, obj.total , CASE  WHEN @rowtotal = obj.total THEN @rownum WHEN @rowtotal := obj.total THEN @rownum := @rownum + ? WHEN @rowtotal = ? THEN @rownum := @rownum + ? END AS rank_idx FROM ( SELECT us.from_id AS id, count(1) AS total FROM user_source us WHERE us.tenant_id = ? AND us.tenant_wechatapp_id = ? AND us.shop_id = ? AND us.create_time >= ? AND us.create_time < ? AND us.source_type = ? AND us.from_id IS NOT NULL AND us.shop_id IS NOT NULL GROUP BY us.from_id ORDER BY count(1) DESC ) obj, ( SELECT @rownum := ?, @rowtotal := NULL ) r|12|18|2||0|0|22552|3429|71|12|
|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 ?|12|31|10||0|0|3988371|492815|544|251|
|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 < ?|11|16|1||0|0|558|136|11|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|11|26|6||0|0|1095647|123617|11|1|
|v4_user|SELECT id, member_id, external_user_id, serial_number, checkin_shop_id , checkin_employee_id, checkin_employee_name, checkin_time, maintain_shop_id, maintain_employee_id , maintain_employee_name, first_maintain_time, last_maintain_time, next_maintain_time, maintain_num , intention_num, latest_intention, status, finish_time, finish_shop_id , deal_employee_id, deal_employee_name, deal_sale_amount, fail_employee_id, fail_employee_name , fail_reason, remark, sex, cutomer_grade, maintain_level , tenant_id, tenant_app_id, create_time, update_time FROM potential_customer WHERE member_id = ? AND status IN (?) AND tenant_id = ? AND tenant_app_id = ?|11|25|4||0|0|240853|21921|1|1|
|goods|SELECT id, img_url, img_index FROM goods_img WHERE goods_id = ? ORDER BY update_time DESC|11|18|4||0|0|287833|26169|29|5|
|user_service|UPDATE user_service.tenant_member_bind SET wx_user_id = NULL WHERE tenant_id = ? AND tenant_app_id = ? AND erp_member_id = ?|11|14|1||0|0|0|0|0|0|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY p.tag_price ASC, p.id DESC LIMIT ?, ?|11|21|3||0|0|91571|8371|66|6|
|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 = ?|10|15|2||0|0|54388|8406|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|106|44||0|0|517526|89330|49|20|
|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|13|2||0|0|365019|108122|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 = ?|9|19|4||0|0|364776|105468|9|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 ?|9|74|26||0|0|578655|105480|31|11|
|user_service|SELECT count(0) FROM user_service.tenant_member tm JOIN user_service.tenant_member_info tmi ON tm.tenant_id = tmi.tenant_id AND tm.id = tmi.id LEFT JOIN user_service.user_employee t3 ON tm.user_id = t3.user_id AND tm.tenant_id = t3.tenant_id AND tm.tenant_app_id = t3.tenant_wechatapp_id WHERE t3.id IS NULL AND tmi.shop_id = ? AND tmi.tenant_id = ? AND tmi.tenant_app_id = ?|9|18|3||0|0|155667|44590|9|1|
|goods|SELECT shop_id FROM goods.goods_take_shop WHERE goods_id = ? AND activity_id = ?|9|16|3||0|0|922977|102553|104|39|
|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 = ?|9|19|4||0|0|364776|105468|9|1|
|v4_employee|SELECT COUNT(*) FROM ( SELECT t.id AS task_id, task_type , if(task_type = ?, st.description, it.description) AS description , if(task_type = ?, st.quick_reply, it.quick_reply) AS quick_reply , task_name, member_id, member_name, member_mobile_no, member_sex , member_level, t.start_time, t.end_time , datediff(t.end_time, ?) AS left_days, send_coupons , recv_coupons, st.coupons, t.accept_time, t.plan_arrival_shop_time, t.arrival_shop_time , t.trade_time FROM task_task t LEFT JOIN task_system_task_template st ON st.id = t.task_template_id AND st.tenant_id = ? AND st.tenant_app_id = ? LEFT JOIN task_invite_task_template it ON it.id = t.task_template_id AND it.tenant_id = ? AND it.tenant_app_id = ? WHERE t.status = ? AND task_type = ? AND system_task_type = ? AND t.start_time <= ? AND t.end_time > ? AND shop_id = ? AND employee_id = ? AND finish_time IS NULL AND t.tenant_id = ? AND t.tenant_app_id = ? ) TOTAL|9|19|3||0|0|24992|3944|9|1|
|gift_mail|SELECT id, tenant_wechatapp_id, shop_id, shop_name, product_id , create_time, update_time FROM take_shop WHERE product_id = ?|9|14|3||0|0|391464|43496|90|22|
|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|9|18|5||0|0|105891|21730|9|1|
|tenant|SELECT count(*) FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ?|8|15|3||0|0|52736|11041|8|1|
|v4_sales|SELECT ifnull(count(*), ?) AS sales_count , ifnull(sum(amount), ?) AS sales_amount FROM erp_sales WHERE member_erp_id IN (?) AND is_sales = ? AND sales_status = ? AND tenant_id = ? AND tenant_app_id = ?|8|18|3||0|0|63706|8800|8|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 ?|7|16|5||0|0|44250|8727|84|12|
|employee|UPDATE backlog SET status = ?, finish_time = now() WHERE tenant_app_id = ? AND employee_id = ? AND status IN (?) AND shop_id = ?|7|32|13||0|0|28593|5716|0|0|
|user_service|SELECT count(0) FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? AND (t1.mobile_no LIKE concat(?, ?) OR t1.user_name LIKE concat(?, ?, ?))|7|48|21||0|0|3476779|496686|7|1|
|coupon_service|SELECT cu.id, cu.coupon_name, cu.coupon_type, cu.coupon_no, cu.source AS couponChannel , cu.coupon_state, ce.user_name, ce.creator_user_name AS creatorName , if(coupon_type IN (?), cu.face_value, round(cu.face_value / ?, ?)) AS faceValue , cu.begin_time, cu.end_time, ce.remark, ce.mobile_no, ce.creator_mobile_no , cu.create_time, cu.user_id , round(cu.balance / ?, ?) AS balance , ce.source_user_id, ce.source_user_type, ce.member_source_shop FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ? AND cu.coupon_no = ? LIMIT ?|7|904|224||0|0|1413869|294677|7|1|
|employee|SELECT DISTINCT t.user_id, t.user_type FROM backlog t WHERE t.tenant_id = ? AND t.tenant_app_id = ? AND t.employee_id = ? AND t.scene = ? AND t.begin_time >= ? AND t.expire_time < ? AND t.finish_amount = ? LIMIT ?|7|37|28||0|0|67275|10786|70|10|
|v4_user|SELECT COUNT(*) AS total FROM potential_customer WHERE maintain_shop_id = ? AND maintain_employee_id = ? AND status IN (?) AND tenant_id = ? AND tenant_app_id = ?|7|9|2||0|0|4188|944|7|1|
|order|SELECT count(0) FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND (od.mobile_no = ? OR ad.mobile_no = ?)|7|24|7||0|0|367692|105480|7|1|
|coupon_service|SELECT count(0) FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ? AND cu.coupon_no = ?|7|973|250||0|0|1413865|294676|7|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|7|8|1||0|0|616|88|7|1|
|activity_service|SELECT count(DISTINCT user_id) FROM user_trace WHERE tenant_app_id = ? AND activity_id = ? AND status != ?|7|10|2||0|0|21392|3515|7|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 sg.maintain_employee_id = ? AND sg.status = ?|6|9|2||0|0|44898|11248|6|1|
|employee|UPDATE backlog SET finish_amount = ?, finish_time = IF(task_amount <= finish_amount, ifnull(finish_time, now()), NULL), status = IF(task_amount <= finish_amount, ?, ?), update_time = now() WHERE tenant_id = ? AND tenant_app_id = ? AND employee_id = ? AND scene = ? AND begin_time <= ? AND expire_time >= ?|6|7|1||0|0|1545|344|0|0|
|employee|UPDATE backlog SET leave_flag = ? WHERE tenant_app_id = ? AND employee_id = ?|6|8|2||0|0|24611|6818|0|0|
|order|SELECT id, type, operator_type AS operatorType, operator_result AS operatorResult, reason_label AS reasonLabel , reason_value AS reasonValue, remark, create_time AS createTime, status FROM order_service_log WHERE order_id = ? ORDER BY create_time DESC|6|7|1||0|0|123113|20521|0|0|
|gift_mail|SELECT count(*) FROM gift_mail.trade t LEFT JOIN gift_mail.trade_take tt ON tt.trade_id = t.id WHERE t.tenant_id = ? AND t.tenant_wechatapp_id = ? AND t.trade_type IN (?) AND t.order_status = ? AND t.take_type = ? AND tt.shop_id = ?|6|8|2||0|0|10436|3530|6|1|
|user_service|SELECT t1.user_id AS userId, t3.open_id AS wxOpenId FROM user_service.tenant_member t1 JOIN user_service.tenant_member_bind t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id JOIN user_service.wx_user t3 ON t2.wx_user_id = t3.id AND t3.is_subscribe = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? AND t1.user_id IN (?)|6|7|2||0|0|891|150|243|46|
|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 ?|6|8|2||0|0|10813|2308|6|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()|6|12|3||0|0|243949|67926|6|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|6|17|5||0|0|502665|84111|6|1|
|user_service|UPDATE tenant_member SET tenant_app_id = ?, user_id = ?, mobile_no = ?, user_name = ?, sex = ?, status = ?, create_time = ?, update_time = ? WHERE tenant_id = ? AND id = ?|6|7|1||0|0|6|1|0|0|
|deliver|SELECT * FROM express_address WHERE user_id = ? AND type = ?|6|8|2||0|0|60889|10150|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.product_status = ? AND p.topping = ? AND p.tenant_id = ? AND (ps.id IS NOT NULL OR p.tenant_wechatapp_id = ?)|6|9|2||0|0|311508|51918|6|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 = ?|5|41|15||0|0|249882|80538|5|1|
|gift_mail|SELECT count(0) FROM ( SELECT p.id, p.default_image_url, p.product_name, p.product_type, p.tag_price , ifnull(pp.integral_price, ifnull(( SELECT min(inventory.price) FROM gift_mail.inventory WHERE inventory.product_id = p.id ), ?)) AS price , p.volume, p.category_id, p.product_status, ? AS quantity, pp.partner_id AS partner_id , p.topping FROM gift_mail.product p LEFT JOIN gift_mail.partner_product pp ON p.id = pp.product_id LEFT JOIN gift_mail.product_status ps ON ps.product_id = p.id WHERE p.tenant_id = ? AND product_status = ? AND (p.is_disable IS NULL OR p.is_disable = ?) AND (ps.tenant_wechatapp_id = ? OR p.product_type = ?) ) p WHERE p.topping = ?|5|9|2||0|0|82361|16501|5|1|
|wx_gateway|UPDATE wx_template_msg SET status = ?, err_msg = ? WHERE msg_id = ?|5|8|2||0|0|5|1|0|0|
|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|1167442|419709|298|163|
|user_service|SELECT count(0) FROM user_service.tenant_member tm JOIN user_service.tenant_member_info tmi ON tmi.tenant_id = ? AND tmi.tenant_app_id = ? AND tm.id = tmi.id WHERE tm.tenant_id = ? AND tm.tenant_app_id = ? AND (tm.user_name LIKE concat(?, ?, ?) OR tm.mobile_no = ?)|5|22|6||0|0|417661|83558|5|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 = ?|5|12|3||0|0|231518|67024|2631|1211|
|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 (?)|5|6|1||0|0|35|10|35|10|
|activity_service|SELECT id FROM activity_service.activity_qualified WHERE tenant_app_id = ? AND activity_id = ? AND (user_id = ? OR open_id = ?) AND invalid = ? ORDER BY id DESC LIMIT ?|5|11|3||0|0|414101|82885|0|0|
|order|SELECT count(0) FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND od.order_no LIKE concat(?, ?, ?)|5|32|21||0|0|175814|35166|5|1|
|wx_gateway|INSERT INTO wx_template_msg (id, tenant_id, tenant_app_id, user_id, push_id , tenant_user_open_id, template_id, template_no, url, data , msg_id, status, err_msg, title, content , create_time, update_time, tenant_short_name, tenant_app_name, user_mobile_no , user_name, user_head_img_url) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?)|5|8|2||0|0|0|0|0|0|
|v4_employee|SELECT id, batch_no, task_type, system_task_type, task_frequency , task_name, task_template_id, business_id, shop_id, employee_id , member_id, start_time, end_time, finish_time, send_coupons , recv_coupons, recv_coupon_time, accept_time, plan_arrival_shop_time, arrival_shop_time , trade_nos, trade_num, trade_amount, trade_time, member_name , member_mobile_no, member_latest_birthday, member_sex, member_age, member_level_id , member_level, member_sales_amount, member_sales_count, member_integral_balance, member_integral_total , status, tenant_id, tenant_app_id, create_time, update_time FROM task_task WHERE member_id = ? AND task_template_id IN (?) AND tenant_id = ? AND tenant_app_id = ?|5|7|2||0|0|1|1|1|1|
|tenant|SELECT count(0) FROM erp_sales_detail t1 LEFT JOIN erp_sales_detail_extend t2 ON t2.tenant_id = t1.tenant_id AND t2.tenant_wechatapp_id = t1.tenant_wechatapp_id AND t2.sales_erp_id = t1.sales_erp_id AND t2.sales_index = t1.sales_index LEFT JOIN erp_sales t3 ON t3.tenant_id = t1.tenant_id AND t3.tenant_wechatapp_id = t1.tenant_wechatapp_id AND t3.sales_erp_id = t1.sales_erp_id WHERE t1.tenant_id = ? AND t1.tenant_wechatapp_id = ? AND t3.tenant_id = t1.tenant_id AND t3.tenant_wechatapp_id = t1.tenant_wechatapp_id AND t3.member_erp_id = ? AND t3.sales_status = ? AND t3.is_sales = ?|4|5|1||0|0|205|137|4|1|
|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 ?|4|5|1||0|0|42511|10628|0|0|
|activity_service|SELECT count(t.user_id) AS lotteryCount, count(DISTINCT t.user_id) AS lotteryNum FROM lottery_winner t WHERE t.lottery_activity_id = ?|4|4|1||0|0|12905|3660|4|1|
|tenant|SELECT id, tenant_id AS tenantid, tenant_wechatapp_id AS tenantwechatappid, sales_erp_id AS salesErpId, sales_index AS salesIndex , sales_type AS salestype, product_barcode AS productbarcode, product_name AS productname, cert_no AS certno, hand_size AS handsize , category_erp_id AS categoryerpid, category_name AS categoryname, stone_weight AS stoneweight, gold_weight AS goldweight, total_weight AS totalweight , quantity, amount_total AS amounttotal, amount_pay AS amountpay, integral, remark FROM erp_sales_detail WHERE tenant_id = ? AND tenant_wechatapp_id = ? AND sales_erp_id = ? ORDER BY sales_index|4|4|1||0|0|0|0|0|0|
|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|4|1||0|0|18176|12106|4|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 ?|4|5|2||0|0|1461359|455520|4|1|
|user_service|SELECT ue.id AS userEmployeeId, ue.tenant_id AS tenantId, ue.tenant_wechatapp_id AS tenantAppId, ue.shop_id AS shopId, tu.user_id AS userId , tu.user_name AS nickName, tu.user_name AS userName, tu.mobile_no AS mobileNo, tu.head_img_url AS headImgUrl FROM user_service.user_employee ue JOIN user_service.tenant_member tu ON tu.tenant_id = ue.tenant_id AND ue.tenant_wechatapp_id = tu.tenant_app_id AND ue.user_id = tu.user_id WHERE ue.tenant_id = ? AND ue.tenant_wechatapp_id = ? AND ue.employee_id = ? AND ue.shop_id = ?|4|6|2||0|0|11165|5040|5579|2519|
|user_service|INSERT INTO erp_integral_log (id, tenant_id, tenant_wechatapp_id, integral_erp_id, member_erp_id , note_erp_id, remark, integral, erp_create_time, create_time , update_time, busi_type, busi_id) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?) ON DUPLICATE KEY UPDATE update_time = now()|4|4|1||0|0|0|0|0|0|
|user_service|SELECT count(0) FROM ( SELECT count(1) FROM user_source us WHERE us.tenant_id = ? AND us.tenant_wechatapp_id = ? AND us.from_id = ? AND us.shop_id = ? AND us.create_time >= ? AND us.create_time < ? AND us.source_type = ? AND us.from_id IS NOT NULL AND us.shop_id IS NOT NULL ) table_count|4|5|1||0|0|2584|892|4|1|
|corpwx|COMMIT ?|4|4|1||0|0|0|0|0|0|
|coupon_service|SELECT count(0) 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 (?)|4|5|2||0|0|1182542|302736|4|1|
|tenant|INSERT INTO erp_sales_detail (id, tenant_id, tenant_wechatapp_id, sales_erp_id, sales_index , sales_type, product_barcode, product_name, cert_no, hand_size , category_erp_id, category_name, stone_weight, gold_weight, total_weight , quantity, amount_total, amount_pay, integral, remark) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE update_time = now(), sales_type = ?, product_barcode = ?, product_name = ?, cert_no = ? , hand_size = ?, category_erp_id = ?, category_name = ?, stone_weight = ?, gold_weight = ? , total_weight = ?, quantity = ?, amount_total = ?, amount_pay = ?, integral = ? , remark = ?|4|5|1||0|0|0|0|0|0|
|gift_mail|SELECT count(0) FROM ( SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY p.tag_price ASC, p.id DESC ) tmp_count|4|6|1||0|0|29048|7262|4|1|
|v4_sales|SELECT count(DISTINCT es.id) FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id = es.sales_erp_id AND esd.sales_type IN (?) AND member_erp_id IN (?) AND esd.tenant_id = ? AND esd.tenant_app_id = ? WHERE es.tenant_id = ? AND es.tenant_app_id = ?|4|7|2||0|0|16661|5660|4|1|
|authorization_service|update user_login_token set status=? where login_token in (|4|47|38||0|0|3750|1569|0|0|
|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 = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? AND (t1.mobile_no LIKE concat(?, ?) OR t1.user_name LIKE concat(?, ?, ?)) ORDER BY t1.id DESC LIMIT ?|4|5|1||0|0|1986710|496679|4|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 = ?|4|6|1||0|0|351240|88089|1|1|
|employee|UPDATE backlog_system SET status = ?, finish_time = now() WHERE tenant_app_id = ? AND scene = ?|4|20|8||0|0|4566996|1141749|0|0|
|v4_user|SELECT COUNT(*) AS total FROM member WHERE status = ? AND member_name LIKE ? AND tenant_id = ? AND tenant_app_id = ?|4|9|3||0|0|686131|213210|4|1|
|corpwx_license|DELETE FROM cwx_sync_active_info WHERE tenant_id = ? AND user_id = ? AND tenant_id = ?|4|4|1||0|0|76776|19211|0|0|
|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|4|15|5||0|0|81291|27145|21|6|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ...|4|7|3||0|0|3767680|1326555|1764|784|
|order|SELECT count(0) FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND dt.product_name LIKE concat(?, ?, ?)|4|27|10||0|0|133434|70727|4|1|
|user_service|UPDATE tenant_member_info SET shop_id = ? WHERE tenant_id = ? AND id IN (?)|3|3|1||0|0|3|1|0|0|
|user_service|UPDATE user_service.tenant_member_info t1 JOIN user_service.user_employee t2 ON t1.tenant_id = t2.tenant_id AND t1.tenant_app_id = t2.tenant_wechatapp_id AND t1.user_id = t2.user_id SET t1.shop_id = ?, t2.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? AND t2.employee_id = ? AND t1.shop_id = ?|3|7|4||0|0|4762|2814|0|0|
|employee|SELECT count(*) FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND status = ? AND expire_time BETWEEN ? AND ?|3|7|3||0|0|21924|8371|3|1|
|order|SELECT count(*) AS amount FROM `order`.order_info od LEFT JOIN `order`.order_detail dt ON od.id = dt.order_id LEFT JOIN order.order_address ad ON od.id = ad.order_id WHERE od.tenant_wechatapp_id = ? AND od.take_type = ? AND od.type = ? AND od.status = ? AND ad.shop_id = ? AND dt.take_start_date = ?|3|12|9||0|0|16511|7833|3|1|
|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 = ?|3|3|1||0|0|5869|3143|3|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 LIMIT ?|3|4|1||0|0|15965|6546|30|10|
|tenant|SELECT count(0) FROM ( SELECT sg.employee_id AS employeeId, sg._actual AS actualNum, sg._maintain AS continueNum, sg._failure AS failNum, sg._success AS dealNum , e.employee_name, e.head_img_url FROM ( SELECT sgm.employee_id, count(DISTINCT sneak_guest_id) AS _actual, sum(_maintain) AS _maintain , sum(_success) AS _success, sum(_failure) AS _failure , max(sgm.create_time) AS create_time FROM ( SELECT sgm.employee_id, sneak_guest_id , if(event_type = ?, ?, ?) AS _maintain , if(event_type = ?, ?, ?) AS _success , if(event_type = ?, ?, ?) AS _failure , sgm.create_time AS create_time FROM tenant.sneak_guest_maintain sgm JOIN tenant.sneak_guest sg ON sgm.sneak_guest_id = sg.id WHERE sgm.tenant_id = ? AND sgm.tenant_app_id = ? AND sgm.shop_id = ? AND sgm.create_time BETWEEN ? AND ? AND sgm.event_type IN (?) AND (sg.fail_type IS NULL OR sg.fail_type = ?) ) sgm WHERE 1 = 1 GROUP BY sgm.employee_id ) sg JOIN tenant.employee e ON e.id = sg.employee_id ORDER BY sg.create_time DESC ) tmp_count|3|69|33||0|0|160161|53389|3|1|
|order|SELECT count(0) FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND (od.mobile_no = ? OR ad.mobile_no = ?) AND (od.status = ?)|3|8|3||0|0|224571|74871|3|1|
|employee|SELECT count(*) FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND status = ? AND finish_time BETWEEN ? AND ?|3|5|2||0|0|4093|1497|3|1|
|tenant|SELECT count(0) FROM ( SELECT sg.id, sneak_guest_no, sg.status, user_id, smg.time , if(sg.status = ?, e.employee_name, ?) AS maintainEmployeeName , smg._count AS maintainNum, sg.update_employee_id FROM tenant.sneak_guest sg JOIN tenant.employee e ON e.id = sg.maintain_employee_id JOIN ( SELECT sneak_guest_id, count(*) AS _count, min(create_time) AS time FROM tenant.sneak_guest_maintain WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND employee_id = ? AND event_type IN (?) AND create_time BETWEEN ? AND ? GROUP BY sneak_guest_id ) smg ON smg.sneak_guest_id = sg.id WHERE sg.tenant_id = ? AND sg.tenant_app_id = ? AND (sg.fail_type IS NULL OR sg.fail_type = ?) ) tmp_count|3|71|38||0|0|157755|52585|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|22|11||0|0|71877|23959|3|1|
|message_push|INSERT INTO message_log (id, tenant_id, tenant_app_id, user_id, scene_type , msg_id, post_data, create_time, update_time) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?)|3|4|1||0|0|0|0|0|0|
|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|1||0|0|8373|3531|3|1|
|gift_mail|SELECT tt.shop_id FROM gift_mail.trade t JOIN gift_mail.trade_take tt ON tt.tenant_wechatapp_id = t.tenant_wechatapp_id AND tt.trade_id = t.id WHERE t.tenant_id = ? AND t.tenant_wechatapp_id = ? AND tt.shop_id IS NOT NULL|3|3|1||0|0|15116|10686|7557|5343|
|order|SELECT ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "2" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "3" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "4" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "5" , count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND (od.mobile_no = ? OR ad.mobile_no = ?) AND (od.status = ?)|3|8|3||0|0|224571|74871|3|1|
|user_service|SELECT id, tenant_id, wechat_app_id, open_id, union_id , nick_name, head_img_url, sex, wx_mobile_no, create_time , update_time FROM mini_app_user WHERE wechat_app_id = ? AND wx_mobile_no = ? AND id <> ?|3|4|1||0|0|60220|28560|0|0|
|order|SELECT count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND (od.mobile_no = ? OR ad.mobile_no = ?)|3|12|7||0|0|242304|105480|3|1|
|user_service|UPDATE tenant_member_bind SET tenant_app_id = ?, user_id = ?, wx_user_id = ?, erp_member_id = ?, wx_union_id = ?, create_time = ?, update_time = ?, external_user_id = ? WHERE tenant_id = ? AND id = ?|3|3|1||0|0|3|1|0|0|
|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 >= ?|2|3|2||0|0|423|232|2|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 (|2|2|1||0|0|6964|3866|6964|3866|
|order|SELECT count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND od.order_no LIKE concat(?, ?, ?)|2|3|1||0|0|70324|35166|2|1|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY p.tag_price DESC, p.id DESC LIMIT ?, ?|2|3|1||0|0|16490|8245|12|6|
|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.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 = ?|2|2|1||0|0|917|462|370|187|
|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|3|1||0|0|16088|9277|8|4|
|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 = ?|2|2|1||0|0|2|1|2|1|
|authorization_service|SELECT id, platform_user_id, user_id, wx_user_id, employee_id , shop_id, tenant_id, tenant_wx_app_id, account_id, login_way , login_code, login_token, roles, status, expire_time , create_time, update_time, login_ip, login_time, login_data , wx_app_user_id FROM user_login_token WHERE tenant_id = ? AND employee_id = ? AND status = ?|2|15|13||0|0|1933|1569|1933|1569|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ...|2|5|3||0|0|1458231|818746|980|684|
|wx_gateway|SELECT * FROM corpwx.external_user WHERE user_id = ?|2|207|204||0|0|7320509|7230037|13|13|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in (|2|5|3||0|0|1873974|1326437|1100|666|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ...|2|4|2||0|0|1694429|868878|611|334|
|tenant|INSERT INTO erp_sales (id, tenant_id, tenant_wechatapp_id, sales_erp_id, sales_no , sales_date, member_erp_id, employee_erp_id, employee_name, dept_erp_id , amount, sales_remark, receipts, sales_status, is_sales , busi_date) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?) ON DUPLICATE KEY UPDATE sales_date = ?, member_erp_id = ?, employee_erp_id = ?, employee_name = ?, dept_erp_id = ? , amount = ?, sales_remark = ?, receipts = ?, sales_status = ?, is_sales = ? , busi_date = ?|2|2|1||0|0|0|0|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.employee_id = ? AND t.tenant_id = ? AND t.tenant_app_id = ?|2|4|3||0|0|233870|117505|2|1|
|order|SELECT id FROM order_operator_log WHERE tenant_wechatapp_id = ? AND order_id = ? AND (src_child_status = ? AND dst_child_status = ?) ORDER BY create_time DESC LIMIT ?|2|9|5||0|0|1768260|884271|0|0|
|order|SELECT count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND dt.product_name LIKE concat(?, ?, ?)|2|12|9||0|0|91618|70727|2|1|
|v4_sales|SELECT w.id, es.dept_erp_id AS shopId, es.employee_erp_id AS employeeId, w.create_time, w.warranty_no FROM v4_sales.warranty w JOIN v4_sales.erp_sales es ON es.id = w.sales_id AND es.tenant_id = ? AND es.tenant_app_id = ? WHERE w.member_id IN (?) AND is_disable = ? AND w.tenant_id = ? AND w.tenant_app_id = ? ORDER BY w.create_time DESC LIMIT ?|2|2|1||0|0|250657|143328|2|1|
|order|SELECT id, tenant_id, tenant_wechatapp_id, order_id, user_id , user_name, shop_id, shop_name, operator_type, src_status , dst_status, full_message, remark, create_time, update_time , src_child_status, dst_child_status FROM order_operator_log WHERE tenant_wechatapp_id = ? AND order_id = ? AND dst_child_status = ? ORDER BY create_time DESC LIMIT ?|2|2|1||0|0|1768821|884550|2|1|
|coupon_service|SELECT source_id, count(*) AS quantity FROM coupon_service.coupon_push WHERE source = ? AND state = ? AND source_id IN (?) GROUP BY source_id|2|4|2||0|0|60850|30425|2|1|
|order|SELECT od.id, od.order_no AS orderNo, od.status, od.take_type AS takeType, od.create_time AS createTime , od.remark, od.total_fee AS totalFee, od.freight_fee AS freightFee, od.discount_fee AS discountFee, od.take_id AS takeId , od.payment_fee AS paymentFee, dt.product_id AS productId, dt.price, dt.quantity, dt.sku_id AS skuId , dt.art_no AS artNo, dt.image_url AS imageUrl, dt.product_name AS productName, dt.take_remark AS takeRemark, dt.take_day AS takeDay , od.product_fee AS productFee, ad.user_name AS receiveName, ad.mobile_no AS mobileNo, ad.shop_name AS shopName, ad.address , ad.express_no AS expressNo, ad.express_company AS expressCompany, od.user_name AS userName, od.update_time AS updateTime, od.child_status AS childStatus , od.finish_type AS finishType, od.receive_time AS receiveTime, od.user_id AS userId, od.mobile_no AS buyMobileNo, od.edit_fee_flag AS editFeeFlag , dt.spec AS spec, od.source, od.take_shop_id, od.take_shop_name, od.take_employee_user_id , od.take_employee_user_name, od.activity_type, od.activity_id, od.offline_payment_fee, od.online_wait_fee , od.offline_wait_fee, od.pay_way, od.take_employee_id, od.pay_id FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND (od.mobile_no = ? OR ad.mobile_no = ?) AND (od.status = ?) ORDER BY od.create_time DESC LIMIT ?|2|4|3||0|0|170155|85087|3|2|
|tenant|SELECT id, tenant_id, tenant_app_id, sneak_guest_id, shop_id , employee_id, maintain_level, remark, create_time, update_time , event_type, data, group_label FROM sneak_guest_maintain WHERE tenant_app_id = ? AND sneak_guest_id IN (?) AND event_type = ?|2|3|1||0|0|318|177|311|177|
|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|2|1||0|0|459405|230557|44|22|
|coupon_service|SELECT id, tenant_id, tenant_app_id, template_id, coupon_type , take_effect_way, take_start_day, take_effect_day, begin_time, end_time , source, source_id, can_give, need_booking, use_threshold , wx_card_id, state, create_time, update_time FROM coupon_push WHERE tenant_id = ? AND tenant_app_id = ? AND wx_card_id = ?|2|2|1||0|0|3644|1822|0|0|
|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|2|4|2||0|0|125916|62958|2|1|
|tenant|SELECT t.id AS employeeid, t.tenant_id, t.employee_erp_id AS employeeerpid, t.employee_name AS employeename, t.employee_type_id AS employeetypeid , t.employee_type AS employeetype, t.shop_id, sp.shop_name, t.employee_no AS employeeno, t.sex , t.mobile_no AS mobileno, t.corp_wx_user_id, t.head_img_url AS headimgurl, t.dept_erp_id, ed.dept_name AS dept_erp_name , t.status FROM employee t LEFT JOIN tenant_wechatapp_shop sp ON sp.tenant_id = t.tenant_id AND t.shop_id = sp.id LEFT JOIN tenant.erp_department ed ON ed.tenant_id = t.tenant_id AND ed.dept_erp_id = t.dept_erp_id WHERE t.tenant_id = ? AND (t.employee_name LIKE concat(?, ?, ?) OR t.mobile_no LIKE concat(?, ?, ?)) AND t.status IN (?) ORDER BY t.id ASC LIMIT ?|2|5|2||0|0|158494|79260|4|3|
|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|4|2||0|0|105778|65870|48|34|
|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 = ?) UNION ALL SELECT pp.id, pp.default_image_url, pp.product_name, ? AS product_type, pi.market_price AS tag_price , ROUND(pp.tag_price * ?, ?) AS price , pi.volume, ? AS category_id, pp.product_status, pi.quantity, ? AS partner_id , ? AS topping FROM gift_mail.platform_recommend_product prp JOIN gift_mail.platform_product pp ON pp.id = prp.platform_product_id JOIN gift_mail.platform_inventory pi ON pi.product_id = pp.id WHERE prp.is_recommend = ? AND tenant_app_id = ? AND pp.product_status = ? ) p WHERE p.topping = ?|2|2|1||0|0|39491|19753|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|
|employee|SELECT tenant_id, tenant_app_id, employee_id, scene, shop_id , count(*) AS record FROM backlog WHERE tenant_app_id = ? AND employee_id = ? AND expire_time >= ? AND status IN (?) AND shop_id = ? AND scene NOT IN (?) GROUP BY tenant_id, tenant_app_id, employee_id, scene, shop_id|1|1|1||0|0|113|113|3|3|
|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 = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? ORDER BY t1.id DESC LIMIT ?|1|1|1||0|0|96679|96679|10|10|
|v4_user|SELECT COUNT(*) AS total FROM member_butler WHERE shop_id = ? AND employee_id = ? AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|46633|46633|1|1|
|employee|SELECT * FROM backlog WHERE tenant_app_id = ? AND employee_id = ? AND status IN (?) AND scene = ? AND shop_id = ? AND expire_time >= ? ORDER BY id DESC|1|1|1||0|0|126|126|19|19|
|payment|UPDATE pay_order SET goods_order_no = ?, fee_type = ?, user_sub_identify = ?, order_start_time = ?, order_expire_time = ?, prepay_id = ?, pay_status = ?, pay_status_desc = ?, wxappid = ?, sub_wxappid = ?, mch_id = ?, sub_mch_id = ? WHERE id = ?|1|1|1||0|0|1|1|0|0|
|tenant|SELECT count(*) AS amount FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? AND maintain_employee_id = ? AND create_time <= ? AND next_maintain_date >= ? AND next_maintain_date <= ?|1|1|1||0|0|11315|11315|1|1|
|message_push|INSERT INTO message_log (id, tenant_id, tenant_app_id, user_id, scene_type , msg_id, content, post_data, create_time, update_time) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ?)|1|1|1||0|0|0|0|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|123|123|1|1|
|v4_user|SELECT COUNT(*) AS total FROM potential_customer t1 WHERE t1.maintain_shop_id = ? AND t1.maintain_employee_id = ? AND t1.status IN (?) AND t1.tenant_id = ? AND t1.tenant_app_id = ?|1|1|1||0|0|663|663|1|1|
|mysql|DELETE FROM message_push.message_log WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|74|74||0|0|2705964|2705964|0|0|
|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|1|1|1||0|0|12818|12818|1|1|
|authorization_service|SELECT r.* , ( SELECT count(*) FROM authorization_service.account a JOIN authorization_service.account_role2 ar ON a.id = ar.account_id WHERE (ar.tenant_id = ? OR 873815834940772352 = 0) AND (ar.tenant_app_id = ? OR 874487438809079808 = 0) AND ar.role_code = r.role_code ) AS count FROM authorization_service.role r WHERE 1 = 1 AND r.role_code IN (?) ORDER BY field(r.role_code, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|1|1|1||0|0|184163|184163|3|3|
|erp_sync|INSERT INTO retry_data (id, tenant_id, tenant_app_id, business_type, operation_type , data_id, user_id, erp_member_id, need_erp_member_id, retry_times , msg, send_time, create_time, data) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?, ?)|1|1|1||0|0|0|0|0|0|
|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|83967|83967|20|20|
|value_added|SELECT ID, tenant_wechatapp_id AS tenantWechatappId, user_id AS userId, template_id AS templateId, sales_erp_id AS saleserpid , product_name AS productName, shop_name AS shopName, product_barcode AS productBarcode, amount_total AS amountTotal, amount_pay AS amountPay , amount_added AS amountAdded, state AS state, add_days, added_percent_per_day AS addedPercentPerDay, devalue_percent_per_day AS devaluePercentPerDay , keeping_days AS keepingDays, exchange_days AS exchangeDays, coupon_user_id AS couponUserId, sales_index AS salesIndex, start_add_time AS createtime , DATE_ADD(start_add_time, INTERVAL add_days - ? DAY) , DATE_ADD(start_add_time, INTERVAL add_days + keeping_days - ? DAY) FROM value_added_user WHERE state = ? AND start_add_time = date_add(CURDATE(), INTERVAL ? * (add_days + keeping_days - ?) DAY)|1|1|1||0|0|1859000|1859000|771|771|
|user_service|UPDATE tenant_member_info SET tenant_app_id = ?, user_id = ?, shop_id = ?, birthday = ?, birthday_is_lunar = ?, address = ?, memorial_name = ?, memorial_day_is_lunar = ?, interest = ?, grade_id = ?, create_time = ?, update_time = ?, member_image_flag = ?, info_is_perfect = ?, erp_card_no = ? WHERE tenant_id = ? AND id = ?|1|1|1||0|0|1|1|0|0|
|coupon_service|SELECT count(0) FROM coupon_service.template t LEFT JOIN coupon_service.template_redpack r ON r.template_id = t.id LEFT JOIN coupon_service.template_activity a ON a.template_id = t.id WHERE t.state != ? AND (t.tenant_app_id = ?) AND t.coupon_name LIKE concat(?, ?, ?)|1|1|1||0|0|20371|20371|1|1|
|gift_mail|SELECT * FROM gift_mail.trade_express WHERE trade_id = ? LIMIT ?|1|1|1||0|0|11531|11531|0|0|
|tenant|SELECT t.id AS employeeid, t.tenant_id, t.employee_erp_id AS employeeerpid, t.employee_name AS employeename, t.employee_type_id AS employeetypeid , t.employee_type AS employeetype, t.shop_id, sp.shop_name, t.employee_no AS employeeno, t.sex , t.mobile_no AS mobileno, t.corp_wx_user_id, t.head_img_url AS headimgurl, t.dept_erp_id, ed.dept_name AS dept_erp_name , t.status FROM employee t LEFT JOIN tenant_wechatapp_shop sp ON sp.tenant_id = t.tenant_id AND t.shop_id = sp.id LEFT JOIN tenant.erp_department ed ON ed.tenant_id = t.tenant_id AND ed.dept_erp_id = t.dept_erp_id WHERE t.tenant_id = ? AND t.status IN (?) ORDER BY t.id ASC LIMIT ?|1|1|1||0|0|11578|11578|10|10|
|mysql|DELETE FROM wx_gateway.wx_template_msg WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|33|33||0|0|945503|945503|0|0|
|v4_user|SELECT t1.maintain_shop_id, t1.maintain_employee_id, t1.maintain_level, count(*) AS maintainNum FROM potential_customer t1 WHERE t1.tenant_app_id = ? AND t1.`status` IN (?) AND t1.next_maintain_time >= ? AND t1.tenant_id = ? AND t1.tenant_app_id = ? GROUP BY t1.maintain_shop_id, t1.maintain_employee_id, t1.maintain_level|1|1|1||0|0|9531|9531|326|326|
||DELETE FROM tenant.sjfx_dct_erp_sales WHERE create_time < ?|1|1|1||0|0|156601|156601|0|0|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY p.tag_price DESC, p.id DESC LIMIT ?|1|1|1||0|0|8239|8239|6|6|
|employee|SELECT id, scene, employee_id, member_user_name AS userName, finish_time , status FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND expire_time BETWEEN ? AND ? AND status != ? AND scene NOT IN (?) ORDER BY id DESC LIMIT ?|1|3|3||0|0|293945|293945|1|1|
|user_service|UPDATE tenant_member_bind SET tenant_app_id = ?, user_id = ?, wx_user_id = ?, erp_member_id = ?, create_time = ?, update_time = ?, external_user_id = ? WHERE tenant_id = ? AND id = ?|1|1|1||0|0|1|1|0|0|
|coupon_service|UPDATE coupon SET coupon_state = ?, update_time = ? WHERE id = ?|1|1|1||0|0|1|1|0|0|
|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|1|1|1||0|0|12056|12056|746|746|
|value_added|UPDATE value_added_user SET state = ? WHERE state = ? AND tenant_id = ? AND tenant_wechatapp_id = ? AND user_id = ? AND product_barcode = ?|1|5|5||0|0|145|145|0|0|
|order|SELECT od.id, od.order_no AS orderNo, od.status, od.take_type AS takeType, od.create_time AS createTime , od.remark, od.total_fee AS totalFee, od.freight_fee AS freightFee, od.discount_fee AS discountFee, od.take_id AS takeId , od.payment_fee AS paymentFee, dt.product_id AS productId, dt.price, dt.quantity, dt.sku_id AS skuId , dt.art_no AS artNo, dt.image_url AS imageUrl, dt.product_name AS productName, dt.take_remark AS takeRemark, dt.take_day AS takeDay , od.product_fee AS productFee, ad.user_name AS receiveName, ad.mobile_no AS mobileNo, ad.shop_name AS shopName, ad.address , ad.express_no AS expressNo, ad.express_company AS expressCompany, od.finish_type AS finishType, od.send_time AS sendTime, od.receive_time AS receiveTime , od.finish_time AS finishTime, od.child_status AS childStatus, od.send_good_remark AS sendGoodRemark, od.service_flag AS serviceFlag, od.coupon_id AS couponId , od.tenant_wechatapp_id AS tenantAppId, od.tenant_id FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.status = ? AND od.send_time <= ? AND od.take_type = ?|1|2|2||0|0|217629|217629|0|0|
|corpwx|DELETE FROM contact_me WHERE tenant_id = ? AND config_id = ?|1|1|1||0|0|1958|1958|0|0|
|order|SELECT count(0) FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND od.order_no LIKE concat(?, ?, ?) AND (od.status = ?)|1|3|3||0|0|24955|24955|1|1|
|v4_sales|SELECT es.id AS salesId, es.sales_no, es.sales_date, es.member_erp_id AS memberId, w.warranty_no FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id = es.id AND wca.tenant_id = ? AND wca.tenant_app_id = ? LEFT JOIN v4_sales.warranty w ON w.sales_id = es.id AND w.tenant_id = ? AND w.tenant_app_id = ? WHERE is_sales = ? AND sales_status = ? AND (es.sales_no LIKE concat(?, ?) OR es.member_erp_id = ?) AND es.tenant_id = ? AND es.tenant_app_id = ? ORDER BY es.sales_date DESC, es.id DESC LIMIT ?, ?|1|1|1||0|0|494163|494163|9|9|
|v4_sales|SELECT member_erp_id FROM v4_sales.erp_sales WHERE sales_status = ? AND sales_date < ? AND member_erp_id IN (?) AND tenant_id = ? AND tenant_app_id = ? GROUP BY member_erp_id|1|1|1||0|0|10195|10195|70|70|
|user_service|INSERT INTO tenant_member (tenant_id, id, tenant_app_id, user_id, mobile_no , user_name, head_img_url, sex, status, create_time , update_time) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?)|1|1|1||0|0|0|0|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 = ? JOIN user_service.user_employee ue ON t1.tenant_id = ue.tenant_id AND t1.tenant_app_id = ue.tenant_wechatapp_id AND t1.user_id = ue.user_id AND ue.employee_id = ? AND ue.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? AND (t1.mobile_no LIKE concat(?, ?) OR t1.user_name LIKE concat(?, ?, ?))|1|1|1||0|0|3403|3403|1|1|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail_extend WHERE create_time < ?|1|1|1||0|0|233529|233529|0|0|
|qrcode_service|INSERT INTO qrcode_scan_log (id, tenant_id, tenant_app_id, qrcode_id, from_id , from_type, open_id) VALUES (?, ?, ?, ?, ? , ?, ?)|1|1|1||0|0|0|0|0|0|
|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|1|1|1||0|0|4475|4475|4|4|
|erp_sync|SELECT * FROM erp_sync.retry_data WHERE (need_erp_member_id = ? OR (need_erp_member_id = ? AND erp_member_id IS NOT NULL)) AND retry_times > ? ORDER BY id|1|2|2||0|0|2865|2865|489|489|
|warranty_service|INSERT INTO warranty (id, tenant_wechatapp_id, user_id, erp_sales_id, warranty_no , is_disable, warranty_data, version, upload_frequency, update_employee_id , employee_erp_id, dept_erp_id, sales_no, sales_date, style_id) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?, ?, ?)|1|1|1||0|0|0|0|0|0|
|user_service|SELECT us.from_id AS id, count(1) AS total FROM user_source us WHERE us.tenant_id = ? AND us.tenant_wechatapp_id = ? AND us.shop_id = ? AND us.create_time >= ? AND us.create_time < ? AND us.source_type = ? AND us.from_id IS NOT NULL AND us.shop_id IS NOT NULL GROUP BY us.from_id ORDER BY count(1) DESC|1|1|1||0|0|1705|1705|5|5|
|v4_employee|SELECT count(1) AS total_count, count(finish_time) AS finish_count FROM task_task t JOIN task_system_task_template t2 ON t.task_template_id = t2.id AND t2.status = ? AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t.task_type = ? AND t.status = ? AND t.start_time >= ? AND t.start_time < ? AND t.shop_id = ? AND t.tenant_id = ? AND t.tenant_app_id = ?|1|2|2||0|0|1572|1572|1|1|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY i.volume DESC, p.id DESC LIMIT ?|1|1|1||0|0|8239|8239|6|6|
|account|SELECT ifnull(sum(amount), ?) FROM account.account_flow WHERE src_tenant_app_id = ? AND src_account_id = ? AND busi_type = ? AND oper_type = ?|1|2|2||0|0|2345|2345|1|1|
|tenant|SELECT count(0) FROM employee t LEFT JOIN tenant_wechatapp_shop sp ON sp.tenant_id = t.tenant_id AND t.shop_id = sp.id LEFT JOIN tenant.erp_department ed ON ed.tenant_id = t.tenant_id AND ed.dept_erp_id = t.dept_erp_id WHERE t.tenant_id = ? AND t.status IN (?)|1|1|1||0|0|2343|2343|1|1|
|tenant|INSERT INTO erp_sales_detail_extend (tenant_id, id, tenant_wechatapp_id, sales_erp_id, sales_index , sales_brand, sales_craft) VALUES (?, ?, ?, ?, ? , ?, ?) ON DUPLICATE KEY UPDATE update_time = now(), sales_brand = ?, sales_craft = ?|1|1|1||0|0|0|0|0|0|
|export|SELECT count(0) FROM export_log el INNER JOIN export_file ef ON el.tenant_app_id = ef.tenant_app_id AND el.batch_no = ef.batch_no AND el.md5_key = ef.md5_key AND el.export_code = ef.export_code WHERE el.tenant_app_id = ? AND el.employee_id = ? AND el.batch_no BETWEEN ? AND ? AND ef.export_code IN (?)|1|1|1||0|0|46530|46530|1|1|
|gift_mail|SELECT p.id, p.product_name, p.tag_price, i.volume, p.product_status AS status , p.default_image_url, i.quantity, i.market_price , if(prp.id IS NULL, ?, ?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id = p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id = ? AND prp.is_recommend = ? AND prp.platform_product_id = p.id WHERE prp.id IS NULL AND p.product_status = ? ORDER BY p.tag_price ASC, p.id DESC LIMIT ?|1|1|1||0|0|8239|8239|6|6|
|activity_service|SELECT id, tenant_id, tenant_app_id, activity_id, sign_user_id , user_id, create_time, update_time FROM online_sign_user_sign_log WHERE tenant_app_id = ? AND user_id = ?|1|1|1||0|0|404929|404929|543|543|
|tenant|SELECT es.id, es.sales_no, es.sales_date, es.sales_erp_id, es.amount , ifnull(shop.shop_name, ed.dept_name) AS dept_name, es.employee_name FROM tenant.erp_sales es JOIN tenant.erp_department ed ON ed.dept_erp_id = es.dept_erp_id AND ed.tenant_id = ? LEFT JOIN tenant.tenant_wechatapp_shop shop ON shop.dept_erp_id = ed.dept_erp_id AND shop.tenant_wechatapp_id = ? WHERE es.member_erp_id = ? AND es.tenant_id = ? AND es.tenant_wechatapp_id = ? AND es.sales_status = ? AND NOT EXISTS ( SELECT i.id FROM tenant.erp_sales_ignore i WHERE i.tenant_id = ? AND i.tenant_app_id = ? AND es.sales_erp_id = i.erp_sales_id ) ORDER BY es.sales_date DESC LIMIT ?|1|1|1||0|0|587270|587270|10|10|
|coupon_service|SELECT count(0) FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ? AND cu.create_time >= ? AND cu.create_time <= ?|1|1|1||0|0|3620|3620|1|1|
|timer|UPDATE task_info SET service = ?, name = ?, callback = ?, params = ?, cron = ?, delay = NULL, next_time = ?, status = ?, create_time = ?, update_time = ? WHERE id = ?|1|1|1||0|0|1|1|0|0|
|coupon_service|UPDATE coupon_extend SET user_name = ?, mobile_no = ?, creator_user_name = ?, creator_mobile_no = ?, writeoff_employee_id = ?, writeoff_time = ? WHERE id = ?|1|1|1||0|0|1|1|0|0|
|v4_coupon|UPDATE v4_coupon.coupon SET coupon_status = ? WHERE tenant_id = ? AND tenant_app_id = ? AND coupon_status = ? AND end_time < now()|1|1|1||0|0|228796|228796|0|0|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail WHERE create_time < ?|1|2|2||0|0|417258|417258|0|0|
|order|SELECT od.id, od.order_no AS orderNo, od.status, od.take_type AS takeType, od.create_time AS createTime , od.remark, od.total_fee AS totalFee, od.freight_fee AS freightFee, od.discount_fee AS discountFee, od.take_id AS takeId , od.payment_fee AS paymentFee, dt.product_id AS productId, dt.price, dt.quantity, dt.sku_id AS skuId , dt.art_no AS artNo, dt.image_url AS imageUrl, dt.product_name AS productName, dt.take_remark AS takeRemark, dt.take_day AS takeDay , od.product_fee AS productFee, od.finish_type AS finishType, od.send_time AS sendTime, od.receive_time AS receiveTime, od.finish_time AS finishTime , od.child_status AS childStatus, od.send_good_remark AS sendGoodRemark, od.service_flag AS serviceFlag, od.coupon_id AS couponId, od.tenant_wechatapp_id AS tenantAppId , od.tenant_id AS tenantId, od.pay_id AS payId, od.user_id AS userId, od.user_name AS userName, od.mobile_no AS buyMobileNo , od.activity_id, od.offline_payment_fee, od.activity_type, dt.spec, od.take_shop_id , od.take_shop_name, od.take_employee_user_id, od.take_employee_user_name FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id WHERE od.status = ? AND od.receive_time <= ?|1|2|2||0|0|217854|217854|225|225|
|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))) AND user_id = ? AND tenant_wechatapp_id = ?|1|13|13||0|0|145|145|0|0|
|v4_user|SELECT t1.id AS memberId, t1.external_user_id AS externalUserId, t2.corp_user_id AS corpUserId, t2.employee_id, t3.raw_external_user_id AS rawExternalUserId FROM member t1 JOIN employee_external_bind t2 ON t1.tenant_id = t2.tenant_id AND t1.external_user_id = t2.external_user_id AND t2.tenant_id = ? JOIN cwx_external_user t3 ON t1.tenant_id = t3.tenant_id AND t1.external_user_id = t3.external_user_id AND t3.tenant_id = ? WHERE t1.id IN (?) AND t1.tenant_id = ? AND t1.tenant_app_id = ?|1|1|1||0|0|69|69|25|25|
|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|14|14||0|0|1859000|1859000|631|631|
|user_service|INSERT INTO tenant_member_info (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 , member_image_flag, member_image_time, info_is_perfect, erp_card_no) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?, ?, ?, ?)|1|1|1||0|0|0|0|0|0|
|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|419658|419658|55|55|
|user_service|INSERT INTO user_employee_alloc_log (id, tenant_id, tenant_wechatapp_id, user_id, from_employee_id , to_employee_id, alloc_employee_id, alloc_date_time, remark) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?)|1|1|1||0|0|0|0|0|0|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id = es.id AND wca.tenant_id = ? AND wca.tenant_app_id = ? LEFT JOIN v4_sales.warranty w ON w.sales_id = es.id AND w.tenant_id = ? AND w.tenant_app_id = ? WHERE is_sales = ? AND sales_status = ? AND es.employee_erp_id = ? AND es.dept_erp_id = ? AND es.sales_date >= ? AND es.tenant_id = ? AND es.tenant_app_id = ?|1|1|1||0|0|3057|3057|1|1|
|user_service|SELECT tenant_id, id, tenant_app_id, user_id, wx_user_id , erp_member_id, customer_user_id, wx_union_id, create_time, update_time , external_user_id FROM tenant_member_bind WHERE tenant_id = ? AND tenant_app_id = ? AND wx_user_id IN (?)|1|1|1||0|0|7|7|7|7|
|coupon_service|SELECT count(0) FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.id = cu.id WHERE cu.tenant_id = ? AND cu.tenant_app_id = ? AND cu.create_time >= ? AND cu.create_time <= ? AND cu.template_id = ?|1|1|1||0|0|253|253|1|1|
|tenant|SELECT * FROM erp_sales_detail WHERE tenant_id = ? AND tenant_wechatapp_id = ? AND sales_erp_id = ? ORDER BY sales_index|1|1|1||0|0|1|1|1|1|
|user_service|SELECT t1.id, t1.user_id AS userId, t1.user_name AS userName, t1.sex, t1.mobile_no AS mobileNo , t1.head_img_url AS headImg FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? JOIN user_service.user_employee ue ON t1.tenant_id = ue.tenant_id AND t1.tenant_app_id = ue.tenant_wechatapp_id AND t1.user_id = ue.user_id AND ue.employee_id = ? AND ue.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? ORDER BY ue.update_time DESC, t1.id DESC LIMIT ?, ?|1|1|1||0|0|8588|8588|10|10|
|youzan|SELECT id, merchant_id, merchant_shop_id, sync_type, api_name , api_request, api_response, status, error_msg, retry_num , create_time, update_time FROM weimob_platform_sync_log WHERE status = ? AND sync_type IN (?) AND retry_num < ?|1|17|17||0|0|112617|112617|0|0|
|tenant|SELECT count(0) FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND 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|8|8||0|0|34946|34946|1|1|
|user_service|UPDATE tenant_member_bind SET tenant_app_id = ?, user_id = ?, wx_user_id = ?, erp_member_id = ?, wx_union_id = ?, create_time = ?, update_time = ? WHERE tenant_id = ? AND id = ?|1|1|1||0|0|1|1|0|0|
|v4_sales|SELECT id, sales_index, sales_erp_id, sales_type, product_barcode , product_name, cert_no, hand_size, category_erp_id, category_name , stone_weight, gold_weight, total_weight, quantity, amount_total , amount_pay, integral, remark, erp_create_time, tenant_id , tenant_app_id, create_time, update_time FROM erp_sales_detail WHERE sales_erp_id = ? AND sales_index = ? AND tenant_id = ? AND tenant_app_id = ?|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|5|5||0|0|1326108|1326108|337|337|
|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.order_no LIKE concat(?, ?, ?) AND (od.status = ?) ORDER BY od.create_time DESC LIMIT ?|1|1|1||0|0|35171|35171|1|1|
|tenant|SELECT count(*) AS amount FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? AND create_time <= ?|1|1|1||0|0|11310|11310|1|1|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?\...|1|4|4||0|0|827739|827739|463|463|
|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|13682|13682|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|250|250||0|0|9689022|9689022|1683|1683|
|gift_mail|SELECT * FROM trade WHERE tenant_wechatapp_id = ? AND user_id = ? ORDER BY create_time DESC LIMIT ?|1|1|1||0|0|13716|13716|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 IN (?) AND tenant_id = ?|1|1|1||0|0|17504|17504|10|10|
|coupon_service|SELECT id, tenant_id, tenant_app_id, template_id, coupon_id , give_user_id, user_id, create_time, update_time FROM user_coupon_give_record WHERE tenant_id = ? AND tenant_app_id = ? AND coupon_id = ? AND give_user_id = ? AND user_id = ?|1|1|1||0|0|1688|1688|0|0|
|user_service|UPDATE tenant_member_bind SET tenant_app_id = ?, user_id = ?, wx_user_id = ?, erp_member_id = ?, create_time = ?, update_time = ? WHERE tenant_id = ? AND id = ?|1|1|1||0|0|1|1|0|0|
|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|
|user_service|INSERT INTO tenant_member_bind (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) VALUES (?, ?, ?, ?, ? , ?, ?, ?, ?, ? , ?)|1|1|1||0|0|0|0|0|0|
|sms|SELECT count(0) FROM ( SELECT a.phone_numbers AS phoneNo , CONCAT(?, a.sign_name, ?, CASE  WHEN b.content IS NOT NULL THEN b.content WHEN stc.content IS NOT NULL THEN stc.content ELSE a.template_param END) AS content , a.template_code, a.out_id AS outId, a.template_param, a.create_time AS sendTime, a.create_time AS recevieTime , a.code AS state , ifnull(ifnull(e.sms_size, ?) * if(a.code = ?, a.send_count, ?), ?) AS send_count , a.message, a.source_type FROM sms_send a LEFT JOIN sms.sms_send_extend e ON a.biz_id = e.biz_id LEFT JOIN sms_template b ON a.template_code = b.code LEFT JOIN sms_template_custom stc ON a.tenant_app_id = stc.tenant_app_id AND a.template_code = stc.code AND stc.status = ? WHERE a.tenant_id = ? AND a.tenant_app_id = ? AND a.create_time >= ? AND a.create_time < ? ORDER BY a.create_time DESC ) tmp_count|1|1|1||0|0|2160|2160|1|1|
|order|SELECT count(0) FROM ( SELECT o.id, o.order_no, o.user_name, o.take_type, o.mobile_no , od.product_name, od.image_url , if(take_shop_id IS NULL, wait_take_shop_id, take_shop_id) AS takeShopId , take_employee_user_name, o.receive_time, o.cancel_time, od.take_start_date, o.refund_start_time AS refundTime , o.user_name AS refundUserName, o.status, oa.express_company, oa.express_no, om.mark FROM `order`.order_info o JOIN `order`.order_detail od ON od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND od.order_id = o.id LEFT JOIN `order`.order_mark om ON om.tenant_id = ? AND om.tenant_app_id = ? AND om.order_id = o.id AND om.status = ? LEFT JOIN `order`.order_address oa ON oa.tenant_id = ? AND oa.tenant_app_id = ? AND oa.order_id = o.id WHERE o.tenant_id = ? AND o.tenant_wechatapp_id = ? AND o.take_type = ? AND (o.wait_take_shop_id = ? OR o.take_shop_id = ?) AND o.status NOT IN (?) ORDER BY o.id ) tmp_count|1|2|2||0|0|11922|11922|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 sg.maintain_employee_id = ? AND sg.next_maintain_date >= ? AND sg.next_maintain_date <= ? AND sg.status = ?|1|1|1||0|0|11321|11321|1|1|
|user_service|SELECT count(?) FROM user_service.tenant_member tm JOIN user_service.tenant_member_info tmi ON tmi.tenant_id = ? AND tmi.tenant_app_id = ? AND tm.id = tmi.id WHERE tm.tenant_id = ? AND tm.tenant_app_id = ? AND tm.user_id NOT IN (?) AND tm.user_id IN (|1|4|4||0|0|948|948|1|1|
