|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|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 ?|389|5785|189||0|0|10577768|369387|3658|292|
|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 ?|324|6657|166||0|0|10839909|369299|3383|250|
|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,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|257|1497|81||0|0|10511377|163774|7477|266|
|v4_user|SELECT t?.id,t?.tenant_id,t?.tenant_app_id,t?.sales_erp_id,t?.member_status,t?.first_sales FROM v4_sales.erp_sales_extend? t? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.update_time>=? AND t?.update_time<? LIMIT ? OFFSET ?|234|423|4||0|0|47805894|547608|742|134|
|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|121|378|22||0|0|4581821|86079|4831|259|
|v4_user|SELECT t?.id,t?.tenant_id,t?.tenant_app_id,t?.checkin_shop_id AS shop_id,t?.checkin_employee_id AS employee_id,t?.external_user_id AS externalUserId,ifnull(t?.member_name,ifnull(t?.external_user_name,?)) AS customer_name,ifnull(t?.mobile_no,?) AS mobile_no,t?.serial_number,DATE_FORMAT(t?.checkin_time,?) AS checkin_date,(CASE t?.`status` WHEN ? THEN ? ELSE ? END) AS `status`,if(t?.`status`=?,t?.finish_time,?) AS deal_time,ifnull(cds.sales_amount,?) AS deal_amount,ifnull(cds.sales_erp_id,?) AS sales_erp_id FROM v4_user.potential_customer t? LEFT JOIN v4_user.potential_customer_deal_sales cds ON t?.id=cds.potential_customer_id LEFT JOIN v4_user.cwx_external_user t? ON t?.tenant_id=t?.tenant_id AND t?.external_user_id=t?.external_user_id LEFT 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?.update_time>=? AND t?.update_time<? LIMIT ? OFFSET ?|102|386|16||0|0|2609786|36714|7820|5000|
|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 ?|84|201|8||0|0|35178854|569752|1169|137|
|v4_user|SELECT t?.id,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,(CASE t?.customer_type WHEN ? THEN ? ELSE ? END) AS customer_type,ifnull(t?.external_user_id,?) AS external_user_id,ifnull(t?.member_id,?) AS member_id,t?.oper_status,t?.recept_time,t?.checkin_labels FROM v4_user.reception_customer t? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.update_time>=? AND t?.update_time<? LIMIT ? OFFSET ?|80|367|14||0|0|4644648|106966|558|184|
|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 ?|67|311|13||0|0|1096730|26056|157|112|
|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=?|57|144|13||0|0|11330010|380311|626|64|
|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 ?|55|83|4||0|0|17874333|325867|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 ?|54|251|33||0|0|643489|31114|16496|3458|
|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 ?|48|436|129||0|0|10509945|1498299|1440|157|
|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 ?|47|150|6||0|0|12519227|266387|0|0|
|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|39|440|54||0|0|2494865|203585|2899|259|
|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)|36|89|5||0|0|8625016|308671|36|1|
|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 `should` FROM v4_sales.warranty_can_added 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 ?|34|80|6||0|0|7488344|369044|1171|137|
|v4_user|SELECT count(DISTINCT if(es.sales_status=?,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=?,es.sales_date,?)) AS firstSaleTime,max(if(es.sales_status=?,es.sales_date,?)) AS lastSaleTime,GROUP_CONCAT(DISTINCT if(es.sales_status=?,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.is_sales=? AND es.sales_status>=?|30|74|8||0|0|811184|39745|30|1|
|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|29|57|7||0|0|13900719|479427|3|1|
|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 ?|27|81|4||0|0|23175937|1193119|118|53|
|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 ?|24|62|9||0|0|3156583|309189|4215|382|
|v4_user|SELECT t.id,t.tenant_id,ifnull(if(t.dept_erp_id=?,e.dept_erp_id,t.dept_erp_id),?) AS dept_erp_id,t.employee_id,t.external_user_id,t.corp_user_id AS employeeCorpId,t.oper_type,t.create_time AS oper_time FROM v4_user.employee_external_bind_log t LEFT JOIN tenant.employee e ON t.employee_id=e.id WHERE t.tenant_id=? AND t.create_time>=? AND t.create_time<? LIMIT ? OFFSET ?|21|29|2||0|0|4294212|287026|207|22|
|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 ?|18|44|6||0|0|209413|43504|0|0|
|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 ?|18|26|2||0|0|8694596|483071|0|0|
|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 ?|12|20|2||0|0|2416514|309019|1173|223|
|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 ?|11|45|18||0|0|3631924|855376|0|0|
|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 ?|10|14|2||0|0|15714|3098|15714|3098|
|employee|SELECT * FROM `backlog_?`|10|33|8||0|0|2379472|431959|2379472|431959|
|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 ?|10|14|2||0|0|1774940|309069|1354|256|
|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 ?|10|15|3||0|0|408898|92625|168|73|
|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 ?|10|105|36||0|0|5248603|1716691|115|23|
|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|21|6||0|0|373600|106826|175|47|
|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 ?|8|25|7||0|0|3336138|855662|170|143|
|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=?,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=?,es.sales_date,?)) AS firstSaleTime,max(if(es.sales_status=?,es.sales_date,?)) AS lastSaleTime,GROUP_CONCAT(DISTINCT if(es.sales_status=?,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.is_sales=? AND es.sales_status>=? AND es.member_erp_id IN (?) GROUP BY es.tenant_id,es.tenant_app_id,es.member_erp_id|8|15|3||0|0|149046|45526|564|203|
|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 ?|7|23|10||0|0|2464878|855416|140|59|
|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 ?|6|8|1||0|0|518931|246764|77|48|
|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 ?|6|14|5||0|0|19442|5271|14442|5000|
|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 ?|5|8|2||0|0|123765|58426|44|29|
|v4_user|SELECT t?.tenant_id,sp.tenant_app_id,sp.id AS shop_id,t?.id AS employee_id,sum(if(t?.oper_type=?,?,?)) AS `add`,sum(if(t?.oper_type=?,?,?)) AS `emp_del_customer`,sum(if(t?.oper_type=?,?,?)) AS `customer_del_emp` FROM v4_user.employee_external_bind_log t? JOIN tenant.employee t? ON t?.tenant_id=t?.tenant_id AND t?.employee_id=t?.id JOIN v4_employee.shop sp ON t?.tenant_id=sp.tenant_id AND t?.dept_erp_id=sp.dept_id WHERE t?.tenant_id=? AND sp.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? GROUP BY t?.tenant_id,sp.tenant_app_id,sp.id,t?.id LIMIT ? OFFSET ?|5|8|2||0|0|1625014|737246|211|76|
|account|SELECT count(?) FROM tenant.erp_sales t? LEFT JOIN tenant.erp_sales_extend? ese ON t?.tenant_id=ese.tenant_id AND t?.tenant_wechatapp_id=ese.tenant_app_id AND t?.sales_erp_id=ese.sales_erp_id LEFT JOIN warranty_service.warranty t? ON t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.sales_erp_id=t?.erp_sales_id AND t?.is_disable=? WHERE t?.tenant_id=? AND t?.tenant_wechatapp_id=? AND t?.sales_status=? AND t?.is_sales=?|4|23|10||0|0|667830|308585|4|1|
|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 ?|4|8|2||0|0|603253|290691|271|113|
|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<=?|4|5|2||0|0|44152|19027|0|0|
|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 ?|3|4|2||0|0|976135|325403|42|18|
|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|3|48|23||0|0|94491|40747|1493|499|
|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 ?|3|13|6||0|0|77494|36309|19|10|
|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|55268|28642|25|18|
|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)|3|6|3||0|0|7825|4003|3|1|
|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 ?|3|3|1||0|0|86004|28668|3|1|
|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 ?|3|5|3||0|0|82935|62462|47|43|
|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 ?|3|5|2||0|0|29574|11503|0|0|
|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,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|3|87|48||0|0|126590|57188|1500|500|
|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 ?|3|3|1||0|0|595710|290614|389|224|
|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|3|3|1||0|0|320424|106830|63|32|
|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 ?|3|3|1||0|0|19221|9612|6407|3204|
|v4_sales|SELECT * FROM `erp_sales`|2|1155|1104||0|0|39549475|33484536|39549475|33484536|
|account|SELECT id,tenant_id,tenant_wechatapp_id tenant_app_id,activity_name,status,activity_type FROM activity_service.activity WHERE tenant_wechatapp_id=? AND create_time>=? AND create_time<=? LIMIT ? OFFSET ?|2|2|1||0|0|19632|9816|0|0|
|v4_user|SELECT DATE_FORMAT(t?.create_time,?) AS statistic_date,DATE_FORMAT(t?.create_time,?) AS statistic_month,DATE_FORMAT(t?.update_time,?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.scene AS channleName,t?.template_id AS templateId,ct.coupon_name,? AS `status`,?*count(t?.coupon_id) AS used FROM v4_coupon.coupon t? JOIN v4_coupon.coupon_template ct ON t?.template_id=ct.id JOIN v4_coupon.coupon_write_off t? ON t?.id=t?.coupon_id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.update_time>=? AND t?.update_time<? AND t?.`status`=? GROUP BY DATE_FORMAT(t?.create_time,?),DATE_FORMAT(t?.create_time,?),DATE_FORMAT(t?.update_time,?),t?.tenant_id,t?.tenant_app_id,t?.scene,t?.template_id,ct.coupon_name LIMIT ? OFFSET ?|2|2|1||0|0|32145|24831|0|0|
|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 ?|2|2|1||0|0|213666|106900|89|89|
|account|SELECT t?.id,t?.tenant_id,t?.tenant_wechatapp_id AS tenantAppId,tb.erp_member_id AS memberId,t?.order_no,(CASE t?.source WHEN ? THEN ? ELSE ? END) AS orderSource,t?.product_fee AS totalGoodsFee,t?.discount_fee AS discountFee,t?.total_fee AS shouldPayFee,t?.online_wait_fee,t?.payment_fee,t?.payment_time,t?.offline_wait_fee,t?.offline_payment_fee,t?.freight_fee,t?.create_time AS orderTime,t?.send_time,t?.receive_time,t?.finish_time,t?.comment_time,t?.refund_start_time,t?.refund_end_time,t?.return_start_time,t?.return_end_time,(CASE t?.pay_way WHEN ? THEN ? ELSE ? END) AS payWay,(CASE t?.take_type WHEN ? THEN ? ELSE ? END)takeType,ifnull(t?.take_shop_id,?) AS take_shop_id,ifnull(t?.take_employee_id,?) AS take_employee_id,ifnull(t?.user_employee_id,?) AS user_employee_id,t?.manager_brokerage AS butlerBrokerage,(CASE t?.`status` WHEN ? THEN ? ELSE ? END) AS orderStatus,(CASE t?.finish_type WHEN ? THEN ? ELSE ? END)AS finishType,(CASE t?.business_type WHEN ? THEN ? ELSE ? END) AS shareSource,(CASE t?.share_user_type WHEN ? THEN t?.share_user_id ELSE ? END)share_employee_id,(CASE t?.share_user_type WHEN ? THEN t?.share_user_id ELSE ? END)shareMemberId FROM `order`.order_info t? JOIN user_service.tenant_member_bind tb ON tb.tenant_id=t?.tenant_id AND tb.tenant_app_id=t?.tenant_wechatapp_id AND tb.user_id=t?.user_id AND tb.tenant_id=? LEFT JOIN goods.share_detail t? ON t?.id=t?.order_id LEFT JOIN (SELECT s?.id,s?.business_type,s?.share_user_type,tb.erp_member_id AS share_user_id FROM goods.`share` s? JOIN user_service.tenant_member_bind tb ON tb.tenant_id=s?.tenant_id AND tb.tenant_app_id=s?.tenant_app_id AND tb.user_id=s?.share_user_id AND tb.tenant_id=? WHERE s?.tenant_app_id=? AND s?.share_user_type=? UNION ALL SELECT s?.id,s?.business_type,s?.share_user_type,s?.share_user_id FROM goods.`share` s? WHERE s?.tenant_app_id=? AND s?.share_user_type=?)t? ON t?.share_id=t?.id WHERE t?.tenant_wechatapp_id=? AND t?.update_time>=? AND t?.update_time<=? LIMIT ? OFFSET ?|2|3|2||0|0|355187|177630|52|38|
|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 ?|2|2|1||0|0|340793|325543|47|39|
|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 ?|2|4|3||0|0|275229|141838|0|0|
|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 ?|2|2|1||0|0|125068|62541|3|3|
|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 ?|2|2|1||0|0|452546|290718|77|52|
|account|SELECT vau.id,vau.tenant_id,vau.tenant_wechatapp_id AS tenant_app_id,vaue.dept_erp_id AS erp_dept_id,vaue.employee_erp_id AS erp_emp_id,vau.user_id,DATE_FORMAT(vaue.sales_date,?) AS busi_date,vaue.category_erp_id,vau.amount_added AS value_add_amount,vau.state,vau.create_time,vau.update_time FROM value_added.value_added_user vau JOIN value_added.value_added_user_extend vaue ON vau.id=vaue.id WHERE vau.tenant_id=? AND vau.tenant_wechatapp_id=? AND vau.update_time>=? AND vau.update_time<=? ORDER BY vau.id LIMIT ? OFFSET ?|2|2|1||0|0|216751|190510|8747|5000|
|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|213932|106990|200|112|
|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 ?|2|5|4||0|0|569536|285411|6286|5000|
|v4_user|SELECT DATE_FORMAT(t?.create_time,?) AS statistic_date,DATE_FORMAT(t?.create_time,?) AS statistic_month,DATE_FORMAT(t?.update_time,?) AS busi_date,t?.tenant_id,t?.tenant_app_id,t?.product_id,t?.product_name,t?.category_id AS classifyId,t?.category_name AS classifyName,ifnull(tt.take_shop_id,?) AS usedShopid,sum(t?.quantity) AS used,count(t?.member_id) AS used_member,sum(t?.pay_points) AS used_point,sum(t?.pay_price) AS deal_amount FROM v4_giftmall.trade t? JOIN v4_giftmall.product t? ON t?.tenant_id=t?.tenant_id AND t?.product_id=t?.id JOIN v4_giftmall.category t? ON t?.category_id=t?.id LEFT JOIN v4_giftmall.trade_take tt ON t?.id=trade_id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.trade_type=? AND t?.order_status=? AND t?.update_time>=? AND t?.update_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,t?.product_id,t?.product_name,t?.category_id,t?.category_name,ifnull(tt.take_shop_id,?),DATE_FORMAT(t?.create_time,?),DATE_FORMAT(t?.create_time,?),DATE_FORMAT(t?.update_time,?) LIMIT ? OFFSET ?|2|2|1||0|0|32222|16123|115|60|
|account|SELECT u.id,u.tenant_id,u.tenant_app_id,tw.dept_erp_id AS shop_id,date_format(u.birthday,?) AS tempBirthDay,ifnull(u.birthday_is_lunar,?) AS birthdayIsLunar,u.memorial_name,date_format(u.memorial_day,?) AS tempMemorialDay,ifnull(u.memorial_day_is_lunar,?) AS memorialDayIsLunar,u.grade_id AS gradeErpId,if(u.birthday IS ?,?,?) AS fullFlag FROM user_service.tenant_member_info u LEFT JOIN tenant.tenant_wechatapp_shop tw ON u.shop_id=tw.id WHERE u.tenant_id=? AND u.tenant_app_id=? AND u.update_time>=? AND u.update_time<=? ORDER BY u.tenant_id,u.id LIMIT ? OFFSET ?|2|2|1||0|0|83552|46776|10000|5000|
|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|2|53|27||0|0|135273|72663|996|499|
|account|SELECT * FROM (SELECT t?.id,t?.tenant_id,t?.tenant_app_id,t?.share_user_id AS user_id,t?.user_name AS user_name,t?.share_user_type AS user_identity,t?.business_id AS goods_id,t?.goods_name AS goods_name,DATE_FORMAT(oi.finish_time,?) AS busi_date,count(*) AS deal_amount,ifnull(sum(oi.total_fee),?) AS deal_money FROM goods.`share` t? JOIN goods.share_detail sd ON t?.id=sd.share_id JOIN ORDER.order_info oi ON sd.order_id=oi.id AND oi.tenant_wechatapp_id=? AND oi.status=? JOIN goods.goods t? ON t?.business_id=t?.id JOIN user_service.tenant_member t? ON t?.tenant_id=t?.tenant_id AND t?.tenant_app_id=t?.tenant_app_id AND t?.share_user_id=t?.user_id WHERE t?.tenant_app_id=? AND t?.share_user_type=? AND t?.business_type=? AND oi.finish_time>=? AND oi.finish_time<=? GROUP BY t?.id,DATE_FORMAT(oi.finish_time,?) UNION ALL SELECT t?.id,t?.tenant_id,t?.tenant_app_id,t?.share_user_id AS user_id,t?.employee_name AS user_name,t?.share_user_type AS user_identity,t?.business_id AS goods_id,t?.goods_name AS goods_name,DATE_FORMAT(oi.finish_time,?) AS busi_date,count(*) AS deal_amount,ifnull(sum(oi.total_fee),?) AS deal_money FROM goods.`share` t? JOIN goods.share_detail sd ON t?.id=sd.share_id JOIN ORDER.order_info oi ON sd.order_id=oi.id AND oi.tenant_wechatapp_id=? AND oi.status=? JOIN goods.goods t? ON t?.business_id=t?.id JOIN tenant.employee t? ON t?.share_user_id=t?.id WHERE t?.tenant_app_id=? AND t?.share_user_type=? AND t?.business_type=? AND oi.finish_time>=? AND oi.finish_time<=? GROUP BY t?.id,DATE_FORMAT(oi.finish_time,?))tt ORDER BY tt.id ASC LIMIT ? OFFSET ?|2|3|2||0|0|81017|61194|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 ?|1|1|1||0|0|7994|7994|4|4|
|account|SELECT * FROM `account_flow`|1|132|132||0|0|16318747|16318747|16318747|16318747|
|v4_employee|SELECT t?.average_score,emp.employee_name,es.sales_no,tm.member_name,tm.mobile_no 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.is_sales=? AND es.sales_status=? JOIN tenant.employee emp ON emp.tenant_id=t?.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 LEFT JOIN v4_user.member tm ON t?.tenant_id=tm.tenant_id AND t?.tenant_app_id=tm.tenant_app_id AND t?.member_id=tm.id WHERE t?.tenant_id=? AND sp.id IN (?) AND t?.create_time>=? AND t?.create_time<=? AND t?.average_score<t?.low_score|1|2|2||0|0|72169|72169|0|0|
|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,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 ?|1|1|1||0|0|290614|290614|33|33|
|user_service|SELECT * FROM `user_employee_alloc_log`|1|120|120||0|0|23570923|23570923|23570923|23570923|
|account|SELECT tenant_id,tenant_app_id,user_id,member_image_flag,member_image_time FROM user_service.tenant_member_info WHERE tenant_id=? AND tenant_app_id=? AND member_image_flag=? AND update_time>=? AND update_time<=? LIMIT ? OFFSET ?|1|1|1||0|0|3316|3316|1020|1020|
|export|SELECT od.id,if(od.take_type=?,?,?)takeType,od.create_time,od.freight_fee,od.payment_fee,dt.price,dt.quantity,dt.art_no,dt.product_name,ad.user_name receiveName,ad.mobile_no,ad.shop_name,ad.address,ad.express_no,ad.express_company,od.user_name,od.update_time,od.receive_time,od.user_id,od.mobile_no buyMobileNo,od.remark,dt.spec,od.take_shop_name,od.take_employee_user_name,od.offline_payment_fee, CASE WHEN od.pay_way=? THEN ? ELSE ? END payWay,od.pay_id,od.payment_time, CASE WHEN od.status=? AND od.finish_type=? THEN ? WHEN od.status=? THEN ? WHEN od.status=? AND od.child_status=? THEN ? ELSE ? END statusName, CASE WHEN od.activity_type=? THEN ? ELSE ? END activityName,if(od.take_type=?,od.receive_time,?)takeTime FROM `order`.order_info od LEFT JOIN `order`.order_detail dt ON od.id=dt.order_id LEFT JOIN `order`.order_address ad ON od.id=ad.order_id WHERE od.tenant_wechatapp_id=? ORDER BY od.create_time DESC|1|1|1||0|0|39918|39918|13306|13306|
|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 ?|1|1|1||0|0|456|456|0|0|
|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 ?|1|1|1||0|0|14480|14480|6|6|
|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 ?|1|2|2||0|0|15997|15997|0|0|
|account|SELECT t?.id,t?.tenant_id,t?.tenant_app_id,t?.employee_id,if(t?.member_erp_id>?,?,t?.member_erp_id) AS memberId,t?.shop_id,(CASE t?.scene WHEN ? THEN ? ELSE ? END) AS taskType,t?.create_time AS taskCreateTime,t?.begin_time AS beginTime,t?.expire_time AS expireTime,t?.finish_time AS finishTime,(CASE t?.`status` WHEN ? THEN ? ELSE ? END) AS status FROM employee.backlog_? t? WHERE t?.tenant_app_id=? AND t?.update_time>=? AND t?.update_time<=? LIMIT ? OFFSET ?|1|1|1||0|0|10000|10000|5000|5000|
|activity_service|SELECT * FROM `intelligent_marketing_activity_gift`|1|3|3||0|0|498054|498054|498054|498054|
|account|SELECT es.tenant_id,es.tenant_wechatapp_id tenant_app_id,es.member_erp_id,es.sales_erp_id lastSaleErpId,sd.category_erp_id lastCategoryId,ifnull(pc.category_name,sd.category_name) AS lastCategoryName,sd.stone_weight lastStoneWeight,sd.gold_weight lastGoldWeight,round(sd.amount_pay/if(sd.quantity=?,?,sd.quantity),?)price,sd.amount_pay salesBalance 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 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.member_erp_id=? AND es.sales_date>=? AND es.sales_status=? AND es.is_sales=? AND sd.sales_type=? ORDER BY es.sales_erp_id DESC,price DESC LIMIT ?|1|3|3||0|0|4092|4092|1|1|
|activity_service|SELECT * FROM `assist_task_receive_prize`|1|1|1||0|0|10487|10487|10487|10487|
|activity_service|SELECT * FROM `activity_signup_user_apply`|1|1|1||0|0|22312|22312|22312|22312|
|tenant|SELECT * FROM `erp_sales_back_?`|1|34|34||0|0|438960|438960|438960|438960|
|employee|SELECT * FROM `backlog_file`|1|64|64||0|0|10143432|10143432|10143432|10143432|
|activity_service|SELECT * FROM `activity_gift_grant`|1|1|1||0|0|181225|181225|181225|181225|
|activity_service|SELECT * FROM `activity_qualified`|1|1|1||0|0|121017|121017|121017|121017|
|activity_service|SELECT * FROM `assist_task_user`|1|2|2||0|0|400022|400022|400022|400022|
|v4_user|SELECT t.tenant_id,t.tenant_app_id,t.member_id AS id,t.source_type AS sourceType,t.registry_shop_id AS sourceShopId,if(t.source_type=?,t.source_id,?) AS sourceEmployeeId FROM v4_user.member_source t WHERE t.tenant_id=? AND t.tenant_app_id=? AND t.update_time>=? AND t.update_time<? ORDER BY t.id LIMIT ? OFFSET ?|1|1|1||0|0|14478|14478|3|3|
|account|SELECT * FROM `wx_redpacket_send_msg`|1|19|19||0|0|818923|818923|818923|818923|
|account|SELECT t.tenant_id,t.tenant_app_id,t.shop_id,t.user_id,t.scene,t.busi_date,count(*)finish_amount FROM (SELECT bg.id,bg.tenant_id,bg.tenant_app_id,ifnull(ws.dept_erp_id,?)shop_id,ifnull(ey.employee_erp_id,?)user_id,bg.status,bg.scene,date_format(bg.expire_time,?)busi_date FROM employee.backlog_? bg INNER JOIN tenant.tenant_wechatapp_shop ws ON bg.shop_id=ws.id INNER JOIN tenant.employee ey ON bg.employee_id=ey.id WHERE bg.tenant_app_id=? AND bg.status IN (?) AND bg.scene NOT IN(?) AND bg.finish_time>=? AND bg.finish_time<=?)t GROUP BY t.tenant_id,t.tenant_app_id,t.shop_id,t.user_id,t.scene,t.busi_date LIMIT ? OFFSET ?|1|1|1||0|0|9262|9262|1263|1263|
|activity_service|SELECT * FROM `intelligent_marketing_activity_msg`|1|17|17||0|0|1059554|1059554|1059554|1059554|
|account|SELECT * FROM (SELECT t?.id,t?.tenant_id,t?.tenant_app_id,t?.share_user_id AS user_id,t?.user_name AS user_name,t?.share_user_type AS user_identity,t?.business_id AS activity_id,t?.activity_name AS activity_name,DATE_FORMAT(oi.finish_time,?) AS busi_date,count(*) AS deal_amount,ifnull(sum(oi.total_fee),?) AS deal_money FROM goods.`share` t? JOIN goods.share_detail sd ON t?.id=sd.share_id JOIN ORDER.order_info oi ON sd.order_id=oi.id AND oi.tenant_wechatapp_id=? AND oi.status=? JOIN activity_service.activity t? ON t?.business_id=t?.id JOIN user_service.tenant_member t? ON t?.tenant_id=t?.tenant_id AND t?.tenant_app_id=t?.tenant_app_id AND t?.share_user_id=t?.user_id WHERE t?.tenant_app_id=? AND t?.share_user_type=? AND t?.business_type!=? AND oi.finish_time>=? AND oi.finish_time<=? GROUP BY t?.id,DATE_FORMAT(oi.finish_time,?) UNION ALL SELECT t?.id,t?.tenant_id,t?.tenant_app_id,t?.share_user_id AS user_id,t?.employee_name AS user_name,t?.share_user_type AS user_identity,t?.business_id AS activity_id,t?.activity_name AS activity_name,DATE_FORMAT(oi.finish_time,?) AS busi_date,count(*) AS deal_amount,ifnull(sum(oi.total_fee),?) AS deal_money FROM goods.`share` t? JOIN goods.share_detail sd ON t?.id=sd.share_id JOIN ORDER.order_info oi ON sd.order_id=oi.id AND oi.tenant_wechatapp_id=? AND oi.status=? JOIN activity_service.activity t? ON t?.business_id=t?.id JOIN tenant.employee t? ON t?.share_user_id=t?.id WHERE t?.tenant_app_id=? AND t?.share_user_type=? AND t?.business_type!=? AND oi.finish_time>=? AND oi.finish_time<=? GROUP BY t?.id,DATE_FORMAT(oi.finish_time,?))tt ORDER BY tt.id ASC LIMIT ? OFFSET ?|1|1|1||0|0|35100|35100|0|0|
|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|3|3||0|0|59324|59324|1|1|
|v4_user|SELECT COUNT(*) AS total FROM v4_user.member m JOIN (SELECT recommend_id,count(*) AS recommend_count FROM v4_user.member WHERE tenant_id=? AND tenant_app_id=? AND recommend_id>? AND recommend_bind_time>=? AND recommend_bind_time<? GROUP BY recommend_id)x ON x.recommend_id=m.id WHERE m.tenant_id=? AND m.tenant_app_id=?|1|1|1||0|0|290661|290661|1|1|
|export|SELECT pc.id,pc.cutomer_grade AS cutomerGrade,ifnull(mem.member_name,ifnull(eu.external_user_name,?)) AS `name`,mem.mobile_no,pc.maintain_employee_name AS maintainEmployee,pc.last_maintain_time,(CASE WHEN pc.`status`=? THEN pc.finish_time ELSE ? END)dealTime,pc.maintain_num AS maintainNum,pc.intention_num,pc.latest_intention,sp.`name` AS maintainShop,pc.`status`,(CASE pc.`status` WHEN ? THEN ? ELSE ? END) AS statusName,pc.fail_employee_name AS failEmployee,pc.checkin_time,pc.finish_time AS finishTime FROM v4_user.potential_customer pc LEFT JOIN (SELECT t?.tenant_id,ifnull(t?.member_name,t?.external_user_name) AS external_user_name,t?.external_user_id FROM v4_user.cwx_external_user t? LEFT JOIN v4_user.member t? ON t?.tenant_id=? AND t?.tenant_app_id=? AND t?.external_user_id=t?.external_user_id WHERE t?.tenant_id=?)eu ON pc.tenant_id=eu.tenant_id AND pc.external_user_id=eu.external_user_id LEFT JOIN v4_user.member mem ON pc.tenant_id=mem.tenant_id AND pc.member_id=mem.id AND mem.`status`=? LEFT JOIN v4_employee.shop sp ON pc.maintain_shop_id=sp.id WHERE pc.tenant_id=? AND pc.tenant_app_id=? AND EXISTS (SELECT ? FROM v4_user.potential_customer_maintain t? WHERE pc.id=t?.potential_customer_id AND t?.create_time>=? AND t?.create_time<=? AND t?.event_type IN(?)) ORDER BY pc.id DESC|1|1|1||0|0|7606|7606|323|323|
|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 ?|1|1|1||0|0|52226|52226|0|0|
|account|SELECT * FROM `wx_redpacket_send_order`|1|13|13||0|0|886438|886438|886438|886438|
|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|45546|45546|0|0|
|account|SELECT t?.id,t?.tenant_id,t?.tenant_app_id,t?.template_id AS coupon_template_id,t?.coupon_no,t?.coupon_name,(CASE t?.coupon_type WHEN ? THEN ? ELSE ? END) AS coupon_type,ifnull(t?.face_value,?)/? AS face_value,t?.discount,ifnull(t?.use_threshold,?)/? AS use_threshold,(CASE t?.source WHEN ? THEN ? ELSE ? END) AS grantChannel,(CASE cm.pay_type WHEN ? THEN ? ELSE ? END) AS saleMethod,t?.begin_time AS effectTime,t?.end_time AS expireTime,(CASE t?.source_user_type WHEN ? THEN t?.source_user_id ELSE ? END) AS grantEmployeeId,ifnull(t?.source_shop_id,?) AS grantShopId,ifnull(es.dept_erp_id,?) AS grantDeptId,(CASE t?.coupon_state WHEN ? THEN ? END) AS couponStatus,ifnull(tb?.erp_member_id,?) AS firstBlongMemberId,t?.create_time AS receiveTime,ifnull(tb.erp_member_id,?) AS lastBlongMemberId,t?.reservation_time AS reservationTime,ifnull(t?.shop_id,?) AS reservationShopId FROM coupon_service.coupon t? LEFT JOIN coupon_service.coupon_extend t? ON t?.id=t?.id LEFT JOIN coupon_service.reservation t? ON t?.id=t?.coupon_user_id AND t?.state=? LEFT JOIN user_service.tenant_member_bind tb ON tb.tenant_id=t?.tenant_id AND tb.tenant_app_id=t?.tenant_app_id AND tb.user_id=t?.user_id AND tb.tenant_id=? LEFT JOIN user_service.tenant_member_bind tb? ON tb?.tenant_id=t?.tenant_id AND tb?.tenant_app_id=t?.tenant_app_id AND tb?.user_id=t?.creator_user_id AND tb?.tenant_id=? LEFT JOIN coupon_service.coupon_push cp ON t?.coupon_push_id=cp.id LEFT JOIN coupon_service.coupon_market cm ON cp.source_id=cm.id LEFT JOIN tenant.erp_sales es ON es.tenant_id=? AND es.tenant_wechatapp_id=? AND t?.source=? AND es.sales_erp_id=t?.business_id WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.update_time>=? AND t?.update_time<=? LIMIT ? OFFSET ?|1|1|1||0|0|40000|40000|5000|5000|
|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 ?|1|1|1||0|0|290811|290811|197|197|
