|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|v4_user|SELECT img.id,img.tenant_id,img.tenant_app_id,de.warranty_id,sd.sales_erp_id,sd.sales_index,img.img_url,img.create_time AS img_create_time FROM v4_sales.warranty_detail_img img JOIN v4_sales.warranty_detail de ON img.warranty_detail_id=de.id JOIN v4_sales.erp_sales_detail sd ON sd.tenant_id=? AND de.sales_detail_id=sd.id WHERE img.tenant_id=? AND img.tenant_app_id=? AND img.create_time>=? AND img.create_time<? LIMIT ? OFFSET ?|846|2360|16||0|0|657129448|913637|3977|253|
|account|SELECT mb.id,mb.tenant_id,mb.tenant_app_id,tu.open_id tenantAppOpenId,? updateTime,if(ifnull(tu.is_subscribe,?)=?,?,?)subscribeFlag,tu.unsubscribe_time AS cancelTime,tu.subscribe_time AS subscribeTime FROM user_service.wx_user tu INNER JOIN tenant.tenant_wechatapp tw ON tu.wx_app_id=tw.wechat_appid INNER JOIN user_service.tenant_member_bind mb ON mb.tenant_id=tw.tenant_id AND mb.tenant_app_id=tw.id AND tu.id=mb.wx_user_id WHERE tw.id=? AND tu.update_time>=? AND tu.update_time<=? ORDER BY tu.id LIMIT ? OFFSET ?|379|5968|162||0|0|10469778|372846|2388|141|
|account|SELECT mb.id,mb.tenant_id,mb.tenant_app_id,tu.open_id tenantAppOpenId,? updateTime,if(ifnull(tu.is_subscribe,?)=?,?,?)subscribeFlag,tu.unsubscribe_time AS cancelTime,tu.subscribe_time AS subscribeTime FROM user_service.wx_user tu INNER JOIN tenant.tenant_wechatapp tw ON tu.wx_app_id=tw.wechat_appid INNER JOIN user_service.tenant_member_bind mb ON mb.tenant_id=tw.tenant_id AND mb.tenant_app_id=tw.id AND tu.id=mb.wx_user_id WHERE tw.id=? AND tw.tenant_id=? AND tu.create_time>=? AND tu.create_time<=? ORDER BY tu.id LIMIT ? OFFSET ?|322|6817|195||0|0|10944959|372827|2204|127|
|account|SELECT es.tenant_id,es.tenant_wechatapp_id tenant_app_id,es.member_erp_id,sum(esd.amount_total) AS salesBalance,count(DISTINCT if(es.sales_status=? AND es.is_sales=?,concat(es.dept_erp_id,?,es.sales_date),?)) AS salesAmount,group_concat(DISTINCT if(es.sales_status=? AND es.is_sales=?,DATE_FORMAT(es.sales_date,?),?)) AS saleDates,max(if(es.sales_status=? AND esd.sales_type=?,if(esd.quantity>?,round(esd.amount_pay/esd.quantity,?),?),?)) AS singleMaxMoney,group_concat(DISTINCT if(es.sales_status=? AND esd.sales_type=?,if(esd.quantity>?,round(esd.amount_pay/esd.quantity,?),?),?)) AS singleConsumeMoneys FROM tenant.erp_sales es JOIN tenant.erp_sales_detail esd 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 WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.sales_status>=? AND es.member_erp_id IN (?) GROUP BY es.tenant_id,es.tenant_wechatapp_id,es.member_erp_id|255|1519|97||0|0|16950617|171857|7851|451|
|account|SELECT es.sales_erp_id FROM tenant.erp_sales es WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.member_erp_id=? AND es.sales_status=? AND es.is_sales=? ORDER BY es.sales_date DESC,es.sales_erp_id DESC LIMIT ?|143|379|10||0|0|2067628|42268|143|1|
|account|SELECT es.tenant_id,es.tenant_wechatapp_id AS tenant_app_id,es.member_erp_id,ifnull(GROUP_CONCAT(DISTINCT if(es.sales_status=?,if(sde.sales_brand=? OR sde.sales_brand=?,?,sde.sales_brand),?)),?) AS sales_brand,ifnull(GROUP_CONCAT(DISTINCT if(es.sales_status=?,if(sde.sales_craft=? OR sde.sales_craft=?,?,sde.sales_craft),?)),?) AS sales_craft FROM tenant.erp_sales es LEFT JOIN tenant.erp_sales_detail_extend sde ON sde.tenant_id=es.tenant_id AND sde.tenant_wechatapp_id=es.tenant_wechatapp_id AND sde.sales_erp_id=es.sales_erp_id WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.is_sales=? AND es.sales_status>=? AND es.member_erp_id IN (?) GROUP BY es.tenant_id,es.tenant_wechatapp_id,es.member_erp_id|134|522|50||0|0|4926488|87850|6215|444|
|v4_user|SELECT t?.id,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.reception_customer_id,t?.create_time AS tryonTime,t?.content FROM v4_user.reception_customer_log t? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.oper_type=? AND t?.create_time>=? AND t?.create_time<? LIMIT ? OFFSET ?|100|157|7||0|0|39223403|393153|5|3|
|account|SELECT t.tenant_id,t.tenant_app_id,t.gift_product_id,t.shop_id,t.statistic_date,t.busi_date,sum(t.quantity)take_amount,sum(t.pay_price)take_score FROM (SELECT date_format(if(td.take_type=?,tp.create_time,td.write_off_time),?)statistic_date,date_format(td.create_time,?)busi_date,td.tenant_id,td.tenant_wechatapp_id tenant_app_id,td.product_id gift_product_id,if(td.take_type=?,?,ifnull(ws.dept_erp_id,?))shop_id,td.quantity,td.pay_price FROM gift_mail.trade td LEFT JOIN gift_mail.trade_take tt ON td.tenant_wechatapp_id=tt.tenant_wechatapp_id AND td.id=tt.trade_id LEFT JOIN tenant.tenant_wechatapp_shop ws ON tt.take_shop_id=ws.id LEFT JOIN gift_mail.trade_express tp ON td.id=tp.trade_id WHERE td.tenant_wechatapp_id=? AND ((td.take_type=? AND td.order_status=? AND tp.create_time>=? AND tp.create_time<=?) OR (td.take_type=? AND td.order_status=? AND td.write_off_time>=? AND td.write_off_time<=?)))t GROUP BY t.tenant_id,t.tenant_app_id,t.gift_product_id,t.shop_id,t.statistic_date,t.busi_date LIMIT ? OFFSET ?|80|364|14||0|0|1279393|26671|145|59|
|v4_user|SELECT count(DISTINCT if(es.sales_status=? AND es.is_sales=?,concat(es.dept_erp_id,?,es.sales_date),?)) AS saleNum,sum(if(es.sales_status=?,esd.amount_total,?)) AS totalSaleAmount,min(if(es.sales_status=? AND es.is_sales=?,es.sales_date,?)) AS firstSaleTime,max(if(es.sales_status=? AND es.is_sales=?,es.sales_date,?)) AS lastSaleTime,GROUP_CONCAT(DISTINCT if(es.sales_status=? AND es.is_sales=?,DATE_FORMAT(es.sales_date,?),?)) AS saleTimes FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON es.tenant_id=esd.tenant_id AND es.tenant_app_id=esd.tenant_app_id AND es.sales_erp_id=esd.sales_erp_id AND esd.sales_type IN(?) WHERE es.tenant_id=? AND es.tenant_app_id=? AND es.member_erp_id IN (?) AND es.sales_status>=?|73|193|8||0|0|2245342|45476|73|1|
|v4_user|SELECT tt.statistic_date,tt.statistic_month,tt.busi_date,tt.tenant_id,tt.tenant_app_id,tt.shop_id,tt.employee_id,tt.task_type,tt.task_template_id,tt.task_name,? AS status,sum(sale_count) AS sales,sum(sale_amount) AS amount FROM (SELECT DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_date,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_month,DATE_FORMAT(es.create_time,?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,count(es.id) AS sale_count,sum(es.amount) AS sale_amount FROM v4_employee.task_task t? JOIN v4_employee.task_system_task_template t? ON t?.tenant_id=t?.tenant_id AND t?.task_template_id=t?.id JOIN v4_sales.erp_sales es ON es.tenant_id=? AND es.tenant_app_id=? AND t?.member_id=es.member_erp_id AND es.is_sales=? AND es.sales_status IN(?) AND es.sales_date>=DATE_FORMAT(t?.create_time,?) AND es.sales_date<date_add(DATE_FORMAT(t?.finish_time,?),INTERVAL ? DAY) WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.`status`=? AND t?.finish_time>=? AND t?.finish_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(es.create_time,?) UNION ALL SELECT DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_date,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_month,DATE_FORMAT(es.create_time,?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,count(es.id) AS sale_count,sum(es.amount) AS sale_amount FROM v4_employee.task_task t? JOIN v4_employee.task_system_task_template t? ON t?.tenant_id=t?.tenant_id AND t?.task_template_id=t?.id JOIN v4_sales.erp_sales es ON es.tenant_id=? AND es.tenant_app_id=? AND t?.member_id=es.member_erp_id AND es.is_sales=? AND es.sales_status IN(?) AND es.sales_date>=date_add(DATE_FORMAT(t?.finish_time,?),INTERVAL ? DAY) AND es.sales_date<(DATE_ADD(DATE_FORMAT(t?.finish_time,?),INTERVAL ? MONTH)-INTERVAL DAY(DATE_FORMAT(t?.finish_time,?))-? DAY) WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.`status`=? AND t?.finish_time IS NOT ? AND es.create_time>=? AND es.create_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(es.create_time,?))tt GROUP BY tt.statistic_date,tt.statistic_month,tt.busi_date,tt.tenant_id,tt.tenant_app_id,tt.shop_id,tt.employee_id,tt.task_type,tt.task_template_id,tt.task_name LIMIT ? OFFSET ?|50|472|141||0|0|12314732|1585332|847|75|
|v4_user|SELECT DISTINCT t?.id,t?.tenant_id,t?.tenant_app_id,? AS collectType,t?.combine_status,t?.combine_id FROM v4_user.wx_user_subscribe_log t? JOIN v4_user.wx_user t? ON t?.wx_user_id=t?.id JOIN v4_user.member t? ON t?.member_id=t?.id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.subscribe_time>=? AND t?.subscribe_time<? AND t?.subscribe_status=?|47|105|11||0|0|10823794|392717|733|121|
|account|SELECT es.tenant_id,es.tenant_wechatapp_id tenant_app_id,es.member_erp_id,ifnull(group_concat(DISTINCT if(es.sales_status=?,sd.category_erp_id,?)),?)categoryId,ifnull(group_concat(DISTINCT if(es.sales_status=?,ifnull(pc.category_name,sd.category_name),?)),?) AS categoryName,min(if(es.sales_status=?,es.sales_date,?)) AS firstSalesTime,max(if(es.sales_status=?,es.sales_date,?)) AS lastSalesTime FROM tenant.erp_sales es INNER JOIN tenant.erp_sales_detail sd ON sd.tenant_id=es.tenant_id AND es.tenant_wechatapp_id=sd.tenant_wechatapp_id AND es.sales_erp_id=sd.sales_erp_id AND sd.sales_type=? LEFT JOIN tenant.erp_product_category pc ON es.tenant_id=pc.tenant_id AND sd.category_erp_id=pc.category_erp_id WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.is_sales=? AND es.sales_status>=? AND es.member_erp_id IN (?) GROUP BY es.tenant_id,es.tenant_wechatapp_id,es.member_erp_id|43|512|66||0|0|3902905|213764|3495|440|
|account|SELECT t?.id,t?.tenant_id,t?.tenant_wechatapp_id AS tenantAppId,t?.order_id,t?.sales_index,t?.product_id AS goodsId,t?.product_name AS goodsName,t?.spec,t?.art_no,t?.price,t?.quantity,t?.total_fee,t?.payment_fee,t?.discount_fee,t?.integral FROM `order`.order_detail t? WHERE t?.tenant_wechatapp_id=? AND t?.create_time>=? AND t?.create_time<=? LIMIT ? OFFSET ?|40|112|5||0|0|10710286|267762|0|0|
|v4_user|SELECT count(*) FROM v4_employee.task_task t? JOIN v4_employee.task_system_task_template t? ON t?.task_template_id=t?.id AND t?.status=? WHERE t?.tenant_app_id=? AND t?.`status`=? AND t?.finish_time IS ? AND (t?.start_time<=CURRENT_DATE AND t?.end_time>CURRENT_DATE)|39|79|4||0|0|6933919|337562|39|1|
|v4_user|SELECT DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_date,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_month,DATE_FORMAT(t?.create_time,?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,count(*) AS `should` FROM v4_employee.task_task t? JOIN v4_employee.task_system_task_template t? ON t?.tenant_id=t?.tenant_id AND t?.task_template_id=t?.id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.`status`=? AND t?.create_time>=? AND t?.create_time<? GROUP BY DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(t?.create_time,?),t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name LIMIT ? OFFSET ?|31|70|9||0|0|4009343|338150|4823|378|
|account|SELECT od.tenant_id,od.tenant_app_id,od.activity_id,count(*)join_amount FROM activity_service.online_sign_user_sign_log od WHERE od.tenant_app_id=? AND od.create_time>=? AND od.create_time<=? GROUP BY od.tenant_id,od.tenant_app_id,od.activity_id|31|56|5||0|0|15102407|487243|0|0|
|account|SELECT tm.id,tm.tenant_id,tm.tenant_app_id,tu.user_id AS external_user_id,? updateTime FROM corpwx.external_user tu INNER JOIN user_service.tenant_member_bind tm ON tu.tenant_id=tm.tenant_id AND tm.tenant_app_id=? AND tu.union_id=tm.wx_union_id WHERE tu.tenant_id=? AND tu.un_assign_flag=? AND tu.union_id IS NOT ? AND tu.update_time>=? AND tu.update_time<=? ORDER BY id LIMIT ? OFFSET ?|30|242|32||0|0|470669|30697|321|255|
|account|SELECT t.id,t.tenant_id AS tenantId,t.tenant_app_id AS tenantAppId,tui.user_id AS memberId,tui.update_time AS memberImageTime FROM customer.tenant_user_image tui JOIN user_service.tenant_member_info t ON t.tenant_id=? AND t.tenant_app_id=tui.tenant_app_id AND t.user_id=tui.user_id WHERE tui.tenant_app_id=? AND tui.is_drawed_img=? AND tui.update_time>=? AND tui.update_time<=? AND (t.member_image_flag=? OR t.member_image_flag IS ?) LIMIT ? OFFSET ?|30|42|2||0|0|9174153|487666|0|0|
|account|SELECT t.id,t.tenant_id AS tenantId,t.tenant_app_id AS tenantAppId,mb.erp_member_id AS memberId,ifnull(t.member_image_time,tui.update_time) AS memberImageTime FROM customer.tenant_user_image tui JOIN user_service.tenant_member_info t ON t.tenant_id=? AND t.tenant_app_id=tui.tenant_app_id AND t.user_id=tui.user_id JOIN user_service.tenant_member_bind mb ON t.tenant_id=mb.tenant_id AND t.id=mb.id AND mb.erp_member_id>? WHERE tui.tenant_app_id=? AND tui.is_drawed_img=? AND tui.update_time>=? AND tui.update_time<=? LIMIT ? OFFSET ?|29|87|4||0|0|24362768|1202424|16|5|
|v4_user|SELECT DATE_FORMAT(es.sales_date,?) AS statistic_date,DATE_FORMAT(es.sales_date,?) AS statistic_month,DATE_FORMAT(t?.create_time,?) AS busi_date,t?.tenant_id,t?.tenant_app_id,ifnull(sp.id,?) AS shop_id,ifnull(emp.id,es.employee_erp_id) AS employee_id,? AS saleStatus,count(t?.id) AS added FROM v4_sales.warranty t? JOIN v4_sales.erp_sales es ON es.tenant_id=t?.tenant_id AND es.id=t?.sales_id AND es.is_sales=? AND es.sales_status IN(?) LEFT JOIN tenant.employee emp ON es.tenant_id=emp.tenant_id AND es.employee_erp_id=emp.employee_erp_id LEFT JOIN v4_employee.shop sp ON es.tenant_id=sp.tenant_id AND es.dept_erp_id=sp.dept_id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,sp.id,emp.id,es.employee_erp_id,DATE_FORMAT(es.sales_date,?),DATE_FORMAT(es.sales_date,?),DATE_FORMAT(t?.create_time,?) LIMIT ? OFFSET ?|25|63|5||0|0|6511437|786580|1057|185|
|employee|SELECT * FROM `backlog_?`|20|124|44||0|0|10012321|3392505|10012321|3392505|
|account|SELECT t.tenant_id,t.tenant_app_id,t.coupon_id,t.statistic_date,t.create_channel,t.coupon_type,t.busi_date,ifnull(sum(ifnull(t.total_fee,?)),?)amount FROM (SELECT cu.tenant_id,cu.tenant_app_id,cu.template_id coupon_id,cu.source create_channel,date_format(od.payment_time,?)statistic_date,cu.coupon_type,od.total_fee,date_format(cu.create_time,?)busi_date FROM `order`.order_info od INNER JOIN coupon_service.coupon cu ON od.tenant_wechatapp_id=cu.tenant_app_id AND od.coupon_id=cu.id WHERE od.tenant_wechatapp_id=? AND od.status>=? AND od.payment_time>=? AND od.payment_time<=?)t GROUP BY t.tenant_id,t.tenant_app_id,t.coupon_id,t.statistic_date,t.create_channel,t.coupon_type,t.busi_date LIMIT ? OFFSET ?|14|35|6||0|0|195866|43883|0|0|
|v4_user|SELECT t.id,t.tenant_id,t.tenant_app_id,t.shop_id AS belongShopId,t.member_name,t.mobile_no,t.recommend_id,t.head_img_url,t.sex,t.create_time AS registerTime,t.birthday,ifnull(t.birthday_is_lunar,?) AS birthdayIsLunar,t.memorial_name,t.memorial_day,ifnull(t.memorial_day_is_lunar,?) AS memorialDayIsLunar,ifnull(w.is_subscribe,?) AS subscribeFlag,w.subscribe_time,w.cancel_subscribe_time,w.nick_name AS wxNickName,t.wx_union_id,t.h5_open_id,t.mini_open_id,if(t.external_user_id IS NOT ? AND t.external_user_id!=?,?,?) AS externalUserFlag,t.external_user_id,t.status,t.combine_status,t.combine_id FROM v4_user.member t LEFT JOIN v4_user.wx_user w ON t.h5_open_id=w.open_id WHERE t.tenant_id=? AND t.tenant_app_id=? AND t.create_time>=? AND t.create_time<? ORDER BY t.id LIMIT ? OFFSET ?|13|27|5||0|0|2050450|335838|1160|204|
|v4_user|SELECT count(*)_count FROM v4_employee.task_task WHERE tenant_id=? AND tenant_app_id=? AND shop_id=? AND employee_id=? AND task_type=? AND finish_time>=? AND finish_time<DATE_ADD(?,INTERVAL ? Day)|13|18|3||0|0|33484|3663|13|1|
|v4_user|SELECT DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_date,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_month,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,count(*) AS `failed` FROM v4_employee.task_task t? JOIN v4_employee.task_system_task_template t? ON t?.tenant_id=t?.tenant_id AND t?.task_template_id=t?.id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.`status`=? AND t?.end_time>=DATE_ADD(?,INTERVAL ? day) AND t?.end_time<DATE_ADD(?,INTERVAL ? day) AND t?.finish_time IS ? GROUP BY DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name LIMIT ? OFFSET ?|13|26|4||0|0|2697274|338026|1085|232|
|v4_user|SELECT es.tenant_id AS tenantId,es.tenant_app_id AS tenantAppId,es.member_erp_id AS id,count(DISTINCT if(es.sales_status=? AND es.is_sales=?,concat(es.dept_erp_id,?,es.sales_date),?)) AS saleNum,ifnull(sum(if(es.sales_status=?,esd.amount_total,?)),?) AS totalSaleAmount,min(if(es.sales_status=? AND es.is_sales=?,es.sales_date,?)) AS firstSaleTime,max(if(es.sales_status=? AND es.is_sales=?,es.sales_date,?)) AS lastSaleTime,GROUP_CONCAT(DISTINCT if(es.sales_status=? AND es.is_sales=?,DATE_FORMAT(es.sales_date,?),?)) AS saleTimes FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON es.tenant_id=esd.tenant_id AND es.tenant_app_id=esd.tenant_app_id AND es.sales_erp_id=esd.sales_erp_id AND esd.sales_type IN(?) WHERE es.tenant_id=? AND es.tenant_app_id=? AND es.sales_status>=? AND es.member_erp_id IN (?) GROUP BY es.tenant_id,es.tenant_app_id,es.member_erp_id|11|17|2||0|0|110621|53344|1273|235|
|v4_user|SELECT t?.id,t?.tenant_id,t?.tenant_app_id,? AS collectType,t?.combine_status,t?.combine_id FROM v4_user.reception_customer t? JOIN v4_user.member t? ON t?.tenant_id=t?.tenant_id AND t?.tenant_app_id=t?.tenant_app_id AND t?.external_user_id=t?.external_user_id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,t?.id LIMIT ? OFFSET ?|11|35|6||0|0|5183941|1378873|947|260|
|v4_user|SELECT tt.statistic_date,tt.statistic_month,tt.busi_date,tt.tenant_id,tt.tenant_app_id,tt.shop_id,tt.employee_id,tt.task_type,tt.task_template_id,tt.task_name,? AS status,sum(sale_count) AS sales,sum(sale_amount) AS amount FROM (SELECT DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_date,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_month,DATE_FORMAT(es.create_time,?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,count(es.id) AS sale_count,sum(es.amount) AS sale_amount FROM v4_employee.task_task t? JOIN v4_employee.task_invite_task_template t? ON t?.tenant_id=t?.tenant_id AND t?.task_template_id=t?.id JOIN v4_sales.erp_sales es ON es.tenant_id=? AND es.tenant_app_id=? AND t?.member_id=es.member_erp_id AND es.is_sales=? AND es.sales_status IN(?) AND es.sales_date>=DATE_FORMAT(t?.start_time,?) AND es.sales_date<date_add(DATE_FORMAT(t?.finish_time,?),INTERVAL ? DAY) WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.`status`!=? AND t?.finish_time>=? AND t?.finish_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(es.create_time,?) UNION ALL SELECT DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_date,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_month,DATE_FORMAT(es.create_time,?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,count(es.id) AS sale_count,sum(es.amount) AS sale_amount FROM v4_employee.task_task t? JOIN v4_employee.task_invite_task_template t? ON t?.tenant_id=t?.tenant_id AND t?.task_template_id=t?.id JOIN v4_sales.erp_sales es ON es.tenant_id=? AND es.tenant_app_id=? AND t?.member_id=es.member_erp_id AND es.is_sales=? AND es.sales_status IN(?) AND es.sales_date>=date_add(DATE_FORMAT(t?.finish_time,?),INTERVAL ? DAY) AND es.sales_date<DATE_FORMAT(t?.end_time,?) WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.`status`!=? AND es.create_time>=? AND es.create_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(es.create_time,?))tt GROUP BY tt.statistic_date,tt.statistic_month,tt.busi_date,tt.tenant_id,tt.tenant_app_id,tt.shop_id,tt.employee_id,tt.task_type,tt.task_template_id,tt.task_name LIMIT ? OFFSET ?|11|99|34||0|0|5718238|1716597|109|31|
|v4_user|SELECT DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_date,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_month,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,count(*) AS `failed` FROM v4_employee.task_task t? JOIN v4_employee.task_invite_task_template t? ON t?.tenant_id=t?.tenant_id AND t?.task_template_id=t?.id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.`status`=? AND t?.end_time>=DATE_ADD(?,INTERVAL ? day) AND t?.end_time<DATE_ADD(?,INTERVAL ? day) AND t?.finish_time IS ? GROUP BY DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name LIMIT ? OFFSET ?|9|19|5||0|0|3667534|855396|0|0|
|v4_user|SELECT t?.tenant_id,t?.tenant_app_id,t?.id,min(t?.recept_time) AS firstShopTime,max(t?.recept_time) AS lastShopTime,count(t?.id) AS enterShopNum FROM v4_user.reception_customer t? JOIN v4_user.member t? ON t?.tenant_id=t?.tenant_id AND t?.tenant_app_id=t?.tenant_app_id AND t?.external_user_id=t?.external_user_id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.id IN (?) GROUP BY t?.tenant_id,t?.tenant_app_id,t?.id|9|30|6||0|0|5245465|1260559|1089|166|
|v4_user|SELECT t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?) AS statistic_date,DATE_FORMAT(t?.recept_time,?) AS statistic_month,DATE_FORMAT(t?.create_time,?) AS busi_date,t?.shop_id,t?.employee_id,t?.customer_type,t?.member_status,count(*) AS total,ifnull(sum(CASE WHEN t?.customer_type=? OR (ifnull(t?.external_user_id,?)=? AND t?.member_id=?) THEN ? ELSE ? END),?)+count(DISTINCT CASE WHEN t?.customer_type=? AND t?.member_id>? THEN t?.member_id ELSE ? END)+count(DISTINCT CASE WHEN t?.customer_type=? AND ifnull(t?.external_user_id,?)!=? THEN t?.external_user_id ELSE ? END) AS persons FROM v4_user.reception_customer t? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? AND t?.first_enter_shop=? GROUP BY t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.create_time,?),t?.shop_id,t?.employee_id,t?.customer_type,t?.member_status LIMIT ? OFFSET ?|9|22|8||0|0|358693|115738|480|131|
|v4_user|SELECT DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_date,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_month,DATE_FORMAT(t?.create_time,?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,count(*) AS `should` FROM v4_employee.task_task t? JOIN v4_employee.task_invite_task_template t? ON t?.tenant_id=t?.tenant_id AND t?.task_template_id=t?.id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.`status`=? AND t?.create_time>=? AND t?.create_time<? GROUP BY DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(t?.create_time,?),t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name LIMIT ? OFFSET ?|9|40|15||0|0|3667550|855396|8|8|
|v4_user|SELECT t?.tenant_id,t?.tenant_app_id,t?.registry_shop_id AS shop_id,t?.source_id AS employee_id,? AS statisticDate,? AS bizType,count(*) AS amount FROM v4_user.member_source t? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.source_type=? AND t?.create_time>=? AND t?.create_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,t?.registry_shop_id,t?.source_id LIMIT ? OFFSET ?|9|14|4||0|0|1644677|335830|318|100|
|v4_user|SELECT DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_date,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_month,DATE_FORMAT(t?.finish_time,?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,count(*) AS `finished` FROM v4_employee.task_task t? JOIN v4_employee.task_system_task_template t? ON t?.tenant_id=t?.tenant_id AND t?.task_template_id=t?.id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.`status`=? AND t?.finish_time>=? AND t?.finish_time<? GROUP BY DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(t?.finish_time,?),t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name LIMIT ? OFFSET ?|9|21|6||0|0|1918717|337970|1208|268|
|v4_user|SELECT t.tenant_id,t.tenant_app_id,t.member_id AS id,t.total_sale_points AS totalSalePoints,t.total_used_points AS totalUsedPoints,t.balance AS balancePoints,t.total_add_points AS totalAddPoints,if(t.total_add_points>?,t.update_time,?) AS lastChangePointsTime,ifnull(m.combine_status,?) AS combineStatus,ifnull(m.combine_id,m.id) AS combineId FROM v4_user.member_points t JOIN v4_user.member m ON t.tenant_id=m.tenant_id AND t.member_id=m.id WHERE t.tenant_id=? AND t.tenant_app_id=? AND t.update_time>=? AND t.update_time<? ORDER BY t.id LIMIT ? OFFSET ?|9|18|4||0|0|1273264|296291|979|251|
|v4_user|SELECT t.tenant_id,t.tenant_app_id,t.user_id AS id,t.grade_id AS gradeId FROM v4_user.member_grade t WHERE t.tenant_id=? AND t.tenant_app_id=? AND t.update_time>=? AND t.update_time<? ORDER BY t.id LIMIT ? OFFSET ?|8|16|3||0|0|1276761|296291|900|276|
|v4_user|SELECT DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_date,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_month,DATE_FORMAT(es.update_time,?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,? AS `status`,?*count(es.id) AS sales,?*sum(es.amount) AS amount FROM v4_employee.task_task t? JOIN v4_employee.task_system_task_template t? ON t?.tenant_id=t?.tenant_id AND t?.task_template_id=t?.id JOIN v4_sales.erp_sales es ON es.tenant_id=? AND es.tenant_app_id=? AND t?.member_id=es.member_erp_id AND es.is_sales=? AND es.sales_status=? AND es.sales_date>=DATE_FORMAT(t?.create_time,?) AND es.sales_date<(DATE_ADD(DATE_FORMAT(t?.finish_time,?),INTERVAL ? MONTH)-INTERVAL DAY(DATE_FORMAT(t?.finish_time,?))-? DAY) WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.`status`=? AND t?.finish_time IS NOT ? AND es.update_time>=? AND es.update_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(es.update_time,?) LIMIT ? OFFSET ?|8|15|2||0|0|453398|131763|92|45|
|v4_user|SELECT DATE_FORMAT(t?.sales_date,?) AS statistic_date,DATE_FORMAT(t?.sales_date,?) AS statistic_month,? AS statistic_version,DATE_FORMAT(t?.create_time,?) AS busi_date,? AS sale_status,t?.tenant_id,t?.tenant_app_id,ifnull(sp.id,?) AS shop_id,ifnull(emp.id,?) AS employee_id,count(*) AS sales_order,ifnull(sum(t?.amount),?) AS sales_amount,ifnull(sum(if(t?.member_erp_id=?,?,?)),?) AS no_sales_order,ifnull(sum(if(t?.member_erp_id=?,t?.amount,?)),?) AS no_sales_amount,ifnull(sum(if(t?.member_erp_id>? AND t?.member_status=?,?,?)),?) AS new_sales_order,ifnull(sum(if(t?.member_erp_id>? AND t?.member_status=?,t?.amount,?)),?) AS new_sales_amount FROM v4_sales.erp_sales t? JOIN v4_sales.erp_sales_extend? t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id LEFT JOIN v4_employee.shop sp ON t?.tenant_id=sp.tenant_id AND t?.dept_erp_id=sp.dept_id LEFT JOIN tenant.employee emp ON t?.tenant_id=emp.tenant_id AND t?.employee_erp_id=emp.employee_erp_id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? AND t?.is_sales=? AND t?.sales_status IN(?) GROUP BY t?.tenant_id,t?.tenant_app_id,sp.id,emp.id,DATE_FORMAT(t?.sales_date,?),DATE_FORMAT(t?.sales_date,?),DATE_FORMAT(t?.create_time,?) LIMIT ? OFFSET ?|7|29|6||0|0|5300482|811109|34910|5000|
|account|SELECT ut.tenant_id,ut.tenant_wx_app_id tenant_app_id,ut.user_id,ut.create_time lastLoginTime FROM authorization_service.user_login_token ut WHERE ut.tenant_wx_app_id=? AND ut.create_time>=? AND ut.create_time<=? LIMIT ? OFFSET ?|6|8|2||0|0|7696|2175|7696|2175|
|v4_user|SELECT DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_date,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_month,DATE_FORMAT(t?.finish_time,?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,count(*) AS `finished` FROM v4_employee.task_task t? JOIN v4_employee.task_invite_task_template t? ON t?.tenant_id=t?.tenant_id AND t?.task_template_id=t?.id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.`status`=? AND t?.finish_time>=? AND t?.finish_time<? GROUP BY DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(t?.finish_time,?),t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name LIMIT ? OFFSET ?|6|14|5||0|0|2502388|855396|61|27|
|v4_user|SELECT DATE_FORMAT(t.finish_time,?) AS statistic_date,DATE_FORMAT(t.finish_time,?) AS statistic_month,t.tenant_id,t.tenant_app_id,sp.id AS shop_id,t.employee_id,count(*) AS tag FROM v4_employee.mark_label_task t LEFT JOIN tenant.employee emp ON t.tenant_id=emp.tenant_id AND t.employee_id=emp.id LEFT JOIN v4_employee.shop sp ON t.tenant_id=sp.tenant_id AND emp.dept_erp_id=sp.dept_id WHERE t.tenant_id=? AND t.tenant_app_id=? AND t.`status`=? AND t.finish_time>=? AND t.finish_time<? GROUP BY DATE_FORMAT(t.finish_time,?),DATE_FORMAT(t.finish_time,?),t.tenant_id,t.tenant_app_id,sp.id,t.employee_id LIMIT ? OFFSET ?|5|9|2||0|0|489849|261814|95|53|
|account|SELECT DISTINCT tenant_wechatapp_id tenant_app_id,date_format(payment_time,?)statistic_date FROM `order`.order_info WHERE tenant_wechatapp_id=? AND status=? AND finish_type IN (?) AND cancel_time>=? AND cancel_time<=?|5|13|5||0|0|78632|19185|0|0|
|v4_user|SELECT sp.id FROM v4_sales.erp_sales es JOIN v4_employee.shop sp ON sp.tenant_id=? AND es.dept_erp_id=sp.dept_id WHERE es.tenant_id=? AND es.tenant_app_id=? AND es.member_erp_id IN (?) AND es.is_sales=? AND es.sales_status=? ORDER BY es.sales_erp_id ASC LIMIT ?|5|14|8||0|0|141936|28668|5|1|
|v4_user|SELECT DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_date,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?) AS statistic_month,DATE_FORMAT(es.update_time,?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,? AS `status`,?*count(es.id) AS sales,?*sum(es.amount) AS amount FROM v4_employee.task_task t? JOIN v4_employee.task_invite_task_template t? ON t?.tenant_id=t?.tenant_id AND t?.task_template_id=t?.id JOIN v4_sales.erp_sales es ON es.tenant_id=? AND es.tenant_app_id=? AND t?.member_id=es.member_erp_id AND es.is_sales=? AND es.sales_status=? AND es.sales_date>=DATE_FORMAT(t?.start_time,?) AND es.sales_date<DATE_FORMAT(t?.end_time,?) WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.`status`!=? AND t?.finish_time IS NOT ? AND es.update_time>=? AND es.update_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,t?.task_type,t?.task_template_id,t?.task_name,DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(DATE_ADD(t?.end_time,INTERVAL ? day),?),DATE_FORMAT(es.update_time,?) LIMIT ? OFFSET ?|4|5|1||0|0|2173|687|3|3|
|v4_user|SELECT t.tenant_id,t.tenant_app_id,t.member_id AS id,t.shop_id AS belongShopId,t.employee_id AS belongEmployeeId,t.update_time AS assignButlerTime FROM v4_user.member_butler t WHERE t.tenant_id=? AND t.tenant_app_id=? AND t.update_time>=? AND t.update_time<? ORDER BY t.id LIMIT ? OFFSET ?|4|9|2||0|0|556295|160665|1271|1044|
|v4_user|SELECT t.change_time FROM v4_user.member_change_log t WHERE t.tenant_id=? AND t.tenant_app_id=? AND t.member_id=? AND t.change_type=? ORDER BY t.id ASC LIMIT ?|4|47|16||0|0|4560342|1310802|0|0|
|v4_user|SELECT DATE_FORMAT(t.finish_time,?) AS statistic_date,DATE_FORMAT(t.finish_time,?) AS statistic_month,t.tenant_id,t.tenant_app_id,t.finish_shop_id AS shop_id,t.maintain_employee_id AS employee_id,t.fail_reason,count(*) AS total FROM v4_user.potential_customer t WHERE t.tenant_id=? AND t.tenant_app_id=? AND t.`status`=? AND t.finish_time>=? AND t.finish_time<? GROUP BY DATE_FORMAT(t.finish_time,?),DATE_FORMAT(t.finish_time,?),t.tenant_id,t.tenant_app_id,t.finish_shop_id,t.maintain_employee_id,t.fail_reason LIMIT ? OFFSET ?|4|11|5||0|0|76587|25538|37|17|
|v4_user|SELECT t.tenant_id,t.tenant_app_id,t.registry_shop_id AS shopId,? AS statisticDate,t.source_type AS memberSource,count(*)amount FROM v4_user.member_source t WHERE t.tenant_id=? AND t.tenant_app_id=? AND t.create_time>=? AND t.create_time<? GROUP BY t.tenant_id,t.tenant_app_id,t.registry_shop_id,t.source_type LIMIT ? OFFSET ?|3|6|3||0|0|268046|160665|50|29|
|v4_user|SELECT t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?) AS statistic_date,DATE_FORMAT(t?.recept_time,?) AS statistic_month,DATE_FORMAT(t?.create_time,?) AS busi_date,t?.shop_id,t?.employee_id,t?.customer_type,t?.member_status,count(DISTINCT if(t?.oper_status&?>? AND t?.oper_type=?,t?.id,?)) AS try_total,count(DISTINCT if(t?.oper_status&?>? AND t?.oper_type=?,t?.id,?)) AS potential_total,count(DISTINCT if(t?.oper_status&?>? AND t?.oper_type=?,t?.id,?)) AS deal_total,count(DISTINCT if(t?.oper_status&?>? AND t?.oper_type=?,(CASE WHEN t?.customer_type=? AND t?.member_id>? THEN t?.member_id WHEN t?.customer_type=? AND ifnull(t?.external_user_id,?)!=? THEN t?.external_user_id ELSE t?.id END),?)) AS tryNum,count(DISTINCT if(t?.oper_status&?>? AND t?.oper_type=?,(CASE WHEN t?.customer_type=? AND t?.member_id>? THEN t?.member_id WHEN t?.customer_type=? AND ifnull(t?.external_user_id,?)!=? THEN t?.external_user_id ELSE t?.id END),?)) AS potentialNum,count(DISTINCT if(t?.oper_status&?>? AND t?.oper_type=?,(CASE WHEN t?.customer_type=? AND t?.member_id>? THEN t?.member_id WHEN t?.customer_type=? AND ifnull(t?.external_user_id,?)!=? THEN t?.external_user_id ELSE t?.id END),?)) AS dealNum FROM v4_user.reception_customer t? JOIN v4_user.reception_customer_log t? ON t?.id=t?.reception_customer_id AND t?.oper_type IN(?) WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? AND t?.first_enter_shop=? GROUP BY t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.create_time,?),t?.shop_id,t?.employee_id,t?.customer_type,t?.member_status LIMIT ? OFFSET ?|3|5|2||0|0|1181616|394254|127|111|
|account|SELECT es.tenant_id,es.tenant_wechatapp_id tenant_app_id,es.sales_date,es.dept_erp_id,es.employee_erp_id erpEmployeeId,sd.category_erp_id FROM tenant.erp_sales es JOIN tenant.erp_sales_detail sd ON sd.tenant_id=es.tenant_id AND es.tenant_wechatapp_id=sd.tenant_wechatapp_id AND es.sales_erp_id=sd.sales_erp_id JOIN tenant.erp_sales_extend ee ON ee.tenant_id=sd.tenant_id AND sd.tenant_wechatapp_id=ee.tenant_wechatapp_id AND sd.sales_erp_id=ee.sales_erp_id AND sd.sales_index=ee.sales_index AND ee.not_add_value_plan=? WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND ee.create_time>=? AND ee.create_time<=? ORDER BY sd.id LIMIT ? OFFSET ?|3|3|1||0|0|56089|29009|25|12|
|account|SELECT cu.tenant_id,cu.tenant_app_id,cu.id AS coupon_id,od.total_fee,DATE_FORMAT(od.payment_time,?) AS saleDate FROM `order`.order_info od INNER JOIN coupon_service.coupon cu ON od.tenant_wechatapp_id=cu.tenant_app_id AND od.coupon_id=cu.id WHERE od.tenant_wechatapp_id=? AND od.status>=? AND od.total_fee>? AND od.payment_time>=? AND od.payment_time<=? LIMIT ? OFFSET ?|3|3|1||0|0|42498|15860|0|0|
|account|SELECT ur.tenant_id,ur.tenant_app_id,ur.user_id,ur.enter_shop_time FROM customer.tenant_user_received ur WHERE ur.tenant_app_id=? AND ur.create_time>=? AND ur.create_time<=? LIMIT ? OFFSET ?|2|2|1||0|0|12454|8181|8|7|
|v4_user|SELECT t.id,t.tenant_id,t.tenant_app_id,t.shop_id AS belongShopId,t.member_name,t.mobile_no,t.recommend_id,t.head_img_url,t.sex,t.create_time AS registerTime,t.birthday,ifnull(t.birthday_is_lunar,?) AS birthdayIsLunar,t.memorial_name,t.memorial_day,ifnull(t.memorial_day_is_lunar,?) AS memorialDayIsLunar,ifnull(w.is_subscribe,?) AS subscribeFlag,w.subscribe_time,w.cancel_subscribe_time,w.nick_name AS wxNickName,t.wx_union_id,t.h5_open_id,t.mini_open_id,if(t.external_user_id IS NOT ?,?,?) AS externalUserFlag,t.external_user_id,t.status,t.combine_status,t.combine_id FROM v4_user.member t LEFT JOIN v4_user.wx_user w ON t.h5_open_id=w.open_id WHERE t.tenant_id=? AND t.tenant_app_id=? AND t.update_time>=? AND t.update_time<? ORDER BY t.id LIMIT ? OFFSET ?|2|3|2||0|0|321798|160946|468|281|
|v4_user|SELECT t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?) AS statistic_date,DATE_FORMAT(t?.recept_time,?) AS statistic_month,DATE_FORMAT(t?.create_time,?) AS busi_date,t?.shop_id,t?.employee_id,t?.customer_type,t?.member_status,count(DISTINCT if(t?.oper_status&?>? AND t?.oper_type=?,t?.id,?)) AS try_total,count(DISTINCT if(t?.oper_status&?>? AND t?.oper_type=?,t?.id,?)) AS potential_total,count(DISTINCT if(t?.oper_status&?>? AND t?.oper_type=?,t?.id,?)) AS deal_total,count(DISTINCT if(t?.oper_status&?>? AND t?.oper_type=?,(CASE WHEN t?.customer_type=? AND t?.member_id>? THEN t?.member_id WHEN t?.customer_type=? AND ifnull(t?.external_user_id,?)!=? THEN t?.external_user_id ELSE t?.id END),?)) AS tryNum,count(DISTINCT if(t?.oper_status&?>? AND t?.oper_type=?,(CASE WHEN t?.customer_type=? AND t?.member_id>? THEN t?.member_id WHEN t?.customer_type=? AND ifnull(t?.external_user_id,?)!=? THEN t?.external_user_id ELSE t?.id END),?)) AS potentialNum,count(DISTINCT if(t?.oper_status&?>? AND t?.oper_type=?,(CASE WHEN t?.customer_type=? AND t?.member_id>? THEN t?.member_id WHEN t?.customer_type=? AND ifnull(t?.external_user_id,?)!=? THEN t?.external_user_id ELSE t?.id END),?)) AS dealNum FROM v4_user.reception_customer t? JOIN v4_user.reception_customer_log t? ON t?.id=t?.reception_customer_id AND t?.oper_type IN(?) WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.create_time,?),t?.shop_id,t?.employee_id,t?.customer_type,t?.member_status LIMIT ? OFFSET ?|2|2|1||0|0|788402|394728|171|163|
|account|SELECT gs.id,tw.tenant_id,tw.id tenant_app_id,gs.goods_name product_name FROM goods.goods gs INNER JOIN tenant.tenant_wechatapp tw ON gs.tenant_id=tw.tenant_id WHERE tw.id=? AND gs.create_time>=? AND gs.create_time<=? ORDER BY gs.id LIMIT ? OFFSET ?|2|3|1||0|0|32264|16132|0|0|
|v4_user|SELECT DATE_FORMAT(tt?.recept_time,?) AS statistic_date,DATE_FORMAT(tt?.recept_time,?) AS statistic_month,tt?.tenant_id,tt?.tenant_app_id,tt?.shop_id,tt?.employee_id,tt?.fieldName,tt?.fieldValue,count(*) AS total FROM (SELECT t?.recept_time,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,? AS fieldName,TRIM(? FROM JSON_EXTRACT(t?.checkin_labels,concat(SUBSTRING(TRIM(? FROM JSON_SEARCH(t?.checkin_labels,?,?)),?,LOCATE(?,TRIM(? FROM JSON_SEARCH(t?.checkin_labels,?,?)))-?),?))) AS fieldValue FROM v4_user.reception_customer t? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? AND JSON_CONTAINS(t?.checkin_labels,JSON_OBJECT(?,?)))tt? GROUP BY DATE_FORMAT(tt?.recept_time,?),DATE_FORMAT(tt?.recept_time,?),tt?.tenant_id,tt?.tenant_app_id,tt?.shop_id,tt?.employee_id,tt?.fieldName,tt?.fieldValue|2|2|1||0|0|231564|115802|220|120|
|account|SELECT t.tenant_app_id,t.user_id,t.is_drawed_img FROM customer.tenant_user_image t WHERE t.tenant_app_id=? AND t.update_time>=? AND t.update_time<=? AND t.is_drawed_img=? GROUP BY t.tenant_app_id,t.user_id,t.is_drawed_img LIMIT ? OFFSET ?|2|2|1||0|0|113651|107756|39|39|
|account|SELECT DISTINCT vu.tenant_wechatapp_id tenant_app_id,date_format(vu.create_time,?)statistic_date,date_format(ue.sales_date,?)busi_date FROM value_added.value_added_user vu INNER JOIN value_added.value_added_user_extend ue ON vu.id=ue.id WHERE vu.tenant_wechatapp_id=? AND vu.update_time>=? AND vu.update_time<=? AND vu.state=? AND ue.sales_date IS NOT ?|2|5|2||0|0|22779|11805|0|0|
|account|SELECT t.tenant_id,t.tenant_app_id,t.coupon_id,t.statistic_date,t.create_channel,t.coupon_type,t.busi_date,count(*)amount FROM (SELECT cu.tenant_id,cu.tenant_app_id,cu.template_id coupon_id,cu.source create_channel,date_format(rt.create_time,?)statistic_date,cu.coupon_type,date_format(cu.create_time,?)busi_date FROM coupon_service.coupon cu INNER JOIN coupon_service.user_coupon_give_record rt ON cu.tenant_app_id=rt.tenant_app_id AND cu.id=rt.coupon_id WHERE rt.tenant_app_id=? AND rt.create_time>=? AND rt.create_time<=? AND rt.user_id>?)t GROUP BY t.tenant_id,t.tenant_app_id,t.coupon_id,t.statistic_date,t.create_channel,t.coupon_type,t.busi_date LIMIT ? OFFSET ?|2|2|1||0|0|105942|52971|0|0|
|user_service|SELECT * FROM `user_employee_?`|2|6|4||0|0|1234777|835482|1234777|835482|
|v4_user|SELECT es.tenant_id AS tenantId,es.tenant_app_id AS tenantAppId,es.member_erp_id AS id,count(DISTINCT if(es.sales_status=? AND es.is_sales=?,concat(es.dept_erp_id,?,es.sales_date),?)) AS saleNum,ifnull(sum(if(es.sales_status=?,esd.amount_total,?)),?) AS totalSaleAmount,min(if(es.sales_status=? AND es.is_sales=?,es.sales_date,?)) AS firstSaleTime,max(if(es.sales_status=? AND es.is_sales=?,es.sales_date,?)) AS lastSaleTime,GROUP_CONCAT(DISTINCT if(es.sales_status=? AND es.is_sales=?,DATE_FORMAT(es.sales_date,?),?)) AS saleTimes FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON es.tenant_id=esd.tenant_id AND es.tenant_app_id=esd.tenant_app_id AND es.sales_erp_id=esd.sales_erp_id AND esd.sales_type IN(?) WHERE es.tenant_id=? AND es.tenant_app_id=? AND es.sales_status>=? AND es.member_erp_id IN|2|3|1||0|0|14846|9833|785|406|
|account|SELECT es.id,es.tenant_id,es.tenant_app_id,es.employee_id,ey.employee_erp_id,ey.employee_name,ey.mobile_no,es.shop_id,es.dept_erp_id,ws.shop_name,ey.corp_wx_user_id corp_user_id,es.`status` AS employee_status FROM tenant.employee_shop es LEFT JOIN tenant.employee ey ON es.employee_id=ey.id LEFT JOIN tenant.tenant_wechatapp_shop ws ON es.shop_id=ws.id WHERE es.tenant_app_id=? LIMIT ? OFFSET ?|2|2|1||0|0|19248|9624|6416|3208|
|tenant|SELECT * FROM `erp_sales`|1|1290|1290||0|0|34009194|34009194|34009194|34009194|
|gift_mail|SELECT * FROM `inventory_log`|1|1|1||0|0|216933|216933|216933|216933|
|v4_user|SELECT t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?) AS statistic_date,DATE_FORMAT(t?.recept_time,?) AS statistic_month,DATE_FORMAT(t?.create_time,?) AS busi_date,t?.shop_id,t?.employee_id,t?.customer_type,t?.member_status,count(*) AS total,ifnull(sum(CASE WHEN t?.customer_type=? OR (ifnull(t?.external_user_id,?)=? AND t?.member_id=?) THEN ? ELSE ? END),?)+count(DISTINCT CASE WHEN t?.customer_type=? AND t?.member_id>? THEN t?.member_id ELSE ? END)+count(DISTINCT CASE WHEN t?.customer_type=? AND ifnull(t?.external_user_id,?)!=? THEN t?.external_user_id ELSE ? END) AS persons FROM v4_user.reception_customer t? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.create_time,?),t?.shop_id,t?.employee_id,t?.customer_type,t?.member_status LIMIT ? OFFSET ?|1|6|6||0|0|115889|115889|180|180|
|activity_service|SELECT * FROM `intelligent_push_gift_qualitied`|1|2|2||0|0|510203|510203|510203|510203|
|v4_user|SELECT t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?) AS recept_time FROM v4_user.reception_customer t? JOIN v4_user.reception_customer_log t? ON t?.id=t?.reception_customer_id AND t?.oper_type=? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? AND t?.oper_status&?=? GROUP BY t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?)|1|1|1||0|0|391519|391519|0|0|
|employee|SELECT * FROM `backlog_bak`|1|3|3||0|0|66096|66096|66096|66096|
|account|SELECT eu.tenant_id,eu.tenant_wechatapp_id tenant_app_id,eu.user_id user_id,eu.employee_erp_id employee_user_id,? update_time FROM user_service.user_employee eu WHERE eu.tenant_wechatapp_id=? AND eu.update_time>=? AND eu.update_time<=? LIMIT ? OFFSET ?|1|2|2||0|0|2106|2106|2106|2106|
|gift_mail|SELECT * FROM `trade`|1|3|3||0|0|221141|221141|221141|221141|
|tenant|SELECT * FROM `employee`|1|5|5||0|0|96993|96993|96993|96993|
|sms|SELECT * FROM `sms_send_extend`|1|32|32||0|0|3812631|3812631|3812631|3812631|
|sms|SELECT * FROM `sms_send`|1|103|103||0|0|9514696|9514696|9514696|9514696|
|activity_service|SELECT * FROM `intelligent_marketing_activity_gift`|1|2|2||0|0|498054|498054|498054|498054|
|tenant|SELECT * FROM `employee_shop`|1|1|1||0|0|94521|94521|94521|94521|
|account|SELECT t.tenant_id,t.tenant_app_id,t.mall_product_id,t.shop_id,t.statistic_date,t.busi_date,sum(t.quantity)take_amount,sum(t.total_fee)take_order_fee FROM (SELECT date_format(if(od.take_type=?,od.send_time,od.receive_time),?)statistic_date,date_format(if(od.take_type=?,od.send_time,od.receive_time),?)busi_date,od.tenant_id,od.tenant_wechatapp_id tenant_app_id,dt.product_id mall_product_id,if(od.take_type=?,?,ifnull(ws.dept_erp_id,?))shop_id,dt.quantity,od.total_fee FROM `order`.order_info od INNER JOIN `order`.order_detail dt ON od.id=dt.order_id LEFT JOIN tenant.tenant_wechatapp_shop ws ON od.take_shop_id=ws.id WHERE od.tenant_wechatapp_id=? AND ((od.take_type=? AND od.receive_time>=? AND od.receive_time<=?) OR (od.take_type=? AND od.send_time>=? AND od.send_time<=?)))t GROUP BY t.tenant_id,t.tenant_app_id,t.mall_product_id,t.shop_id,t.statistic_date,t.busi_date LIMIT ? OFFSET ?|1|1|1||0|0|63064|63064|0|0|
|employee|SELECT * FROM `backlog_detail`|1|6|6||0|0|1429463|1429463|1429463|1429463|
|gift_mail|SELECT * FROM `trade_take`|1|1|1||0|0|215713|215713|215713|215713|
|employee|SELECT * FROM `backlog_file`|1|60|60||0|0|10442927|10442927|10442927|10442927|
|v4_user|SELECT DATE_FORMAT(es.sales_date,?) AS statistic_date,DATE_FORMAT(es.sales_date,?) AS statistic_month,DATE_FORMAT(es.update_time,?) AS busi_date,es.tenant_id,es.tenant_app_id,ifnull(sp.id,?) AS shop_id,ifnull(emp.id,?) AS employee_id,? AS saleStatus,?*count(t?.id) AS `comment`,?*ifnull(sum(if(t?.average_score<t?.low_score,?,?)),?) AS low_comment,?*ifnull(sum(t?.average_score),?) AS score_total FROM v4_sales.`comment`t? JOIN v4_sales.erp_sales es ON es.id=t?.order_id AND es.tenant_id=t?.tenant_id AND es.tenant_app_id=t?.tenant_app_id AND es.sales_status=? LEFT JOIN tenant.employee emp ON es.tenant_id=emp.tenant_id AND emp.employee_erp_id=es.employee_erp_id LEFT JOIN v4_employee.shop sp ON es.tenant_id=sp.tenant_id AND es.dept_erp_id=sp.dept_id WHERE es.tenant_id=? AND es.tenant_app_id=? AND es.update_time>=? AND es.update_time<? GROUP BY es.tenant_id,es.tenant_app_id,sp.id,emp.id,DATE_FORMAT(es.sales_date,?),DATE_FORMAT(es.sales_date,?),DATE_FORMAT(es.update_time,?) LIMIT ? OFFSET ?|1|1|1||0|0|615877|615877|4|4|
|activity_service|SELECT * FROM `assist_task_user`|1|2|2||0|0|400022|400022|400022|400022|
|erp_sync|SELECT * FROM `sync_record_?`|1|66|66||0|0|3370712|3370712|3370712|3370712|
|tenant|SELECT * FROM `erp_employee`|1|2|2||0|0|89091|89091|89091|89091|
|item_manage|SELECT * FROM `task`|1|1|1||0|0|65359|65359|65359|65359|
|message_push|SELECT * FROM `message_log`|1|47|47||0|0|2735431|2735431|2735431|2735431|
|activity_service|SELECT * FROM `intelligent_marketing_activity_msg`|1|14|14||0|0|1059554|1059554|1059554|1059554|
|v4_user|SELECT ifnull(group_concat(DISTINCT IF(es.sales_status=?,sd.category_erp_id,?)),?)saleCategoryIds,ifnull(group_concat(DISTINCT IF(es.sales_status=?,ifnull(pc.category_name,sd.category_name),?)),?) AS saleCategoryNames,ifnull(GROUP_CONCAT(DISTINCT IF(es.sales_status=?,if(sd.sales_brand=? OR sd.sales_brand=?,?,sd.sales_brand),?)),?) AS salesBrand,ifnull(GROUP_CONCAT(DISTINCT IF(es.sales_status=?,if(sd.sales_craft=? OR sd.sales_craft=?,?,sd.sales_craft),?)),?) AS salesCraft FROM v4_sales.erp_sales es INNER JOIN v4_sales.erp_sales_detail sd ON sd.tenant_id=es.tenant_id AND es.tenant_app_id=sd.tenant_app_id AND es.sales_erp_id=sd.sales_erp_id AND sd.sales_type=? LEFT JOIN v4_sales.erp_product_category pc ON es.tenant_id=pc.tenant_id AND sd.category_erp_id=pc.category_erp_id WHERE es.tenant_id=? AND es.tenant_app_id=? AND es.member_erp_id IN (?) AND es.is_sales=? AND es.sales_status>=?|1|5|5||0|0|15103|15103|1|1|
|v4_user|SELECT DATE_FORMAT(tt?.recept_time,?) AS statistic_date,DATE_FORMAT(tt?.recept_time,?) AS statistic_month,DATE_FORMAT(tt?.create_time,?) AS busiDate,tt?.tenant_id,tt?.tenant_app_id,tt?.shop_id,tt?.fieldName,tt?.fieldValue,count(*) AS total FROM (SELECT t?.id AS reception_customer_id,t?.recept_time,t?.create_time,t?.tenant_id,t?.tenant_app_id,t?.shop_id,? AS fieldName,TRIM(? FROM JSON_EXTRACT(t?.checkin_labels,concat(SUBSTRING(TRIM(? FROM JSON_SEARCH(t?.checkin_labels,?,?)),?,LOCATE(?,TRIM(? FROM JSON_SEARCH(t?.checkin_labels,?,?)))-?),?))) AS fieldValue FROM v4_user.reception_customer t? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? AND JSON_CONTAINS(t?.checkin_labels,JSON_OBJECT(?,?)))tt? GROUP BY DATE_FORMAT(tt?.recept_time,?),DATE_FORMAT(tt?.recept_time,?),DATE_FORMAT(tt?.create_time,?),tt?.tenant_id,tt?.tenant_app_id,tt?.shop_id,tt?.fieldName,tt?.fieldValue|1|1|1||0|0|115632|115632|35|35|
|user_service|SELECT * FROM `tenant_member_info`|1|102|102||0|0|18961238|18961238|18961238|18961238|
|sms|SELECT * FROM `sms_send_back`|1|1|1||0|0|16036|16036|16036|16036|
|v4_user|SELECT t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?) AS statistic_date,DATE_FORMAT(t?.recept_time,?) AS statistic_month,DATE_FORMAT(t?.recept_time,?) AS `hour`,DATE_FORMAT(t?.create_time,?) AS busi_date,t?.shop_id,count(*) AS total FROM v4_user.reception_customer t? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.create_time,?),t?.shop_id LIMIT ? OFFSET ?|1|1|1||0|0|115792|115792|115|115|
|tenant|SELECT * FROM `employee_qrcode`|1|2|2||0|0|66995|66995|66995|66995|
