|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|v4_sales|SELECT count(es.id) FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id=es.id AND if(wca.source=?,es.sales_date>=?,wca.create_time>=?) 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.employee_erp_id=? AND dept_erp_id=? AND w.id IS ? AND es.tenant_id=? AND es.tenant_app_id=?|2818|4773|5||0|0|12218287|37592|2818|1|
|v4_sales|SELECT * FROM v4_sales.value_added_record WHERE value_added_id=? AND date_format(create_time,?)=? AND tenant_id=? AND tenant_app_id=?|1731|1770|3||0|0|4820723275|2789525|0|0|
|sjfx_etl|SELECT COUNT(*) AS total FROM etl_task WHERE (create_time<?)|755|71828|187||0|0|21657859745|29043044|755|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 ? 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|584|937|6||0|0|2309739|8641|1483|5|
|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 ?|318|813|9||0|0|5826519|41656|318|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|153|231|3||0|0|215285|2287|93337|1053|
|user_service|SELECT count(?) FROM user_service.tenant_member t? JOIN user_service.tenant_member_info t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id AND t?.tenant_app_id=? AND t?.shop_id=? JOIN user_service.user_employee ue ON t?.tenant_id=ue.tenant_id AND t?.tenant_app_id=ue.tenant_wechatapp_id AND t?.user_id=ue.user_id AND ue.employee_id=? AND ue.shop_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=?|149|308|14||0|0|1347693|146011|149|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,?)>=?) AND w.id IS ? AND es.tenant_id=? AND es.tenant_app_id=?|137|225|5||0|0|466880|28717|137|1|
|v4_sales|SELECT ifnull(sum(integral),?)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=?|112|469|9||0|0|3221802|41043|112|1|
|v4_sales|SELECT count(DISTINCT sales_date) FROM v4_sales.erp_sales WHERE member_erp_id IN (?) AND is_sales=? AND sales_status=? AND tenant_id=? AND tenant_app_id=?|90|221|4||0|0|1227866|17027|90|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=?|85|315|7||0|0|781025|9216|15|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,?)>=?) AND w.id IS NOT ? AND es.tenant_id=? AND es.tenant_app_id=?|85|149|6||0|0|452882|9553|85|1|
|tenant|SELECT count(?) 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=?|68|106|3||0|0|219089|6817|68|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=?|65|87|3||0|0|82993|1581|39080|746|
|v4_user|SELECT id,member_id,external_user_id,serial_number,checkin_shop_id,checkin_employee_id,checkin_employee_name,checkin_time,maintain_shop_id,maintain_employee_id,maintain_employee_name,first_maintain_time,last_maintain_time,next_maintain_time,maintain_num,intention_num,latest_intention,status,finish_time,finish_shop_id,deal_employee_id,deal_employee_name,deal_sale_amount,fail_employee_id,fail_employee_name,fail_reason,remark,sex,cutomer_grade,maintain_level,tenant_id,tenant_app_id,create_time,update_time FROM potential_customer WHERE ((member_id=?) AND status IN (?) AND maintain_shop_id=?) AND tenant_id=? AND tenant_app_id=?|65|93|2||0|0|164122|2581|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 tu.status=? AND mb.erp_member_id IN (?)|56|132|14||0|0|31540914|1915006|5432|464|
|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 ?,?,?) 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 ? AND p.product_status=? ORDER BY i.volume DESC ,p.tag_price ASC ,p.id DESC LIMIT ?|54|63|1||0|0|478830|8870|324|6|
|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 ?|46|410|27||0|0|21361101|1117845|23|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=?|44|63|2||0|0|365477|12862|44|1|
|v4_user|SELECT id,checkin_employee_name,maintain_employee_name FROM potential_customer WHERE ((external_user_id=? OR member_id=?) AND status IN (?)) AND tenant_id=? AND tenant_app_id=? ORDER BY id ASC|44|167|6||0|0|400262|9216|23|1|
|gift_mail|SELECT count(*) FROM gift_mail.trade t LEFT JOIN gift_mail.trade_take tt ON tt.trade_id=t.id WHERE t.tenant_id=? AND t.tenant_wechatapp_id=? AND t.trade_type IN (?) AND t.order_status=? AND t.take_type=? AND tt.shop_id=?|43|61|2||0|0|313524|11857|43|1|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE is_sales=? AND sales_status=? AND (es.sales_no LIKE concat(?,?) OR es.member_erp_id=?) AND w.id IS ? AND es.tenant_id=? AND es.tenant_app_id=?|42|130|7||0|0|11509022|378281|42|1|
|v4_sales|SELECT t?.sales_erp_id AS salesErpId,t?.sales_no AS salesNo,DATE_FORMAT(t?.sales_date,?) AS salesDate,t?.member_erp_id AS memberId,t?.employee_erp_id AS employeeErpId,t?.employee_name AS employeeName,t?.assist_employee_erp_id AS assistEmployeeErpId,t?.assist_employee_name AS assistEmployeeName,t?.dept_erp_id AS deptErpId,t?.amount,t?.post_time AS postTime FROM erp_sales t? WHERE t?.employee_erp_id=? AND t?.post_time>=? AND t?.post_time<=? AND t?.sales_status=? AND NOT EXISTS (SELECT ? FROM erp_sales_relate esr WHERE t?.tenant_id=esr.tenant_id AND t?.tenant_app_id=esr.tenant_app_id AND t?.sales_erp_id=esr.sales_erp_id AND esr.sales_status IN (?) AND esr.tenant_id=? AND esr.tenant_app_id=?) AND EXISTS (SELECT ? FROM erp_sales_detail esd WHERE t?.tenant_id=esd.tenant_id AND t?.tenant_app_id=esd.tenant_app_id AND t?.sales_erp_id=esd.sales_erp_id AND esd.sales_type IN (?) AND esd.tenant_id=? AND esd.tenant_app_id=?) AND t?.tenant_id=? AND t?.tenant_app_id=?|41|55|2||0|0|174729|11639|123|8|
|user_service|SELECT count(?) 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=?|40|502|27||0|0|2824864|102349|40|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 ?|38|79|4||0|0|15482126|407516|41|3|
|user_service|SELECT count(?) FROM (SELECT count(?) 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 ? AND us.shop_id IS NOT ?)table_count|33|45|2||0|0|62320|2247|33|1|
|v4_employee|SELECT count(?) AS total_count,count(finish_time) AS finish_count FROM task_task t JOIN task_system_task_template t? ON t.task_template_id=t?.id AND t?.status=? AND t?.tenant_id=? AND t?.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=?|30|69|6||0|0|501104|48607|30|1|
|corpwx|UPDATE external_user SET un_assign_flag=? WHERE (tenant_id=? AND status=? AND un_assign_flag=?)|29|135|20||0|0|673848|77310|0|0|
|v4_sales|SELECT es.id salesId,es.sales_no,es.sales_date,es.member_erp_id memberId,w.warranty_no FROM v4_sales.erp_sales es LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE is_sales=? AND sales_status=? AND (es.sales_no LIKE concat(?,?) OR es.member_erp_id=?) AND w.id IS ? AND es.tenant_id=? AND es.tenant_app_id=? ORDER BY es.sales_date DESC,es.id DESC LIMIT ?|23|57|5||0|0|7792390|665850|24|2|
|user_service|SELECT t?.id,t?.user_id AS userId,t?.user_name AS userName,t?.sex,t?.mobile_no AS mobileNo,t?.head_img_url AS headImg FROM user_service.tenant_member t? JOIN user_service.tenant_member_info t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id AND t?.tenant_app_id=? AND t?.shop_id=? JOIN user_service.user_employee ue ON t?.tenant_id=ue.tenant_id AND t?.tenant_app_id=ue.tenant_wechatapp_id AND t?.user_id=ue.user_id AND ue.employee_id=? AND ue.shop_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=? ORDER BY ue.update_time DESC,t?.id DESC LIMIT ?|21|76|15||0|0|776955|159441|210|10|
|v4_user|SELECT id,member_id,external_user_id,serial_number,checkin_shop_id,checkin_employee_id,checkin_employee_name,checkin_time,maintain_shop_id,maintain_employee_id,maintain_employee_name,first_maintain_time,last_maintain_time,next_maintain_time,maintain_num,intention_num,latest_intention,status,finish_time,finish_shop_id,deal_employee_id,deal_employee_name,deal_sale_amount,fail_employee_id,fail_employee_name,fail_reason,remark,sex,cutomer_grade,maintain_level,tenant_id,tenant_app_id,create_time,update_time FROM potential_customer WHERE ((member_id=? OR external_user_id=?) AND status IN (?) AND maintain_shop_id=?) AND tenant_id=? AND tenant_app_id=?|20|28|2||0|0|51506|2581|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=?|19|32|2||0|0|201415|10813|0|0|
|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=?|19|61|6||0|0|449154|41656|19|1|
|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 ?|19|50|5||0|0|694546|54281|19|1|
|warranty_service|SELECT count(*) FROM warranty WHERE user_id=? AND tenant_wechatapp_id=? AND is_disable=?|18|98|12||0|0|209449|33208|18|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 ?,?,?) 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 ? AND p.product_status=? ORDER BY i.volume DESC ,p.tag_price ASC ,p.id DESC LIMIT ?,?|16|18|1||0|0|144002|9092|96|6|
|employee|SELECT count(*) FROM label_task_employee t? JOIN label_task_setting t? ON t?.label_task_id=t?.id AND t?.disabled=? WHERE t?.tenant_app_id=? AND t?.shop_id=? AND t?.visit_status>? AND t?.finish_time>=DATE_SUB(CURRENT_DATE,INTERVAL ? day) AND t?.finish_time<CURRENT_DATE|16|30|2||0|0|541138|57972|16|1|
|user_service|SELECT count(?) 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=?)|16|27|3||0|0|1842595|485307|16|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 ?,?,?) 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 ? AND p.product_status=? ORDER BY p.tag_price ASC ,p.id DESC LIMIT ?,?|16|18|1||0|0|143636|9104|96|6|
|gift_mail|SELECT count(?) 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 ?,?,?) 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 ? AND p.product_status=? ORDER BY i.volume DESC ,p.tag_price ASC ,p.id DESC)tmp_count|16|18|1||0|0|125024|7814|16|1|
|tenant|SELECT count(?) FROM (SELECT es.id,es.sales_no,es.sales_date,es.sales_erp_id,es.amount,ifnull(shop.shop_name,ed.dept_name)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|13|19|3||0|0|25989102|3856436|13|1|
|user_service|SELECT count(?) FROM user_service.tenant_member t? JOIN user_service.tenant_member_info t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id AND t?.tenant_app_id=? AND t?.shop_id=? JOIN user_service.user_employee ue ON t?.tenant_id=ue.tenant_id AND t?.tenant_app_id=ue.tenant_wechatapp_id AND t?.user_id=ue.user_id AND ue.employee_id=? AND ue.shop_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND (t?.mobile_no LIKE concat(?,?) OR t?.user_name LIKE concat(?,?,?))|12|16|1||0|0|48122|8348|12|1|
|user_service|SELECT count(?) FROM user_service.tenant_member t? JOIN user_service.tenant_member_info t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id AND t?.tenant_app_id=? AND t?.shop_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=?|11|16|3||0|0|676952|140354|11|1|
|v4_employee|SELECT count(*) AS total_count,count(finish_time) AS finish_count FROM task_task t JOIN task_invite_task_template t? ON t.task_template_id=t?.id AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t?.invite_time<? AND t.end_time>? AND t?.status IN (?) AND t.task_type=? AND t.status=? AND t.shop_id=? AND t.tenant_id=? AND t.tenant_app_id=?|11|26|5||0|0|603944|110187|11|1|
|v4_user|SELECT maintain_employee_id,id FROM potential_customer WHERE (maintain_shop_id=? AND status IN (?)) AND tenant_id=? AND tenant_app_id=?|11|15|1||0|0|23415|2579|4538|1270|
|v4_sales|SELECT es.id salesId,es.sales_no,es.sales_date,es.member_erp_id memberId,w.warranty_no FROM v4_sales.erp_sales es LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE is_sales=? AND sales_status=? AND (es.sales_no LIKE concat(?,?) OR es.member_erp_id=?) AND w.id IS NOT ? AND es.tenant_id=? AND es.tenant_app_id=? ORDER BY es.sales_date DESC,es.id DESC LIMIT ?|10|33|7||0|0|4887722|665935|22|6|
|v4_user|SELECT id,member_name,mobile_no,head_img_url,combine_status,combine_id FROM member WHERE ((mobile_no LIKE ? OR member_name LIKE ?)) AND tenant_id=? AND tenant_app_id=? LIMIT ?|10|24|4||0|0|2325788|334516|7|1|
|user_service|SELECT count(?) 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 t? ON tm.user_id=t?.user_id AND tm.tenant_id=t?.tenant_id AND tm.tenant_app_id=t?.tenant_wechatapp_id WHERE t?.id IS ? AND tmi.shop_id=? AND tmi.tenant_id=? AND tmi.tenant_app_id=?|10|20|2||0|0|106836|24561|10|1|
|v4_sales|SELECT * FROM v4_sales.comment WHERE order_id=? AND tenant_id=? AND tenant_app_id=? LIMIT ?|10|12|1||0|0|218172|26637|1|1|
|v4_user|SELECT id FROM member_points_detail WHERE (member_points_id=? AND oper_biz_id=? AND oper_biz_type=? AND status=?) AND tenant_id=? AND tenant_app_id=? LIMIT ?|9|12|1||0|0|51853|6289|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 ? OR sg.fail_type=?) AND sgm.create_time BETWEEN ? AND ?)t JOIN tenant.employee e ON e.id=t.employee_id|9|58|8||0|0|344971|52691|39|6|
|activity_service|SELECT *FROM activity_service.sign_in_activity_log WHERE user_id=? AND sign_in_id=? LIMIT ?|8|11|2||0|0|319422|39935|0|0|
|coupon_service|SELECT * FROM coupon_service.coupon_can_give WHERE coupon_id=? LIMIT ?|7|10|2||0|0|2416244|351505|7|1|
|v4_sales|SELECT id,sales_erp_id,sales_no,sales_date,member_erp_id,employee_erp_id,employee_name,assist_employee_erp_id,assist_employee_name,dept_erp_id,amount,sales_remark,receipts,sales_status,is_sales,busi_date,erp_create_time,recommend_id,post_time,should_comment,tenant_id,tenant_app_id,create_time,update_time FROM erp_sales WHERE (sales_no=?) AND tenant_id=? AND tenant_app_id=?|6|29|7||0|0|864078|425394|6|1|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE is_sales=? AND sales_status=? AND (es.sales_no LIKE concat(?,?) OR es.member_erp_id=?) AND w.id IS NOT ? AND es.tenant_id=? AND es.tenant_app_id=?|6|25|7||0|0|972472|412845|6|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 ?,?,?) 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 ? AND p.product_status=? ORDER BY p.tag_price DESC ,p.id DESC LIMIT ?,?|6|8|1||0|0|53766|9002|36|6|
|v4_employee|SELECT ? AS task_type,t?.id AS invite_task_id,t?.name,ifnull(t?.undo_count,?) AS undo_count,t?.invite_time AS invite_task_start_time,ifnull(t?.interrupt_time,t?.end_time) AS invite_task_end_time FROM task_invite_task_template t? LEFT JOIN (SELECT t.task_template_id AS id,sum(if(t.finish_time IS ?,?,?)) 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)t? ON t?.id=t?.id WHERE t?.status IN (?) AND t?.tenant_id=? AND t?.tenant_app_id=? ORDER BY t?.id DESC|6|6|1||0|0|7902|1656|48|8|
|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=?)|6|7|1||0|0|16539|2757|6|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_name LIKE concat(?,?,?) OR tm.mobile_no=?)|6|11|2||0|0|909128|316027|6|1|
|tenant|SELECT count(*)amount FROM sneak_guest WHERE tenant_app_id=? AND status=? AND create_shop_id=? AND create_time<=?|5|7|2||0|0|19748|4100|5|1|
|value_added|SELECT ? AS limitDayType,t.tenant_wechatapp_id AS tenantAppId,t.user_id AS userId,min(ue.employee_erp_id)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(?,?),interval ?*(t.add_days?)day) AND t.start_add_time<date_add(DATE_FORMAT(?,?),interval(?*(t.add_days?)+?)day) GROUP BY t.tenant_wechatapp_id,t.user_id,ue.dept_erp_id|5|10|4||0|0|1390338|480684|251|122|
|v4_coupon|UPDATE v4_coupon.coupon SET coupon_status=? WHERE tenant_id=? AND tenant_app_id=? AND coupon_status=? AND end_time<now()|5|8|2||0|0|3815724|1263430|0|0|
|v4_user|SELECT checkin_time,id FROM potential_customer WHERE (maintain_shop_id=? AND status IN (?)) AND tenant_id=? AND tenant_app_id=?|5|7|1||0|0|11720|2575|2653|1270|
|user_service|SELECT * FROM user_service.user_employee WHERE employee_erp_id=? AND tenant_id=? AND tenant_wechatapp_id=? AND date_format(update_time,?)=date_format(now(),?)|5|112|35||0|0|1001723|316283|63|41|
|employee|UPDATE backlog_system SET status=?,finish_time=now() WHERE tenant_app_id=? AND scene=?|5|44|23||0|0|3204664|1473255|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|5|7|2||0|0|39496|8200|19748|4100|
|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=?)|4|7|3||0|0|8660|2676|8660|2676|
|authorization_service|UPDATE user_login_token SET status=? WHERE login_token IN|4|21|9||0|0|8660|2676|0|0|
|warranty_service|SELECT count(?) FROM warranty WHERE user_id=? AND tenant_wechatapp_id=? AND is_disable=?|4|5|1||0|0|7700|1925|4|1|
|tenant|SELECT sg.tenant_app_id AS tenantAppId,sg.create_shop_id AS shopId,sg.maintain_employee_id AS employeeId,emp.corp_wx_user_id AS corpwxUserId,count(*) AS waitMaintainNum FROM tenant.sneak_guest sg JOIN tenant.employee emp ON sg.maintain_employee_id=emp.id WHERE sg.tenant_app_id=? AND sg.status=? AND sg.next_maintain_date>=CURRENT_DATE AND sg.next_maintain_date<DATE_ADD(CURRENT_DATE,INTERVAL ? day) GROUP BY sg.tenant_app_id,sg.create_shop_id,sg.maintain_employee_id,emp.corp_wx_user_id|3|7|5||0|0|139934|103050|51|36|
|v4_sales|SELECT COUNT(*) AS total FROM comment WHERE (order_id=? AND member_id=?) AND tenant_id=? AND tenant_app_id=?|3|3|1||0|0|55927|18672|3|1|
|employee|SELECT id,scene,employee_id,member_user_name 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 ?|3|17|6||0|0|1619301|539767|10|4|
|v4_sales|SELECT id,value_added_id,change_amount,balance,tenant_id,tenant_app_id,create_time,update_time FROM value_added_record WHERE (value_added_id=?) AND tenant_id=? AND tenant_app_id=? ORDER BY create_time DESC LIMIT ?|3|9|6||0|0|8368610|2789538|5|3|
|v4_user|SELECT id,checkin_employee_name,maintain_employee_name FROM potential_customer WHERE ((member_id=?) AND status IN (?)) AND tenant_id=? AND tenant_app_id=? ORDER BY id ASC|3|11|6||0|0|19260|8346|3|1|
|v4_user|SELECT COUNT(*) AS total FROM potential_customer t? WHERE t?.maintain_shop_id=? AND t?.maintain_employee_id=? AND t?.status IN (?) AND t?.tenant_id=? AND t?.tenant_app_id=?|3|4|2||0|0|4333|1786|3|1|
|tenant|SELECT count(?) 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|4|1||0|0|10440|3480|3|1|
|v4_coupon|SELECT COUNT(*) AS total FROM (SELECT DISTINCT c.id,c.activity_name,c.push_time,c.tag_id,c.butler_call_member FROM v4_coupon.tag_push_coupon c JOIN v4_coupon.tag_push_coupon_log l ON l.tag_push_coupon_id=c.id AND l.push_coupon_state=? AND l.tenant_id=? AND l.tenant_app_id=? WHERE c.push_state=? AND c.butler_visible=? AND l.shop_id=? AND l.employee_id=? AND c.push_time>=? AND c.tenant_id=? AND c.tenant_app_id=? ORDER BY c.push_time DESC)c|3|6|2||0|0|1459077|486536|3|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=?|3|9|4||0|0|65630|43138|3|1|
|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 FROM task_task WHERE task_type=? AND status!=? AND shop_id=? AND system_task_type=? AND end_time>? AND end_time<=? AND tenant_id=? AND tenant_app_id=?|3|6|2||0|0|17779|6304|3|1|
|v4_sales|SELECT COUNT(*) AS total FROM value_added_record WHERE (value_added_id=?) AND tenant_id=? AND tenant_app_id=?|3|35|17||0|0|8368605|2789535|3|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(?)|2|2|1||0|0|2023|1058|2|1|
|user_service|SELECT t?.id,t?.user_id AS userId,t?.user_name AS userName,t?.sex,t?.mobile_no AS mobileNo,t?.head_img_url AS headImg FROM user_service.tenant_member t? JOIN user_service.tenant_member_info t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id AND t?.tenant_app_id=? AND t?.shop_id=? JOIN user_service.user_employee ue ON t?.tenant_id=ue.tenant_id AND t?.tenant_app_id=ue.tenant_wechatapp_id AND t?.user_id=ue.user_id AND ue.employee_id=? AND ue.shop_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=? ORDER BY ue.update_time DESC,t?.id DESC LIMIT ?,?|2|2|1||0|0|40100|27588|20|10|
|tenant|SELECT es.id,es.sales_no,es.sales_date,es.sales_erp_id,es.amount,ifnull(shop.shop_name,ed.dept_name)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 ?,?|2|2|1||0|0|5513492|2756776|20|10|
|v4_user|SELECT t?.id AS memberId,t?.id AS potentialCustomerId,t?.checkin_time AS checkinTime FROM potential_customer t? JOIN member t? ON t?.id=t?.member_id AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t?.maintain_shop_id=? AND t?.maintain_employee_id=? AND t?.`status` IN (?) AND t?.tenant_id=? AND t?.tenant_app_id=? UNION SELECT t?.id AS memberId,t?.id AS potentialCustomerId,t?.checkin_time AS checkinTime FROM potential_customer t? JOIN member t? ON t?.external_user_id=t?.external_user_id AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t?.maintain_shop_id=? AND t?.maintain_employee_id=? AND t?.`status` IN (?) AND t?.member_id=? AND t?.tenant_id=? AND t?.tenant_app_id=?|2|3|2||0|0|5378|3844|142|136|
|v4_coupon|SELECT tenant_id,tenant_app_id,member_id,count(?)total FROM v4_coupon.coupon WHERE DATEDIFF(DATE_FORMAT(end_time,?),DATE_FORMAT(now(),?))=? AND coupon_status IN (?) GROUP BY tenant_id,tenant_app_id,member_id|2|29|17||0|0|2530595|1266558|580|292|
|v4_sales|SELECT count(s.sales_erp_id) FROM (SELECT es.tenant_id,es.tenant_app_id,es.sales_erp_id,esd.product_barcode,max(esd.category_erp_id)category_erp_id,max(es.sales_date)sales_date 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 es.tenant_id,es.tenant_app_id,es.sales_erp_id,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=? 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=? 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 if(ifnull(vat.effective_date,?)!=?,s.sales_date>vat.effective_date,?=?) AND va.id IS ? AND i.id IS ?|2|2|1||0|0|31403|16188|2|1|
|tenant|SELECT count(*) FROM sneak_guest WHERE (tenant_app_id=? AND status=? AND create_shop_id=? AND maintain_employee_id=?)|2|2|1||0|0|4258|2230|2|1|
|coupon_service|SELECT cet.id,cet.coupon_id,cet.user_id,cet.coupon_type,cet.expire_time,if((cet.expire_time<now() AND cet.status=?),?,cet.status) AS status FROM coupon_service.coupon_expire_task cet JOIN coupon_service.coupon_extend ce ON ce.tenant_id=? AND ce.tenant_app_id=? AND ce.coupon_id=cet.coupon_id WHERE cet.tenant_id=? AND cet.tenant_app_id=? AND cet.employee_id=? AND cet.shop_id=?|2|2|1||0|0|3278|1776|1639|888|
|v4_user|SELECT td?.added,td?.dealed,td?.failed,td?.maintain FROM (SELECT count(DISTINCT CASE WHEN t.event_type=? THEN t.potential_customer_id ELSE ? END) AS dealed,count(DISTINCT CASE WHEN t.event_type=? THEN t.potential_customer_id ELSE ? END) AS failed FROM potential_customer_maintain t WHERE t.create_time>=? AND t.create_time<=? AND t.event_type IN (?) AND t.tenant_app_id=?)td?,(SELECT count(DISTINCT t?.potential_customer_id) AS added FROM potential_customer_maintain t? LEFT JOIN potential_customer_maintain t? ON t?.potential_customer_id=t?.potential_customer_id AND t?.create_time>=? AND t?.create_time<=? AND t?.event_type IN (?) AND t?.tenant_app_id=? WHERE t?.create_time>=? AND t?.create_time<=? AND t?.event_type=? AND t?.id IS ? AND t?.tenant_app_id=?)td?,(SELECT count(DISTINCT t?.potential_customer_id) AS maintain FROM potential_customer_maintain t? LEFT JOIN potential_customer_maintain t? ON t?.potential_customer_id=t?.potential_customer_id AND t?.create_time>=? AND t?.create_time<=? AND t?.event_type IN (?) AND t?.tenant_app_id=? WHERE t?.create_time>=? AND t?.create_time<=? AND t?.event_type=? AND t?.id IS ? AND t?.tenant_app_id=?)td?|2|3|2||0|0|54950|44848|2|1|
|authorization_service|SELECT id,tenant_id,account_id,type,login_name,hash_password,salt,user_id,employee_id,tenant_app_id,status,create_time,update_time FROM login_account WHERE (type=? AND login_name=?)|2|2|1||0|0|132558|66279|2|1|
|v4_user|SELECT count(DISTINCT t?.potential_customer_id) FROM potential_customer_maintain t? WHERE t?.maintain_shop_id=? AND t?.event_type IN (?) AND t?.create_time>=? AND t?.create_time<? AND t?.tenant_id=? AND t?.tenant_app_id=?|2|3|2||0|0|9954|5747|2|1|
|check_stock|COMMIT ?|2|3|1||0|0|0|0|0|0|
|gift_mail|SELECT count(?) FROM (SELECT t.*,tt.can_take_date,tt.shop_id,tt.shop_name,tt.take_shop_name,tt.take_employee_name,ta.recipients,ta.user_tel,CONCAT(ta.area,ta.address)address,if(t.trade_type=? OR t.trade_type=?,pl.id,it.barcode) AS barcode,if(t.trade_type=? OR t.trade_type=?,pl.default_image_url,p.default_image_url) AS defaultImageUrl FROM trade t LEFT OUTER JOIN trade_take tt ON t.tenant_wechatapp_id=tt.tenant_wechatapp_id AND t.id=tt.trade_id LEFT OUTER JOIN trade_addr ta ON t.tenant_wechatapp_id=ta.tenant_wechatapp_id AND t.id=ta.trade_id LEFT OUTER JOIN product p ON p.id=t.product_id LEFT OUTER JOIN platform_product pl ON pl.id=t.product_id LEFT OUTER JOIN inventory it ON it.product_id=t.product_id AND it.specification=t.specification LEFT OUTER JOIN trade_express te ON te.tenant_wechatapp_id=t.tenant_wechatapp_id AND te.trade_id=t.id WHERE (t.tenant_wechatapp_id=? AND t.trade_type=?) ORDER BY create_time DESC)tmp_count|2|4|2||0|0|124371|95872|2|1|
|user_service|SELECT tm.tenant_id,tm.tenant_app_id,tm.user_id,tm.mobile_no,tm.sex,tm.user_name,tm.head_img_url,tmi.birthday,tmi.birthday_is_lunar,tmi.shop_id,tmi.memorial_day_is_lunar,tmi.memorial_day,tmi.memorial_name,tmi.interest,tmi.address 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=?) ORDER BY tm.id LIMIT ?|2|3|1||0|0|660353|330188|2|1|
|v4_sales|SELECT sum(amount_total) FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id=es.sales_erp_id AND esd.tenant_id=? AND esd.tenant_app_id=? WHERE es.member_erp_id IN (?) AND es.sales_status=? AND es.is_sales=? AND esd.sales_type IN (?) AND es.tenant_id=? AND es.tenant_app_id=?|2|3|2||0|0|82010|41033|2|1|
|v4_employee|SELECT ? AS task_type,t?.type AS system_task_type,t.task_template_id,count(?) AS total_count,count(finish_time) AS finish_count FROM task_task t JOIN task_system_task_template t? ON t.task_template_id=t?.id AND t?.status=? AND t?.tenant_id=? AND t?.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=? GROUP BY t.task_template_id,t?.type|2|6|5||0|0|43052|35186|8|4|
|user_service|SELECT * FROM user_employee WHERE tenant_wechatapp_id=? AND employee_id=?|2|2|1||0|0|116643|113883|9394|6634|
|tenant|SELECT es.id,es.sales_no,es.sales_date,es.sales_erp_id,es.amount,ifnull(shop.shop_name,ed.dept_name)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 ?|2|2|1||0|0|7273230|3855638|20|10|
|v4_user|SELECT t?.maintain_shop_id,t?.maintain_employee_id,t?.maintain_level,count(*) AS maintainNum FROM potential_customer t? WHERE t?.tenant_app_id=? AND t?.`status` IN (?) AND t?.next_maintain_time>=? AND t?.tenant_id=? AND t?.tenant_app_id=? GROUP BY t?.maintain_shop_id,t?.maintain_employee_id,t?.maintain_level|2|6|4||0|0|18546|9893|531|362|
|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 ?|2|4|2||0|0|35536|27392|17767|13696|
|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|14|9||0|0|2222769|1111411|0|0|
|gift_mail|SELECT count(?) 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 ? OR p.is_disable=?) AND (ps.tenant_wechatapp_id=? OR p.product_type=?)) AS p WHERE (p.topping=?)|2|2|1||0|0|37216|18608|2|1|
|v4_user|SELECT td?.shop_id AS shopId,ifnull(td?.added,?) AS added,ifnull(td?.dealed,?) AS dealed,ifnull(td?.failed,?) AS failed,ifnull(td?.maintain,?) AS maintain FROM (SELECT DISTINCT t.maintain_shop_id AS shop_id FROM potential_customer_maintain t WHERE t.create_time>=? AND t.create_time<=? AND t.event_type IN (?) AND t.tenant_app_id=?)td? LEFT JOIN (SELECT t.maintain_shop_id AS shop_id,count(DISTINCT CASE WHEN t.event_type=? THEN t.potential_customer_id ELSE ? END) AS dealed,count(DISTINCT CASE WHEN t.event_type=? THEN t.potential_customer_id ELSE ? END) AS failed FROM potential_customer_maintain t WHERE t.create_time>=? AND t.create_time<=? AND t.event_type IN (?) AND t.tenant_app_id=? GROUP BY t.maintain_shop_id)td? ON td?.shop_id=td?.shop_id LEFT JOIN (SELECT t?.maintain_shop_id AS shop_id,count(DISTINCT t?.potential_customer_id) AS added FROM potential_customer_maintain t? LEFT JOIN potential_customer_maintain t? ON t?.potential_customer_id=t?.potential_customer_id AND t?.create_time>=? AND t?.create_time<=? AND t?.event_type IN (?) AND t?.tenant_app_id=? WHERE t?.create_time>=? AND t?.create_time<=? AND t?.event_type=? AND t?.id IS ? AND t?.tenant_app_id=? GROUP BY t?.maintain_shop_id)td? ON td?.shop_id=td?.shop_id LEFT JOIN (SELECT t?.maintain_shop_id AS shop_id,count(DISTINCT t?.potential_customer_id) AS maintain FROM potential_customer_maintain t? LEFT JOIN potential_customer_maintain t? ON t?.potential_customer_id=t?.potential_customer_id AND t?.create_time>=? AND t?.create_time<=? AND t?.event_type IN (?) AND t?.tenant_app_id=? WHERE t?.create_time>=? AND t?.create_time<=? AND t?.event_type=? AND t?.id IS ? AND t?.tenant_app_id=? GROUP BY t?.maintain_shop_id)td? ON td?.shop_id=td?.shop_id|2|3|2||0|0|75558|61847|16|8|
|gift_mail|SELECT count(*) FROM gift_mail.trade t WHERE t.tenant_wechatapp_id=? AND t.trade_type=? AND t.order_status=?|2|3|1||0|0|18737|9369|2|1|
|tenant|SELECT count(?) 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=? AND es.is_sales=?|1|1|1||0|0|1589|1589|1|1|
|user_service|SELECT count(?) FROM user_service.tenant_member t? JOIN user_service.tenant_member_info t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id AND t?.tenant_app_id=? AND t?.shop_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND (t?.mobile_no LIKE concat(?,?) OR t?.user_name LIKE concat(?,?,?))|1|1|1||0|0|542752|542752|1|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=?|1|1|1||0|0|1272|1272|0|0|
|v4_giftmall|SELECT count(*) FROM v4_giftmall.trade t LEFT JOIN v4_giftmall.trade_take tt ON tt.trade_id=t.id AND tt.tenant_id=? AND tt.tenant_app_id=? WHERE t.trade_type=? AND t.order_status=? AND t.take_type=? AND tt.shop_id=? AND t.tenant_id=? AND t.tenant_app_id=?|1|1|1||0|0|8300|8300|1|1|
|coupon_service|SELECT t.id FROM coupon_service.template t LEFT JOIN coupon_service.coupon_scope s ON s.tenant_id=t.tenant_id AND s.tenant_app_id=t.tenant_app_id AND s.template_id=t.id WHERE t.coupon_type=? AND t.tenant_id=? AND t.tenant_app_id=? AND (t.scope=? OR (s.scope=? AND s.product_id=?) OR (s.scope=? AND s.classify_id=?))|1|1|1||0|0|22364|22364|0|0|
|v4_sales|SELECT t?.sales_erp_id AS salesErpId,t?.sales_no AS salesNo,DATE_FORMAT(t?.sales_date,?) AS salesDate,t?.member_erp_id AS memberId,t?.employee_erp_id AS employeeErpId,t?.employee_name AS employeeName,t?.assist_employee_erp_id AS assistEmployeeErpId,t?.assist_employee_name AS assistEmployeeName,t?.dept_erp_id AS deptErpId,t?.amount,t?.post_time AS postTime FROM erp_sales t? WHERE t?.dept_erp_id=? AND t?.member_erp_id IN (?) AND t?.post_time>=? AND t?.sales_status=? AND NOT EXISTS (SELECT ? FROM erp_sales_relate esr WHERE t?.tenant_id=esr.tenant_id AND t?.tenant_app_id=esr.tenant_app_id AND t?.sales_erp_id=esr.sales_erp_id AND esr.sales_status IN (?) AND esr.tenant_id=? AND esr.tenant_app_id=?) AND EXISTS (SELECT ? FROM erp_sales_detail esd WHERE t?.tenant_id=esd.tenant_id AND t?.tenant_app_id=esd.tenant_app_id AND t?.sales_erp_id=esd.sales_erp_id AND esd.sales_type IN (?) AND esd.tenant_id=? AND esd.tenant_app_id=?) AND t?.tenant_id=? AND t?.tenant_app_id=?|1|1|1||0|0|978|978|174|174|
|erp_app|INSERT INTO app_status(id,tenant_id,app_name,version,pid) VALUES (?,?,?,?,?) ON DUPLICATE key UPDATE version=?,pid=?,online_status_time=?|1|1|1||0|0|0|0|0|0|
|order|SELECT count(?)total,ifnull(sum(if(od.status>?,od.payment_fee,?)),?)paymentFee,ifnull(sum(if(od.status>?,od.offline_payment_fee,?)),?)offlinePaymentFee,ifnull(sum(if(od.status>?,od.payment_fee+od.offline_payment_fee,?)),?)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=?|1|3|3||0|0|188952|188952|1|1|
|v4_sales|SELECT count(*) FROM v4_sales.erp_sales WHERE employee_erp_id=? AND sales_status=? AND is_sales=? AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|4502|4502|1|1|
|mysql|DELETE FROM wx_gateway.wx_template_msg WHERE create_time<DATE_SUB(now(),interval ? day)|1|16|16||0|0|784571|784571|0|0|
|user_service|SELECT count(?) FROM user_service.user_source us LEFT JOIN user_service.tenant_member m ON m.user_id=us.user_id LEFT JOIN user_service.user_employee ue ON ue.user_id=m.user_id WHERE m.tenant_id=? AND m.tenant_app_id=? AND us.tenant_id=? AND us.tenant_wechatapp_id=? AND ue.tenant_id=? AND ue.tenant_wechatapp_id=? AND us.shop_id=? AND us.from_id=? AND us.create_time>=? AND us.create_time<? AND us.source_type=? AND us.from_id IS NOT ? AND us.shop_id IS NOT ?|1|1|1||0|0|2016|2016|1|1|
|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|9|9||0|0|2137988|2137988|525|525|
|coupon_service|SELECT * FROM coupon_service.coupon WHERE DATEDIFF(DATE_FORMAT(end_time,?),DATE_FORMAT(now(),?))=? AND coupon_state IN(?)|1|126|126||0|0|12189209|12189209|1485|1485|
|v4_employee|SELECT count(?) AS total_count,count(finish_time) AS finish_count FROM task_task t JOIN task_system_task_template t? ON t.task_template_id=t?.id AND t?.status=? AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t.task_type=? AND t.status=? AND t.start_time>=? AND t.start_time<? AND t.shop_id=? AND t.employee_id=? AND t.tenant_id=? AND t.tenant_app_id=?|1|1|1||0|0|2173|2173|1|1|
|erp_sync|SELECT * FROM erp_sync.retry_data WHERE (need_erp_member_id=? OR (need_erp_member_id=? AND erp_member_id IS NOT ?)) AND retry_times>? ORDER BY id|1|1|1||0|0|6088|6088|3391|3391|
||DELETE FROM v4_user.sjfx_dct_member_grade WHERE create_time<?|1|1|1||0|0|239377|239377|0|0|
|value_added|SELECT ID,tenant_wechatapp_id AS tenantWechatappId,user_id AS userId,template_id AS templateId,sales_erp_id AS saleserpid,product_name AS productName,shop_name AS shopName,product_barcode AS productBarcode,amount_total AS amountTotal,amount_pay AS amountPay,amount_added AS amountAdded,state AS state,add_days,added_percent_per_day AS addedPercentPerDay,devalue_percent_per_day AS devaluePercentPerDay,keeping_days AS keepingDays,exchange_days AS exchangeDays,coupon_user_id AS couponUserId,sales_index AS salesIndex,start_add_time AS createtime,DATE_ADD(start_add_time,INTERVAL add_days? DAY),DATE_ADD(start_add_time,INTERVAL add_days+keeping_days? DAY) FROM value_added_user WHERE keeping_days>? AND state=? AND start_add_time=date_add(CURDATE(),interval ?*(add_days?)day)|1|17|17||0|0|2137988|2137988|596|596|
|order|SELECT count(?) 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=?|1|3|3||0|0|188952|188952|1|1|
|v4_employee|SELECT COUNT(*) AS total FROM task_task t JOIN employee e ON e.employee_id=t.employee_id AND e.shop_id=t.shop_id AND e.tenant_id=? AND e.tenant_app_id=? LEFT JOIN (SELECT task_id,GROUP_CONCAT(file_url SEPARATOR ?) AS task_attaches FROM task_task_attach WHERE tenant_id=? AND tenant_app_id=? GROUP BY task_id)tta ON t.id=tta.task_id WHERE t.status=? AND system_task_type=? AND t.shop_id=? AND finish_time>=? AND finish_time<? AND t.employee_id=? AND t.tenant_id=? AND t.tenant_app_id=?|1|1|1||0|0|9380|9380|1|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(?)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 ? AND us.shop_id IS NOT ? GROUP BY us.from_id ORDER BY count(?) DESC) AS obj,(SELECT @rownum:=?,@rowtotal:=?)r|1|1|1||0|0|2413|2413|2|2|
|mysql|DELETE FROM message_push.message_log WHERE create_time<DATE_SUB(now(),interval ? day)|1|34|34||0|0|2531446|2531446|0|0|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail WHERE create_time<?|1|2|2||0|0|278117|278117|0|0|
|v4_sales|SELECT id,sales_id,status,tenant_id,tenant_app_id,create_time,update_time FROM comment_not_remind_sales WHERE (status=?)|1|1|1||0|0|137258|137258|606|606|
|order|SELECT od.id,od.order_no orderNo,od.status,od.take_type takeType,od.create_time createTime,od.remark,od.total_fee totalFee,od.freight_fee freightFee,od.discount_fee discountFee,od.take_id takeId,od.payment_fee paymentFee,dt.product_id productId,dt.price,dt.quantity,dt.sku_id skuId,dt.art_no artNo,dt.image_url imageUrl,dt.product_name productName,dt.take_remark takeRemark,dt.take_day takeDay,od.product_fee productFee,od.finish_type finishType,od.send_time sendTime,od.receive_time receiveTime,od.finish_time finishTime,od.child_status childStatus,od.send_good_remark sendGoodRemark,od.service_flag serviceFlag,od.coupon_id couponId,od.tenant_wechatapp_id tenantAppId,od.tenant_id tenantId,od.pay_id payId,od.user_id userId,od.user_name userName,od.mobile_no 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|1|1||0|0|267522|267522|18|18|
|account|SELECT id,tenant_id,tenant_app_id,account_type,owner_type,owner_id,balance,cumulation,status FROM account WHERE owner_type=? AND balance<? AND account_type=?|1|1|1||0|0|693|693|217|217|
|tenant|SELECT count(*)amount FROM sneak_guest WHERE tenant_app_id=? AND status=? AND create_shop_id=? AND maintain_employee_id=? AND create_time>=? AND create_time<=?|1|1|1||0|0|2230|2230|1|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(?)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 ? AND us.shop_id IS NOT ? GROUP BY us.from_id,us.shop_id ORDER BY count(?) DESC) AS obj,(SELECT @rownum:=?,@rowtotal:=?)r|1|1|1||0|0|2755|2755|116|116|
|employee|UPDATE backlog_? SET status=?,finish_time=now() WHERE tenant_app_id=? AND employee_id=? AND status IN (?) AND shop_id=?|1|1|1||0|0|4561|4561|0|0|
|authorization_service|SELECT ar.tenant_id,ar.tenant_app_id,a.employee_id,ar.shop_id,ar.role_code,ar.role_name,a.status AS account_status,ar.status AS role_status FROM authorization_service.account_role? ar JOIN authorization_service.account a ON ar.account_id=a.id WHERE ar.tenant_id=? AND ar.tenant_app_id=? AND ar.role_code IN (?)|1|1|1||0|0|66462|66462|1|1|
|value_added|UPDATE value_added_user SET amount_added=IF(?>(((added_percent_per_day/?)*IF(?>=TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days,TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?,add_days))-((devalue_percent_per_day/?)*IF(?>=TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days-keeping_days,?,TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days-keeping_days)))*amount_pay,?,(((added_percent_per_day/?)*IF(?>=TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days,TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?,add_days))-((devalue_percent_per_day/?)*IF(?>=TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days-keeping_days,?,TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),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|14|14||0|0|2137972|2137972|0|0|
|employee|UPDATE backlog_? SET leave_flag=? WHERE tenant_app_id=? AND employee_id=?|1|3|3||0|0|10758|10758|0|0|
|tenant|SELECT count(?) 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 EXISTS (SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id=sgm.sneak_guest_id AND sgm.event_type=? AND sgm.intention_info REGEXP ?) AND sg.status=?|1|1|1||0|0|601|601|1|1|
|value_added|SELECT ? AS limitDayType,t.tenant_wechatapp_id,t.user_id,min(ue.employee_erp_id)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(?,?),interval ?*(t.add_days+t.keeping_days?)day) AND t.start_add_time<date_add(DATE_FORMAT(?,?),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|480897|480897|73|73|
||DELETE FROM tenant.sjfx_dct_erp_sales WHERE create_time<?|1|1|1||0|0|105602|105602|0|0|
|tenant|SELECT t?.id,t?.sales_erp_id,t?.product_name,t?.product_barcode,t?.sales_type,t?.category_name,t?.gold_weight,t?.stone_weight,t?.total_weight,t?.remark,t?.amount_total AS amount_pay,t?.amount_total,t?.quantity,t?.sales_brand,t?.sales_craft,t?.sales_no,t?.sales_date,t?.employee_name,t?.sales_remark FROM erp_sales_detail t? LEFT JOIN erp_sales_detail_extend t? ON t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.sales_erp_id=t?.sales_erp_id AND t?.sales_index=t?.sales_index LEFT JOIN erp_sales t? ON t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.sales_erp_id=t?.sales_erp_id WHERE t?.tenant_id=? AND t?.tenant_wechatapp_id=? AND t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.member_erp_id=? AND t?.sales_status=? AND t?.is_sales=? ORDER BY t?.id DESC LIMIT ?|1|2|2||0|0|18067|18067|10|10|
|order|SELECT od.id,od.order_no orderNo,od.status,od.take_type takeType,od.create_time createTime,od.remark,od.total_fee totalFee,od.freight_fee freightFee,od.discount_fee discountFee,od.take_id takeId,od.payment_fee paymentFee,dt.product_id productId,dt.price,dt.quantity,dt.sku_id skuId,dt.art_no artNo,dt.image_url imageUrl,dt.product_name productName,dt.take_remark takeRemark,dt.take_day takeDay,od.product_fee productFee,ad.user_name receiveName,ad.mobile_no mobileNo,ad.shop_name shopName,ad.address,ad.express_no expressNo,ad.express_company expressCompany,od.finish_type finishType,od.send_time sendTime,od.receive_time receiveTime,od.finish_time finishTime,od.child_status childStatus,od.send_good_remark sendGoodRemark,od.service_flag serviceFlag,od.coupon_id couponId,od.tenant_wechatapp_id 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|1|1||0|0|267504|267504|0|0|
|sms|SELECT ifnull(sum(ifnull(t?.sms_size,?)*t?.send_count),?) AS amount FROM sms_send t? LEFT JOIN sms.sms_send_extend t? ON t?.biz_id=t?.biz_id WHERE t?.tenant_app_id=? AND t?.code=? AND t?.create_time>=? AND t?.create_time<?|1|5|5||0|0|17824|17824|1|1|
|v4_sales|SELECT COUNT(*) AS total FROM warranty WHERE (member_id IN (?) AND is_disable=?) AND tenant_id=? AND tenant_app_id=?|1|3|3||0|0|11115|11115|1|1|
|v4_user|SELECT id FROM potential_customer WHERE (status IN (?) AND next_maintain_time<?) AND tenant_id=? AND tenant_app_id=?|1|3|3||0|0|9169|9169|508|508|
|sjfx_etl|SELECT COUNT(*) AS total FROM etl_task|1|26|26||0|0|28538675|28538675|1|1|
|gift_mail|SELECT count(?) FROM (SELECT t.*,tt.can_take_date,tt.shop_id,tt.shop_name,tt.take_shop_name,tt.take_employee_name,ta.recipients,ta.user_tel,CONCAT(ta.area,ta.address)address,if(t.trade_type=? OR t.trade_type=?,pl.id,it.barcode) AS barcode,if(t.trade_type=? OR t.trade_type=?,pl.default_image_url,p.default_image_url) AS defaultImageUrl FROM trade t LEFT OUTER JOIN trade_take tt ON t.tenant_wechatapp_id=tt.tenant_wechatapp_id AND t.id=tt.trade_id LEFT OUTER JOIN trade_addr ta ON t.tenant_wechatapp_id=ta.tenant_wechatapp_id AND t.id=ta.trade_id LEFT OUTER JOIN product p ON p.id=t.product_id LEFT OUTER JOIN platform_product pl ON pl.id=t.product_id LEFT OUTER JOIN inventory it ON it.product_id=t.product_id AND it.specification=t.specification LEFT OUTER JOIN trade_express te ON te.tenant_wechatapp_id=t.tenant_wechatapp_id AND te.trade_id=t.id WHERE (t.mobile_no LIKE ? AND t.tenant_wechatapp_id=? AND t.trade_type=?) ORDER BY create_time DESC)tmp_count|1|2|2||0|0|13709|13709|1|1|
|tenant|SELECT count(?) FROM erp_sales_detail t? LEFT JOIN erp_sales_detail_extend t? ON t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.sales_erp_id=t?.sales_erp_id AND t?.sales_index=t?.sales_index LEFT JOIN erp_sales t? ON t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.sales_erp_id=t?.sales_erp_id WHERE t?.tenant_id=? AND t?.tenant_wechatapp_id=? AND t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.member_erp_id=? AND t?.sales_status=? AND t?.is_sales=?|1|4|4||0|0|13003|13003|1|1|
|v4_giftmall|SELECT * FROM v4_giftmall.trade WHERE trade_type=? AND order_status=? AND update_time<=DATE_SUB(NOW(),INTERVAL ? MINUTE)|1|1|1||0|0|18741|18741|0|0|
|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 task_template_id=? AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|1514|1514|1|1|
|tenant|SELECT * FROM tenant.erp_sales WHERE tenant_id=? AND tenant_wechatapp_id=? AND member_erp_id=? ORDER BY sales_date DESC,sales_erp_id DESC LIMIT ?|1|1|1||0|0|11695|11695|1|1|
||DELETE FROM v4_sales.sjfx_dct_erp_sales_extend? WHERE create_time<?|1|1|1||0|0|346250|346250|0|0|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE (coupon_status=? AND member_id=?) AND tenant_id=? AND tenant_app_id=?|1|4|4||0|0|11643|11643|1|1|
|gift_mail|SELECT count(?) 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,?)quantity,pt.partner_name vendorName,? distance,c.categroy_name categroy_name,pp.partner_id FROM product p INNER JOIN category c ON c.id=p.category_id LEFT OUTER JOIN self_product sp ON p.id=sp.product_id LEFT OUTER JOIN partner_product pp ON p.id=pp.product_id LEFT OUTER JOIN partner pt ON pt.id=pp.partner_id LEFT OUTER JOIN (SELECT product_id,sum(quantity)quantity FROM gift_mail.inventory GROUP BY product_id)t ON p.id=t.product_id WHERE ((p.is_disable IS ? OR p.is_disable=?))) AS p LEFT OUTER 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 ? OR p.tenant_wechatapp_id=?))|1|1|1||0|0|56433|56433|1|1|
|v4_user|SELECT count(*) FROM member_change_log t? WHERE t?.change_type IN (?) AND t?.change_time>=? AND t?.change_time<? AND t?.new_shop_id=? AND t?.tenant_id=? AND t?.tenant_app_id=?|1|1|1||0|0|48216|48216|1|1|
|tenant|SELECT id,tenant_id,tenant_app_id,user_id,status,group_label,maintain_level,remark,create_time,create_shop_id,create_employee_id,update_time,update_shop_id,update_employee_id,sales_amount,next_maintain_date,maintain_employee_id,sneak_guest_no,last_maintain_date,finish_date,fail_type,oid,user_type FROM sneak_guest WHERE (tenant_app_id=? AND status=? AND create_time<?)|1|1|1||0|0|5001|5001|5|5|
|tenant|SELECT DISTINCT t?.category_erp_id,t?.category_name FROM erp_sales_detail t? LEFT JOIN erp_sales t? ON t?.sales_erp_id=t?.sales_erp_id AND t?.tenant_id=t?.tenant_id WHERE t?.tenant_id=? AND t?.tenant_wechatapp_id=? AND ifnull(t?.category_name,?)!=? AND t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.member_erp_id=? AND t?.sales_status=? AND t?.is_sales=?|1|5|5||0|0|7969|7969|20|20|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail_extend WHERE create_time<?|1|1|1||0|0|161145|161145|0|0|
|v4_employee|SELECT COUNT(*) AS total FROM task_task t JOIN employee e ON e.employee_id=t.employee_id AND e.shop_id=t.shop_id AND e.tenant_id=? AND e.tenant_app_id=? LEFT JOIN (SELECT task_id,GROUP_CONCAT(file_url SEPARATOR ?) AS task_attaches FROM task_task_attach WHERE tenant_id=? AND tenant_app_id=? GROUP BY task_id)tta ON t.id=tta.task_id WHERE t.status=? AND system_task_type=? AND t.shop_id=? AND finish_time>=? AND finish_time<? AND t.tenant_id=? AND t.tenant_app_id=?|1|1|1||0|0|5835|5835|1|1|
|tenant|SELECT DISTINCT t?.sales_type FROM erp_sales_detail t? LEFT JOIN erp_sales t? ON t?.sales_erp_id=t?.sales_erp_id AND t?.tenant_id=t?.tenant_id WHERE t?.tenant_id=? AND t?.tenant_wechatapp_id=? AND ifnull(t?.sales_type,?)!=? AND t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.member_erp_id=? AND t?.sales_status=? AND t?.is_sales=?|1|5|5||0|0|7963|7963|14|14|
|v4_user|SELECT COUNT(*) AS total FROM potential_customer pc WHERE EXISTS (SELECT ? FROM potential_customer_maintain t? WHERE pc.id=t?.potential_customer_id AND t?.create_time>=? AND t?.create_time<=? AND t?.event_type IN (?) AND t?.tenant_app_id=?) AND pc.tenant_app_id=?|1|3|3||0|0|7577|7577|1|1|
|v4_user|SELECT COUNT(*) AS total FROM potential_customer pc WHERE EXISTS (SELECT ? FROM potential_customer_maintain t? WHERE pc.id=t?.potential_customer_id AND t?.create_time>=? AND t?.create_time<=? AND t?.event_type=? AND t?.tenant_app_id=?) AND pc.tenant_app_id=?|1|11|11||0|0|231443|231443|1|1|
