|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|v4_user|SELECT t1.id AS memberId, t2.id AS potentialCustomerId, t2.checkin_time AS checkinTime FROM member t1 JOIN potential_customer t2 ON t1.tenant_app_id = t2.tenant_app_id AND (t1.id = t2.member_id OR (t2.external_user_id != ? AND t1.external_user_id = t2.external_user_id)) AND t2.tenant_id = ? AND t2.tenant_app_id = ? WHERE t2.maintain_shop_id = ? AND t2.maintain_employee_id = ? AND t2.`status` IN (?) AND t1.tenant_id = ? AND t1.tenant_app_id = ?|393|2315|30||0|0|3550150023|46260426|13918|205|
|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 = ?|331|513|4||0|0|670387885|2235600|2655|10|
|v4_sales|SELECT count(es.id) FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id = es.id AND wca.tenant_id = ? AND wca.tenant_app_id = ? LEFT JOIN v4_sales.warranty w ON w.sales_id = es.id AND w.tenant_id = ? AND w.tenant_app_id = ? WHERE es.sales_status = ? AND is_sales = ? AND if(wca.source = ?, es.sales_date >= ?, date_format(wca.create_time, '%Y-%m-%d') >= ?) AND es.employee_erp_id = ? AND dept_erp_id = ? AND w.id IS NULL AND es.tenant_id = ? AND es.tenant_app_id = ?|152|228|3||0|0|849189|13840|152|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)|144|338|8||0|0|81759606|567865|0|0|
|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|139|193|3||0|0|692868|14889|139|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 = ?|111|152|4||0|0|276328|6238|276328|6238|
|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 ?|94|179|5||0|0|1156486|32558|94|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 (|54|84|4||0|0|83106|1702|38618|790|
|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 (?)|51|112|12||0|0|24748674|1171346|4170|222|
|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 ?|50|72|3||0|0|7511252|223559|39|1|
|user_service|SELECT count(0) FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? JOIN user_service.user_employee ue ON t1.tenant_id = ue.tenant_id AND t1.tenant_app_id = ue.tenant_wechatapp_id AND t1.user_id = ue.user_id AND ue.employee_id = ? AND ue.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ?|45|59|2||0|0|547383|108159|45|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(?)|43|59|3||0|0|18504780|430414|43|1|
|tenant|SELECT count(0) FROM ( SELECT sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, ey.employee_name AS maintainEmployeeName , sg.last_maintain_date, ws.shop_name AS createShopName, sg.status, sg.create_time, t1.employee_name AS createEmployeeName , sg.finish_date, sg.fail_type, gs.sales_id, gs.sales_no, w1.shop_name AS salesShopName , gs.sales_date, gs.product_name, gs.product_quantity, gs.amount AS salesAmount , if(sg.status = ?, CASE  WHEN sg.fail_type = ? THEN ? WHEN sg.fail_type = ? THEN ? ELSE ifnull(emp.employee_name, ?) END, ?) AS operFailEmployeeName FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id LEFT JOIN tenant_wechatapp_shop ws ON sg.create_shop_id = ws.id LEFT JOIN employee t1 ON sg.create_employee_id = t1.id LEFT JOIN sneak_guest_sales gs ON sg.tenant_app_id = gs.tenant_app_id AND sg.id = gs.sneak_guest_id LEFT JOIN tenant_wechatapp_shop w1 ON gs.shop_id = w1.id LEFT JOIN tenant.sneak_guest_maintain gm ON gm.sneak_guest_id = sg.id AND gm.event_type = ? LEFT JOIN employee emp ON gm.employee_id = emp.id WHERE sg.tenant_app_id = ? ORDER BY sg.id DESC ) tmp_count|26|101|10||0|0|21112922|812210|26|1|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE member_id = ? AND scene = ? AND scene_id = ? AND tenant_id = ? AND tenant_app_id = ?|20|29|3||0|0|2691065|158875|20|1|
|tenant|SELECT es.id, es.sales_no, es.sales_date, es.member_erp_id, es.sales_erp_id , es.is_sales FROM erp_sales es WHERE es.tenant_id = ? AND es.tenant_wechatapp_id = ? AND es.sales_status = ? AND es.sales_no LIKE concat(?, ?) ORDER BY es.sales_date DESC LIMIT ?|19|69|10||0|0|6480823|913691|6|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|19|34|3||0|0|2874872|163393|19|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 = ?|18|25|2||0|0|53612|6212|18|1|
|corpwx|UPDATE external_user SET un_assign_flag = ? WHERE tenant_id = ? AND status = ? AND un_assign_flag = ?|17|47|8||0|0|527718|61620|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.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 ?|14|24|3||0|0|1824462|130662|54|6|
|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 = ?)|13|28|3||0|0|1694295|130662|13|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 (?)|11|47|13||0|0|17169708|1561828|51|20|
|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()|11|13|1||0|0|726949|104696|11|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')|10|48|10||0|0|1931568|339812|3679|3017|
|user_service|SELECT t1.id, t1.user_id AS userId, t1.user_name AS userName, t1.sex, t1.mobile_no AS mobileNo , t1.head_img_url AS headImg FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? JOIN user_service.user_employee ue ON t1.tenant_id = ue.tenant_id AND t1.tenant_app_id = ue.tenant_wechatapp_id AND t1.user_id = ue.user_id AND ue.employee_id = ? AND ue.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ? ORDER BY ue.update_time DESC, t1.id DESC LIMIT ?|9|10|1||0|0|92297|11630|90|10|
|v4_user|SELECT id, checkin_employee_name, maintain_employee_name FROM potential_customer WHERE (external_user_id = ? OR member_id = ?) AND status IN (?) AND tenant_id = ? AND tenant_app_id = ? ORDER BY id ASC|9|12|1||0|0|114324|12715|2|1|
|order|SELECT max(create_time) FROM `order`.order_operator_log WHERE tenant_wechatapp_id = ? AND order_id = ?|9|44|6||0|0|8573794|953079|9|1|
|v4_user|SELECT COUNT(*) AS total FROM reception_customer WHERE shop_id = ? AND (member_id = ? OR external_user_id = ?) AND tenant_id = ? AND tenant_app_id = ?|9|11|2||0|0|40084|8652|9|1|
|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 ?|8|10|1||0|0|69256|12080|8|1|
|v4_sales|SELECT id, warranty_id, sales_detail_id, tenant_id, tenant_app_id , create_time, update_time FROM warranty_detail WHERE warranty_id = ? AND tenant_id = ? AND tenant_app_id = ?|8|21|5||0|0|8531490|1066988|25|6|
|v4_employee|SELECT ? AS task_type, t1.id AS invite_task_id, t1.name , ifnull(t2.undo_count, ?) AS undo_count, t1.invite_time AS invite_task_start_time , ifnull(t1.interrupt_time, t1.end_time) AS invite_task_end_time FROM task_invite_task_template t1 LEFT JOIN ( SELECT t.task_template_id AS id , sum(if(t.finish_time IS NULL, ?, ?)) AS undo_count FROM task_task t WHERE t.task_type = ? AND t.`status` = ? AND t.end_time > ? AND t.shop_id = ? AND t.employee_id = ? AND t.tenant_id = ? AND t.tenant_app_id = ? GROUP BY t.task_template_id ) t2 ON t1.id = t2.id WHERE t1.status IN (?) AND t1.tenant_id = ? AND t1.tenant_app_id = ? ORDER BY t1.id DESC|8|9|1||0|0|83267|12887|32|4|
|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 <= ?|8|11|1||0|0|69256|12080|8|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 = ?|8|10|2||0|0|101568|12710|0|0|
|tenant|SELECT sum(tt.maintainCount) AS maintainCount, sum(tt.maintainNum) AS maintainNum , sum(tt.successNum) AS successNum, sum(tt.failNum) AS failNum , sum(tt.saleMoney) AS saleMoney FROM ( SELECT count(1) AS maintainCount, count(DISTINCT t.sneak_guest_id) AS maintainNum, ? AS successNum , ? AS failNum, ? AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id = g.id WHERE g.tenant_app_id = ? AND (g.fail_type IS NULL OR g.fail_type = ?) AND t.event_type IN (?) AND t.create_time >= ? AND t.create_time < ? UNION ALL SELECT ? AS maintainCount, ? AS maintainNum, count(DISTINCT t.sneak_guest_id) AS successNum, ? AS failNum , sum(sgs.`amount`) AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id = g.id JOIN tenant.sneak_guest_sales sgs ON g.id = sgs.sneak_guest_id WHERE g.tenant_app_id = ? AND t.event_type IN (?) AND t.create_time >= ? AND t.create_time < ? UNION ALL SELECT ? AS maintainCount, ? AS maintainNum, ? AS successNum, count(DISTINCT t.sneak_guest_id) AS failNum , ? AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id = g.id WHERE g.tenant_app_id = ? AND g.fail_type = ? AND t.event_type IN (?) AND t.create_time >= ? AND t.create_time < ? ) tt|8|18|8||0|0|5630569|868950|8|1|
|employee|SELECT id, tenant_id, tenant_app_id, shop_id, employee_id , user_id, external_user_id, mobile_no, scene, status , begin_time, expire_time, create_time, update_time, directional_task_id , member_erp_id, finish_time, md5_str, tenant_open_id, data FROM backlog_system WHERE tenant_app_id = ? AND scene = ? AND status = ? AND create_time BETWEEN ? AND ?|8|20|9||0|0|3841618|531955|500|219|
|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 = ?|8|11|1||0|0|1054891|132031|4|2|
|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 ?|7|13|5||0|0|4872526|696271|21|5|
|order|SELECT count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND (od.mobile_no = ? OR ad.mobile_no = ?)|7|13|2||0|0|912069|130635|7|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|7|12|3||0|0|1111362|158853|7|1|
|tenant|SELECT count(*) FROM sneak_guest WHERE tenant_app_id = ? AND status = ? AND create_shop_id = ? AND maintain_employee_id = ?|7|9|1||0|0|61139|12080|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 = ?|7|10|2||0|0|599181|130392|7|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 = ?|7|10|2||0|0|599181|130392|7|1|
|employee|SELECT count(*) FROM label_task_employee t1 JOIN label_task_setting t2 ON t1.label_task_id = t2.id AND t2.disabled = ? WHERE t1.tenant_app_id = ? AND t1.shop_id = ? AND t1.visit_status > ? AND t1.finish_time >= DATE_SUB(CURRENT_DATE, INTERVAL ? DAY) AND t1.finish_time < CURRENT_DATE|7|11|2||0|0|112999|33836|7|1|
|user_service|SELECT count(0) FROM user_service.tenant_member t1 JOIN user_service.tenant_member_info t2 ON t1.tenant_id = t2.tenant_id AND t1.id = t2.id AND t2.tenant_app_id = ? AND t2.shop_id = ? WHERE t1.tenant_id = ? AND t1.tenant_app_id = ?|6|13|4||0|0|2765762|910836|6|1|
|v4_employee|SELECT t.id AS task_id, task_type , if(task_type = ?, st.description, it.description) AS description , if(task_type = ?, st.quick_reply, it.quick_reply) AS quick_reply , task_name, member_id, member_name, member_mobile_no, member_sex , member_level, t.start_time, t.end_time , datediff(t.end_time, NULL) AS left_days, send_coupons , recv_coupons, st.coupons, t.accept_time, t.plan_arrival_shop_time, t.arrival_shop_time , t.trade_time FROM task_task t LEFT JOIN task_system_task_template st ON st.id = t.task_template_id AND st.tenant_id = ? AND st.tenant_app_id = ? LEFT JOIN task_invite_task_template it ON it.id = t.task_template_id AND it.tenant_id = ? AND it.tenant_app_id = ? WHERE t.status = ? AND task_type = ? AND task_template_id = ? AND shop_id = ? AND employee_id = ? AND finish_time IS NOT NULL AND t.tenant_id = ? AND t.tenant_app_id = ? ORDER BY t.id DESC LIMIT ?|6|25|7||0|0|6365244|1067654|12|2|
|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|6|9|2||0|0|279641|78392|48|11|
|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 = ?|6|8|1||0|0|959588|159995|0|0|
|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 = ?|6|10|2||0|0|144769|46261|6|1|
|value_added|SELECT ? AS limitDayType, t.tenant_wechatapp_id AS tenantAppId, t.user_id AS userId, min(ue.employee_erp_id) AS employee_erp_id , ue.dept_erp_id, GROUP_CONCAT(t.product_barcode ORDER BY product_barcode ASC) AS productCode, GROUP_CONCAT(t.product_name ORDER BY product_barcode ASC) AS productName FROM value_added_user t INNER JOIN value_added_user_extend ue ON t.id = ue.id WHERE t.tenant_wechatapp_id = ? AND t.state = ? AND t.start_add_time >= date_add(DATE_FORMAT(?, '%Y-%m-%d'), INTERVAL ? * (t.add_days - ?) DAY) AND t.start_add_time < date_add(DATE_FORMAT(?, '%Y-%m-%d'), INTERVAL ? * (t.add_days - ?) + ? DAY) GROUP BY t.tenant_wechatapp_id, t.user_id, ue.dept_erp_id|5|13|7||0|0|1251005|442081|270|171|
|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 = ?|5|23|6||0|0|134169|26837|5|1|
|coupon_service|SELECT * FROM coupon_service.coupon_can_give WHERE coupon_id = ? LIMIT ?|5|6|1||0|0|1395941|280832|5|1|
|v4_sales|SELECT ifnull(sum(integral), ?) AS points FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id = es.sales_erp_id AND esd.tenant_id = ? AND esd.tenant_app_id = ? WHERE es.member_erp_id IN (?) AND es.sales_status = ? AND es.is_sales = ? AND esd.sales_type = ? AND es.tenant_id = ? AND es.tenant_app_id = ?|5|12|4||0|0|112085|26461|5|1|
|warranty_service|SELECT count(*) FROM warranty WHERE user_id = ? AND tenant_wechatapp_id = ? AND is_disable = ?|5|32|9||0|0|47725|12655|5|1|
|tenant|SELECT sp.id AS shopId, sp.shop_name AS shopName , ifnull(sum(tt.maintainCount), ?) AS maintainCount , ifnull(sum(tt.maintainNum), ?) AS maintainNum , ifnull(sum(tt.successNum), ?) AS successNum , ifnull(sum(tt.failNum), ?) AS failNum , ifnull(sum(tt.saleMoney), ?) AS saleMoney FROM tenant.tenant_wechatapp_shop sp LEFT JOIN ( SELECT g.create_shop_id AS shop_id, count(1) AS maintainCount, count(DISTINCT t.sneak_guest_id) AS maintainNum , ? AS successNum, ? AS failNum, ? AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id = g.id WHERE g.tenant_app_id = ? AND (g.fail_type IS NULL OR g.fail_type = ?) AND t.event_type IN (?) AND t.create_time >= ? AND t.create_time < ? GROUP BY g.create_shop_id UNION ALL SELECT g.create_shop_id AS shop_id, ? AS maintainCount, ? AS maintainNum, count(DISTINCT t.sneak_guest_id) AS successNum , ? AS failNum, sum(sgs.`amount`) AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id = g.id JOIN tenant.sneak_guest_sales sgs ON g.id = sgs.sneak_guest_id WHERE g.tenant_app_id = ? AND t.event_type IN (?) AND t.create_time >= ? AND t.create_time < ? GROUP BY g.create_shop_id UNION ALL SELECT g.create_shop_id AS shop_id, ? AS maintainCount, ? AS maintainNum, ? AS successNum , count(DISTINCT t.sneak_guest_id) AS failNum, ? AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id = g.id WHERE g.tenant_app_id = ? AND g.fail_type = ? AND t.event_type IN (?) AND t.create_time >= ? AND t.create_time < ? GROUP BY g.create_shop_id ) tt ON sp.id = tt.shop_id WHERE sp.status = ? AND sp.tenant_wechatapp_id = ? GROUP BY sp.id, sp.shop_name ORDER BY sp.id|5|5|1||0|0|4976726|995681|160|32|
|v4_employee|SELECT sum(ifnull(member_sales_amount = ?, ?)) AS `amount_total_consume|等于0元` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|1-2000元` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|2001-10000元` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|10001-50000元` , sum(ifnull(member_sales_amount >= ?, ?)) AS `amount_total_consume|大于等于50001元` , sum(ifnull(member_level_id = ?, ?)) AS `member_level|粉丝会员` , sum(ifnull(member_level_id = ?, ?)) AS `member_level|白银会员` , sum(ifnull(member_level_id = ?, ?)) AS `member_level|黄金会员` , sum(ifnull(member_level_id = ?, ?)) AS `member_level|铂金会员` , sum(ifnull(member_level_id = ?, ?)) AS `member_level|钻石会员` , sum(ifnull(member_integral_total = ?, ?)) AS `integral_total|等于0分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|1-4999分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|5000-19999分` , sum(ifnull(member_integral_total BETWEEN ? AND ?, ?)) AS `integral_total|20000-49999分` , sum(ifnull(member_integral_total >= ?, ?)) AS `integral_total|大于等于50000分` , sum(ifnull(member_age <= ?, ?)) AS `age|25岁以下` , sum(ifnull(member_age BETWEEN ? AND ?, ?)) AS `age|26-35岁` , sum(ifnull(member_age BETWEEN ? AND ?, ?)) AS `age|36-40岁` , sum(ifnull(member_age BETWEEN ? AND ?, ?)) AS `age|41-55岁` , sum(ifnull(member_age >= ?, ?)) AS `age|56岁以上` , sum(ifnull(member_sales_count = ?, ?)) AS `consume_num|0次` , sum(ifnull(member_sales_count = ?, ?)) AS `consume_num|1次` , sum(ifnull(member_sales_count = ?, ?)) AS `consume_num|2次` , sum(ifnull(member_sales_count BETWEEN ? AND ?, ?)) AS `consume_num|3-5次` , sum(ifnull(member_sales_count >= ?, ?)) AS `consume_num|6次以上` , sum(ifnull(member_sex = ?, ?)) AS `sex|男` , sum(ifnull(member_sex = ?, ?)) AS `sex|女` , sum(ifnull(member_sex = ?, ?)) AS `sex|其他` , sum(ifnull(member_integral_balance = ?, ?)) |5|25|9||0|0|4715237|995932|5|1|
|employee|SELECT count(0) FROM employee.backlog t WHERE t.tenant_id = ? AND t.tenant_app_id = ? AND t.employee_id = ? AND t.begin_time >= ? AND t.expire_time < ? AND t.`status` != ? AND t.scene = ?|5|11|3||0|0|21186|4655|5|1|
|tenant|SELECT esd.id, esd.sales_erp_id, es.employee_name, esd.product_barcode, es.sales_no , es.member_erp_id, esd.category_name, es.sales_date, esd.category_erp_id, esd.product_name , esd.cert_no, esd.amount_pay, esd.sales_index , ifnull(ee.not_add_value_plan, ?) AS not_add_value_plan FROM erp_sales_detail esd JOIN erp_sales es ON es.tenant_id = esd.tenant_id AND es.tenant_wechatapp_id = esd.tenant_wechatapp_id AND es.sales_erp_id = esd.sales_erp_id LEFT JOIN erp_sales_extend ee ON ee.tenant_id = es.tenant_id AND es.tenant_wechatapp_id = ee.tenant_wechatapp_id AND es.sales_erp_id = ee.sales_erp_id AND esd.sales_index = ee.sales_index WHERE esd.tenant_id = ? AND es.sales_status = ? AND es.tenant_wechatapp_id = ? AND esd.product_barcode = ? ORDER BY es.sales_date DESC|5|23|5||0|0|146958|34144|27991|6469|
|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 ?|5|5|1||0|0|10207|2664|5|1|
|v4_employee|SELECT s.id, s.name FROM shop s JOIN ( SELECT DISTINCT shop_id FROM task_task WHERE status = ? AND task_template_id = ? AND tenant_id = ? AND tenant_app_id = ? ) t ON s.id = t.shop_id WHERE s.tenant_id = ? AND s.tenant_app_id = ?|4|6|1||0|0|528291|204801|38|12|
|v4_employee|SELECT count(*) AS total_count, count(finish_time) AS finish_count , 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 , ifnull(sum(trade_amount), ?) AS trade_amount , ifnull(sum(trade_num), ?) AS trade_num FROM task_task WHERE task_type = ? AND `status` = ? AND task_template_id = ? AND tenant_id = ? AND tenant_app_id = ?|4|6|1||0|0|528131|204762|4|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 ?|4|17|4||0|0|3810243|953031|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 ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ...|4|15|5||0|0|5100781|1366658|1355|417|
|v4_sales|SELECT count(DISTINCT sales_date) FROM v4_sales.erp_sales WHERE member_erp_id IN (?) AND is_sales = ? AND sales_status = ? AND tenant_id = ? AND tenant_app_id = ?|4|7|2||0|0|41994|10500|4|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 = ?)|4|4|1||0|0|1502203|464597|4|1|
|erp_app|INSERT INTO app_status (id, tenant_id, app_name, version, pid) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE version = ?, pid = ?, online_status_time = ?|4|5|1||0|0|0|0|0|0|
|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|4|4|1||0|0|8508|2361|4|4|
|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|3|3|1||0|0|24286|11750|4|3|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ...|3|7|3||0|0|3144382|1171760|1122|624|
|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 = ?|3|3|1||0|0|17102|6282|3|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 = ?|3|10|3||0|0|97657|32557|3|1|
|coupon_service|SELECT count(*) FROM employee_give_coupon_log WHERE tenant_app_id = ? AND coupon_push_id = ?|3|4|1||0|0|25698|17361|3|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 ?|3|3|1||0|0|2088755|696399|13|9|
|v4_employee|SELECT sum(ifnull(member_sales_amount = ?, ?)) AS `amount_total_consume|等于0元` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|1-2000元` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|2001-10000元` , sum(ifnull(member_sales_amount BETWEEN ? AND ?, ?)) AS `amount_total_consume|10001-50000元` , sum(ifnull(member_sales_amount >= ?, ?)) AS `amount_total_consume|大于等于50001元` , sum(ifnull(shop_id = ?, ?)) AS `shop|北票萃华金店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城萃华珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平萃华金店` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平萃华通胜店` , sum(ifnull(shop_id = ?, ?)) AS `shop|喀左萃华一店` , sum(ifnull(shop_id = ?, ?)) AS `shop|喀左萃华二店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城潮宏基珠宝二店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华专卖店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华形象店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区萃华旗舰店` , sum(ifnull(shop_id = ?, ?)) AS `shop|苏区六福珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|凌源南街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|凌源北街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|建平潮宏基珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|大和周大福店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城站前街周大福` , sum(ifnull(shop_id = ?, ?)) AS `shop|北票周大福珠宝` , sum(ifnull(shop_id = ?, ?)) AS `shop|鞍山青年街` , sum(ifnull(shop_id = ?, ?)) AS `shop|鞍山周大福景子街店` , sum(ifnull(shop_id = ?, ?)) AS `shop|海城潮宏基一店` , sum(ifnull(member_integral_balance = ?, ?)) AS `integral_balance|等于0分` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|1-1999分` , sum(ifnull(member_integral_balance BETWEEN ? AND ?, ?)) AS `integral_balance|2000-4999分` , sum(ifnull(member_integral_balance BETWEEN ? AN|3|14|7||0|0|2734168|995880|3|1|
|order|SELECT count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND od.order_no LIKE concat(?, ?, ?)|2|4|2||0|0|87029|43599|2|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.order_no LIKE concat(?, ?, ?)|2|4|2||0|0|87029|43599|2|1|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id = es.id AND wca.tenant_id = ? AND wca.tenant_app_id = ? LEFT JOIN v4_sales.warranty w ON w.sales_id = es.id AND w.tenant_id = ? AND w.tenant_app_id = ? WHERE is_sales = ? AND sales_status = ? AND (es.sales_no LIKE concat(?, ?) OR es.member_erp_id = ?) AND es.tenant_id = ? AND es.tenant_app_id = ?|2|2|1||0|0|517385|328764|2|1|
|employee|UPDATE backlog_system SET status = ?, finish_time = now() WHERE tenant_app_id = ? AND scene = ?|2|5|3||0|0|2441464|1220732|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 dt.product_name LIKE concat(?, ?, ?) AND (od.status = ?) AND ad.shop_id = ?|2|3|1||0|0|124804|62404|2|1|
|employee|SELECT count(*) FROM employee.backlog WHERE tenant_id = ? AND tenant_app_id = ? AND shop_id = ? AND status = ? AND finish_time BETWEEN ? AND ?|2|2|1||0|0|3466|1733|2|1|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id = es.id AND wca.tenant_id = ? AND wca.tenant_app_id = ? LEFT JOIN v4_sales.warranty w ON w.sales_id = es.id AND w.tenant_id = ? AND w.tenant_app_id = ? WHERE is_sales = ? AND sales_status = ? AND es.employee_erp_id = ? AND es.dept_erp_id = ? AND if(wca.source = ?, es.sales_date >= ?, date_format(wca.create_time, '%Y-%m-%d') >= ?) AND es.tenant_id = ? AND es.tenant_app_id = ?|2|3|1||0|0|16213|8643|2|1|
|user_service|SELECT obj.id, obj.shop_id, obj.total , CASE  WHEN @rowtotal = obj.total THEN @rownum WHEN @rowtotal := obj.total THEN @rownum := @rownum + ? WHEN @rowtotal = ? THEN @rownum := @rownum + ? END AS rank_idx FROM ( SELECT us.from_id AS id, us.shop_id, count(1) AS total FROM user_source us WHERE us.tenant_id = ? AND us.tenant_wechatapp_id = ? AND us.create_time >= ? AND us.create_time < ? AND us.source_type = ? AND us.from_id IS NOT NULL AND us.shop_id IS NOT NULL GROUP BY us.from_id, us.shop_id ORDER BY count(1) DESC ) obj, ( SELECT @rownum := ?, @rowtotal := NULL ) r|2|2|1||0|0|9123|4903|431|266|
|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|7|4||0|0|729306|364837|126|63|
|authorization_service|COMMIT ?|2|2|1||0|0|0|0|0|0|
|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 = ?|2|4|3||0|0|2134212|1067214|1|1|
|tenant|SELECT count(*) FROM tenant.sneak_guest_maintain s JOIN tenant.sneak_guest sg ON sg.id = s.sneak_guest_id WHERE s.tenant_id = ? AND s.tenant_app_id = ? AND s.shop_id = ? AND s.event_type = ? AND s.create_time BETWEEN ? AND ?|2|2|1||0|0|4056|2028|2|1|
|tenant|SELECT count(0) FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id = ey.id WHERE sg.tenant_app_id = ? AND sg.create_shop_id = ? AND EXISTS ( SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id = sgm.sneak_guest_id AND sgm.event_type = ? AND sgm.intention_info REGEXP ? ) AND EXISTS ( SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id = sgm.sneak_guest_id AND sgm.event_type = ? AND sgm.intention_info REGEXP ? ) AND sg.status = ?|2|22|13||0|0|73264|36636|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|5931|2974|5931|2974|
|user_service|SELECT obj.id, obj.total , CASE  WHEN @rowtotal = obj.total THEN @rownum WHEN @rowtotal := obj.total THEN @rownum := @rownum + ? WHEN @rowtotal = ? THEN @rownum := @rownum + ? END AS rank_idx FROM ( SELECT us.from_id AS id, count(1) AS total FROM user_source us WHERE us.tenant_id = ? AND us.tenant_wechatapp_id = ? AND us.shop_id = ? AND us.create_time >= ? AND us.create_time < ? AND us.source_type = ? AND us.from_id IS NOT NULL AND us.shop_id IS NOT NULL GROUP BY us.from_id ORDER BY count(1) DESC ) obj, ( SELECT @rownum := ?, @rowtotal := NULL ) r|2|2|1||0|0|7878|4429|16|9|
|v4_sales|SELECT COUNT(*) AS total FROM warranty WHERE member_id IN (?) AND is_disable = ? AND tenant_id = ? AND tenant_app_id = ?|2|2|1||0|0|11072|5536|2|1|
|value_added|SELECT count(0) FROM ( SELECT t1.id, t2.sales_no AS salesNo, DATE_FORMAT(t2.sales_date, '%Y-%m-%d') AS salesDate , DATE_FORMAT(t1.start_add_time, '%Y-%m-%d') AS valueAddDate, t2.dept_erp_id AS shopId , t1.shop_name AS shopName, t2.employee_erp_id AS userId, t2.employee_name AS userName, t1.product_name AS productName, t1.amount_pay AS amountPay , t1.id AS valueAddNo, t1.amount_added AS valueAddAmount, t1.state , if(t1.state = ?, t1.coupon_user_id, NULL) AS valueAddCoupon , t1.user_id AS memberUserId , CASE  WHEN start_add_time > ? THEN ? WHEN DATE_ADD(start_add_time, INTERVAL add_days DAY) > ? AND state = ? THEN ? WHEN DATE_ADD(start_add_time, INTERVAL add_days + keeping_days DAY) > ? AND DATE_ADD(start_add_time, INTERVAL add_days DAY) < ? AND state = ? THEN ? WHEN DATE_ADD(start_add_time, INTERVAL add_days + keeping_days DAY) < ? AND amount_added > ? AND state = ? THEN ? ELSE ? END AS addedStatus FROM value_added.value_added_user t1 JOIN value_added.`value_added_user_extend` t2 ON t1.id = t2.id WHERE t1.tenant_wechatapp_id = ? AND EXISTS ( SELECT NULL FROM value_added.value_added_category t3 JOIN value_added.value_added_template t4 ON t3.template_id = t4.id AND t4.is_disable = ? WHERE t1.tenant_wechatapp_id = t3.tenant_wechatapp_id AND t2.category_erp_id = t3.erp_product_category_id ) AND t2.sales_date >= ? AND t2.sales_date < ? AND t1.state != ? ) tmp_count|2|4|2||0|0|74372|38268|2|1|
|tenant|SELECT DISTINCT s.employee_id AS id, e.employee_name FROM tenant.sneak_guest_maintain s JOIN tenant.sneak_guest sg ON sg.id = s.sneak_guest_id JOIN tenant.employee e ON s.tenant_id = e.tenant_id AND s.employee_id = e.id WHERE s.tenant_id = ? AND s.tenant_app_id = ? AND sg.create_shop_id = ? AND (sg.fail_type IS NULL OR sg.fail_type = ?) AND s.event_type = ? AND s.create_time BETWEEN ? AND ?|1|1|1||0|0|49423|49423|6|6|
|v4_sales|SELECT es.id AS salesId, es.sales_no, es.sales_date, es.member_erp_id AS memberId, w.warranty_no , wca.source 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|328764|328764|2|2|
|v4_user|UPDATE wx_user SET app_type = ?, app_id = ?, open_id = ?, mobile_no = ?, is_subscribe = ?, wx_card_code = ?, sex = ?, member_id = ?, logout = ? WHERE id = ?|1|1|1||0|0|1|1|0|0|
|v4_user|SELECT id FROM potential_customer WHERE status IN (?) AND next_maintain_time < ? AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|12680|12680|324|324|
|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 ?|1|3|3||0|0|105838|105838|4|4|
|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 = ?)|1|1|1||0|0|93609|93609|1|1|
|order|SELECT od.id, od.order_no AS orderNo, od.status, od.take_type AS takeType, od.create_time AS createTime , od.remark, od.total_fee AS totalFee, od.freight_fee AS freightFee, od.discount_fee AS discountFee, od.take_id AS takeId , od.payment_fee AS paymentFee, dt.product_id AS productId, dt.price, dt.quantity, dt.sku_id AS skuId , dt.art_no AS artNo, dt.image_url AS imageUrl, dt.product_name AS productName, dt.take_remark AS takeRemark, dt.take_day AS takeDay , od.product_fee AS productFee, ad.user_name AS receiveName, ad.mobile_no AS mobileNo, ad.shop_name AS shopName, ad.address , ad.express_no AS expressNo, ad.express_company AS expressCompany, od.finish_type AS finishType, od.send_time AS sendTime, od.receive_time AS receiveTime , od.finish_time AS finishTime, od.child_status AS childStatus, od.send_good_remark AS sendGoodRemark, od.service_flag AS serviceFlag, od.coupon_id AS couponId , od.tenant_wechatapp_id AS tenantAppId, od.tenant_id FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.status = ? AND od.send_time <= ? AND od.take_type = ?|1|2|2||0|0|231838|231838|0|0|
|value_added|SELECT ID, tenant_wechatapp_id AS tenantWechatappId, user_id AS userId, template_id AS templateId, sales_erp_id AS saleserpid , product_name AS productName, shop_name AS shopName, product_barcode AS productBarcode, amount_total AS amountTotal, amount_pay AS amountPay , amount_added AS amountAdded, state AS state, add_days, added_percent_per_day AS addedPercentPerDay, devalue_percent_per_day AS devaluePercentPerDay , keeping_days AS keepingDays, exchange_days AS exchangeDays, coupon_user_id AS couponUserId, sales_index AS salesIndex, start_add_time AS createtime , DATE_ADD(start_add_time, INTERVAL add_days - ? DAY) , DATE_ADD(start_add_time, INTERVAL add_days + keeping_days - ? DAY) FROM value_added_user WHERE state = ? AND start_add_time = date_add(CURDATE(), INTERVAL ? * (add_days + keeping_days - ?) DAY)|1|1|1||0|0|1973043|1973043|1214|1214|
|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 = ?)|1|1|1||0|0|93609|93609|1|1|
|tenant|SELECT sales_erp_id FROM tenant.erp_sales es JOIN tenant.erp_sales_ignore ei ON ei.tenant_id = ? AND ei.tenant_app_id = ? AND es.sales_erp_id = ei.erp_sales_id WHERE es.tenant_id = ? AND es.tenant_wechatapp_id = ? AND member_erp_id = ?|1|1|1||0|0|8089|8089|0|0|
|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|115|115||0|0|10437793|10437793|972|972|
|user_service|SELECT * FROM user_employee WHERE tenant_wechatapp_id = ? AND employee_id = ?|1|1|1||0|0|3500|3500|3500|3500|
|corpwx|SELECT id, tenant_id, params_key, params_value, group_id , create_time, update_time FROM corp_mini_qrcode_params WHERE group_id = ?|1|1|1||0|0|404906|404906|5|5|
|authorization_service|update user_login_token set status=? where login_token in (|1|1|1||0|0|453|453|0|0|
|v4_sales|SELECT id, sales_erp_id, sales_no, sales_date, member_erp_id , employee_erp_id, employee_name, assist_employee_erp_id, assist_employee_name, dept_erp_id , amount, sales_remark, receipts, sales_status, is_sales , busi_date, erp_create_time, recommend_id, post_time, tenant_id , tenant_app_id, create_time, update_time FROM erp_sales WHERE sales_no = ? AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|148956|148956|1|1|
|v4_employee|SELECT t.id AS task_id, t.employee_id, e.employee_name, t.member_id, t.member_name , t.finish_time, t.plan_arrival_shop_time, tta.task_attaches FROM task_task t JOIN employee e ON e.employee_id = t.employee_id AND e.shop_id = t.shop_id AND e.tenant_id = ? AND e.tenant_app_id = ? LEFT JOIN ( SELECT task_id, GROUP_CONCAT(file_url SEPARATOR '|') AS task_attaches FROM task_task_attach WHERE tenant_id = ? AND tenant_app_id = ? GROUP BY task_id ) tta ON t.id = tta.task_id WHERE t.status = ? AND system_task_type = ? AND t.shop_id = ? AND finish_time >= ? AND finish_time < ? AND t.employee_id = ? AND t.tenant_id = ? AND t.tenant_app_id = ? ORDER BY t.finish_time DESC, t.id DESC LIMIT ?|1|1|1||0|0|291361|291361|3|3|
|value_added|SELECT t1.id, t2.sales_no AS salesNo, DATE_FORMAT(t2.sales_date, '%Y-%m-%d') AS salesDate , DATE_FORMAT(t1.start_add_time, '%Y-%m-%d') AS valueAddDate, t2.dept_erp_id AS shopId , t1.shop_name AS shopName, t2.employee_erp_id AS userId, t2.employee_name AS userName, t1.product_name AS productName, t1.amount_pay AS amountPay , t1.id AS valueAddNo, t1.amount_added AS valueAddAmount, t1.state , if(t1.state = ?, t1.coupon_user_id, NULL) AS valueAddCoupon , t1.user_id AS memberUserId , CASE  WHEN start_add_time > ? THEN ? WHEN DATE_ADD(start_add_time, INTERVAL add_days DAY) > ? AND state = ? THEN ? WHEN DATE_ADD(start_add_time, INTERVAL add_days + keeping_days DAY) > ? AND DATE_ADD(start_add_time, INTERVAL add_days DAY) < ? AND state = ? THEN ? WHEN DATE_ADD(start_add_time, INTERVAL add_days + keeping_days DAY) < ? AND amount_added > ? AND state = ? THEN ? ELSE ? END AS addedStatus FROM value_added.value_added_user t1 JOIN value_added.`value_added_user_extend` t2 ON t1.id = t2.id WHERE t1.tenant_wechatapp_id = ? AND EXISTS ( SELECT NULL FROM value_added.value_added_category t3 JOIN value_added.value_added_template t4 ON t3.template_id = t4.id AND t4.is_disable = ? WHERE t1.tenant_wechatapp_id = t3.tenant_wechatapp_id AND t2.category_erp_id = t3.erp_product_category_id ) AND t2.sales_date >= ? AND t2.sales_date < ? AND t1.state != ? LIMIT ?|1|2|2||0|0|36341|36341|3|3|
|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|18|18||0|0|1973043|1973043|709|709|
|corpwx|SELECT t.tenant_id AS tenantId, t.wx_user_id AS wxUserId, t.union_id AS wxUnionId, t.user_id AS externalUserId , ifnull(et.raw_external_user_id, t.old_user_id) AS rawExternalUserId, t.corp_user_id AS employeeCorpUserId FROM corpwx.external_user t LEFT JOIN corpwx.external_userid_transform et ON t.tenant_id = et.tenant_id AND t.user_id = et.external_user_id WHERE t.tenant_id = ? AND t.status = ? AND t.user_id IN (?) AND t.un_assign_flag = ?|1|1|1||0|0|297|297|142|142|
|v4_employee|SELECT COUNT(*) AS total FROM task_task t JOIN employee e ON e.employee_id = t.employee_id AND e.shop_id = t.shop_id AND e.tenant_id = ? AND e.tenant_app_id = ? LEFT JOIN ( SELECT task_id, GROUP_CONCAT(file_url SEPARATOR '|') AS task_attaches FROM task_task_attach WHERE tenant_id = ? AND tenant_app_id = ? GROUP BY task_id ) tta ON t.id = tta.task_id WHERE t.status = ? AND system_task_type = ? AND t.shop_id = ? AND finish_time >= ? AND finish_time < ? AND t.employee_id = ? AND t.tenant_id = ? AND t.tenant_app_id = ?|1|2|2||0|0|291333|291333|1|1|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail WHERE create_time < ?|1|1|1||0|0|240080|240080|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.tenant_id = ? AND p.product_type = ? AND (ps.id IS NOT NULL OR p.tenant_wechatapp_id = ?)|1|1|1||0|0|52149|52149|1|1|
|user_service|SELECT count(0) FROM user_service.tenant_member tm JOIN user_service.user_employee ue ON ue.tenant_id = ? AND ue.tenant_wechatapp_id = ? AND tm.user_id = ue.user_id AND ue.employee_id = ? AND ue.shop_id = ? WHERE tm.tenant_id = ? AND tm.tenant_app_id = ?|1|4|4||0|0|86389|86389|1|1|
|value_added|UPDATE value_added_user SET amount_added = IF(? > (added_percent_per_day / ? * IF(? >= TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ? - add_days, TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ?, add_days) - devalue_percent_per_day / ? * IF(? >= TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ? - add_days - keeping_days, ?, TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ? - add_days - keeping_days)) * amount_pay, ?, (added_percent_per_day / ? * IF(? >= TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ? - add_days, TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ?, add_days) - devalue_percent_per_day / ? * IF(? >= TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ? - add_days - keeping_days, ?, TIMESTAMPDIFF(DAY, DATE_FORMAT(start_add_time, '%Y-%m-%d'), CURRENT_DATE) + ? - add_days - keeping_days)) * amount_pay), update_time = now() WHERE state = ? AND update_time <= CURDATE() AND (start_add_time >= DATE_ADD(CURDATE(), INTERVAL -(add_days + keeping_days - ?) DAY) OR (amount_added > ? AND start_add_time < DATE_ADD(CURDATE(), INTERVAL -(add_days + keeping_days - ?) DAY)))|1|23|23||0|0|1972992|1972992|0|0|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ...|1|3|3||0|0|884482|884482|297|297|
|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 ?, ?|1|1|1||0|0|696124|696124|1|1|
|mysql|DELETE FROM message_push.message_log WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|83|83||0|0|2939634|2939634|0|0|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE coupon_status = ? AND member_id = ? AND tenant_id = ? AND tenant_app_id = ?|1|1|1||0|0|21|21|1|1|
|activity_service|SELECT id, tenant_id, tenant_app_id, activity_id, user_id , day, continuous_day, has_subscribe, user_name, create_time , update_time, first_sign_time, mobile_no FROM online_sign_user WHERE tenant_app_id = ? AND user_id = ?|1|1|1||0|0|130126|130126|1|1|
|value_added|SELECT count(0) FROM ( SELECT t1.id, t2.sales_no AS salesNo, DATE_FORMAT(t2.sales_date, '%Y-%m-%d') AS salesDate , DATE_FORMAT(t1.start_add_time, '%Y-%m-%d') AS valueAddDate, t2.dept_erp_id AS shopId , t1.shop_name AS shopName, t2.employee_erp_id AS userId, t2.employee_name AS userName, t1.product_name AS productName, t1.amount_pay AS amountPay , t1.id AS valueAddNo, t1.amount_added AS valueAddAmount, t1.state , if(t1.state = ?, t1.coupon_user_id, NULL) AS valueAddCoupon , t1.user_id AS memberUserId , CASE  WHEN start_add_time > ? THEN ? WHEN DATE_ADD(start_add_time, INTERVAL add_days DAY) > ? AND state = ? THEN ? WHEN DATE_ADD(start_add_time, INTERVAL add_days + keeping_days DAY) > ? AND DATE_ADD(start_add_time, INTERVAL add_days DAY) < ? AND state = ? THEN ? WHEN DATE_ADD(start_add_time, INTERVAL add_days + keeping_days DAY) < ? AND amount_added > ? AND state = ? THEN ? ELSE ? END AS addedStatus FROM value_added.value_added_user t1 JOIN value_added.`value_added_user_extend` t2 ON t1.id = t2.id WHERE t1.tenant_wechatapp_id = ? AND EXISTS ( SELECT NULL FROM value_added.value_added_category t3 JOIN value_added.value_added_template t4 ON t3.template_id = t4.id AND t4.is_disable = ? WHERE t1.tenant_wechatapp_id = t3.tenant_wechatapp_id AND t2.category_erp_id = t3.erp_product_category_id ) AND t2.dept_erp_id = ? AND t2.employee_erp_id IN (?) AND t2.sales_date >= ? AND t2.sales_date < ? AND t1.state != ? ) tmp_count|1|8|8||0|0|1971296|1971296|1|1|
|order|SELECT ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "2" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "3" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "4" , ifnull(sum(if(od.status = ?, ?, ?)), ?) AS "5" , count(1) AS total , ifnull(sum(if(od.status > ?, od.payment_fee, ?)), ?) AS paymentFee , ifnull(sum(if(od.status > ?, od.offline_payment_fee, ?)), ?) AS offlinePaymentFee , ifnull(sum(if(od.status > ?, od.payment_fee + od.offline_payment_fee, ?)), ?) AS payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id LEFT JOIN order_address ad ON od.id = ad.order_id WHERE od.tenant_id = ? AND od.tenant_wechatapp_id = ? AND dt.product_name LIKE concat(?, ?, ?) AND (od.status = ?) AND ad.shop_id = ?|1|1|1||0|0|62400|62400|1|1|
|v4_user|INSERT INTO wx_user (id, app_type, app_id, open_id, sex) VALUES (?, ?, ?, ?, ?)|1|1|1||0|0|0|0|0|0|
|tenant|SELECT count(0) FROM ( SELECT es.id, es.sales_no, es.sales_date, es.sales_erp_id, es.amount , ifnull(shop.shop_name, ed.dept_name) AS dept_name, es.employee_name FROM tenant.erp_sales es JOIN tenant.erp_department ed ON ed.dept_erp_id = es.dept_erp_id AND ed.tenant_id = ? LEFT JOIN tenant.tenant_wechatapp_shop shop ON shop.dept_erp_id = ed.dept_erp_id AND shop.tenant_wechatapp_id = ? WHERE es.member_erp_id = ? AND es.tenant_id = ? AND es.tenant_wechatapp_id = ? AND es.sales_status = ? AND NOT EXISTS ( SELECT i.id FROM tenant.erp_sales_ignore i WHERE i.tenant_id = ? AND i.tenant_app_id = ? AND es.sales_erp_id = i.erp_sales_id ) ) table_count|1|1|1||0|0|1940679|1940679|1|1|
|v4_employee|SELECT t.employee_id AS employeeId, count(*) AS total , ifnull(sum(if(t.finish_time IS NOT NULL, ?, ?)), ?) AS finished FROM v4_employee.task_task t WHERE t.task_template_id = ? AND t.task_type = ? AND t.shop_id = ? AND t.`status` = ? AND t.start_time <= ? AND t.end_time > ? AND t.tenant_id = ? AND t.tenant_app_id = ? GROUP BY t.employee_id|1|1|1||0|0|2705|2705|5|5|
|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 ?|1|1|1||0|0|8215|8215|6|6|
|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|442324|442324|82|82|
|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|1|1|1||0|0|915|915|1|1|
|order|SELECT od.id, od.order_no AS orderNo, od.status, od.take_type AS takeType, od.create_time AS createTime , od.remark, od.total_fee AS totalFee, od.freight_fee AS freightFee, od.discount_fee AS discountFee, od.take_id AS takeId , od.payment_fee AS paymentFee, dt.product_id AS productId, dt.price, dt.quantity, dt.sku_id AS skuId , dt.art_no AS artNo, dt.image_url AS imageUrl, dt.product_name AS productName, dt.take_remark AS takeRemark, dt.take_day AS takeDay , od.product_fee AS productFee, od.finish_type AS finishType, od.send_time AS sendTime, od.receive_time AS receiveTime, od.finish_time AS finishTime , od.child_status AS childStatus, od.send_good_remark AS sendGoodRemark, od.service_flag AS serviceFlag, od.coupon_id AS couponId, od.tenant_wechatapp_id AS tenantAppId , od.tenant_id AS tenantId, od.pay_id AS payId, od.user_id AS userId, od.user_name AS userName, od.mobile_no AS buyMobileNo , od.activity_id, od.offline_payment_fee, od.activity_type, dt.spec, od.take_shop_id , od.take_shop_name, od.take_employee_user_id, od.take_employee_user_name FROM order_info od LEFT JOIN order_detail dt ON od.id = dt.order_id WHERE od.status = ? AND od.receive_time <= ?|1|2|2||0|0|231921|231921|83|83|
|v4_employee|SELECT count(*) AS total , ifnull(sum(if(t.finish_time IS NOT NULL, ?, ?)), ?) AS finished FROM v4_employee.task_task t WHERE t.task_template_id = ? AND t.task_type = ? AND t.shop_id = ? AND t.`status` = ? AND t.start_time <= ? AND t.end_time > ? AND t.tenant_id = ? AND t.tenant_app_id = ?|1|1|1||0|0|2705|2705|1|1|
|user_service|select tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id=? and tu.tenant_app_id = ? and mb.erp_member_id in (|1|2|2||0|0|1366616|1366616|375|375|
|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|13392|13392|356|356|
|coupon_service|SELECT cet.id, cet.coupon_id, cet.user_id, cet.coupon_type, cet.expire_time , if(cet.expire_time < now() AND cet.status = ?, ?, cet.status) AS status FROM coupon_service.coupon_expire_task cet JOIN coupon_service.coupon_extend ce ON ce.tenant_id = ? AND ce.tenant_app_id = ? AND ce.coupon_id = cet.coupon_id WHERE cet.tenant_id = ? AND cet.tenant_app_id = ? AND cet.employee_id = ? AND cet.shop_id = ?|1|1|1||0|0|3040|3040|1520|1520|
|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|364343|364343|0|0|
|mysql|DELETE FROM wx_gateway.wx_template_msg WHERE create_time < DATE_SUB(now(), INTERVAL ? DAY)|1|43|43||0|0|1203425|1203425|0|0|
|authorization_service|SELECT id, platform_user_id, user_id, wx_user_id, employee_id , shop_id, tenant_id, tenant_wx_app_id, account_id, login_way , login_code, login_token, roles, status, expire_time , create_time, update_time, login_ip, login_time, login_data , wx_app_user_id FROM user_login_token WHERE tenant_id = ? AND employee_id = ? AND status = ?|1|1|1||0|0|687|687|687|687|
