|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|v4_sales|SELECT count(es.id) FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id=es.id AND if(wca.source=?,es.sales_date>=?,wca.create_time>=?) AND wca.tenant_id=? AND wca.tenant_app_id=? LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE es.sales_status=? AND is_sales=? AND es.employee_erp_id=? AND dept_erp_id=? AND w.id IS ? AND es.tenant_id=? AND es.tenant_app_id=?|3345|17506|73||0|0|11373141|29621|3345|1|
|v4_employee|SELECT ? AS task_type,t.system_task_type,count(*) AS undo_count FROM task_task t JOIN task_system_task_template st ON t.task_template_id=st.id AND st.status=? AND st.tenant_id=? AND st.tenant_app_id=? WHERE t.`status`=? AND t.finish_time IS ? AND t.end_time>? AND shop_id=? AND employee_id=? AND t.task_template_id IN (?) AND t.tenant_id=? AND t.tenant_app_id=? GROUP BY t.system_task_type|1290|4652|51||0|0|2333854|7844|2800|5|
|youzan|SELECT id,merchant_id,merchant_shop_id,sync_type,api_name,api_request,api_response,status,error_msg,retry_num,create_time,update_time FROM weimob_platform_sync_log WHERE (status=? AND sync_type IN (?) AND retry_num<?)|563|4357|105||0|0|64892506|115262|0|0|
|tenant|SELECT sales_date FROM tenant.erp_sales WHERE tenant_id=? AND tenant_wechatapp_id=? AND member_erp_id=? AND sales_erp_id<? AND is_sales=? AND sales_status=? ORDER BY sales_erp_id ASC LIMIT ?|461|2455|109||0|0|4943843|40336|422|1|
|v4_employee|SELECT ? AS task_type,t?.id AS invite_task_id,t?.name,ifnull(t?.undo_count,?) AS undo_count,t?.invite_time AS invite_task_start_time,ifnull(t?.interrupt_time,t?.end_time) AS invite_task_end_time FROM task_invite_task_template t? LEFT JOIN (SELECT t.task_template_id AS id,sum(if(t.finish_time IS ?,?,?)) AS undo_count FROM task_task t WHERE t.task_type=? AND t.`status`=? AND t.end_time>? AND t.shop_id=? AND t.employee_id=? AND t.tenant_id=? AND t.tenant_app_id=? GROUP BY t.task_template_id)t? ON t?.id=t?.id WHERE t?.status IN (?) AND t?.tenant_id=? AND t?.tenant_app_id=? ORDER BY t?.id DESC|446|2208|87||0|0|2451818|19359|5623|61|
|youzan|SELECT id,merchant_shop_id,api_name,api_request,api_response,status,error_msg,retry_num,sync_type,create_time,update_time FROM youzan_platform_sync_log WHERE (status=? AND retry_num<? AND create_time>?)|339|1508|42||0|0|59614358|175857|0|0|
|v4_employee|SELECT COUNT(*) AS total FROM mark_label_task WHERE (employee_id=? AND start_time>=? AND end_time<? AND status=?) AND tenant_id=? AND tenant_app_id=?|310|583|6||0|0|225765|3493|310|1|
|user_service|SELECT count(?) FROM user_service.tenant_member t? JOIN user_service.tenant_member_info t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id AND t?.tenant_app_id=? AND t?.shop_id=? JOIN user_service.user_employee ue ON t?.tenant_id=ue.tenant_id AND t?.tenant_app_id=ue.tenant_wechatapp_id AND t?.user_id=ue.user_id AND ue.employee_id=? AND ue.shop_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=?|291|1192|28||0|0|1483219|98559|291|1|
|corpwx|SELECT count(*) AS addedNum FROM external_user t WHERE t.tenant_id=? AND t.corp_user_id=? AND t.create_time>=? AND t.create_time<?|244|439|5||0|0|595571|13410|244|1|
|v4_sales|SELECT id,comment_id,subject_id,subject_type,subject,score,labels,content,tenant_id,tenant_app_id,create_time,update_time FROM comment_detail WHERE (comment_id=?) AND tenant_id=? AND tenant_app_id=?|235|1257|48||0|0|76935695|328725|1175|5|
|user_service|SELECT tmb.erp_member_id AS member_erp_id,tm.tenant_id,tm.tenant_app_id,tm.mobile_no,tm.user_name,tmi.grade_id AS grade_erp_id FROM user_service.tenant_member tm JOIN user_service.tenant_member_bind tmb ON tm.tenant_id=tmb.tenant_id AND tm.id=tmb.id JOIN user_service.tenant_member_info tmi ON tm.tenant_id=tmi.tenant_id AND tm.id=tmi.id WHERE tmb.tenant_id=? AND tmb.tenant_app_id=? AND tmb.erp_member_id IN (?)|230|517|6||0|0|6876|60|2292|20|
|user_service|SELECT * FROM user_service.user_employee WHERE employee_erp_id=? AND tenant_id=? AND tenant_wechatapp_id=? AND date_format(update_time,?)=date_format(now(),?)|223|7929|306||0|0|29232048|132232|2363|38|
|warranty_service|SELECT count(*) FROM warranty WHERE user_id=? AND tenant_wechatapp_id=? AND is_disable=?|194|676|166||0|0|269274|31804|194|1|
|authorization_service|SELECT id,user_id,tenant_id,tenant_wx_app_id,account_id,login_way,login_code,login_token,roles,status,expire_time,create_time,update_time,login_ip,login_time,login_data,employee_id,shop_id,platform_user_id,wx_user_id,wx_app_user_id FROM user_login_token WHERE user_id=? AND tenant_id=? AND tenant_wx_app_id=? AND login_way=? AND status=? AND expire_time>now()|191|330|8||0|0|5149|568|64|1|
|tenant|SELECT sales_erp_id FROM tenant.erp_sales es JOIN tenant.erp_sales_ignore ei ON ei.tenant_id=? AND ei.tenant_app_id=? AND es.sales_erp_id=ei.erp_sales_id WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND member_erp_id=?|185|284|4||0|0|1342686|10447|0|0|
|v4_sales|SELECT count(s.sales_erp_id) FROM (SELECT es.tenant_id,es.tenant_app_id,es.sales_erp_id,esd.product_barcode,max(esd.category_erp_id)category_erp_id,max(es.sales_date)sales_date FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id=es.sales_erp_id AND esd.tenant_id=? AND esd.tenant_app_id=? WHERE dept_erp_id=? AND employee_erp_id=? AND es.sales_status=? AND es.is_sales=? AND es.tenant_id=? AND es.tenant_app_id=? GROUP BY es.tenant_id,es.tenant_app_id,es.sales_erp_id,esd.product_barcode)s LEFT JOIN v4_sales.value_added_ignore i ON i.erp_sales_id=s.sales_erp_id AND i.product_barcode=s.product_barcode AND i.tenant_id=? AND i.tenant_app_id=? LEFT JOIN v4_sales.value_added va ON va.erp_sales_id=s.sales_erp_id AND va.product_barcode=s.product_barcode AND va.tenant_id=? AND va.tenant_app_id=? JOIN v4_sales.value_added_category vac ON vac.erp_category_id=s.category_erp_id AND vac.status=? AND vac.tenant_id=? AND vac.tenant_app_id=? JOIN v4_sales.value_added_template vat ON vat.id=vac.template_id AND vat.status=? AND vat.tenant_id=? AND vat.tenant_app_id=? WHERE if(ifnull(vat.effective_date,?)!=?,s.sales_date>vat.effective_date,?=?) AND va.id IS ? AND i.id IS ?|183|416|11||0|0|859856|18132|183|1|
|corpwx|SELECT t.tenant_id AS tenantId,t.wx_user_id AS wxUserId,t.union_id AS wxUnionId,t.user_id AS externalUserId,ifnull(et.raw_external_user_id,t.old_user_id) AS rawExternalUserId,t.corp_user_id AS employeeCorpUserId FROM corpwx.external_user t LEFT JOIN corpwx.external_userid_transform et ON t.tenant_id=et.tenant_id AND t.user_id=et.external_user_id WHERE t.tenant_id=? AND t.status=? AND t.user_id IN|171|523|31||0|0|292980|1987|128894|911|
|user_service|SELECT tenant_id,id,tenant_app_id,user_id,wx_user_id,erp_member_id,customer_user_id,wx_union_id,create_time,update_time,external_user_id FROM tenant_member_bind WHERE (tenant_id=? AND tenant_app_id=? AND user_id IN (?))|147|230|3||0|0|860|80|860|80|
|user_service|SELECT t?.id,t?.user_id AS userId,t?.user_name AS userName,t?.sex,t?.mobile_no AS mobileNo,t?.head_img_url AS headImg FROM user_service.tenant_member t? JOIN user_service.tenant_member_info t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id AND t?.tenant_app_id=? AND t?.shop_id=? JOIN user_service.user_employee ue ON t?.tenant_id=ue.tenant_id AND t?.tenant_app_id=ue.tenant_wechatapp_id AND t?.user_id=ue.user_id AND ue.employee_id=? AND ue.shop_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=? ORDER BY ue.update_time DESC,t?.id DESC LIMIT ?|140|491|20||0|0|937628|15666|1400|10|
|tenant|SELECT es.id,es.sales_no,es.sales_date,es.member_erp_id,es.sales_erp_id,es.is_sales FROM erp_sales es WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.sales_status=? AND es.sales_no LIKE concat(?,?) ORDER BY es.sales_date DESC LIMIT ?|138|792|60||0|0|54215298|1249014|13|1|
|tenant|SELECT count(DISTINCT concat(dept_erp_id,?,sales_date)) AS total FROM tenant.erp_sales WHERE tenant_id=? AND tenant_wechatapp_id=? AND member_erp_id=? AND sales_status=? AND is_sales=?|121|244|8||0|0|488850|40335|121|1|
|warranty_service|SELECT * FROM warranty WHERE tenant_wechatapp_id=? AND erp_sales_id=? LIMIT ?|114|173|2||0|0|21|1|21|1|
|tenant|SELECT count(?) FROM erp_sales es WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.sales_date>=? AND es.employee_erp_id=? AND es.sales_status=?|110|340|30||0|0|190030|6471|110|1|
|authorization_service|SELECT id,user_id,tenant_id,tenant_wx_app_id,account_id,login_way,login_code,login_token,roles,status,expire_time,create_time,update_time,login_ip,login_time,login_data,employee_id,shop_id,platform_user_id,wx_user_id,wx_app_user_id FROM user_login_token WHERE wx_user_id=? AND tenant_id=? AND tenant_wx_app_id=? AND login_way=? AND expire_time>now() AND status=? AND user_id=?|107|189|3||0|0|22|4|7|1|
|v4_user|SELECT id,checkin_employee_name,maintain_employee_name FROM potential_customer WHERE ((external_user_id=? OR member_id=?) AND status IN (?)) AND tenant_id=? AND tenant_app_id=? ORDER BY id ASC|106|1899|97||0|0|854933|8438|64|1|
|tenant|SELECT id,tenant_id AS tenantid,tenant_wechatapp_id AS tenantwechatappid,sales_erp_id AS salesErpId,sales_index AS salesIndex,sales_type AS salestype,product_barcode AS productbarcode,product_name AS productname,cert_no AS certno,hand_size AS handsize,category_erp_id AS categoryerpid,category_name AS categoryname,stone_weight AS stoneweight,gold_weight AS goldweight,total_weight AS totalweight,quantity,amount_total AS amounttotal,amount_pay AS amountpay,integral,remark FROM erp_sales_detail WHERE tenant_id=? AND tenant_wechatapp_id=? AND sales_erp_id=? ORDER BY sales_index|97|129|2||0|0|7|4|7|4|
|user_service|SELECT tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id FROM user_service.tenant_member tu INNER JOIN user_service.tenant_member_info tm ON tu.tenant_id=tm.tenant_id AND tu.id=tm.id INNER JOIN user_service.tenant_member_bind mb ON tu.tenant_id=mb.tenant_id AND tu.id=mb.id LEFT JOIN user_service.user_employee ue ON tu.tenant_app_id=ue.tenant_wechatapp_id AND tu.user_id=ue.user_id WHERE tu.tenant_id=? AND tu.tenant_app_id=? AND tu.status=? AND mb.erp_member_id IN (?)|89|251|19||0|0|39913647|1907028|4817|286|
|gift_mail|SELECT count(*) FROM gift_mail.trade t LEFT JOIN gift_mail.trade_take tt ON tt.trade_id=t.id WHERE t.tenant_id=? AND t.tenant_wechatapp_id=? AND t.trade_type=? AND t.order_status=? AND t.take_type=? AND tt.shop_id=?|81|168|18||0|0|359692|15469|81|1|
|gift_mail|SELECT count(*) FROM gift_mail.trade t LEFT JOIN gift_mail.trade_take tt ON tt.trade_id=t.id WHERE t.tenant_id=? AND t.tenant_wechatapp_id=? AND t.trade_type IN (?) AND t.order_status=? AND t.take_type=? AND tt.shop_id=?|81|166|18||0|0|328400|13496|81|1|
|v4_sales|SELECT ifnull(sum(integral),?)points FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id=es.sales_erp_id AND esd.tenant_id=? AND esd.tenant_app_id=? WHERE es.member_erp_id IN (?) AND es.sales_status=? AND es.is_sales=? AND esd.sales_type=? AND es.tenant_id=? AND es.tenant_app_id=?|79|896|134||0|0|1543204|45119|79|1|
|v4_user|SELECT id,member_id,external_user_id,serial_number,checkin_shop_id,checkin_employee_id,checkin_employee_name,checkin_time,maintain_shop_id,maintain_employee_id,maintain_employee_name,first_maintain_time,last_maintain_time,next_maintain_time,maintain_num,intention_num,latest_intention,status,finish_time,finish_shop_id,deal_employee_id,deal_employee_name,deal_sale_amount,fail_employee_id,fail_employee_name,fail_reason,remark,sex,cutomer_grade,maintain_level,tenant_id,tenant_app_id,create_time,update_time FROM potential_customer WHERE ((member_id=? OR external_user_id=?) AND status IN (?)) AND tenant_id=? AND tenant_app_id=?|79|476|31||0|0|593941|8436|24|1|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id=es.id AND wca.tenant_id=? AND wca.tenant_app_id=? LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE is_sales=? AND sales_status=? AND es.employee_erp_id=? AND es.dept_erp_id=? AND if(wca.source=?,es.sales_date>=?,date_format(wca.create_time,?)>=?) AND w.id IS NOT ? AND es.tenant_id=? AND es.tenant_app_id=?|78|403|34||0|0|396409|14797|78|1|
|tenant|SELECT count(*) FROM sneak_guest WHERE (tenant_app_id=? AND status=? AND create_shop_id=? AND maintain_employee_id=?)|77|158|12||0|0|34741|2204|77|1|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id=es.id AND wca.tenant_id=? AND wca.tenant_app_id=? LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE is_sales=? AND sales_status=? AND es.employee_erp_id=? AND es.dept_erp_id=? AND if(wca.source=?,es.sales_date>=?,date_format(wca.create_time,?)>=?) AND w.id IS ? AND es.tenant_id=? AND es.tenant_app_id=?|74|537|36||0|0|271666|28555|74|1|
|v4_sales|SELECT t?.sales_erp_id AS salesErpId,t?.sales_no AS salesNo,DATE_FORMAT(t?.sales_date,?) AS salesDate,t?.member_erp_id AS memberId,t?.employee_erp_id AS employeeErpId,t?.employee_name AS employeeName,t?.assist_employee_erp_id AS assistEmployeeErpId,t?.assist_employee_name AS assistEmployeeName,t?.dept_erp_id AS deptErpId,t?.amount,t?.post_time AS postTime FROM erp_sales t? WHERE t?.employee_erp_id=? AND t?.post_time>=? AND t?.post_time<=? AND t?.sales_status=? AND NOT EXISTS (SELECT ? FROM erp_sales_relate esr WHERE t?.tenant_id=esr.tenant_id AND t?.tenant_app_id=esr.tenant_app_id AND t?.sales_erp_id=esr.sales_erp_id AND esr.sales_status IN (?) AND esr.tenant_id=? AND esr.tenant_app_id=?) AND EXISTS (SELECT ? FROM erp_sales_detail esd WHERE t?.tenant_id=esd.tenant_id AND t?.tenant_app_id=esd.tenant_app_id AND t?.sales_erp_id=esd.sales_erp_id AND esd.sales_type IN (?) AND esd.tenant_id=? AND esd.tenant_app_id=?) AND t?.tenant_id=? AND t?.tenant_app_id=?|69|195|11||0|0|199602|11481|128|8|
|corpwx|SELECT t.tenant_id AS tenantId,t.wx_user_id AS wxUserId,t.union_id AS wxUnionId,t.user_id AS externalUserId,ifnull(et.raw_external_user_id,t.old_user_id) AS rawExternalUserId,t.corp_user_id AS employeeCorpUserId FROM corpwx.external_user t LEFT JOIN corpwx.external_userid_transform et ON t.tenant_id=et.tenant_id AND t.user_id=et.external_user_id WHERE t.tenant_id=? AND t.status=? AND t.user_id IN (?) AND t.un_assign_flag=?|67|178|16||0|0|48202|1065|23161|512|
|v4_sales|SELECT * FROM erp_sales WHERE member_erp_id=? AND is_sales=? AND sales_status=? AND id<? AND tenant_id=? AND tenant_app_id=? ORDER BY sales_date ASC,sales_erp_id ASC LIMIT ?|66|322|42||0|0|444468|54281|48|1|
|tenant|SELECT count(*)amount FROM sneak_guest WHERE tenant_app_id=? AND status=? AND create_shop_id=? AND maintain_employee_id=? AND create_time>=?|65|115|12||0|0|24646|2204|65|1|
|user_service|UPDATE user_service.tenant_member_bind SET external_user_id=? WHERE external_user_id=? AND tenant_id=? AND tenant_app_id=? AND wx_user_id!=?|65|98|2||0|0|16|1|0|0|
|authorization_service|SELECT ar.tenant_id,ar.tenant_app_id,a.employee_id,ar.shop_id,ar.role_code,ar.role_name,a.status AS account_status,ar.status AS role_status FROM authorization_service.account_role? ar JOIN authorization_service.account a ON ar.account_id=a.id WHERE ar.tenant_id=? AND ar.tenant_app_id=? AND ar.shop_id=?|64|180|10||0|0|4227740|66085|2293|58|
|user_service|SELECT tenant_id,id,tenant_app_id,user_id,mobile_no,user_name,head_img_url,sex,status,create_time,update_time FROM tenant_member WHERE (tenant_id=? AND tenant_app_id=? AND user_id IN (?))|60|78|2||0|0|409|80|409|80|
|user_service|UPDATE user_service.tenant_member_bind SET wx_user_id=? WHERE tenant_id=? AND tenant_app_id=? AND erp_member_id=?|58|83|2||0|0|0|0|0|0|
|v4_sales|SELECT round(avg(cd.score),?) FROM comment c JOIN comment_detail cd ON cd.comment_id=c.id AND cd.tenant_id=? AND cd.tenant_app_id=? WHERE c.erp_dept_id=? AND c.erp_employee_id=? AND c.create_time BETWEEN ? AND ? AND c.tenant_id=? AND c.tenant_app_id=?|56|265|26||0|0|18332235|328860|56|1|
|v4_sales|SELECT count(DISTINCT sales_date) FROM v4_sales.erp_sales WHERE member_erp_id IN (?) AND is_sales=? AND sales_status=? AND tenant_id=? AND tenant_app_id=?|53|302|50||0|0|560833|15358|53|1|
|tenant|SELECT count(*) FROM erp_sales es WHERE tenant_id=? AND member_erp_id=? AND tenant_wechatapp_id=? AND sales_status=? AND (comment_id IS ? OR comment_id=?) AND sales_date>=? AND NOT EXISTS(SELECT i.id FROM tenant.erp_sales_ignore i WHERE i.tenant_id=? AND i.tenant_app_id=? AND es.sales_erp_id=i.erp_sales_id)|50|71|2||0|0|126387|18095|50|1|
|v4_employee|SELECT count(*) AS total_count,count(finish_time) AS finish_count,ifnull(sum(if(finish_time>=? AND finish_time<?,?,?)),?) AS todayFinishCount,count(send_coupons) AS coupon_send_count,count(recv_coupons) AS coupon_recv_count,count(accept_time) AS accept_count,count(arrival_shop_time) AS arrival_shop_count,count(trade_time) AS trade_count FROM task_task WHERE task_type=? AND status=? AND shop_id=? AND employee_id=? AND system_task_type=? AND start_time<=? AND end_time>? AND tenant_id=? AND tenant_app_id=?|47|96|12||0|0|45040|3203|47|1|
|v4_employee|SELECT id,batch_no,task_type,system_task_type,task_frequency,task_name,task_template_id,business_id,shop_id,employee_id,member_id,start_time,end_time,finish_time,send_coupons,recv_coupons,recv_coupon_time,accept_time,plan_arrival_shop_time,arrival_shop_time,trade_nos,trade_num,trade_amount,trade_time,member_name,member_mobile_no,member_latest_birthday,member_sex,member_age,member_level_id,member_level,member_sales_amount,member_sales_count,member_integral_balance,member_integral_total,status,remark,tenant_id,tenant_app_id,create_time,update_time FROM task_task WHERE (task_template_id IN (?) AND business_id=? AND member_id=?) AND tenant_id=? AND tenant_app_id=?|43|56|2||0|0|0|0|0|0|
|v4_sales|SELECT * FROM v4_sales.value_added_record WHERE value_added_id=? AND date_format(create_time,?)=? AND tenant_id=? AND tenant_app_id=?|42|50|5||0|0|101384724|2417663|0|0|
|employee|SELECT tenant_id,tenant_app_id,employee_id,scene,shop_id,count(*) AS record FROM backlog_? WHERE tenant_app_id=? AND employee_id=? AND expire_time>=? AND status IN (?) AND shop_id=? AND scene NOT IN(?) GROUP BY tenant_id,tenant_app_id,employee_id,scene,shop_id|39|67|4||0|0|4643|285|104|7|
|v4_sales|SELECT id,sales_index,sales_erp_id,sales_type,product_barcode,product_name,cert_no,hand_size,category_erp_id,category_name,stone_weight,gold_weight,total_weight,quantity,amount_total,amount_pay,integral,remark,sales_brand,sales_craft,erp_create_time,tenant_id,tenant_app_id,create_time,update_time FROM erp_sales_detail WHERE (sales_erp_id=? AND sales_index=?) AND tenant_id=? AND tenant_app_id=?|38|52|2||0|0|0|0|0|0|
|coupon_service|SELECT t.id FROM coupon_service.template t LEFT JOIN coupon_service.coupon_scope s ON s.tenant_id=t.tenant_id AND s.tenant_app_id=t.tenant_app_id AND s.template_id=t.id WHERE t.coupon_type=? AND t.tenant_id=? AND t.tenant_app_id=? AND (t.scope=? OR (s.scope=? AND s.product_id=?) OR (s.scope=? AND s.classify_id=?))|37|118|9||0|0|817799|22127|24|1|
|authorization_service|INSERT INTO user_login_token(id,platform_user_id,user_id,wx_user_id,wx_app_user_id,employee_id,shop_id,tenant_id,tenant_wx_app_id,account_id,login_way,login_code,login_token,roles,status,expire_time,create_time,update_time,login_ip,login_time,login_data) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)|37|67|3||0|0|0|0|0|0|
|v4_user|SELECT t?.id AS memberId,t?.id AS potentialCustomerId,t?.checkin_time AS checkinTime FROM potential_customer t? JOIN member t? ON t?.id=t?.member_id AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t?.maintain_shop_id=? AND t?.maintain_employee_id=? AND t?.`status` IN (?) AND t?.tenant_id=? AND t?.tenant_app_id=? UNION SELECT t?.id AS memberId,t?.id AS potentialCustomerId,t?.checkin_time AS checkinTime FROM potential_customer t? JOIN member t? ON t?.external_user_id=t?.external_user_id AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t?.maintain_shop_id=? AND t?.maintain_employee_id=? AND t?.`status` IN (?) AND t?.member_id=? AND t?.tenant_id=? AND t?.tenant_app_id=?|36|84|9||0|0|35952|3576|1652|132|
|corpwx|SELECT id,tenant_id,cwx_user_id,user_id,old_user_id,union_id,name,sex,avatar,tenant_user_id,un_assign_flag,corp_user_id,wx_user_id,create_time,update_time,status FROM external_user WHERE (tenant_id=? AND union_id=? AND status=?)|35|52|2||0|0|33|8|32|7|
|v4_user|SELECT COUNT(*) AS total FROM potential_customer t? WHERE t?.maintain_shop_id=? AND t?.maintain_employee_id=? AND t?.status IN (?) AND t?.tenant_id=? AND t?.tenant_app_id=?|35|76|8||0|0|25355|1684|35|1|
|v4_user|SELECT id,member_id,external_user_id,serial_number,checkin_shop_id,checkin_employee_id,checkin_employee_name,checkin_time,maintain_shop_id,maintain_employee_id,maintain_employee_name,first_maintain_time,last_maintain_time,next_maintain_time,maintain_num,intention_num,latest_intention,status,finish_time,finish_shop_id,deal_employee_id,deal_employee_name,deal_sale_amount,fail_employee_id,fail_employee_name,fail_reason,remark,sex,cutomer_grade,maintain_level,tenant_id,tenant_app_id,create_time,update_time FROM potential_customer WHERE ((member_id=?) AND status IN (?) AND maintain_shop_id=?) AND tenant_id=? AND tenant_app_id=?|32|177|28||0|0|72565|2320|6|1|
|corpwx|UPDATE external_user SET un_assign_flag=? WHERE (tenant_id=? AND status=? AND un_assign_flag=?)|30|107|8||0|0|828705|77310|0|0|
|user_service|SELECT count(?) FROM user_service.tenant_member tm JOIN user_service.user_employee ue ON ue.tenant_id=? AND ue.tenant_wechatapp_id=? AND tm.user_id=ue.user_id AND ue.employee_id=? AND ue.shop_id=? WHERE tm.tenant_id=? AND tm.tenant_app_id=?|30|440|74||0|0|1560601|100385|30|1|
|payment|SELECT id,tenant_id,tenant_app_id,goods_order_source,goods_order_no,pay_order_id,transaction_id,goods_amount,refund_amount,fee_type,refund_reason,refund_account,request_ip,user_id,user_identify,user_sub_identify,order_start_time,refund_id,settlement_refund_amount,refund_recv_accout,refund_request_source,refund_finish_time,refund_status,refund_status_desc,error_msg,wxappid,sub_wxappid,mch_id,sub_mch_id,callback_tag,callback_result,create_time,update_time FROM refund_order WHERE callback_result IN(?) AND refund_status IN(?) ORDER BY id ASC LIMIT ?|30|61|8||0|0|427470|14250|0|0|
|order|SELECT id,type,operator_type operatorType,operator_result operatorResult,reason_label reasonLabel,reason_value reasonValue,remark,create_time createTime,status FROM order_service_log WHERE order_id=? ORDER BY create_time DESC|30|78|5||0|0|788046|26270|0|0|
|v4_user|SELECT id,shop_id,mobile_no,member_name,head_img_url,sex,birthday,birthday_is_lunar,memorial_name,memorial_day,memorial_day_is_lunar,address,interest,wx_union_id,mini_open_id,h5_open_id,wx_card_code,recommend_id,recommend_bind_time,external_user_id,status,combine_status,combine_id,tenant_id,tenant_app_id,create_time,update_time FROM member WHERE id IN (?) AND tenant_id=? AND tenant_app_id=?|29|39|1||0|0|203|20|203|20|
|v4_sales|SELECT * FROM v4_sales.comment WHERE order_id=? AND tenant_id=? AND tenant_app_id=? LIMIT ?|29|88|9||0|0|1898120|65598|2|1|
|gift_mail|SELECT count(?) FROM (SELECT p.id,p.default_image_url,p.product_name,p.product_type,p.tag_price,ifnull(pp.integral_price,ifnull((SELECT min(inventory.price) FROM gift_mail.inventory WHERE inventory.product_id=p.id),?)) AS price,p.volume,p.category_id,p.product_status,? AS quantity,pp.partner_id AS partner_id,p.topping FROM gift_mail.product p LEFT JOIN gift_mail.partner_product pp ON p.id=pp.product_id LEFT JOIN gift_mail.product_status ps ON ps.product_id=p.id WHERE p.tenant_id=? AND product_status=? AND (p.is_disable IS ? OR p.is_disable=?) AND (ps.tenant_wechatapp_id=? OR p.product_type=?)) AS p WHERE (p.topping=?)|29|50|3||0|0|494761|18396|29|1|
|goods|SELECT id,img_url,img_index FROM goods_img WHERE goods_id=? ORDER BY update_time DESC|28|59|4||0|0|777470|27769|78|5|
|employee|SELECT count(?) FROM backlog_? WHERE tenant_app_id=? AND employee_id=? AND status IN (?) AND scene=? AND shop_id=? AND expire_time>=?|28|44|4||0|0|3163|279|28|1|
|v4_employee|SELECT count(?) AS total_count,count(finish_time) AS finish_count FROM task_task t JOIN task_system_task_template t? ON t.task_template_id=t?.id AND t?.status=? AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t.task_type=? AND t.status=? AND t.start_time>=? AND t.start_time<? AND t.shop_id=? AND t.tenant_id=? AND t.tenant_app_id=?|27|58|7||0|0|220234|44097|27|1|
|warranty_service|SELECT count(?) FROM warranty WHERE user_id=? AND tenant_wechatapp_id=? AND is_disable=?|27|40|2||0|0|143|39|27|1|
|tenant|SELECT * FROM erp_sales_detail WHERE tenant_id=? AND tenant_wechatapp_id=? AND sales_erp_id=? ORDER BY sales_index|27|36|2||0|0|76|13|76|13|
|tenant|SELECT count(?) FROM (SELECT es.id,es.sales_no,es.sales_date,es.sales_erp_id,es.amount,ifnull(shop.shop_name,ed.dept_name)dept_name,es.employee_name FROM tenant.erp_sales es JOIN tenant.erp_department ed ON ed.dept_erp_id=es.dept_erp_id AND ed.tenant_id=? LEFT JOIN tenant.tenant_wechatapp_shop shop ON shop.dept_erp_id=ed.dept_erp_id AND shop.tenant_wechatapp_id=? WHERE es.member_erp_id=? AND es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.sales_status=? AND NOT EXISTS (SELECT i.id FROM tenant.erp_sales_ignore i WHERE i.tenant_id=? AND i.tenant_app_id=? AND es.sales_erp_id=i.erp_sales_id))table_count|26|53|5||0|0|53063190|6531565|26|1|
|v4_sales|SELECT count(DISTINCT es.id) FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id=es.sales_erp_id AND esd.sales_type IN (?) AND member_erp_id IN (?) AND esd.tenant_id=? AND esd.tenant_app_id=? WHERE es.tenant_id=? AND es.tenant_app_id=?|25|45|3||0|0|60986|47016|25|1|
|v4_user|SELECT id,shop_id,mobile_no,member_name,head_img_url,sex,birthday,birthday_is_lunar,memorial_name,memorial_day,memorial_day_is_lunar,address,interest,wx_union_id,mini_open_id,h5_open_id,wx_card_code,recommend_id,recommend_bind_time,external_user_id,status,combine_status,combine_id,tenant_id,tenant_app_id,create_time,update_time FROM member WHERE (h5_open_id=?) AND tenant_id=? AND tenant_app_id=?|25|31|1||0|0|11|1|11|1|
|user_service|UPDATE tenant_member SET tenant_app_id=?,user_id=?,mobile_no=?,user_name=?,sex=?,status=?,create_time=?,update_time=? WHERE tenant_id=? AND id=?|25|30|1||0|0|25|1|0|0|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE is_sales=? AND sales_status=? AND (es.sales_no LIKE concat(?,?) OR es.member_erp_id=?) AND w.id IS ? AND es.tenant_id=? AND es.tenant_app_id=?|24|86|16||0|0|4841740|371192|24|1|
|coupon_service|SELECT * FROM coupon_service.coupon_can_give WHERE coupon_id=? LIMIT ?|23|184|27||0|0|7638668|334975|23|1|
|user_service|SELECT tm.user_id AS id,tm.user_name AS userName,tm.head_img_url AS headImgUrl,tm.user_name AS nickName,tm.mobile_no AS mobile,tm.sex FROM user_service.tenant_member tm WHERE tm.tenant_id=? AND tm.tenant_app_id=? AND (tm.user_name LIKE CONCAT(?,?,?) OR tm.mobile_no=?) ORDER BY tm.id DESC LIMIT ?|23|223|27||0|0|9257949|402565|25|3|
|user_service|SELECT count(?) FROM user_service.tenant_member tm WHERE tm.tenant_id=? AND tm.tenant_app_id=? AND (tm.user_name LIKE CONCAT(?,?,?) OR tm.mobile_no=?)|22|108|21||0|0|2659788|481958|22|1|
|employee|SELECT * FROM backlog_? WHERE tenant_app_id=? AND employee_id=? AND status IN (?) AND scene=? AND shop_id=? AND expire_time>=? ORDER BY id DESC|21|32|2||0|0|2412|321|214|40|
|v4_employee|SELECT COUNT(*) AS total FROM task_task t JOIN employee e ON e.employee_id=t.employee_id AND e.shop_id=t.shop_id AND e.tenant_id=? AND e.tenant_app_id=? LEFT JOIN (SELECT task_id,GROUP_CONCAT(file_url SEPARATOR ?) AS task_attaches FROM task_task_attach WHERE tenant_id=? AND tenant_app_id=? GROUP BY task_id)tta ON t.id=tta.task_id WHERE t.status=? AND system_task_type=? AND t.shop_id=? AND finish_time>=? AND finish_time<? AND t.employee_id=? AND t.tenant_id=? AND t.tenant_app_id=?|21|400|64||0|0|4770815|311025|21|1|
|activity_service|SELECT count(DISTINCT (user_id)) FROM user_trace WHERE tenant_app_id=? AND activity_id=? AND status!=?|20|38|2||0|0|40123|3515|20|1|
|v4_sales|SELECT count(*) FROM v4_sales.erp_sales es LEFT JOIN v4_sales.erp_sales_ignore esi ON esi.sales_id=es.id AND esi.tenant_id=? AND esi.tenant_app_id=? WHERE es.member_erp_id IN (?) AND esi.id IS ? AND es.sales_status=? AND (es.comment_id IS ? OR es.comment_id=?) AND es.tenant_id=? AND es.tenant_app_id=?|20|26|1||0|0|6061|607|20|1|
|user_service|SELECT count(?) FROM (SELECT count(?) FROM user_source us WHERE us.tenant_id=? AND us.tenant_wechatapp_id=? AND us.from_id=? AND us.shop_id=? AND us.create_time>=? AND us.create_time<? AND us.source_type=? AND us.from_id IS NOT ? AND us.shop_id IS NOT ?)table_count|20|48|4||0|0|9103|1709|20|1|
|v4_user|SELECT id FROM member_points_detail WHERE (member_points_id=? AND oper_biz_id=? AND oper_biz_type=? AND status=?) AND tenant_id=? AND tenant_app_id=? LIMIT ?|20|56|8||0|0|43622|5142|0|0|
|v4_sales|SELECT es.id salesId,es.sales_no,es.sales_date,es.member_erp_id memberId,w.warranty_no FROM v4_sales.erp_sales es LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE is_sales=? AND sales_status=? AND (es.sales_no LIKE concat(?,?) OR es.member_erp_id=?) AND w.id IS ? AND es.tenant_id=? AND es.tenant_app_id=? ORDER BY es.sales_date DESC,es.id DESC LIMIT ?|20|141|22||0|0|8527774|640732|30|3|
|user_service|SELECT ue.user_id AS id,tm.user_name AS userName,tm.head_img_url AS headImgUrl,tm.user_name AS nickName,tm.mobile_no AS mobile,tm.sex FROM user_service.user_employee ue JOIN user_service.tenant_member tm ON tm.tenant_id=ue.tenant_id AND tm.tenant_app_id=ue.tenant_wechatapp_id AND tm.user_id=ue.user_id WHERE ue.employee_id=? AND ue.tenant_id=? AND ue.tenant_wechatapp_id=? AND ue.shop_id=? ORDER BY tm.id DESC LIMIT ?|20|54|8||0|0|76697|4153|200|10|
|user_service|SELECT count(*) FROM user_service.tenant_member_info t WHERE t.tenant_id=? AND t.tenant_app_id=? AND t.shop_id=?|20|32|3||0|0|413965|33413|20|1|
|tenant|SELECT id,tenant_id,tenant_wechatapp_id,sales_erp_id,sales_index,sales_type,product_barcode,product_name,cert_no,hand_size,category_erp_id,category_name,stone_weight,gold_weight,total_weight,quantity,amount_total,amount_pay,integral,remark,create_time,update_time FROM erp_sales_detail WHERE tenant_id=? AND sales_erp_id=? AND tenant_wechatapp_id=?|19|24|1||0|0|38|3|38|3|
|user_service|SELECT count(?) FROM user_service.tenant_member t? JOIN user_service.tenant_member_info t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id AND t?.tenant_app_id=? AND t?.shop_id=? JOIN user_service.user_employee ue ON t?.tenant_id=ue.tenant_id AND t?.tenant_app_id=ue.tenant_wechatapp_id AND t?.user_id=ue.user_id AND ue.employee_id=? AND ue.shop_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND (t?.mobile_no LIKE concat(?,?) OR t?.user_name LIKE concat(?,?,?))|19|78|35||0|0|42791|6093|19|1|
|v4_user|SELECT ifnull(t?.id,?) AS id,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.mobile_no,(CASE WHEN t?.member_name IS ? OR t?.member_name=? THEN t?.external_user_name ELSE t?.member_name END) AS member_name,t?.head_img_url,ifnull(t?.sex,t?.sex) AS sex,t?.wx_union_id,t?.mini_open_id,t?.h5_open_id,t?.external_user_id FROM cwx_external_user t? LEFT JOIN member t? ON t?.external_user_id=t?.external_user_id AND t?.`status` IN (?) AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t?.external_user_id=? AND t?.tenant_id=? LIMIT ?|18|24|2||0|0|18|1|18|1|
|v4_employee|SELECT t.id AS task_id,t.employee_id,e.employee_name,t.member_id,t.member_name,t.finish_time,t.plan_arrival_shop_time,t.remark,tta.task_attaches FROM task_task t JOIN employee e ON e.employee_id=t.employee_id AND e.shop_id=t.shop_id AND e.tenant_id=? AND e.tenant_app_id=? LEFT JOIN (SELECT task_id,GROUP_CONCAT(file_url SEPARATOR ?) AS task_attaches FROM task_task_attach WHERE tenant_id=? AND tenant_app_id=? GROUP BY task_id)tta ON t.id=tta.task_id WHERE t.status=? AND system_task_type=? AND t.shop_id=? AND finish_time>=? AND finish_time<? AND t.employee_id=? AND t.tenant_id=? AND t.tenant_app_id=? ORDER BY t.finish_time DESC,t.id DESC LIMIT ?|18|131|32||0|0|4386185|311025|107|10|
|v4_sales|SELECT t?.sales_erp_id AS salesErpId,t?.sales_no AS salesNo,DATE_FORMAT(t?.sales_date,?) AS salesDate,t?.member_erp_id AS memberId,t?.employee_erp_id AS employeeErpId,t?.employee_name AS employeeName,t?.assist_employee_erp_id AS assistEmployeeErpId,t?.assist_employee_name AS assistEmployeeName,t?.dept_erp_id AS deptErpId,t?.amount,t?.post_time AS postTime FROM erp_sales t? WHERE t?.dept_erp_id=? AND t?.member_erp_id IN (?) AND t?.post_time>=? AND t?.sales_status=? AND NOT EXISTS (SELECT ? FROM erp_sales_relate esr WHERE t?.tenant_id=esr.tenant_id AND t?.tenant_app_id=esr.tenant_app_id AND t?.sales_erp_id=esr.sales_erp_id AND esr.sales_status IN (?) AND esr.tenant_id=? AND esr.tenant_app_id=?) AND EXISTS (SELECT ? FROM erp_sales_detail esd WHERE t?.tenant_id=esd.tenant_id AND t?.tenant_app_id=esd.tenant_app_id AND t?.sales_erp_id=esd.sales_erp_id AND esd.sales_type IN (?) AND esd.tenant_id=? AND esd.tenant_app_id=?) AND t?.tenant_id=? AND t?.tenant_app_id=?|18|45|8||0|0|8287|1549|1363|255|
|coupon_service|SELECT id,tenant_id,tenant_app_id,template_id,coupon_type,take_effect_way,take_start_day,take_effect_day,begin_time,end_time,source,source_id,can_give,need_booking,use_threshold,wx_card_id,state,create_time,update_time FROM coupon_push WHERE (tenant_id=? AND tenant_app_id=? AND wx_card_id=?)|18|25|4||0|0|12876|1999|0|0|
|tenant|SELECT count(?) FROM erp_sales_detail t? LEFT JOIN erp_sales_detail_extend t? ON t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.sales_erp_id=t?.sales_erp_id AND t?.sales_index=t?.sales_index LEFT JOIN erp_sales t? ON t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.sales_erp_id=t?.sales_erp_id WHERE t?.tenant_id=? AND t?.tenant_wechatapp_id=? AND t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.member_erp_id=? AND t?.sales_status=? AND t?.is_sales=?|18|35|4||0|0|1321|528|18|1|
|coupon_service|SELECT id,tenant_id,tenant_app_id,template_id,coupon_id,give_user_id,user_id,create_time,update_time FROM user_coupon_give_record WHERE (tenant_id=? AND tenant_app_id=? AND coupon_id=? AND give_user_id=? AND user_id=?)|18|29|3||0|0|22105|3441|1|1|
|corpwx|SELECT id,tenant_id,cwx_user_id,user_id,old_user_id,union_id,name,sex,avatar,tenant_user_id,un_assign_flag,corp_user_id,wx_user_id,create_time,update_time,status FROM external_user WHERE (tenant_id=? AND user_id=? AND status=? AND union_id IS NOT ?)|18|23|1||0|0|33|6|8|3|
|user_service|SELECT count(*) FROM user_service.user_employee ue WHERE ue.tenant_id=? AND ue.employee_id=? AND ue.tenant_wechatapp_id=? AND ue.shop_id=?|18|70|25||0|0|52466|4804|18|1|
|tenant|SELECT count(DISTINCT sg.id) AS createNum,count(sgm.id) AS maintainCount FROM tenant.sneak_guest sg LEFT JOIN tenant.sneak_guest_maintain sgm ON sg.id=sgm.sneak_guest_id AND sgm.event_type=? AND sgm.create_time>=? AND sgm.create_time<? WHERE sg.tenant_app_id=? AND sg.create_time>=? AND sg.create_time<? AND sg.create_shop_id=?|17|24|1||0|0|69386|10145|17|1|
|order|SELECT count(*) FROM `order`.order_info WHERE tenant_id=? AND tenant_wechatapp_id=? AND take_type=? AND status=? AND (wait_take_shop_id=? OR take_shop_id=?)|17|26|3||0|0|43691|3980|17|1|
|coupon_service|SELECT count(*) FROM coupon WHERE (tenant_id=? AND tenant_app_id=? AND user_id=? AND coupon_push_id=?)|17|21|1||0|0|148|47|17|1|
|corpwx|UPDATE external_user SET update_time=?,status=? WHERE (tenant_id=? AND cwx_user_id=? AND user_id=?)|17|20|1||0|0|16|1|0|0|
|user_service|SELECT t?.id,t?.user_id AS userId,t?.user_name AS userName,t?.sex,t?.mobile_no AS mobileNo,t?.head_img_url AS headImg FROM user_service.tenant_member t? JOIN user_service.tenant_member_info t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id AND t?.tenant_app_id=? AND t?.shop_id=? JOIN user_service.user_employee ue ON t?.tenant_id=ue.tenant_id AND t?.tenant_app_id=ue.tenant_wechatapp_id AND t?.user_id=ue.user_id AND ue.employee_id=? AND ue.shop_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=? ORDER BY ue.update_time DESC,t?.id DESC LIMIT ?,?|17|45|8||0|0|120879|12002|170|10|
|wx_gateway|UPDATE wx_template_msg SET status=?,err_msg=? WHERE msg_id=?|16|24|2||0|0|16|1|0|0|
|wx_gateway|INSERT INTO wx_template_msg(id,tenant_id,tenant_app_id,user_id,push_id,tenant_user_open_id,template_id,template_no,url,data,msg_id,status,err_msg,title,content,create_time,update_time,tenant_short_name,tenant_app_name,user_mobile_no,user_name,user_head_img_url) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)|16|28|2||0|0|0|0|0|0|
|v4_employee|SELECT COUNT(*) AS total FROM task_task WHERE (task_template_id=?) AND tenant_id=? AND tenant_app_id=?|16|27|2||0|0|263288|16892|16|1|
|corpwx_license|DELETE FROM cwx_sync_active_info WHERE (tenant_id=? AND user_id=?) AND tenant_id=?|16|38|5||0|0|475132|29701|0|0|
|deliver|SELECT * FROM express_address WHERE user_id=? AND type=?|15|30|3||0|0|191389|12761|2|1|
|user_service|SELECT count(?) FROM user_service.tenant_member t? JOIN user_service.tenant_member_info t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id AND t?.tenant_app_id=? AND t?.shop_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=?|15|54|9||0|0|2402921|884320|15|1|
|value_added|UPDATE value_added_user SET amount_added=IF(?>(((added_percent_per_day/?)*IF(?>=TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days,TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?,add_days))-((devalue_percent_per_day/?)*IF(?>=TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days-keeping_days,?,TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days-keeping_days)))*amount_pay,?,(((added_percent_per_day/?)*IF(?>=TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days,TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?,add_days))-((devalue_percent_per_day/?)*IF(?>=TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days-keeping_days,?,TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days-keeping_days)))*amount_pay),update_time=now() WHERE state=? AND update_time<=CURDATE() AND (start_add_time>=DATE_ADD(CURDATE(),INTERVAL-(add_days+keeping_days-?)DAY) OR (amount_added>? AND start_add_time<DATE_ADD(CURDATE(),INTERVAL-(add_days+keeping_days-?)DAY))) AND user_id=? AND tenant_wechatapp_id=?|15|17|1||0|0|49|17|0|0|
|v4_user|SELECT ifnull(t?.id,?) AS id,t?.shop_id,t?.mobile_no,(CASE WHEN t?.member_name IS ? OR t?.member_name=? THEN ifnull(t?.external_user_name,t?.nick_name) ELSE t?.member_name END) AS member_name,ifnull(t?.head_img_url,t?.head_img_url) AS head_img_url,ifnull(t?.sex,ifnull(t?.sex,?)) AS sex,t?.wx_union_id,t?.mini_open_id,t?.h5_open_id,t?.external_user_id,t?.status FROM cwx_external_user t? LEFT JOIN member t? ON t?.tenant_id=t?.tenant_id AND t?.external_user_id=t?.external_user_id AND t?.tenant_id=? AND t?.tenant_app_id=? LEFT JOIN wx_user t? ON t?.h5_open_id=t?.open_id WHERE t?.external_user_id IN (?) AND t?.tenant_id=?|14|25|2||0|0|766|138|257|46|
|user_service|UPDATE tenant_member_bind SET tenant_app_id=?,user_id=?,wx_user_id=?,erp_member_id=?,wx_union_id=?,create_time=?,update_time=? WHERE tenant_id=? AND id=?|14|27|3||0|0|14|1|0|0|
|message_push|INSERT INTO message_log(id,tenant_id,tenant_app_id,user_id,scene_type,msg_id,post_data,create_time,update_time) VALUES (?,?,?,?,?,?,?,?,?)|14|22|3||0|0|0|0|0|0|
|erp_app|INSERT INTO app_status(id,tenant_id,app_name,version,pid) VALUES (?,?,?,?,?) ON DUPLICATE key UPDATE version=?,pid=?,online_status_time=?|14|18|1||0|0|0|0|0|0|
|coupon_service|SELECT count(?) FROM coupon_service.coupon_expire_task WHERE tenant_id=? AND tenant_app_id=? AND shop_id=? AND employee_id=? AND status=? AND expire_time>now()|13|36|11||0|0|41562|6267|13|1|
|user_service|SELECT tm.user_id AS id,tm.user_name AS userName,tm.head_img_url AS headImgUrl,tm.user_name AS nickName,tm.mobile_no AS mobile,tm.sex FROM user_service.tenant_member tm JOIN user_service.user_employee ue ON ue.tenant_id=? AND ue.tenant_wechatapp_id=? AND tm.user_id=ue.user_id AND ue.employee_id=? AND ue.shop_id=? WHERE tm.tenant_id=? AND tm.tenant_app_id=? ORDER BY tm.id DESC LIMIT ?|13|26|4||0|0|64536|10251|156|12|
|v4_sales|SELECT id,template_id,no,member_id,erp_sales_id,product_barcode,product_name,dept_id,amount_total,amount_pay,added_amount,added_rate,added_days,keep_days,impairment_rate,exchange_days,added_time,status,coupon_id,tenant_id,tenant_app_id,create_time,update_time FROM value_added WHERE (member_id=? AND status<>?) AND tenant_id=? AND tenant_app_id=?|13|25|3||0|0|88129|6790|15|6|
|v4_user|SELECT id,member_id,external_user_id,serial_number,checkin_shop_id,checkin_employee_id,checkin_employee_name,checkin_time,maintain_shop_id,maintain_employee_id,maintain_employee_name,first_maintain_time,last_maintain_time,next_maintain_time,maintain_num,intention_num,latest_intention,status,finish_time,finish_shop_id,deal_employee_id,deal_employee_name,deal_sale_amount,fail_employee_id,fail_employee_name,fail_reason,remark,sex,cutomer_grade,maintain_level,tenant_id,tenant_app_id,create_time,update_time FROM potential_customer WHERE ((member_id=? OR external_user_id=?) AND status IN (?) AND maintain_shop_id=?) AND tenant_id=? AND tenant_app_id=?|13|40|7||0|0|28723|2313|2|1|
|user_service|SELECT id,wx_app_id,open_id,union_id,nick_name,user_name,mobile_no,head_img_url,is_subscribe,subscribe_time,unsubscribe_time,wx_card_code,wx_card_no,sex,country,province,city,plat_open_id,create_time,update_time FROM wx_user WHERE id=?|13|19|1||0|0|13|1|13|1|
|message_push|INSERT INTO message_log(id,tenant_id,tenant_app_id,user_id,scene_type,msg_id,content,post_data,create_time,update_time) VALUES (?,?,?,?,?,?,?,?,?,?)|13|20|2||0|0|0|0|0|0|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE is_sales=? AND sales_status=? AND (es.sales_no LIKE concat(?,?) OR es.member_erp_id=?) AND w.id IS NOT ? AND es.tenant_id=? AND es.tenant_app_id=?|13|35|5||0|0|1090312|180744|13|1|
|v4_sales|SELECT sum(amount_total) FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id=es.sales_erp_id AND esd.tenant_id=? AND esd.tenant_app_id=? WHERE es.member_erp_id IN (?) AND es.sales_status=? AND es.is_sales=? AND esd.sales_type IN (?) AND es.tenant_id=? AND es.tenant_app_id=?|12|675|175||0|0|216502|37625|12|1|
|user_service|SELECT obj.id,obj.shop_id,obj.total, CASE WHEN @rowtotal=obj.total THEN @rownum WHEN @rowtotal:=obj.total THEN @rownum:=@rownum+? WHEN @rowtotal=? THEN @rownum:=@rownum+? END AS rank_idx FROM (SELECT us.from_id AS id,us.shop_id,count(?)total FROM user_source us WHERE us.tenant_id=? AND us.tenant_wechatapp_id=? AND us.create_time>=? AND us.create_time<? AND us.source_type=? AND us.from_id IS NOT ? AND us.shop_id IS NOT ? GROUP BY us.from_id,us.shop_id ORDER BY count(?) DESC) AS obj,(SELECT @rownum:=?,@rowtotal:=?)r|12|17|2||0|0|17410|5006|1190|272|
|gift_mail|SELECT count(?) FROM (SELECT p.id,p.product_name,p.tag_price,i.volume,p.product_status AS status,p.default_image_url,i.quantity,i.market_price,if(prp.id IS ?,?,?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id=p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id=? AND prp.is_recommend=? AND prp.platform_product_id=p.id WHERE prp.id IS ? AND p.product_status=? ORDER BY i.volume DESC ,p.tag_price ASC ,p.id DESC)tmp_count|12|15|2||0|0|93648|7804|12|1|
|gift_mail|SELECT id,tenant_wechatapp_id,shop_id,shop_name,product_id,create_time,update_time FROM take_shop WHERE product_id=?|11|34|5||0|0|547921|49811|115|44|
|order|SELECT od.id,od.order_no orderNo,od.status,od.take_type takeType,od.create_time createTime,od.remark,od.total_fee totalFee,od.freight_fee freightFee,od.discount_fee discountFee,od.take_id takeId,od.payment_fee paymentFee,dt.product_id productId,dt.price,dt.quantity,dt.sku_id skuId,dt.art_no artNo,dt.image_url imageUrl,dt.product_name productName,dt.take_remark takeRemark,dt.take_day takeDay,od.product_fee productFee,ad.user_name receiveName,ad.mobile_no mobileNo,ad.shop_name shopName,ad.address,ad.express_no expressNo,ad.express_company expressCompany,od.user_name userName,od.update_time updateTime,od.child_status childStatus,od.finish_type finishType,od.receive_time receiveTime,od.user_id userId,od.mobile_no buyMobileNo,od.edit_fee_flag editFeeFlag,dt.spec spec,od.source,od.take_shop_id,od.take_shop_name,od.take_employee_user_id,od.take_employee_user_name,od.activity_type,od.activity_id,od.offline_payment_fee,od.online_wait_fee,od.offline_wait_fee,od.pay_way,od.take_employee_id,od.pay_id FROM order_info od LEFT JOIN order_detail dt ON od.id=dt.order_id LEFT JOIN order_address ad ON od.id=ad.order_id WHERE od.tenant_id=? AND od.tenant_wechatapp_id=? AND (od.mobile_no=? OR ad.mobile_no=?) ORDER BY od.create_time DESC LIMIT ?|11|347|52||0|0|2024721|184131|23|3|
|v4_user|UPDATE member SET shop_id=?,update_time=? WHERE id=? AND tenant_id=? AND tenant_app_id=?|11|16|2||0|0|11|1|0|0|
|tenant|SELECT count(*)amount FROM sneak_guest WHERE tenant_app_id=? AND status=? AND create_shop_id=? AND maintain_employee_id=? AND create_time<=?|11|27|5||0|0|7840|846|11|1|
|user_service|SELECT obj.id,obj.total, CASE WHEN @rowtotal=obj.total THEN @rownum WHEN @rowtotal:=obj.total THEN @rownum:=@rownum+? WHEN @rowtotal=? THEN @rownum:=@rownum+? END AS rank_idx FROM (SELECT us.from_id AS id,count(?)total FROM user_source us WHERE us.tenant_id=? AND us.tenant_wechatapp_id=? AND us.shop_id=? AND us.create_time>=? AND us.create_time<? AND us.source_type=? AND us.from_id IS NOT ? AND us.shop_id IS NOT ? GROUP BY us.from_id ORDER BY count(?) DESC) AS obj,(SELECT @rownum:=?,@rowtotal:=?)r|11|16|2||0|0|13373|4274|93|28|
|user_service|UPDATE tenant_member_bind SET tenant_app_id=?,user_id=?,wx_user_id=?,erp_member_id=?,wx_union_id=?,create_time=?,update_time=?,external_user_id=? WHERE tenant_id=? AND id=?|11|18|5||0|0|11|1|0|0|
|user_service|UPDATE tenant_member_bind SET tenant_app_id=?,user_id=?,wx_user_id=?,erp_member_id=?,create_time=?,update_time=?,external_user_id=? WHERE tenant_id=? AND id=?|11|19|5||0|0|11|1|0|0|
|tenant|SELECT id,tenant_id,tenant_app_id,sneak_guest_id,shop_id,employee_id,maintain_level,remark,create_time,update_time,event_type,data,group_label FROM sneak_guest_maintain WHERE (tenant_app_id=? AND sneak_guest_id IN (?) AND event_type=?)|11|18|4||0|0|2084|401|1812|306|
|tenant|UPDATE erp_sales SET sales_date=?,member_erp_id=?,employee_erp_id=?,employee_name=?,dept_erp_id=?,amount=?,sales_remark=?,receipts=?,sales_status=?,is_sales=?,busi_date=?,update_time=? WHERE tenant_id=? AND tenant_wechatapp_id=? AND sales_erp_id=? AND sales_no=?|11|16|2||0|0|11|1|0|0|
|employee|SELECT task_amount-finish_amount FROM backlog_? t WHERE t.tenant_app_id=? AND t.shop_id=? AND t.employee_id=? AND t.status IN (?) AND t.scene=? AND t.begin_time<=? AND t.expire_time>=?|10|16|2||0|0|1944|689|9|1|
|gift_mail|SELECT count(?) FROM (SELECT p.id,p.default_image_url,p.product_name,p.product_type,p.tag_price,ifnull(pp.integral_price,ifnull((SELECT min(inventory.price) FROM gift_mail.inventory WHERE inventory.product_id=p.id),?)) AS price,p.volume,p.category_id,p.product_status,? AS quantity,pp.partner_id AS partner_id,p.topping FROM gift_mail.product p LEFT JOIN gift_mail.partner_product pp ON p.id=pp.product_id LEFT JOIN gift_mail.product_status ps ON ps.product_id=p.id WHERE p.tenant_id=? AND product_status=? AND (p.is_disable IS ? OR p.is_disable=?) AND (ps.tenant_wechatapp_id=? OR p.product_type=?) UNION ALL SELECT pp.id,pp.default_image_url,pp.product_name,? AS product_type,pi.market_price AS tag_price,ROUND(pp.tag_price*?,?) AS price,pi.volume,? AS category_id,pp.product_status,pi.quantity,? AS partner_id,? AS topping FROM gift_mail.platform_recommend_product prp JOIN gift_mail.platform_product pp ON pp.id=prp.platform_product_id JOIN gift_mail.platform_inventory pi ON pi.product_id=pp.id WHERE prp.is_recommend=? AND tenant_app_id=? AND pp.product_status=?) AS p WHERE (p.topping=?)|10|13|2||0|0|216274|23326|10|1|
|coupon_service|SELECT count(*) FROM coupon WHERE (coupon_state=? AND user_id=? AND tenant_app_id=? AND end_time>?)|10|11|1||0|0|1|1|10|1|
|corpwx|SELECT id,tenant_id,tenant_app_id,external_user_id,wx_user_id FROM external_user_bind WHERE (tenant_id=? AND wx_user_id=?)|10|11|1||0|0|9|1|9|1|
|v4_user|SELECT maintain_employee_id,id FROM potential_customer WHERE (maintain_shop_id=? AND status IN (?)) AND tenant_id=? AND tenant_app_id=?|10|18|3||0|0|19111|4128|3506|913|
|erp_sync|INSERT INTO sync_record(id,tenant_id,tenant_app_id,data_id,business_type,operate_type,user_id,erp_member_id,data,send_time,create_time) VALUES (?,?,?,?,?,?,?,?,?,?,?)|10|16|2||0|0|0|0|0|0|
|tenant|INSERT INTO erp_sales(id,tenant_id,tenant_wechatapp_id,sales_erp_id,sales_no,sales_date,member_erp_id,employee_erp_id,employee_name,dept_erp_id,amount,sales_remark,receipts,sales_status,is_sales,busi_date) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ON DUPLICATE key UPDATE sales_date=?,member_erp_id=?,employee_erp_id=?,employee_name=?,dept_erp_id=?,amount=?,sales_remark=?,receipts=?,sales_status=?,is_sales=?,busi_date=?|9|12|1||0|0|0|0|0|0|
|v4_user|SELECT id,shop_id,mobile_no,member_name,head_img_url,sex,birthday,birthday_is_lunar,memorial_name,memorial_day,memorial_day_is_lunar,address,interest,wx_union_id,mini_open_id,h5_open_id,wx_card_code,recommend_id,recommend_bind_time,external_user_id,status,combine_status,combine_id,tenant_id,tenant_app_id,create_time,update_time FROM member WHERE (wx_card_code=?) AND tenant_id=? AND tenant_app_id=? LIMIT ?|9|10|1||0|0|0|0|0|0|
|employee|SELECT count(*) FROM label_task_employee t? JOIN label_task_setting t? ON t?.label_task_id=t?.id AND t?.disabled=? WHERE t?.tenant_app_id=? AND t?.shop_id=? AND t?.visit_status>? AND t?.finish_time>=DATE_SUB(CURRENT_DATE,INTERVAL ? day) AND t?.finish_time<CURRENT_DATE|9|23|4||0|0|265040|54695|9|1|
|v4_user|UPDATE member_grade SET grade_id=?,grade_name=?,user_id=?,sale_number=?,sale_amount=?,sale_points=?,tenant_id=?,tenant_app_id=?,create_time=?,update_time=? WHERE id=? AND tenant_id=? AND tenant_app_id=?|9|14|1||0|0|9|1|0|0|
|user_service|UPDATE tenant_member_bind SET tenant_app_id=?,user_id=?,wx_user_id=?,erp_member_id=?,create_time=?,update_time=? WHERE tenant_id=? AND id=?|9|13|3||0|0|9|1|0|0|
|user_service|UPDATE tenant_member_info SET tenant_app_id=?,user_id=?,shop_id=?,birthday_is_lunar=?,memorial_name=?,memorial_day_is_lunar=?,grade_id=?,create_time=?,update_time=?,erp_card_no=? WHERE tenant_id=? AND id=?|9|13|2||0|0|9|1|0|0|
|v4_user|SELECT id,member_id,external_user_id,serial_number,checkin_shop_id,checkin_employee_id,checkin_employee_name,checkin_time,maintain_shop_id,maintain_employee_id,maintain_employee_name,first_maintain_time,last_maintain_time,next_maintain_time,maintain_num,intention_num,latest_intention,status,finish_time,finish_shop_id,deal_employee_id,deal_employee_name,deal_sale_amount,fail_employee_id,fail_employee_name,fail_reason,remark,sex,cutomer_grade,maintain_level,tenant_id,tenant_app_id,create_time,update_time FROM potential_customer WHERE ((member_id=? OR external_user_id=?) AND status IN (?) AND maintain_shop_id=? AND maintain_employee_id=?) AND tenant_id=? AND tenant_app_id=?|9|13|2||0|0|2364|418|3|1|
|v4_user|SELECT id,shop_id,mobile_no,member_name,head_img_url,sex,birthday,birthday_is_lunar,memorial_name,memorial_day,memorial_day_is_lunar,address,interest,wx_union_id,mini_open_id,h5_open_id,wx_card_code,recommend_id,recommend_bind_time,external_user_id,status,combine_status,combine_id,tenant_id,tenant_app_id,create_time,update_time FROM member WHERE (external_user_id=? AND status IN (?)) AND tenant_id=? AND tenant_app_id=? LIMIT ?|9|11|1||0|0|0|0|0|0|
|erp_sync|SELECT * FROM erp_sync.retry_data WHERE (need_erp_member_id=? OR (need_erp_member_id=? AND erp_member_id IS NOT ?)) AND retry_times>? ORDER BY id|9|24|3||0|0|35804|3979|2232|248|
|order|SELECT count(*)amount FROM `order`.order_info od LEFT JOIN `order`.order_detail dt ON od.id=dt.order_id LEFT JOIN ORDER.order_address ad ON od.id=ad.order_id WHERE od.tenant_wechatapp_id=? AND od.take_type=? AND od.type=? AND od.status=? AND ad.shop_id=? AND dt.take_start_date=?|9|23|8||0|0|13257|1513|9|1|
|v4_activity|SELECT COUNT(*) AS total FROM lottery_log l WHERE l.win_status=? AND l.win_prize_id IS NOT ? AND l.activity_id=? AND l.member_id=? AND qualified_id=? AND l.tenant_id=? AND l.tenant_app_id=?|8|16|3||0|0|118614|14839|8|1|
|user_service|SELECT count(?) FROM (SELECT count(?) FROM user_source us WHERE us.tenant_id=? AND us.tenant_wechatapp_id=? AND us.from_id=? AND us.shop_id=? AND us.source_type=? AND us.from_id IS NOT ? AND us.shop_id IS NOT ?)table_count|8|10|2||0|0|11522|3513|8|1|
|order|SELECT count(?)total,ifnull(sum(if(od.status>?,od.payment_fee,?)),?)paymentFee,ifnull(sum(if(od.status>?,od.offline_payment_fee,?)),?)offlinePaymentFee,ifnull(sum(if(od.status>?,od.payment_fee+od.offline_payment_fee,?)),?)payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id=dt.order_id LEFT JOIN order_address ad ON od.id=ad.order_id WHERE od.tenant_id=? AND od.tenant_wechatapp_id=?|8|116|47||0|0|1471776|184131|8|1|
|v4_user|SELECT t?.id AS memberId,t?.external_user_id AS externalUserId,t?.corp_user_id AS corpUserId,t?.employee_id,t?.raw_external_user_id AS rawExternalUserId FROM member t? JOIN employee_external_bind t? ON t?.tenant_id=t?.tenant_id AND t?.external_user_id=t?.external_user_id AND t?.tenant_id=? JOIN cwx_external_user t? ON t?.tenant_id=t?.tenant_id AND t?.external_user_id=t?.external_user_id AND t?.tenant_id=? WHERE t?.id IN (?) AND t?.tenant_id=? AND t?.tenant_app_id=?|8|13|2||0|0|123|49|59|29|
|v4_employee|SELECT id,batch_no,task_type,system_task_type,task_frequency,task_name,task_template_id,business_id,shop_id,employee_id,member_id,start_time,end_time,finish_time,send_coupons,recv_coupons,recv_coupon_time,accept_time,plan_arrival_shop_time,arrival_shop_time,trade_nos,trade_num,trade_amount,trade_time,member_name,member_mobile_no,member_latest_birthday,member_sex,member_age,member_level_id,member_level,member_sales_amount,member_sales_count,member_integral_balance,member_integral_total,status,remark,tenant_id,tenant_app_id,create_time,update_time FROM task_task WHERE (member_id=? AND task_template_id IN (?)) AND tenant_id=? AND tenant_app_id=?|8|13|2||0|0|0|0|0|0|
|v4_sales|SELECT product_name,sales_type,amount_total,amount_pay,integral,quantity,remark FROM erp_sales_detail WHERE sales_erp_id=? AND sales_type=? AND tenant_id=? AND tenant_app_id=?|8|11|1||0|0|25|5|10|2|
|user_service|SELECT count(?) FROM user_service.user_source us LEFT JOIN user_service.tenant_member m ON m.user_id=us.user_id LEFT JOIN user_service.user_employee ue ON ue.user_id=m.user_id WHERE m.tenant_id=? AND m.tenant_app_id=? AND us.tenant_id=? AND us.tenant_wechatapp_id=? AND ue.tenant_id=? AND ue.tenant_wechatapp_id=? AND us.shop_id=? AND us.from_id=? AND us.create_time>=? AND us.create_time<? AND us.source_type=? AND us.from_id IS NOT ? AND us.shop_id IS NOT ?|8|12|2||0|0|6850|1742|8|1|
|tenant|SELECT id,tenant_id,tenant_app_id,user_id,status,group_label,maintain_level,remark,create_time,create_shop_id,create_employee_id,update_time,update_shop_id,update_employee_id,sales_amount,next_maintain_date,maintain_employee_id,sneak_guest_no,last_maintain_date,finish_date,fail_type,oid,user_type FROM sneak_guest WHERE (tenant_app_id=? AND status=? AND create_shop_id=?) ORDER BY id DESC|8|19|5||0|0|42208|8472|21104|4236|
|user_service|SELECT count(?) FROM user_service.user_employee ue JOIN user_service.tenant_member tm ON tm.tenant_id=ue.tenant_id AND tm.tenant_app_id=ue.tenant_wechatapp_id AND tm.user_id=ue.user_id WHERE ue.employee_id=? AND ue.tenant_id=? AND ue.tenant_wechatapp_id=? AND ue.shop_id=?|8|22|7||0|0|21658|2762|8|1|
|v4_sales|SELECT COUNT(*) AS total FROM comment WHERE (order_id=? AND member_id=?) AND tenant_id=? AND tenant_app_id=?|8|15|3||0|0|523898|65593|8|1|
|v4_giftmall|SELECT * FROM v4_giftmall.trade WHERE trade_type=? AND order_status=? AND update_time<=DATE_SUB(NOW(),INTERVAL ? MINUTE)|8|18|3||0|0|89187|11160|0|0|
|order|SELECT count(?) FROM order_info od LEFT JOIN order_detail dt ON od.id=dt.order_id LEFT JOIN order_address ad ON od.id=ad.order_id WHERE od.tenant_id=? AND od.tenant_wechatapp_id=? AND (od.mobile_no=? OR ad.mobile_no=?)|8|158|43||0|0|1472466|184059|8|1|
|v4_user|SELECT id,member_id,external_user_id,serial_number,checkin_shop_id,checkin_employee_id,checkin_employee_name,checkin_time,maintain_shop_id,maintain_employee_id,maintain_employee_name,first_maintain_time,last_maintain_time,next_maintain_time,maintain_num,intention_num,latest_intention,status,finish_time,finish_shop_id,deal_employee_id,deal_employee_name,deal_sale_amount,fail_employee_id,fail_employee_name,fail_reason,remark,sex,cutomer_grade,maintain_level,tenant_id,tenant_app_id,create_time,update_time FROM potential_customer WHERE ((member_id=?) AND status IN (?)) AND tenant_id=? AND tenant_app_id=?|8|49|13||0|0|5929|743|2|1|
|tenant|SELECT * FROM tenant.erp_sales WHERE tenant_id=? AND tenant_wechatapp_id=? AND member_erp_id=? ORDER BY sales_date DESC,sales_erp_id DESC LIMIT ?|8|331|88||0|0|71820|25558|8|1|
|tenant|SELECT count(?) FROM (SELECT shop.*,dept.dept_name,count(es.id) AS employeesCount FROM tenant_wechatapp_shop shop LEFT JOIN erp_department dept ON shop.dept_erp_id=dept.dept_erp_id AND shop.tenant_id=dept.tenant_id LEFT JOIN employee_shop es ON shop.id=es.shop_id AND es.status IN (?) WHERE shop.tenant_wechatapp_id=? AND shop.status IN (?) GROUP BY shop.id)table_count|7|17|2||0|0|656096|93728|7|1|
|warranty_service|UPDATE warranty_service.warranty SET has_read=? WHERE tenant_wechatapp_id=? AND id=?|7|9|2||0|0|7|1|0|0|
|tenant|SELECT count(?) FROM employee t LEFT JOIN tenant_wechatapp_shop sp ON sp.tenant_id=t.tenant_id AND t.shop_id=sp.id LEFT JOIN tenant.erp_department ed ON ed.tenant_id=t.tenant_id AND ed.dept_erp_id=t.dept_erp_id WHERE t.tenant_id=? AND t.status IN (?)|7|9|1||0|0|8165|2178|7|1|
|tenant|INSERT INTO erp_sales_detail_extend(tenant_id,id,tenant_wechatapp_id,sales_erp_id,sales_index,sales_brand,sales_craft) VALUES (?,?,?,?,?,?,?) ON DUPLICATE key UPDATE update_time=now(),sales_brand=?,sales_craft=?|7|11|2||0|0|0|0|0|0|
|v4_activity|SELECT ? member_id,(SELECT count(?) FROM lottery_log WHERE activity_id=? AND member_id=? AND qualified_id=? AND tenant_id=? AND tenant_app_id=?)play_count,(SELECT count(?) FROM lottery_log WHERE win_status=? AND activity_id=? AND member_id=? AND qualified_id=? AND tenant_id=? AND tenant_app_id=?)play_count_win|7|14|3||0|0|207596|29678|7|1|
|tenant|SELECT count(*) FROM tenant.sneak_guest_maintain s JOIN tenant.sneak_guest sg ON sg.tenant_id=s.tenant_id AND sg.tenant_app_id=s.tenant_app_id AND sg.id=s.sneak_guest_id JOIN tenant.employee e ON e.tenant_id=s.tenant_id AND e.id=s.employee_id WHERE s.tenant_id=? AND s.tenant_app_id=? AND sg.create_shop_id=? AND (sg.fail_type IS ? OR sg.fail_type=?) AND s.event_type=? AND s.create_time BETWEEN ? AND ?|7|12|3||0|0|6315|1266|7|1|
|v4_employee|SELECT COUNT(*) FROM (SELECT t.id AS task_id,task_type,if(task_type=?,st.description,it.description) AS description,if(task_type=?,st.quick_reply,it.quick_reply) AS quick_reply,task_name,member_id,member_name,member_mobile_no,member_sex,member_level,t.start_time,t.end_time,datediff(t.end_time,?) AS left_days,send_coupons,recv_coupons,st.coupons,t.accept_time,t.plan_arrival_shop_time,t.arrival_shop_time,t.trade_time FROM task_task t LEFT JOIN task_system_task_template st ON st.id=t.task_template_id AND st.tenant_id=? AND st.tenant_app_id=? LEFT JOIN task_invite_task_template it ON it.id=t.task_template_id AND it.tenant_id=? AND it.tenant_app_id=? WHERE t.status=? AND task_type=? AND task_template_id=? AND shop_id=? AND employee_id=? AND finish_time IS ? AND t.end_time>now() AND t.tenant_id=? AND t.tenant_app_id=?)TOTAL|7|10|2||0|0|1400|450|7|1|
|coupon_service|SELECT egc.id,tmp.coupon_name,tmp.coupon_type,tmp.remark,cp.take_effect_way,cp.take_start_day,cp.take_effect_day,DATE_FORMAT(cp.begin_time,?) AS begin_time,DATE_FORMAT(cp.end_time,?) AS end_time,egc.limit_grant_time,DATE_FORMAT(egc.grant_begin_time,?) AS grant_begin_time,DATE_FORMAT(egc.grant_end_time,?) AS grant_end_time,ifnull(tmp.face_value,?)/? AS face_value,tmp.face_value AS point,ifnull(tmp.discount,?)/? AS discount,tmp.scope,tmp.product_name,tmp.product_image_url,if(egc.state=?,?,(CASE WHEN cp.end_time IS NOT ? AND cp.end_time<now() THEN ? WHEN egc.limit_grant_time=? AND egc.grant_end_time<now() THEN ? WHEN tgl.put_quantity<=(SELECT count(*) FROM coupon_service.employee_give_coupon_log WHERE employee_give_coupon_id=egc.id) THEN ? ELSE ? END)) AS state,tr.type AS redpackType,ifnull(tr.min_price,?)/? AS minPrice FROM coupon_service.employee_give_coupon egc INNER JOIN coupon_service.coupon_push cp ON egc.template_id=cp.template_id AND cp.source=? AND egc.id=cp.source_id AND cp.state=? INNER JOIN coupon_service.template tmp ON egc.template_id=tmp.id INNER JOIN coupon_service.template_grant_limit tgl ON cp.id=tgl.coupon_push_id LEFT JOIN coupon_service.template_redpack tr ON tr.template_id=tmp.id WHERE egc.tenant_app_id=? AND egc.state=? AND (egc.limit_grant_time=? OR egc.grant_begin_time<=now()) AND (egc.limit_shop=? OR EXISTS(SELECT ? FROM coupon_service.employee_give_coupon_shop cs WHERE egc.id=cs.employee_give_id AND cs.shop_id=?)) AND egc.limit_role IN (?) ORDER BY state ASC,egc.id DESC LIMIT ?|7|9|1||0|0|673157|246969|58|10|
|corpwx|SELECT count(*) FROM external_user WHERE (tenant_id=? AND corp_user_id=? AND user_id=? AND status=?)|7|9|1||0|0|11|2|7|1|
|order|SELECT count(?) FROM order_info od LEFT JOIN order_detail dt ON od.id=dt.order_id LEFT JOIN order_address ad ON od.id=ad.order_id WHERE od.tenant_id=? AND od.tenant_wechatapp_id=?|7|114|47||0|0|1287861|184131|7|1|
|v4_coupon|SELECT COUNT(*) AS total FROM v4_coupon.employee_grant_coupon egc JOIN v4_coupon.coupon_put cp ON egc.put_id=cp.id AND cp.tenant_id=? AND cp.tenant_app_id=? JOIN v4_coupon.coupon_put_limit cpl ON cpl.put_id=cp.id AND cpl.tenant_id=? AND cpl.tenant_app_id=? LEFT JOIN v4_coupon.employee_grant_record egr ON egr.employee_grant_id=egc.id AND egr.employee_id=? AND egr.shop_id=? AND (egr.external_user_id=? OR egr.member_id=?) AND egr.tenant_id=? AND egr.tenant_app_id=? WHERE cp.put_scene=? AND cp.status=? AND if(cp.take_effect_way=?,cp.end_time>now(),?) AND (egc.limit_grant_time=? OR (egc.grant_begin_time<=now() AND egc.grant_end_time>now())) AND (cpl.put_quantity>get_quantity OR cpl.put_quantity=?) AND (egc.limit_shop=? OR EXISTS (SELECT ? FROM v4_coupon.employee_grant_shop cs WHERE egc.id=cs.employee_grant_id AND cs.shop_id=? AND cs.tenant_id=? AND cs.tenant_app_id=?)) AND limit_role IN (?) AND egc.tenant_id=? AND egc.tenant_app_id=?|6|13|4||0|0|126388|21841|6|1|
|qrcode_service|SELECT id,tenant_id,params_key,params_value,group_id,create_time,update_time FROM qrcode_params WHERE (tenant_id=? AND group_id=?)|6|7|1||0|0|55176|9202|0|0|
|user_service|SELECT count(?) FROM user_source us WHERE us.tenant_id=? AND us.tenant_wechatapp_id=? AND us.shop_id=? AND us.create_time>=? AND us.create_time<? AND us.source_type=? AND us.from_id IS NOT ? AND us.shop_id IS NOT ?|6|10|2||0|0|2420|829|6|1|
|user_service|INSERT INTO erp_integral_log(id,tenant_id,tenant_wechatapp_id,integral_erp_id,member_erp_id,note_erp_id,remark,integral,erp_create_time,create_time,update_time,busi_type,busi_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?) ON DUPLICATE key UPDATE update_time=now()|6|10|2||0|0|0|0|0|0|
|gift_mail|SELECT count(?) FROM gift_mail.product WHERE product_type=? AND product_status=? AND is_disable!=? AND tenant_id=?|6|8|2||0|0|48234|8039|6|1|
|agency|SELECT count(*) FROM agency.booking_order WHERE tenant_app_id=? AND shop_id=? AND status=?|6|8|1||0|0|42126|7021|6|1|
|coupon_service|INSERT INTO coupon_extend(id,tenant_id,tenant_app_id,coupon_id,remark,user_name,mobile_no,creator_user_id,creator_user_name,creator_mobile_no,product_name,exchange_shop,is_give,writeoff_user_id,writeoff_employee_id,writeoff_time,source_shop_id,source_user_id,source_user_type,member_source_shop,create_time,update_time) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)|6|10|2||0|0|0|0|0|0|
|tenant|SELECT count(*)amount FROM sneak_guest WHERE tenant_app_id=? AND status=? AND create_shop_id=? AND create_time<=?|6|13|4||0|0|16927|4236|6|1|
|v4_sales|SELECT es.sales_no,es.sales_date,esd.product_name,esd.product_barcode,esd.quantity,esd.sales_type AS giftType FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id=es.sales_erp_id AND esd.sales_type IN (?) AND member_erp_id IN (?) AND esd.tenant_id=? AND esd.tenant_app_id=? WHERE es.tenant_id=? AND es.tenant_app_id=? ORDER BY es.id DESC|6|14|3||0|0|1510|1472|190|188|
|tenant|SELECT shop.*,dept.dept_name,count(es.id) AS employeesCount FROM tenant_wechatapp_shop shop LEFT JOIN erp_department dept ON shop.dept_erp_id=dept.dept_erp_id AND shop.tenant_id=dept.tenant_id LEFT JOIN employee_shop es ON shop.id=es.shop_id AND es.status IN(?) WHERE shop.tenant_wechatapp_id=? AND shop.status IN (?) GROUP BY shop.id ORDER BY shop.create_time DESC LIMIT ?,?|6|14|2||0|0|561711|93641|107|20|
|gift_mail|SELECT p.id,product_name,default_image_url,tag_price,product_status,(SELECT ifnull(MIN(price),?) FROM gift_mail.inventory WHERE product_id=p.id)price,if(product_type=?,?,ifnull(i.quantity,?))quantity,ifnull(i.volume,?)volume FROM gift_mail.product p JOIN gift_mail.product_status ps ON ps.product_id=p.id AND ps.tenant_wechatapp_id=? LEFT OUTER JOIN (SELECT sum(quantity)quantity,sum(volume)volume,product_id FROM gift_mail.inventory GROUP BY product_id)i ON i.product_id=p.id WHERE (p.id IN (?))|6|10|3||0|0|51120|8520|6|1|
|coupon_service|SELECT count(?) FROM (SELECT cm.id,coupon_name,coupon_pack_name AS packName,cp.coupon_type,round(t.face_value/?,?) AS faceValue,round(t.discount/?,?) AS discount,cp.begin_time,cp.end_time,t.scope,round(cp.use_threshold/?,?) AS useThreshold,cm.pay_type,round(cm.cash/?,?) AS cash,cm.point,t.product_name,cm.type,cp.take_effect_way,cp.take_start_day,cp.take_effect_day,tgl.get_quantity,(tgl.get_quantity/tgl.put_quantity)*? AS total,t.face_value AS couponPoint FROM coupon_service.coupon_market cm JOIN coupon_service.coupon_push cp ON cp.tenant_app_id=? AND cp.source_id=cm.id AND cp.source IN (?) JOIN coupon_service.template t ON t.tenant_app_id=? AND t.id=cp.template_id JOIN coupon_service.template_grant_limit tgl ON tgl.tenant_app_id=? AND tgl.coupon_push_id=cp.id LEFT JOIN coupon_service.coupon_market_limit_tag tag ON tag.tenant_id=? AND tag.tenant_app_id=? AND cm.id=tag.coupon_market_id AND tag.label_id IN (?) WHERE cm.tenant_id=? AND cm.tenant_app_id=? AND cm.type=? AND cm.state=? AND if(take_effect_way=?,end_time>now(),?=?) AND tgl.get_quantity<tgl.put_quantity AND cm.display_way=? AND (cm.limit_type=? OR (cm.limit_type=? AND find_in_set(?,cm.limit_grade_ids)) OR (cm.limit_type=? AND tag.id IS NOT ?)) UNION ALL SELECT cm.id,?,coupon_pack_name AS packName,?,?,?,?,?,?,?,pay_type,round(cash/?,?) AS cash,point,?,type,?,?,?,?,?,? FROM coupon_service.coupon_market cm LEFT JOIN coupon_service.coupon_market_limit_tag tag ON tag.tenant_id=? AND tag.tenant_app_id=? AND cm.id=tag.coupon_market_id AND tag.label_id IN (?) WHERE cm.tenant_id=? AND cm.tenant_app_id=? AND cm.type=? AND cm.state=? AND display_way=? AND (cm.limit_type=? OR (cm.limit_type=? AND find_in_set(?,cm.limit_grade_ids)) OR (cm.limit_type=? AND tag.id IS NOT ?)))table_count|6|7|1||0|0|2469|430|6|1|
|tenant|SELECT count(*) FROM sneak_guest WHERE (tenant_app_id=? AND create_shop_id=? AND maintain_employee_id=? AND status=? AND next_maintain_date BETWEEN ? AND ?)|6|7|1||0|0|247|69|6|1|
|v4_employee|SELECT count(*) AS total_count,count(finish_time) AS finish_count FROM task_task t JOIN task_invite_task_template t? ON t.task_template_id=t?.id AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t?.invite_time<? AND t.end_time>? AND t?.status IN (?) AND t.task_type=? AND t.status=? AND t.shop_id=? AND t.tenant_id=? AND t.tenant_app_id=?|6|14|3||0|0|235536|106292|6|1|
|coupon_service|SELECT count(?) FROM (SELECT c.id,c.coupon_name,c.coupon_type,if(c.coupon_type IN (?),c.face_value,round(c.face_value/?,?)) AS faceValue,round(c.discount/?,?) AS discount,c.begin_time,c.end_time,c.wx_card_id,c.wx_card_no,c.template_id,round(c.use_threshold/?) AS useThreshold,round(c.balance/?,?)balance,t.scope,ce.product_name,(CASE WHEN c.end_time<now() AND c.coupon_state!=? THEN ? WHEN c.begin_time>now() THEN ? ELSE c.coupon_state END) AS state FROM coupon_service.coupon c JOIN coupon_service.coupon_extend ce ON ce.id=c.id JOIN coupon_service.template t ON t.id=c.template_id WHERE c.tenant_app_id=? AND c.user_id=? AND c.end_time>=?) AS c|6|6|1||0|0|66|18|6|1|
|gift_mail|SELECT count(*) FROM gift_mail.product p LEFT JOIN gift_mail.partner_product pp ON p.id=pp.product_id WHERE tenant_wechatapp_id=? AND product_status=?|6|8|1||0|0|48271|8058|6|1|
|tenant|INSERT INTO erp_sales_detail(id,tenant_id,tenant_wechatapp_id,sales_erp_id,sales_index,sales_type,product_barcode,product_name,cert_no,hand_size,category_erp_id,category_name,stone_weight,gold_weight,total_weight,quantity,amount_total,amount_pay,integral,remark) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ON DUPLICATE key UPDATE update_time=now(),sales_type=?,product_barcode=?,product_name=?,cert_no=?,hand_size=?,category_erp_id=?,category_name=?,stone_weight=?,gold_weight=?,total_weight=?,quantity=?,amount_total=?,amount_pay=?,integral=?,remark=?|6|11|2||0|0|0|0|0|0|
|order|SELECT count(?)total,ifnull(sum(if(od.status>?,od.payment_fee,?)),?)paymentFee,ifnull(sum(if(od.status>?,od.offline_payment_fee,?)),?)offlinePaymentFee,ifnull(sum(if(od.status>?,od.payment_fee+od.offline_payment_fee,?)),?)payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id=dt.order_id LEFT JOIN order_address ad ON od.id=ad.order_id WHERE od.tenant_id=? AND od.tenant_wechatapp_id=? AND (od.mobile_no=? OR ad.mobile_no=?)|6|143|43||0|0|1104348|184059|6|1|
|v4_sales|SELECT * FROM v4_sales.erp_sales_detail WHERE sales_erp_id=? AND product_barcode=? AND tenant_id=? AND tenant_app_id=?|6|9|1||0|0|7|2|6|1|
|v4_coupon|UPDATE v4_coupon.coupon SET coupon_status=? WHERE tenant_id=? AND tenant_app_id=? AND coupon_status=? AND end_time<now()|6|11|4||0|0|3278728|1079343|0|0|
|v4_user|SELECT id,checkin_employee_name,maintain_employee_name FROM potential_customer WHERE ((member_id=?) AND status IN (?)) AND tenant_id=? AND tenant_app_id=? ORDER BY id ASC|6|19|6||0|0|26794|8420|4|1|
|employee|UPDATE backlog_system SET status=?,finish_time=now() WHERE tenant_app_id=? AND scene=?|5|39|23||0|0|3089796|1439175|0|0|
|v4_sales|SELECT es.sales_erp_id,es.sales_no,es.sales_date,count(esd.id)busiQuantity,sum(amount_total)amountTotal FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id=es.sales_erp_id AND esd.sales_type IN (?) AND esd.tenant_id=? AND esd.tenant_app_id=? WHERE sales_status=? AND es.is_sales AND member_erp_id IN (?) AND es.tenant_id=? AND es.tenant_app_id=? GROUP BY es.sales_erp_id,es.sales_no,es.sales_date|5|12|3||0|0|1708|1684|342|337|
|activity_service|SELECT count(?) FROM (SELECT t?.id AS activityId,t?.activity_name AS activityname,t?.activity_main_pic_url AS activityMainPicUrl,t?.activity_type AS activitytype,date_format(t?.start_time,?) AS startTime,date_format(t?.end_time,?) AS endTime,t?.activity_remark AS activityremark,t?.`status` AS activityStatus,t?.must_attention AS mustAttention,t?.must_register AS mustRegister,t?.activity_rule AS activityRule,t?.activity_list_pic_url AS activityListPicUrl,t?.contact_merchant AS contactMerchant,if(t?.end_time>now(),?,?) AS overdue,t?.background_color,t?.share_type,t?.share_icon_url,t?.share_text FROM activity t? WHERE participation_type=? AND t?.`status`=? AND t?.`status`=? AND t?.activity_type IN (?) AND t?.end_time>=now() AND t?.tenant_id=? AND t?.tenant_wechatapp_id=? ORDER BY overdue ASC,t?.start_time ASC)tmp_count|5|5|1||0|0|1133|385|5|1|
|employee|INSERT INTO backlog_?(id,tenant_id,tenant_app_id,user_id,employee_id,status,scene,begin_time,expire_time,md5_str,shop_id,task_amount,finish_amount) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?) ON DUPLICATE key UPDATE update_time=now()|5|7|2||0|0|0|0|0|0|
|v4_user|SELECT COUNT(*) AS total FROM potential_customer pc WHERE EXISTS (SELECT ? FROM potential_customer_maintain t? WHERE pc.id=t?.potential_customer_id AND t?.create_time>=? AND t?.create_time<=? AND t?.event_type IN (?) AND t?.tenant_app_id=?) AND pc.tenant_app_id=?|5|66|33||0|0|27966|5594|5|1|
|tenant|SELECT DISTINCT t?.category_erp_id,t?.category_name FROM erp_sales_detail t? LEFT JOIN erp_sales t? ON t?.sales_erp_id=t?.sales_erp_id AND t?.tenant_id=t?.tenant_id WHERE t?.tenant_id=? AND t?.tenant_wechatapp_id=? AND ifnull(t?.category_name,?)!=? AND t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.member_erp_id=? AND t?.sales_status=? AND t?.is_sales=?|5|9|3||0|0|482|341|42|18|
|v4_employee|SELECT COUNT(*) FROM (SELECT t.id AS task_id,task_type,if(task_type=?,st.description,it.description) AS description,if(task_type=?,st.quick_reply,it.quick_reply) AS quick_reply,task_name,member_id,member_name,member_mobile_no,member_sex,member_level,t.start_time,t.end_time,datediff(t.end_time,?) AS left_days,send_coupons,recv_coupons,st.coupons,t.accept_time,t.plan_arrival_shop_time,t.arrival_shop_time,t.trade_time FROM task_task t LEFT JOIN task_system_task_template st ON st.id=t.task_template_id AND st.tenant_id=? AND st.tenant_app_id=? LEFT JOIN task_invite_task_template it ON it.id=t.task_template_id AND it.tenant_id=? AND it.tenant_app_id=? WHERE t.status=? AND task_type=? AND system_task_type=? AND t.start_time<=? AND t.end_time>? AND shop_id=? AND employee_id=? AND finish_time IS ? AND t.tenant_id=? AND t.tenant_app_id=?)TOTAL|5|9|2||0|0|872|302|5|1|
|gift_mail|SELECT c.id,c.categroy_name,c.parent_id,count(p.id)hasProducedCount FROM gift_mail.platform_category c LEFT JOIN gift_mail.platform_product p ON p.category_id=c.id GROUP BY c.id,c.categroy_name,c.parent_id ORDER BY c.parent_id ASC,c.update_time ASC|5|7|1||0|0|12490|2498|525|105|
|v4_user|INSERT INTO member_change_log(id,member_id,change_type,change_time,oper_employee_id,oper_desc,oper_detail,old_shop_id,new_shop_id,old_butler_id,new_butler_id,member_status,tenant_id,tenant_app_id,create_time,update_time) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)|5|5|1||0|0|0|0|0|0|
|activity_service|SELECT count(t.user_id) AS lotteryCount,count(DISTINCT t.user_id) AS lotteryNum FROM lottery_winner t WHERE t.lottery_activity_id=?|5|17|10||0|0|9538|2265|5|1|
|tenant|SELECT DISTINCT t?.sales_type FROM erp_sales_detail t? LEFT JOIN erp_sales t? ON t?.sales_erp_id=t?.sales_erp_id AND t?.tenant_id=t?.tenant_id WHERE t?.tenant_id=? AND t?.tenant_wechatapp_id=? AND ifnull(t?.sales_type,?)!=? AND t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.member_erp_id=? AND t?.sales_status=? AND t?.is_sales=?|5|9|3||0|0|463|332|23|9|
|user_service|SELECT tmi.tenant_id,tmi.id,tmi.tenant_app_id,tmi.user_id,tmi.shop_id,tmi.birthday,tmi.birthday_is_lunar,tmi.address,tmi.memorial_name,tmi.memorial_day,tmi.memorial_day_is_lunar,tmi.interest,tmi.grade_id,tmi.create_time,tmi.update_time FROM user_service.tenant_member_info tmi JOIN user_service.tenant_member tm ON tm.tenant_id=? AND tm.tenant_app_id=? AND tm.user_id=tmi.user_id WHERE tmi.tenant_id=? AND tmi.tenant_app_id=? AND tm.status=? AND tmi.user_id IN|5|5|1||0|0|33643|10024|16753|5012|
|order|SELECT ifnull(sum(ifnull(dt.quantity,?)),?)amount FROM `order`.order_info od LEFT JOIN `order`.order_detail dt ON od.id=dt.order_id WHERE od.tenant_wechatapp_id=? AND od.user_id=? AND od.status>? AND dt.product_id=? AND activity_id=?|5|8|2||0|0|500|100|5|1|
|coupon_service|SELECT cet.id,cet.coupon_id,cet.user_id,cet.coupon_type,cet.expire_time,if((cet.expire_time<now() AND cet.status=?),?,cet.status) AS status FROM coupon_service.coupon_expire_task cet JOIN coupon_service.coupon_extend ce ON ce.tenant_id=? AND ce.tenant_app_id=? AND ce.coupon_id=cet.coupon_id WHERE cet.tenant_id=? AND cet.tenant_app_id=? AND cet.employee_id=? AND cet.shop_id=?|5|20|7||0|0|2276|720|1138|360|
|value_added|SELECT ? AS limitDayType,t.tenant_wechatapp_id AS tenantAppId,t.user_id AS userId,min(ue.employee_erp_id)employee_erp_id,ue.dept_erp_id,GROUP_CONCAT(t.product_barcode ORDER BY product_barcode ASC) AS productCode,GROUP_CONCAT(t.product_name ORDER BY product_barcode ASC) AS productName FROM value_added_user t INNER JOIN value_added_user_extend ue ON t.id=ue.id WHERE t.tenant_wechatapp_id=? AND t.state=? AND t.start_add_time>=date_add(DATE_FORMAT(?,?),interval ?*(t.add_days?)day) AND t.start_add_time<date_add(DATE_FORMAT(?,?),interval(?*(t.add_days?)+?)day) GROUP BY t.tenant_wechatapp_id,t.user_id,ue.dept_erp_id|5|15|8||0|0|1368519|473148|199|115|
|user_service|SELECT count(?) FROM user_service.user_employee ue JOIN user_service.tenant_member tm ON tm.tenant_id=ue.tenant_id AND tm.tenant_app_id=ue.tenant_wechatapp_id AND tm.user_id=ue.user_id WHERE ue.employee_id=? AND ue.tenant_id=? AND ue.tenant_wechatapp_id=? AND ue.shop_id=? AND (tm.user_name LIKE CONCAT(?,?,?) OR tm.mobile_no LIKE CONCAT(?,?))|5|14|4||0|0|13602|2754|5|1|
|v4_user|SELECT checkin_time,id FROM potential_customer WHERE (maintain_shop_id=? AND status IN (?)) AND tenant_id=? AND tenant_app_id=?|5|10|3||0|0|9405|4128|1841|913|
|coupon_service|INSERT INTO coupon(id,tenant_id,tenant_app_id,template_id,coupon_push_id,coupon_no,coupon_state,user_id,coupon_name,coupon_type,face_value,discount,use_threshold,balance,begin_time,end_time,wx_card_id,wx_card_no,source,source_id,business_id,create_time,update_time) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)|5|8|2||0|0|0|0|0|0|
|tenant|UPDATE erp_sales SET comment_id=? WHERE tenant_id=? AND id=?|4|5|1||0|0|4|1|0|0|
|user_service|SELECT count(?) FROM user_service.tenant_member tm JOIN user_service.tenant_member_info tmi ON tmi.tenant_id=? AND tmi.tenant_app_id=? AND tm.id=tmi.id WHERE tm.tenant_id=? AND tm.tenant_app_id=? AND (tm.user_name LIKE concat(?,?,?) OR tm.mobile_no=?)|4|21|16||0|0|481356|311002|4|1|
|goods|SELECT count(?) FROM (SELECT gs.id,gs.category_id,gs.goods_name,gs.style_no,gs.status,gs.thumbnail_img,gs.express_type,gs.take_stock_day,gs.take_remark,gs.express_fee,ifnull(gs.base_sale_number,?)+ifnull(t?.sales_volume,?)total_sales_volume,ifnull(ifnull(t?.quantity,t?.quantity),?)total_quantity,ifnull(ifnull(t?.price,t?.price),?)min_price,gs.create_time,gs.exchange_money,ifnull(t?.number,?)skuNumber,ifnull(t?.number,?)activitySkuNumber FROM goods.goods gs LEFT JOIN goods.goods_category cg ON gs.category_id=cg.id INNER JOIN goods.goods_up_app t ON gs.id=t.goods_id AND t.tenant_app_id=? LEFT JOIN (SELECT tenant_app_id,goods_id,sum(sales_volume)sales_volume FROM goods.goods_sku GROUP BY tenant_app_id,goods_id)t? ON t.tenant_app_id=t?.tenant_app_id AND t.goods_id=t?.goods_id LEFT JOIN (SELECT tenant_app_id,goods_id,sum(quantity)quantity,min(price)price,count(*)number FROM goods.goods_sku WHERE activity_id=? GROUP BY tenant_app_id,goods_id)t? ON t.tenant_app_id=t?.tenant_app_id AND t.goods_id=t?.goods_id LEFT JOIN (SELECT tenant_app_id,goods_id,sum(quantity)quantity,min(price)price,count(*)number FROM goods.goods_sku WHERE activity_id>? GROUP BY tenant_app_id,goods_id)t? ON t.tenant_app_id=t?.tenant_app_id AND t.goods_id=t?.goods_id WHERE ?=? AND gs.topping=?)tmp|4|7|2||0|0|522244|131092|4|1|
|corpwx|SELECT eu.id,eu.tenant_id,eu.user_id,eu.name,eu.avatar,eu.corp_user_id,eu.cwx_user_id,eu.sex,eu.un_assign_flag,eu.union_id,eub.wx_user_id FROM corpwx.external_user eu JOIN corpwx.external_user_bind eub ON eu.tenant_id=eub.tenant_id AND eu.user_id=eub.external_user_id WHERE eu.tenant_id=? AND eu.status=? AND eub.wx_user_id IN (?) AND eu.un_assign_flag=?|4|7|1||0|0|0|0|0|0|
|v4_sales|SELECT es.id salesId,es.sales_no,es.sales_date,es.member_erp_id memberId,w.warranty_no FROM v4_sales.erp_sales es LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE is_sales=? AND sales_status=? AND (es.sales_no LIKE concat(?,?) OR es.member_erp_id=?) AND w.id IS NOT ? AND es.tenant_id=? AND es.tenant_app_id=? ORDER BY es.sales_date DESC,es.id DESC LIMIT ?|4|15|9||0|0|1373750|640733|24|10|
|v4_coupon|SELECT id,put_id,employee_grant_id,employee_id,shop_id,external_user_id,member_id,type,business_id,status,fail_reason,tenant_id,tenant_app_id,create_time,update_time FROM employee_grant_record WHERE (employee_grant_id=? AND shop_id=? AND employee_id=? AND member_id=? AND type=? AND business_id=?) AND tenant_id=? AND tenant_app_id=?|4|7|2||0|0|74965|18760|1|1|
|tenant|SELECT es.id,es.sales_no,es.sales_date,es.sales_erp_id,es.amount,ifnull(shop.shop_name,ed.dept_name)dept_name,es.employee_name FROM tenant.erp_sales es JOIN tenant.erp_department ed ON ed.dept_erp_id=es.dept_erp_id AND ed.tenant_id=? LEFT JOIN tenant.tenant_wechatapp_shop shop ON shop.dept_erp_id=ed.dept_erp_id AND shop.tenant_wechatapp_id=? WHERE es.member_erp_id=? AND es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.sales_status=? AND NOT EXISTS(SELECT i.id FROM tenant.erp_sales_ignore i WHERE i.tenant_id=? AND i.tenant_app_id=? AND es.sales_erp_id=i.erp_sales_id) ORDER BY es.sales_date DESC LIMIT ?|4|6|1||0|0|24066966|6530145|40|10|
|v4_user|SELECT potential_customer_id FROM potential_customer_follow WHERE (potential_customer_id IN (?) AND is_required=? AND oper_status=?) AND tenant_id=? AND tenant_app_id=?|4|7|1||0|0|604|151|20|5|
|user_service|UPDATE tenant_member_info SET shop_id=? WHERE tenant_id=? AND id IN (?)|4|6|2||0|0|4|1|0|0|
|employee|SELECT id,scene,employee_id,member_user_name userName,finish_time,status FROM employee.backlog_? WHERE tenant_id=? AND tenant_app_id=? AND shop_id=? AND expire_time BETWEEN ? AND ? AND status!=? AND scene NOT IN(?) ORDER BY id DESC LIMIT ?|4|13|4||0|0|1137368|518027|10|5|
|user_service|SELECT count(?) FROM user_service.tenant_member tm JOIN user_service.tenant_member_info tmi ON tm.tenant_id=tmi.tenant_id AND tm.id=tmi.id LEFT JOIN user_service.user_employee t? ON tm.user_id=t?.user_id AND tm.tenant_id=t?.tenant_id AND tm.tenant_app_id=t?.tenant_wechatapp_id WHERE t?.id IS ? AND tmi.shop_id=? AND tmi.tenant_id=? AND tmi.tenant_app_id=?|4|20|7||0|0|139445|40865|4|1|
|user_service|SELECT t?.user_id AS userId,t?.open_id AS wxOpenId FROM user_service.tenant_member t? JOIN user_service.tenant_member_bind t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id JOIN user_service.wx_user t? ON t?.wx_user_id=t?.id AND t?.is_subscribe=? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.user_id IN (?)|4|6|2||0|0|23|6|5|2|
|v4_sales|SELECT COUNT(*) AS total FROM value_added_record WHERE (value_added_id=?) AND tenant_id=? AND tenant_app_id=?|4|25|8||0|0|9672812|2418203|4|1|
|coupon_service|SELECT id,tenant_id,tenant_app_id,template_id,coupon_push_id,coupon_no,coupon_state,user_id,coupon_name,coupon_type,face_value,discount,use_threshold,balance,begin_time,end_time,wx_card_id,wx_card_no,source,source_id,business_id,create_time,update_time FROM coupon WHERE (tenant_app_id=? AND user_id=? AND source=? AND business_id=?)|4|4|1||0|0|3|3|0|0|
|tenant|SELECT e.id,e.employee_name FROM (SELECT DISTINCT sgm.employee_id FROM tenant.sneak_guest sg JOIN tenant.sneak_guest_maintain sgm ON sgm.sneak_guest_id=sg.id WHERE sg.tenant_id=? AND sg.tenant_app_id=? AND sg.update_shop_id=? AND sgm.event_type IN (?) AND (sg.fail_type IS ? OR sg.fail_type=?) AND sgm.create_time BETWEEN ? AND ?)t JOIN tenant.employee e ON e.id=t.employee_id|4|19|7||0|0|122804|50439|15|7|
|v4_sales|SELECT count(*) FROM v4_sales.erp_sales es LEFT JOIN v4_sales.erp_sales_ignore esi ON esi.sales_id=es.id AND esi.tenant_id=? AND esi.tenant_app_id=? WHERE es.member_erp_id IN (?) AND esi.id IS ? AND es.sales_status=? AND (es.comment_id IS ? OR es.comment_id=?) AND es.sales_date>=? AND es.tenant_id=? AND es.tenant_app_id=?|4|5|1||0|0|1212|606|4|1|
|coupon_service|SELECT count(?) FROM coupon_service.employee_give_coupon egc INNER JOIN coupon_service.coupon_push cp ON egc.template_id=cp.template_id AND cp.source=? AND egc.id=cp.source_id AND cp.state=? INNER JOIN coupon_service.template tmp ON egc.template_id=tmp.id INNER JOIN coupon_service.template_grant_limit tgl ON cp.id=tgl.coupon_push_id LEFT JOIN coupon_service.template_redpack tr ON tr.template_id=tmp.id WHERE egc.tenant_app_id=? AND egc.state=? AND (egc.limit_grant_time=? OR egc.grant_begin_time<=now()) AND (egc.limit_shop=? OR EXISTS (SELECT ? FROM coupon_service.employee_give_coupon_shop cs WHERE egc.id=cs.employee_give_id AND cs.shop_id=?)) AND egc.limit_role IN (?)|4|4|1||0|0|677847|243071|4|1|
|value_added|SELECT id,tenant_wechatapp_id AS tenantWechatappId,user_id AS userId,template_id AS templateId,sales_erp_id AS saleserpid,product_name AS productName,shop_name AS shopName,product_barcode AS productBarcode,amount_total AS amountTotal,amount_pay AS amountPay,amount_added AS amountAdded,state AS state,add_days AS addDays,added_percent_per_day AS addedPercentPerDay,devalue_percent_per_day AS devaluePercentPerDay,keeping_days AS keepingDays,exchange_days AS exchangeDays,coupon_user_id AS couponUserId,sales_index AS salesIndex,start_add_time AS createtime FROM value_added_user WHERE sales_erp_id=? AND sales_index=? AND tenant_wechatapp_id=?|4|4|1||0|0|1|1|1|1|
|v4_user|SELECT pc.id,pc.member_id,pc.external_user_id,pc.maintain_num,pc.intention_num,pc.checkin_time,pc.checkin_employee_name AS checkinEmployee,pc.maintain_employee_id,pc.maintain_employee_name AS maintainEmployee,pc.maintain_shop_id,pc.last_maintain_time,pc.cutomer_grade AS cutomerGrade,(CASE WHEN pc.`status`=? THEN pc.finish_time ELSE ? END)dealTime,pc.`status`,pc.fail_employee_name AS failEmployee,pc.finish_time AS finishTime FROM potential_customer pc WHERE EXISTS (SELECT ? FROM potential_customer_maintain t? WHERE pc.id=t?.potential_customer_id AND t?.create_time>=? AND t?.create_time<=? AND t?.event_type IN (?) AND t?.tenant_app_id=?) AND pc.tenant_app_id=? ORDER BY pc.id DESC LIMIT ?|4|4|1||0|0|22576|5644|200|50|
|v4_giftmall|SELECT count(*) FROM v4_giftmall.trade t LEFT JOIN v4_giftmall.trade_take tt ON tt.trade_id=t.id AND tt.tenant_id=? AND tt.tenant_app_id=? WHERE t.trade_type=? AND t.order_status=? AND t.take_type=? AND tt.shop_id=? AND t.tenant_id=? AND t.tenant_app_id=?|4|8|4||0|0|8984|6793|4|1|
|tenant|SELECT esd.id,esd.product_name,esd.category_name,esd.product_barcode,esd.cert_no,esd.amount_total,esd.amount_pay,esd.sales_index,esd.sales_type,esd.integral,esd.quantity,ifnull(ee.not_add_value_plan,?) AS not_add_value_plan FROM erp_sales_detail esd LEFT JOIN erp_sales_extend ee ON ee.tenant_id=esd.tenant_id AND esd.tenant_wechatapp_id=ee.tenant_wechatapp_id AND esd.sales_erp_id=ee.sales_erp_id AND esd.sales_index=ee.sales_index WHERE esd.sales_erp_id=? AND esd.tenant_id=? AND esd.tenant_wechatapp_id=? AND (esd.sales_type=? OR esd.amount_pay>?)|4|5|2||0|0|13|6|6|3|
|user_service|SELECT * FROM user_employee WHERE tenant_wechatapp_id=? AND employee_id=?|3|3|1||0|0|120303|113883|13054|6634|
|employee|UPDATE backlog_? SET finish_amount=?,finish_time=IF(task_amount<=finish_amount,ifnull(finish_time,now()),?),status=IF(task_amount<=finish_amount,?,?),update_time=now() WHERE tenant_id=? AND tenant_app_id=? AND employee_id=? AND scene=? AND begin_time<=? AND expire_time>=?|3|3|1||0|0|279|147|0|0|
|v4_sales|SELECT rownum FROM (SELECT erp_employee_id,average,@rank:=@rank+? AS rownum FROM (SELECT erp_employee_id,round(avg(c.average_score),?) AS average FROM v4_sales.comment c WHERE c.tenant_id=? AND c.tenant_app_id=? AND c.erp_dept_id=? AND c.create_time BETWEEN ? AND ? GROUP BY c.erp_employee_id) AS a,(SELECT @rank:=?)b ORDER BY average DESC)r WHERE r.erp_employee_id=?|3|7|4||0|0|196292|65604|0|0|
|user_service|SELECT count(?) FROM user_service.tenant_member t? JOIN user_service.tenant_member_info t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.id AND t?.tenant_app_id=? AND t?.shop_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND (t?.mobile_no LIKE concat(?,?) OR t?.user_name LIKE concat(?,?,?))|3|11|9||0|0|600232|537304|3|1|
|user_service|INSERT INTO user_employee(id,tenant_id,tenant_wechatapp_id,shop_id,user_id,employee_id,employee_erp_id,create_time,update_time) VALUES (?,?,?,?,?,?,?,?,?)|3|7|2||0|0|0|0|0|0|
|gift_mail|SELECT count(?) FROM (SELECT p.*,sp.take_type,ifnull(pp.integral_price,ifnull((SELECT min(inventory.price) FROM inventory WHERE inventory.product_id=p.id),?)) AS price,ifnull(t.quantity,?)quantity,pt.partner_name vendorName,? distance,c.categroy_name categroy_name,pp.partner_id FROM product p INNER JOIN category c ON c.id=p.category_id LEFT OUTER JOIN self_product sp ON p.id=sp.product_id LEFT OUTER JOIN partner_product pp ON p.id=pp.product_id LEFT OUTER JOIN partner pt ON pt.id=pp.partner_id LEFT OUTER JOIN (SELECT product_id,sum(quantity)quantity FROM gift_mail.inventory GROUP BY product_id)t ON p.id=t.product_id WHERE ((p.is_disable IS ? OR p.is_disable=?))) AS p LEFT OUTER JOIN product_status ps ON p.id=ps.product_id AND ps.tenant_wechatapp_id=? WHERE (p.product_status=? AND p.topping=? AND p.tenant_id=? AND (ps.id IS NOT ? OR p.tenant_wechatapp_id=?))|3|4|1||0|0|166125|55375|3|1|
|v4_sales|INSERT INTO erp_sales_detail(id,sales_index,sales_erp_id,sales_type,product_barcode,product_name,cert_no,hand_size,category_erp_id,category_name,stone_weight,gold_weight,total_weight,quantity,amount_total,amount_pay,integral,remark,sales_brand,sales_craft,create_time,update_time,tenant_id,tenant_app_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)|3|4|1||0|0|0|0|0|0|
|authorization_service|SELECT id,user_id,tenant_id,tenant_wx_app_id,account_id,login_way,login_code,login_token,roles,status,expire_time,create_time,update_time,login_ip,login_time,login_data,employee_id,shop_id,platform_user_id,wx_user_id,wx_app_user_id FROM user_login_token WHERE tenant_id=? AND login_way=?|3|3|1||0|0|3|1|3|1|
|user_service|UPDATE tenant_member_info SET tenant_app_id=?,user_id=?,shop_id=?,birthday=?,birthday_is_lunar=?,address=?,memorial_name=?,memorial_day_is_lunar=?,grade_id=?,create_time=?,update_time=?,info_is_perfect=?,erp_card_no=? WHERE tenant_id=? AND id=?|3|4|2||0|0|3|1|0|0|
|tenant|SELECT sg.tenant_app_id AS tenantAppId,sg.create_shop_id AS shopId,sg.maintain_employee_id AS employeeId,emp.corp_wx_user_id AS corpwxUserId,count(*) AS waitMaintainNum FROM tenant.sneak_guest sg JOIN tenant.employee emp ON sg.maintain_employee_id=emp.id WHERE sg.tenant_app_id=? AND sg.status=? AND sg.next_maintain_date>=CURRENT_DATE AND sg.next_maintain_date<DATE_ADD(CURRENT_DATE,INTERVAL ? day) GROUP BY sg.tenant_app_id,sg.create_shop_id,sg.maintain_employee_id,emp.corp_wx_user_id|3|10|5||0|0|90387|77203|67|54|
|user_service|SELECT tenant_id,id,tenant_app_id,user_id,mobile_no,user_name,head_img_url,sex,status,create_time,update_time FROM tenant_member WHERE (tenant_id=? AND tenant_app_id=? AND user_name LIKE ?) LIMIT ?|3|3|1||0|0|0|0|0|0|
|v4_sales|SELECT COUNT(*) AS total FROM comment_prize WHERE (member_id=? AND prize_setting_id=? AND type=? AND create_time BETWEEN ? AND ?) AND tenant_id=? AND tenant_app_id=?|3|5|2||0|0|68637|22898|3|1|
|tenant|SELECT es.id,es.sales_no,es.sales_date,es.sales_erp_id,es.amount,ifnull(shop.shop_name,ed.dept_name)dept_name,es.employee_name FROM tenant.erp_sales es JOIN tenant.erp_department ed ON ed.dept_erp_id=es.dept_erp_id AND ed.tenant_id=? LEFT JOIN tenant.tenant_wechatapp_shop shop ON shop.dept_erp_id=ed.dept_erp_id AND shop.tenant_wechatapp_id=? WHERE es.member_erp_id=? AND es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.sales_status=? AND NOT EXISTS(SELECT i.id FROM tenant.erp_sales_ignore i WHERE i.tenant_id=? AND i.tenant_app_id=? AND es.sales_erp_id=i.erp_sales_id) ORDER BY es.sales_date DESC LIMIT ?,?|3|4|1||0|0|19590555|6530205|30|10|
|gift_mail|SELECT count(*) FROM gift_mail.trade t WHERE t.tenant_wechatapp_id=? AND t.trade_type=? AND t.order_status=?|3|9|4||0|0|31998|13496|3|1|
|v4_coupon|SELECT COUNT(*) AS total FROM (SELECT DISTINCT c.id,c.activity_name,c.push_time,c.tag_id,c.butler_call_member FROM v4_coupon.tag_push_coupon c JOIN v4_coupon.tag_push_coupon_log l ON l.tag_push_coupon_id=c.id AND l.push_coupon_state=? AND l.tenant_id=? AND l.tenant_app_id=? WHERE c.push_state=? AND c.butler_visible=? AND l.shop_id=? AND l.employee_id=? AND c.push_time>=? AND c.tenant_id=? AND c.tenant_app_id=? ORDER BY c.push_time DESC)c|3|6|3||0|0|1236870|412290|3|1|
|order|SELECT max(create_time) FROM `order`.order_operator_log WHERE tenant_wechatapp_id=? AND order_id=?|3|126|65||0|0|3282236|1094356|3|1|
|tenant|SELECT count(?) FROM employee emp JOIN employee_shop es ON emp.id=es.employee_id JOIN tenant_wechatapp_shop sp ON es.shop_id=sp.id WHERE emp.tenant_id=? AND es.`tenant_app_id`=? AND sp.id=? AND es.`status` IN (?) AND emp.`status` IN (?) AND es.`status`=? AND NOT EXISTS (SELECT ? FROM employee_shop_change esc WHERE emp.tenant_id=esc.tenant_id AND emp.id=esc.employee_id AND sp.id=esc.new_shop_id AND esc.status=?) AND emp.id IN (?)|3|3|1||0|0|270|90|3|1|
|user_service|INSERT INTO tenant_member_bind(tenant_id,id,tenant_app_id,user_id,wx_user_id,erp_member_id,customer_user_id,wx_union_id,create_time,update_time,external_user_id) VALUES (?,?,?,?,?,?,?,?,?,?,?)|3|5|2||0|0|0|0|0|0|
|gift_mail|SELECT p.id,p.product_name,p.tag_price,i.volume,p.product_status AS status,p.default_image_url,i.quantity,i.market_price,if(prp.id IS ?,?,?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id=p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id=? AND prp.is_recommend=? AND prp.platform_product_id=p.id WHERE prp.id IS ? AND p.product_status=? ORDER BY i.volume DESC ,p.tag_price ASC ,p.id DESC LIMIT ?|3|3|1||0|0|26697|8899|18|6|
|coupon_service|UPDATE coupon_extend SET user_name=?,mobile_no=?,creator_user_name=?,creator_mobile_no=?,writeoff_employee_id=?,writeoff_time=? WHERE id=?|3|4|1||0|0|3|1|0|0|
|goods|SELECT count(?) FROM (SELECT gs.id,gs.category_id,gs.goods_name,gs.style_no,gs.status,gs.thumbnail_img,gs.express_type,gs.take_stock_day,gs.take_remark,gs.express_fee,ifnull(gs.base_sale_number,?)+ifnull(t?.sales_volume,?)total_sales_volume,ifnull(ifnull(t?.quantity,t?.quantity),?)total_quantity,ifnull(ifnull(t?.price,t?.price),?)min_price,gs.create_time,gs.exchange_money,ifnull(t?.number,?)skuNumber,ifnull(t?.number,?)activitySkuNumber FROM goods.goods gs LEFT JOIN goods.goods_category cg ON gs.category_id=cg.id INNER JOIN goods.goods_up_app t ON gs.id=t.goods_id AND t.tenant_app_id=? LEFT JOIN (SELECT tenant_app_id,goods_id,sum(sales_volume)sales_volume FROM goods.goods_sku GROUP BY tenant_app_id,goods_id)t? ON t.tenant_app_id=t?.tenant_app_id AND t.goods_id=t?.goods_id LEFT JOIN (SELECT tenant_app_id,goods_id,sum(quantity)quantity,min(price)price,count(*)number FROM goods.goods_sku WHERE activity_id=? GROUP BY tenant_app_id,goods_id)t? ON t.tenant_app_id=t?.tenant_app_id AND t.goods_id=t?.goods_id LEFT JOIN (SELECT tenant_app_id,goods_id,sum(quantity)quantity,min(price)price,count(*)number FROM goods.goods_sku WHERE activity_id>? GROUP BY tenant_app_id,goods_id)t? ON t.tenant_app_id=t?.tenant_app_id AND t.goods_id=t?.goods_id WHERE ?=?)tmp|3|8|5||0|0|393234|131078|3|1|
|authorization_service|SELECT id,tenant_id,account_id,type,login_name,hash_password,salt,user_id,employee_id,tenant_app_id,status,create_time,update_time FROM login_account WHERE (type=? AND login_name=?)|3|15|8||0|0|197463|65821|3|1|
|v4_sales|SELECT es.id salesId,es.sales_no,es.sales_date,es.member_erp_id memberId,w.warranty_no,wca.source FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id=es.id AND wca.tenant_id=? AND wca.tenant_app_id=? LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE is_sales=? AND sales_status=? AND es.employee_erp_id=? AND es.dept_erp_id=? AND if(wca.source=?,es.sales_date>=?,date_format(wca.create_time,?)>=?) AND w.id IS ? AND es.tenant_id=? AND es.tenant_app_id=? ORDER BY es.sales_date DESC,es.id DESC LIMIT ?|3|40|13||0|0|9666|3222|6|2|
|authorization_service|COMMIT ?|3|5|1||0|0|0|0|0|0|
|employee|UPDATE backlog_? SET tenant_id=?,tenant_app_id=?,status=?,scene=?,expire_time=?,finish_time=? WHERE id=?|3|5|2||0|0|3|1|0|0|
|authorization_service|UPDATE user_login_token SET status=? WHERE login_token IN|3|11|5||0|0|4728|3477|0|0|
|value_added|UPDATE value_added_user SET state=? WHERE state=? AND tenant_id=? AND tenant_wechatapp_id=? AND user_id=? AND product_barcode=?|2|2|1||0|0|8|5|0|0|
|v4_user|INSERT INTO reception_customer(id,shop_id,employee_id,customer_type,external_user_id,member_id,recept_time,checkin_labels,member_status,first_enter_shop,create_time,update_time,tenant_id,tenant_app_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)|2|3|2||0|0|0|0|0|0|
|corpwx|INSERT INTO external_user_log(tenant_id,id,external_user_id,corp_user_id,employee_id,oper_type) VALUES (?,?,?,?,?,?)|2|2|1||0|0|0|0|0|0|
|gift_mail|SELECT id,tenant_id,tenant_wechatapp_id,product_id,price,create_time,update_time FROM product_status WHERE product_id=?|2|2|1||0|0|19196|9598|2|1|
|user_service|SELECT us.from_id AS id,count(?)total FROM user_source us WHERE us.tenant_id=? AND us.tenant_wechatapp_id=? AND us.shop_id=? AND us.create_time>=? AND us.create_time<? AND us.source_type=? AND us.from_id IS NOT ? AND us.shop_id IS NOT ? GROUP BY us.from_id ORDER BY count(?) DESC|2|2|1||0|0|8492|4246|56|28|
|corpwx|INSERT INTO mini_app_msg(id,tenant_id,to_user,to_party,to_tag,msg_type,msg_scene,msg_id,msg_content,status,err_msg,template_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)|2|2|1||0|0|0|0|0|0|
|tenant|SELECT count(*) FROM (SELECT s.sneak_guest_id FROM tenant.sneak_guest_maintain s JOIN tenant.sneak_guest sg ON sg.id=s.sneak_guest_id AND (sg.fail_type IS ? OR sg.fail_type=?) WHERE s.tenant_id=? AND s.tenant_app_id=? AND s.shop_id=? AND s.create_time BETWEEN ? AND ? AND s.event_type IN (?) GROUP BY s.sneak_guest_id)a|2|2|1||0|0|854|597|2|1|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.warranty w JOIN v4_sales.erp_sales es ON es.id=w.sales_id AND es.tenant_id=? AND es.tenant_app_id=? WHERE w.member_id IN (?) AND is_disable=? AND w.tenant_id=? AND w.tenant_app_id=?|2|4|2||0|0|2|2|2|1|
|v4_user|SELECT COUNT(*) AS total FROM member_butler t? JOIN member t? ON t?.tenant_id=t?.tenant_id AND t?.member_id=t?.id AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t?.shop_id=? AND t?.employee_id=? AND t?.tenant_id=? AND t?.tenant_app_id=?|2|6|5||0|0|26438|25830|2|1|
|v4_user|UPDATE potential_customer SET first_maintain_time=?,last_maintain_time=?,maintain_num=?,status=?,cutomer_grade=?,update_time=? WHERE id=? AND tenant_id=? AND tenant_app_id=?|2|2|1||0|0|2|1|0|0|
|tenant|SELECT id,tenant_id,tenant_app_id,user_id,status,group_label,maintain_level,remark,create_time,create_shop_id,create_employee_id,update_time,update_shop_id,update_employee_id,sales_amount,next_maintain_date,maintain_employee_id,sneak_guest_no,last_maintain_date,finish_date,fail_type,oid,user_type FROM sneak_guest WHERE (tenant_app_id=? AND user_id=? AND user_type=? AND status=? AND create_shop_id=? AND maintain_employee_id=?) ORDER BY id DESC|2|2|1||0|0|2|1|2|1|
|tenant|SELECT id,tenant_id,employee_erp_id,employee_name,employee_no,employee_type,mobile_no,head_img_url,sex,corp_wx_user_id,raw_corp_user_id,shop_id,dept_erp_id,work_dept_erp_ids,status,create_time,update_time,employee_type_id,is_shop_manager,open_id FROM employee WHERE (tenant_id=? AND corp_wx_user_id IN (?))|2|2|1||0|0|458|229|458|229|
|corpwx|INSERT INTO external_user_bind(id,tenant_id,tenant_app_id,external_user_id,wx_user_id) VALUES (?,?,?,?,?)|2|3|2||0|0|0|0|0|0|
|v4_user|SELECT id,member_name,mobile_no,head_img_url,combine_status,combine_id FROM member WHERE ((mobile_no LIKE ? OR member_name LIKE ?)) AND tenant_id=? AND tenant_app_id=? LIMIT ?|2|2|1||0|0|284905|165314|1|1|
|employee|SELECT count(*) FROM label_task_employee t? JOIN label_task_setting t? ON t?.label_task_id=t?.id AND t?.disabled=? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.task_status=? AND t?.end_date>=CURRENT_DATE AND t?.shop_id=? AND t?.employee_id=? AND t?.visit_status=?|2|2|1||0|0|204|106|2|1|
|order|SELECT count(?) FROM order_info od LEFT JOIN order_detail dt ON od.id=dt.order_id LEFT JOIN order_address ad ON od.id=ad.order_id WHERE od.tenant_id=? AND od.tenant_wechatapp_id=? AND od.activity_id=?|2|5|3||0|0|124558|62309|2|1|
|order|SELECT count(?)amount FROM order_info WHERE user_id=? AND tenant_wechatapp_id=? AND finish_type IS ? AND status<>?|2|2|1||0|0|0|0|2|1|
|v4_employee|SELECT count(?) AS total_count,count(finish_time) AS finish_count FROM task_task t JOIN task_system_task_template t? ON t.task_template_id=t?.id AND t?.status=? AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t.task_type=? AND t.status=? AND t.start_time>=? AND t.start_time<? AND t.shop_id=? AND t.employee_id=? AND t.tenant_id=? AND t.tenant_app_id=?|2|4|2||0|0|2610|2168|2|1|
|v4_user|INSERT INTO member_grade(id,grade_id,user_id,sale_number,sale_amount,sale_points,create_time,update_time,tenant_id,tenant_app_id) VALUES (?,?,?,?,?,?,?,?,?,?)|2|3|2||0|0|0|0|0|0|
|v4_coupon|SELECT tenant_id,tenant_app_id,member_id,count(?)total FROM v4_coupon.coupon WHERE DATEDIFF(DATE_FORMAT(end_time,?),DATE_FORMAT(now(),?))=? AND coupon_status IN (?) GROUP BY tenant_id,tenant_app_id,member_id|2|45|28||0|0|2161014|1081566|100|51|
|tenant|SELECT count(?) FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id=ey.id WHERE sg.tenant_app_id=? AND sg.create_shop_id=? AND sg.maintain_employee_id=? AND sg.status=?|2|2|1||0|0|238|156|2|1|
|user_service|UPDATE tenant_member_info SET tenant_app_id=?,user_id=?,shop_id=?,birthday_is_lunar=?,address=?,memorial_name=?,memorial_day_is_lunar=?,grade_id=?,create_time=?,update_time=?,erp_card_no=? WHERE tenant_id=? AND id=?|2|2|1||0|0|2|1|0|0|
|warranty_service|INSERT INTO warranty_data(id,warranty_data,create_time,update_time) VALUES (?,?,now(),now())|2|3|1||0|0|0|0|0|0|
|authorization_service|SELECT ar.tenant_id,ar.tenant_app_id,a.employee_id,ar.shop_id,ar.role_code,ar.role_name,a.status AS account_status,ar.status AS role_status FROM authorization_service.account_role? ar JOIN authorization_service.account a ON ar.account_id=a.id WHERE ar.tenant_id=? AND ar.tenant_app_id=? AND ar.role_code IN (?)|2|3|1||0|0|132047|66026|4|2|
|tenant|SELECT esd.id,esd.sales_erp_id,es.employee_name,esd.product_barcode,es.sales_no,es.member_erp_id,esd.category_name,es.sales_date,esd.category_erp_id,esd.product_name,esd.cert_no,esd.amount_pay,esd.sales_index,ifnull(ee.not_add_value_plan,?) AS not_add_value_plan FROM erp_sales_detail esd JOIN erp_sales es ON es.tenant_id=esd.tenant_id AND es.tenant_wechatapp_id=esd.tenant_wechatapp_id AND es.sales_erp_id=esd.sales_erp_id LEFT JOIN erp_sales_extend ee ON ee.tenant_id=es.tenant_id AND es.tenant_wechatapp_id=ee.tenant_wechatapp_id AND es.sales_erp_id=ee.sales_erp_id AND esd.sales_index=ee.sales_index WHERE esd.tenant_id=? AND es.sales_status=? AND es.tenant_wechatapp_id=? AND esd.product_barcode=? ORDER BY es.sales_date DESC|2|2|1||0|0|10|5|2|1|
|warranty_service|UPDATE warranty SET upload_frequency=? WHERE id=?|2|2|1||0|0|2|1|0|0|
|tenant|SELECT count(*)amount FROM sneak_guest WHERE tenant_app_id=? AND status=? AND create_shop_id=? AND maintain_employee_id=? AND create_time>=? AND create_time<=?|2|2|1||0|0|527|325|2|1|
|user_service|INSERT INTO tenant_member(tenant_id,id,tenant_app_id,user_id,mobile_no,user_name,head_img_url,sex,status,create_time,update_time) VALUES (?,?,?,?,?,?,?,?,?,?,?)|2|3|1||0|0|0|0|0|0|
|authorization_service|SELECT id,platform_user_id,user_id,wx_user_id,employee_id,shop_id,tenant_id,tenant_wx_app_id,account_id,login_way,login_code,login_token,roles,status,expire_time,create_time,update_time,login_ip,login_time,login_data,wx_app_user_id FROM user_login_token WHERE (tenant_id=? AND employee_id=? AND status=?)|2|3|1||0|0|4128|3477|4128|3477|
|employee|UPDATE backlog_? SET leave_flag=? WHERE tenant_app_id=? AND employee_id=?|2|2|1||0|0|7886|4250|0|0|
|tenant|SELECT id,tenant_id,tenant_app_id,sneak_guest_maintain_id,sneak_guest_id,url,create_time,update_time FROM sneak_guest_maintain_file WHERE (tenant_app_id=? AND sneak_guest_maintain_id IN (?))|2|2|1||0|0|24|19|24|19|
|v4_user|SELECT t?.id AS memberId,t?.id AS potentialCustomerId,t?.checkin_time AS checkinTime FROM potential_customer t? JOIN member t? ON t?.id=t?.member_id AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t?.maintain_shop_id=? AND t?.id IN (?) AND t?.tenant_id=? AND t?.tenant_app_id=? UNION SELECT t?.id AS memberId,t?.id AS potentialCustomerId,t?.checkin_time AS checkinTime FROM potential_customer t? JOIN member t? ON t?.external_user_id=t?.external_user_id AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t?.maintain_shop_id=? AND t?.id IN (?) AND t?.member_id=? AND t?.tenant_id=? AND t?.tenant_app_id=?|2|3|1||0|0|68|40|14|10|
|v4_sales|SELECT id,sales_index,sales_erp_id,sales_type,product_barcode,product_name,cert_no,hand_size,category_erp_id,category_name,stone_weight,gold_weight,total_weight,quantity,amount_total,amount_pay,integral,remark,sales_brand,sales_craft,erp_create_time,tenant_id,tenant_app_id,create_time,update_time FROM erp_sales_detail WHERE (sales_erp_id=?) AND tenant_id=? AND tenant_app_id=?|2|2|1||0|0|2|1|2|1|
|tenant|SELECT count(?) FROM tenant.erp_sales es LEFT JOIN tenant.tenant_wechatapp_shop shop ON shop.tenant_wechatapp_id=es.tenant_wechatapp_id AND shop.dept_erp_id=es.dept_erp_id LEFT JOIN tenant.employee e ON e.tenant_id=es.tenant_id AND e.employee_erp_id=es.employee_erp_id LEFT JOIN tenant.employee_shop esh ON esh.tenant_app_id=es.tenant_wechatapp_id AND esh.employee_id=e.id AND esh.dept_erp_id=es.dept_erp_id WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.comment_id>? AND es.sales_status IN (?) AND es.is_sales=?|2|34|24||0|0|156264|78132|2|1|
|tenant|SELECT count(?) FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id=ey.id WHERE sg.tenant_app_id=? AND sg.create_shop_id=? AND sg.maintain_employee_id=? AND EXISTS (SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id=sgm.sneak_guest_id AND sgm.event_type=? AND sgm.intention_info REGEXP ?) AND sg.status=?|2|2|1||0|0|917|460|2|1|
|v4_sales|SELECT es.id salesId,es.sales_no,es.sales_date,es.member_erp_id memberId,w.warranty_no,wca.source FROM v4_sales.erp_sales es JOIN v4_sales.warranty_can_added wca ON wca.sales_id=es.id AND wca.tenant_id=? AND wca.tenant_app_id=? LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE is_sales=? AND sales_status=? AND es.employee_erp_id=? AND es.dept_erp_id=? AND if(wca.source=?,es.sales_date>=?,date_format(wca.create_time,?)>=?) AND w.id IS NOT ? AND es.tenant_id=? AND es.tenant_app_id=? ORDER BY es.sales_date DESC,es.id DESC LIMIT ?|2|6|3||0|0|5779|4429|16|10|
|v4_employee|SELECT count(*) AS total_count,count(finish_time) AS finish_count FROM task_task t JOIN task_invite_task_template t? ON t.task_template_id=t?.id AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t?.invite_time<? AND t.end_time>? AND t?.status IN (?) AND t.task_type=? AND t.status=? AND t.shop_id=? AND t.employee_id=? AND t.tenant_id=? AND t.tenant_app_id=?|2|3|2||0|0|18091|16025|2|1|
|user_service|INSERT INTO wx_user(id,wx_app_id,open_id,union_id,nick_name,user_name,mobile_no,head_img_url,is_subscribe,subscribe_time,unsubscribe_time,wx_card_code,wx_card_no,sex,country,province,city,plat_open_id,create_time,update_time) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)|2|4|2||0|0|0|0|0|0|
|coupon_service|SELECT cmod.coupon_id,cmo.pay_type,cmo.id orderId,cmo.cash_flow_id AS payId FROM coupon_service.coupon_market_order_detail cmod JOIN coupon_service.coupon_market_order cmo ON cmo.tenant_id=? AND cmo.tenant_app_id=? AND cmo.id=cmod.order_id WHERE cmod.tenant_id=? AND cmod.tenant_app_id=? AND cmod.coupon_id IN (?)|2|2|1||0|0|77302|38651|40|20|
|user_service|UPDATE tenant_member_info SET tenant_app_id=?,user_id=?,shop_id=?,birthday=?,birthday_is_lunar=?,memorial_name=?,memorial_day_is_lunar=?,grade_id=?,create_time=?,update_time=?,info_is_perfect=?,erp_card_no=? WHERE tenant_id=? AND id=?|2|2|1||0|0|2|1|0|0|
|v4_sales|SELECT t?.sales_erp_id AS salesErpId,t?.sales_no AS salesNo,DATE_FORMAT(t?.sales_date,?) AS salesDate,t?.member_erp_id AS memberId,t?.employee_erp_id AS employeeErpId,t?.employee_name AS employeeName,t?.assist_employee_erp_id AS assistEmployeeErpId,t?.assist_employee_name AS assistEmployeeName,t?.dept_erp_id AS deptErpId,t?.amount,t?.post_time AS postTime FROM erp_sales t? WHERE t?.member_erp_id IN (?) AND t?.post_time>=? AND t?.sales_status=? AND NOT EXISTS (SELECT ? FROM erp_sales_relate esr WHERE t?.tenant_id=esr.tenant_id AND t?.tenant_app_id=esr.tenant_app_id AND t?.sales_erp_id=esr.sales_erp_id AND esr.sales_status IN (?) AND esr.tenant_id=? AND esr.tenant_app_id=?) AND EXISTS (SELECT ? FROM erp_sales_detail esd WHERE t?.tenant_id=esd.tenant_id AND t?.tenant_app_id=esd.tenant_app_id AND t?.sales_erp_id=esd.sales_erp_id AND esd.sales_type IN (?) AND esd.tenant_id=? AND esd.tenant_app_id=?) AND t?.tenant_id=? AND t?.tenant_app_id=?|2|3|2||0|0|1150|778|162|116|
|tenant|SELECT count(?) FROM (SELECT es.id,es.sales_no,es.sales_date,es.sales_erp_id,es.amount,ifnull(shop.shop_name,ed.dept_name)dept_name,es.employee_name FROM tenant.erp_sales es JOIN tenant.erp_department ed ON ed.dept_erp_id=es.dept_erp_id AND ed.tenant_id=? LEFT JOIN tenant.tenant_wechatapp_shop shop ON shop.dept_erp_id=ed.dept_erp_id AND shop.tenant_wechatapp_id=? WHERE es.member_erp_id=? AND es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.sales_status=?)table_count|2|2|1||0|0|104|83|2|1|
|v4_user|SELECT pc.id,count(*) AS maintainCount FROM potential_customer pc JOIN potential_customer_maintain pcm ON pc.id=pcm.potential_customer_id AND pcm.tenant_id=? AND pcm.tenant_app_id=? WHERE pc.maintain_shop_id=? AND pc.status=? AND pcm.event_type IN (?) AND pc.finish_time>=? AND pc.finish_time<? AND pc.tenant_id=? AND pc.tenant_app_id=? GROUP BY pc.id|2|4|2||0|0|3608|2900|3|2|
|account|INSERT INTO account(id,tenant_id,tenant_app_id,account_type,owner_type,owner_id,balance,platform_balance,cumulation,status,create_time,update_time) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)|2|3|1||0|0|0|0|0|0|
|v4_user|SELECT COUNT(*) AS total FROM member_butler WHERE (shop_id=? AND employee_id=?) AND tenant_id=? AND tenant_app_id=?|2|2|1||0|0|4257|4257|2|1|
|v4_coupon|SELECT * FROM v4_coupon.coupon_market_order WHERE pay_way=? AND order_status=? AND update_time<=DATE_SUB(NOW(),INTERVAL ? MINUTE)|2|2|1||0|0|15438|7721|0|0|
|corpwx|INSERT INTO corpwx_external_user(id,tenant_id,external_user_id,sex,nick_name) VALUES (?,?,?,?,?)|2|2|1||0|0|0|0|0|0|
|order|SELECT id FROM order_operator_log WHERE tenant_wechatapp_id=? AND order_id=? AND (src_child_status=? AND dst_child_status=?) ORDER BY create_time DESC LIMIT ?|2|13|8||0|0|2188096|1094236|0|0|
|user_service|UPDATE tenant_member_bind SET tenant_app_id=?,user_id=?,erp_member_id=?,create_time=?,update_time=? WHERE tenant_id=? AND id=?|2|2|1||0|0|2|1|0|0|
|authorization_service|SELECT id,user_id,tenant_id,tenant_wx_app_id,account_id,login_way,login_code,login_token,roles,status,expire_time,create_time,update_time,login_ip,login_time,login_data,employee_id,shop_id,platform_user_id,wx_user_id,wx_app_user_id FROM user_login_token WHERE wx_app_user_id=? AND tenant_id=? AND tenant_wx_app_id=? AND login_way=? AND expire_time>now() AND status=? AND user_id=?|2|5|2||0|0|17|17|0|0|
|user_service|SELECT id,tenant_id,wechat_app_id,open_id,union_id,nick_name,head_img_url,sex,wx_mobile_no,create_time,update_time FROM mini_app_user WHERE (wechat_app_id=? AND wx_mobile_no=? AND id<>?)|2|2|1||0|0|6209|3832|1|1|
|v4_user|UPDATE member_butler SET member_id=?,employee_id=?,shop_id=?,update_time=? WHERE id=? AND tenant_id=? AND tenant_app_id=?|2|2|1||0|0|2|1|0|0|
|v4_user|INSERT INTO employee_external_bind(id,external_user_id,corp_user_id,employee_id,create_time,update_time,tenant_id) VALUES (?,?,?,?,?,?,?)|2|3|1||0|0|0|0|0|0|
|coupon_service|UPDATE coupon SET coupon_state=?,update_time=? WHERE id=?|2|2|1||0|0|2|1|0|0|
|gift_mail|SELECT p.id,p.product_name,p.tag_price,i.volume,p.product_status AS status,p.default_image_url,i.quantity,i.market_price,if(prp.id IS ?,?,?) AS hasRecommend FROM gift_mail.platform_product p JOIN gift_mail.platform_inventory i ON i.product_id=p.id LEFT JOIN gift_mail.platform_recommend_product prp ON prp.tenant_app_id=? AND prp.is_recommend=? AND prp.platform_product_id=p.id WHERE prp.id IS ? AND p.product_status=? ORDER BY i.volume DESC ,p.tag_price ASC ,p.id DESC LIMIT ?,?|2|2|1||0|0|17816|8911|12|6|
|v4_user|SELECT t?.maintain_shop_id,t?.maintain_employee_id,t?.maintain_level,count(*) AS maintainNum FROM potential_customer t? WHERE t?.tenant_app_id=? AND t?.`status` IN (?) AND t?.next_maintain_time>=? AND t?.tenant_id=? AND t?.tenant_app_id=? GROUP BY t?.maintain_shop_id,t?.maintain_employee_id,t?.maintain_level|2|9|7||0|0|16036|9106|504|343|
|employee|SELECT count(*) FROM employee.backlog_? WHERE tenant_id=? AND tenant_app_id=? AND shop_id=? AND status=? AND finish_time BETWEEN ? AND ?|2|2|1||0|0|2527|1760|2|1|
|activity_service|SELECT count(*) FROM activity_signup_user_apply WHERE activity_id=? AND audit_status IN (?)|2|2|1||0|0|4898|2449|2|1|
|account|SELECT id,tenant_id,tenant_app_id,account_type,owner_type,owner_id,balance,cumulation,status FROM account WHERE owner_type=? AND balance<? AND account_type=?|1|1|1||0|0|685|685|214|214|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales_detail t? LEFT JOIN v4_sales.erp_sales t? ON t?.sales_erp_id=t?.sales_erp_id AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t?.member_erp_id=? AND t?.sales_status=? AND t?.is_sales=? AND t?.tenant_id=? AND t?.tenant_app_id=?|1|1|1||0|0|3|3|1|1|
|v4_user|SELECT count(CASE WHEN t?.customer_type=? THEN t?.id ELSE ? END) AS visitor,count(DISTINCT CASE WHEN t?.customer_type=? THEN t?.member_id ELSE ? END) AS member,count(DISTINCT CASE WHEN t?.customer_type=? THEN t?.external_user_id ELSE ? END) AS externalUser FROM reception_customer t? WHERE t?.recept_time>=? AND t?.recept_time<=? AND t?.shop_id=? AND t?.employee_id=? AND t?.tenant_id=? AND t?.tenant_app_id=?|1|1|1||0|0|4|4|1|1|
|v4_user|SELECT COUNT(*) AS total FROM reception_customer WHERE (recept_time>=? AND recept_time<=? AND shop_id=? AND employee_id=?) AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|38|38|1|1|
|user_service|SELECT tenant_id,id,tenant_app_id,user_id,shop_id,birthday,birthday_is_lunar,address,memorial_name,memorial_day,memorial_day_is_lunar,interest,grade_id,create_time,update_time,member_image_flag,member_image_time,info_is_perfect,erp_card_no FROM tenant_member_info WHERE tenant_id=? AND id=?|1|1|1||0|0|1|1|1|1|
|v4_user|SELECT COUNT(*) AS total FROM potential_customer t? WHERE t?.maintain_shop_id=? AND t?.maintain_employee_id=? AND t?.status IN (?) AND t?.maintain_level=? AND t?.tenant_id=? AND t?.tenant_app_id=?|1|5|5||0|0|788|788|1|1|
|order|SELECT count(?)total,ifnull(sum(if(od.status>?,od.payment_fee,?)),?)paymentFee,ifnull(sum(if(od.status>?,od.offline_payment_fee,?)),?)offlinePaymentFee,ifnull(sum(if(od.status>?,od.payment_fee+od.offline_payment_fee,?)),?)payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id=dt.order_id LEFT JOIN order_address ad ON od.id=ad.order_id WHERE od.tenant_id=? AND od.tenant_wechatapp_id=? AND od.activity_id=?|1|3|3||0|0|62309|62309|1|1|
|v4_sales|SELECT id,sales_id,status,tenant_id,tenant_app_id,create_time,update_time FROM comment_not_remind_sales WHERE (status=?)|1|1|1||0|0|120665|120665|336|336|
|agency|SELECT * FROM ambassador WHERE tenant_app_id=? AND user_id=? LIMIT ?|1|1|1||0|0|8233|8233|0|0|
|export|SELECT count(?) FROM export_log el INNER JOIN export_file ef ON el.tenant_app_id=ef.tenant_app_id AND el.batch_no=ef.batch_no AND el.md5_key=ef.md5_key AND el.export_code=ef.export_code WHERE el.tenant_app_id=? AND el.employee_id=? AND (el.batch_no BETWEEN ? AND ?)|1|2|2||0|0|63441|63441|1|1|
|mysql|DELETE FROM message_push.message_log WHERE create_time<DATE_SUB(now(),interval ? day)|1|95|95||0|0|3339690|3339690|0|0|
|employee|INSERT INTO backlog_file(id,tenant_id,tenant_app_id,backlog_id,url,status) VALUES (?,?,?,?,?,?)|1|1|1||0|0|0|0|0|0|
|employee|SELECT count(*) FROM employee.backlog_? WHERE tenant_id=? AND tenant_app_id=? AND shop_id=? AND status=? AND expire_time BETWEEN ? AND ?|1|5|5||0|0|13757|13757|1|1|
|timer|UPDATE task_info SET service=?,name=?,callback=?,params=?,cron=?,delay=?,next_time=?,status=?,create_time=?,update_time=? WHERE id=?|1|2|2||0|0|1|1|0|0|
|user_service|SELECT id,wx_app_id,open_id,union_id,nick_name,user_name,mobile_no,head_img_url,is_subscribe,subscribe_time,unsubscribe_time,wx_card_code,wx_card_no,sex,country,province,city,plat_open_id,create_time,update_time FROM wx_user WHERE (wx_app_id=? AND open_id=?)|1|1|1||0|0|1|1|1|1|
|v4_employee|SELECT count(*) AS total_count,count(finish_time) AS finish_count,ifnull(sum(if(finish_time>=? AND finish_time<?,?,?)),?) AS todayFinishCount,count(send_coupons) AS coupon_send_count,count(recv_coupons) AS coupon_recv_count,count(accept_time) AS accept_count,count(arrival_shop_time) AS arrival_shop_count,count(trade_time) AS trade_count FROM task_task WHERE task_type=? AND status=? AND shop_id=? AND employee_id=? AND task_template_id=? AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|188|188|1|1|
|employee|INSERT INTO backlog_?(id,tenant_id,tenant_app_id,user_id,user_type,employee_id,status,scene,begin_time,expire_time,md5_str,shop_id,member_erp_id,task_amount,finish_amount) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ON DUPLICATE key UPDATE task_amount=?,finish_time=if(?>finish_amount,?,finish_time),status=if(?>finish_amount,?,status),update_time=now()|1|1|1||0|0|0|0|0|0|
|export|SELECT od.coupon_id, CASE o.pay_type WHEN ? THEN ? ELSE ? END payTypeText FROM coupon_service.coupon_market_order_detail od JOIN coupon_service.coupon_market_order o ON o.tenant_id=? AND o.tenant_app_id=? AND o.id=od.order_id WHERE od.tenant_id=? AND od.tenant_app_id=? AND od.coupon_id IN (?)|1|2|2||0|0|38651|38651|94|94|
|employee|SELECT id,scene,employee_id,member_user_name userName,finish_time,status FROM employee.backlog_? WHERE tenant_id=? AND tenant_app_id=? AND shop_id=? AND expire_time BETWEEN ? AND ? AND status!=? AND scene NOT IN(?) ORDER BY id DESC LIMIT ?,?|1|8|8||0|0|518027|518027|3|3|
|v4_employee|SELECT COUNT(*) FROM (SELECT shop_id,employee_id,count(*) AS total_count,count(finish_time) AS finish_count,count(send_coupons) AS coupon_send_count,count(recv_coupons) AS coupon_recv_count FROM task_task WHERE task_type=? AND `status`!=? AND system_task_type=? AND end_time>? AND end_time<=? AND tenant_id=? AND tenant_app_id=? GROUP BY shop_id,employee_id ORDER BY shop_id,employee_id)TOTAL|1|1|1||0|0|7351|7351|1|1|
|v4_sales|SELECT id,comment_id,subject_id,subject_type,subject,score,labels,content,tenant_id,tenant_app_id,create_time,update_time FROM comment_detail WHERE (comment_id=? AND subject_type=?) AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|326125|326125|4|4|
|v4_employee|SELECT count(*) AS total_count,count(finish_time) AS finish_count,count(send_coupons) AS coupon_send_count,count(recv_coupons) AS coupon_recv_count,count(accept_time) AS accept_count,count(arrival_shop_time) AS arrival_shop_count,count(trade_time) AS trade_count FROM task_task WHERE task_type=? AND status!=? AND shop_id=? AND system_task_type=? AND end_time>? AND end_time<=? AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|15308|15308|1|1|
|user_service|UPDATE tenant_member_info SET tenant_app_id=?,user_id=?,shop_id=?,birthday=?,birthday_is_lunar=?,memorial_name=?,memorial_day_is_lunar=?,grade_id=?,create_time=?,update_time=?,member_image_flag=?,info_is_perfect=?,erp_card_no=? WHERE tenant_id=? AND id=?|1|1|1||0|0|1|1|0|0|
|user_service|SELECT count(?) FROM user_service.tenant_member tm JOIN user_service.tenant_member_info tmi ON tmi.tenant_id=? AND tmi.tenant_app_id=? AND tm.id=tmi.id WHERE tm.tenant_id=? AND tm.tenant_app_id=? AND tm.user_id IN (?)|1|3|3||0|0|380|380|1|1|
|tenant|SELECT es.sales_erp_id FROM tenant.erp_sales es JOIN tenant.erp_sales_detail esd ON esd.tenant_id=? AND esd.tenant_wechatapp_id=? AND esd.sales_erp_id=es.sales_erp_id WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND member_erp_id=? AND es.sales_status=? AND es.is_sales=? AND (esd.product_barcode=? OR esd.product_name LIKE concat(?,?,?))|1|2|2||0|0|16325|16325|0|0|
|user_service|UPDATE wx_user SET wx_app_id=?,open_id=?,union_id=?,nick_name=?,is_subscribe=?,subscribe_time=?,wx_card_code=?,sex=?,country=?,province=?,city=?,create_time=?,update_time=? WHERE id=?|1|1|1||0|0|1|1|0|0|
|order|SELECT count(?) FROM order_info od LEFT JOIN order_detail dt ON od.id=dt.order_id LEFT JOIN order_address dd ON od.id=dd.order_id WHERE od.tenant_wechatapp_id=? AND od.status=? AND od.confirm_time IS ?|1|2|2||0|0|11928|11928|1|1|
|employee|SELECT employee_id FROM employee.backlog_? WHERE tenant_id=? AND tenant_app_id=? AND shop_id=? AND status=? AND finish_time BETWEEN ? AND ? GROUP BY employee_id|1|3|3||0|0|27893|27893|8|8|
|corpwx|DELETE FROM contact_me WHERE (tenant_id=? AND config_id=?)|1|5|5||0|0|5783|5783|0|0|
|coupon_service|SELECT * FROM coupon_service.coupon WHERE DATEDIFF(DATE_FORMAT(end_time,?),DATE_FORMAT(now(),?))=? AND coupon_state IN(?)|1|204|204||0|0|11969556|11969556|987|987|
|v4_user|INSERT INTO potential_customer(id,member_id,external_user_id,serial_number,checkin_shop_id,checkin_employee_id,checkin_employee_name,checkin_time,maintain_shop_id,maintain_employee_id,maintain_employee_name,next_maintain_time,intention_num,latest_intention,status,sex,cutomer_grade,maintain_level,create_time,update_time,tenant_id,tenant_app_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)|1|1|1||0|0|0|0|0|0|
|tenant|SELECT shop.*,dept.dept_name,count(es.id) AS employeesCount FROM tenant_wechatapp_shop shop LEFT JOIN erp_department dept ON shop.dept_erp_id=dept.dept_erp_id AND shop.tenant_id=dept.tenant_id LEFT JOIN employee_shop es ON shop.id=es.shop_id AND es.status IN(?) WHERE shop.tenant_wechatapp_id=? AND shop.status IN (?) GROUP BY shop.id ORDER BY shop.create_time DESC LIMIT ?|1|2|2||0|0|93574|93574|20|20|
|goods|SELECT id,tenant_id,tenant_app_id,share_id,user_id,order_id,create_time,update_time FROM share_detail WHERE (tenant_app_id=? AND order_id=?)|1|1|1||0|0|2167|2167|0|0|
|v4_employee|SELECT s.id,s.name FROM shop s JOIN (SELECT DISTINCT shop_id FROM task_task WHERE status!=? AND system_task_type=? AND tenant_id=? AND tenant_app_id=?)t ON s.id=t.shop_id WHERE s.tenant_id=? AND s.tenant_app_id=?|1|1|1||0|0|7294|7294|7|7|
|order|SELECT count(*) FROM order_info WHERE tenant_wechatapp_id=? AND status=? AND payment_time BETWEEN ? AND ? AND confirm_time IS ?|1|1|1||0|0|1873|1873|1|1|
|employee|INSERT INTO backlog_?(id,tenant_id,tenant_app_id,user_id,user_type,employee_id,status,scene,begin_time,expire_time,md5_str,shop_id,member_erp_id,task_amount,finish_amount,finish_time) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ON DUPLICATE key UPDATE task_amount=?,finish_time=if(?>finish_amount,?,finish_time),status=if(?>finish_amount,?,status),update_time=now()|1|1|1||0|0|0|0|0|0|
|youzan|UPDATE youzan_message_push SET merchant_shop_id=?,status=?,error_msg=?,update_time=? WHERE id=?|1|1|1||0|0|1|1|0|0|
|v4_coupon|UPDATE coupon_extend SET coupon_name=?,remark=?,member_name=?,mobile_no=?,write_off_time=?,is_new_member=?,can_give=?,tenant_id=?,tenant_app_id=?,create_time=?,update_time=? WHERE id=? AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|1|1|0|0|
|coupon_service|SELECT id,tenant_id,tenant_app_id,template_id,coupon_push_id,coupon_no,coupon_state,user_id,coupon_name,coupon_type,face_value,discount,use_threshold,balance,begin_time,end_time,wx_card_id,wx_card_no,source,source_id,business_id,create_time,update_time FROM coupon WHERE (tenant_id=? AND tenant_app_id=? AND id=?)|1|1|1||0|0|0|0|0|0|
|v4_sales|SELECT COUNT(*) AS total FROM v4_sales.erp_sales es LEFT JOIN v4_sales.erp_sales_ignore esi ON esi.sales_id=es.id AND esi.tenant_id=? AND esi.tenant_app_id=? WHERE member_erp_id IN (?) AND esi.id IS ? AND sales_status=? AND es.tenant_id=? AND es.tenant_app_id=?|1|1|1||0|0|608|608|1|1|
|v4_employee|SELECT count(*) AS total_count,ifnull(sum(if(finish_time,?,?)),?) AS undo_count,count(finish_time) AS finish_count,count(accept_time) AS accept_count,count(arrival_shop_time) AS arrival_shop_count,count(trade_time) AS trade_count,count(send_coupons) AS coupon_send_count,count(recv_coupons) AS coupon_recv_count,ifnull(sum(trade_amount),?) AS trade_amount,ifnull(sum(trade_num),?) AS trade_num FROM task_task WHERE task_type=? AND `status`!=? AND task_template_id=? AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|16892|16892|1|1|
|v4_employee|SELECT count(*) AS total_count,ifnull(sum(if(finish_time,?,?)),?) AS undo_count,count(finish_time) AS finish_count,count(accept_time) AS accept_count,count(arrival_shop_time) AS arrival_shop_count,count(trade_time) AS trade_count,count(send_coupons) AS coupon_send_count,count(recv_coupons) AS coupon_recv_count,ifnull(sum(trade_amount),?) AS trade_amount,ifnull(sum(trade_num),?) AS trade_num FROM task_task WHERE task_type=? AND `status`!=? AND system_task_type=? AND end_time>? AND end_time<=? AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|7273|7273|1|1|
|value_added|SELECT count(?) FROM (SELECT t?.id,t?.sales_no AS salesNo,DATE_FORMAT(t?.sales_date,?) AS salesDate,DATE_FORMAT(t?.start_add_time,?) AS valueAddDate,t?.dept_erp_id AS shopId,t?.shop_name AS shopName,t?.employee_erp_id AS userId,t?.employee_name AS userName,t?.product_name AS productName,t?.amount_pay AS amountPay,t?.id AS valueAddNo,t?.amount_added AS valueAddAmount,t?.state,if(t?.state=?,t?.coupon_user_id,?) AS valueAddCoupon,t?.user_id AS memberUserId, CASE WHEN start_add_time>? THEN ? WHEN DATE_ADD(start_add_time,INTERVAL add_days DAY)>? AND state=? THEN ? WHEN DATE_ADD(start_add_time,INTERVAL add_days+keeping_days DAY)>? AND DATE_ADD(start_add_time,INTERVAL add_days DAY)<? AND state=? THEN ? WHEN DATE_ADD(start_add_time,INTERVAL add_days+keeping_days DAY)<? AND amount_added>? AND state=? THEN ? ELSE ? END AS addedStatus FROM value_added.value_added_user t? JOIN value_added.`value_added_user_extend` t? ON t?.id=t?.id WHERE t?.tenant_wechatapp_id=? AND t?.state!=?)tmp_count|1|6|6||0|0|19282|19282|1|1|
|order|SELECT count(?)total,ifnull(sum(if(od.status>?,od.payment_fee,?)),?)paymentFee,ifnull(sum(if(od.status>?,od.offline_payment_fee,?)),?)offlinePaymentFee,ifnull(sum(if(od.status>?,od.payment_fee+od.offline_payment_fee,?)),?)payTotalFee FROM order_info od LEFT JOIN order_detail dt ON od.id=dt.order_id LEFT JOIN order_address ad ON od.id=ad.order_id WHERE od.tenant_id=? AND od.tenant_wechatapp_id=? AND dt.product_name LIKE concat(?,?,?)|1|4|4||0|0|122591|122591|1|1|
|activity_service|SELECT id,tenant_id,tenant_wechatapp_id,activity_id,lottery_activity_id,user_id,head_img_url,user_name,mobile_no,prize_type,prize_name,prize_image_url,status,retry_num,create_time,update_time,prize_data,winning_prize FROM lottery_winner WHERE status=? AND retry_num<? AND create_time>=? AND create_time<?|1|1|1||0|0|89|89|0|0|
|employee|SELECT count(*) FROM employee.backlog_? t WHERE t.tenant_app_id=? AND t.shop_id=? AND t.employee_id=? AND t.scene=? AND t.user_id=? AND t.user_type=?|1|1|1||0|0|0|0|1|1|
|gift_mail|SELECT count(?) FROM gift_mail.trade t LEFT OUTER JOIN gift_mail.product p ON p.id=t.product_id LEFT OUTER JOIN gift_mail.trade_take tt ON tt.trade_id=t.id WHERE (t.tenant_wechatapp_id=? AND t.trade_type=? AND t.order_status=?)|1|1|1||0|0|17438|17438|1|1|
|coupon_service|SELECT count(?) FROM (SELECT cm.id,coupon_name,coupon_pack_name AS packName,cp.coupon_type,round(t.face_value/?,?) AS faceValue,round(t.discount/?,?) AS discount,cp.begin_time,cp.end_time,t.scope,round(cp.use_threshold/?,?) AS useThreshold,cm.pay_type,round(cm.cash/?,?) AS cash,cm.point,t.product_name,cm.type,cp.take_effect_way,cp.take_start_day,cp.take_effect_day,tgl.get_quantity,(tgl.get_quantity/tgl.put_quantity)*? AS total,t.face_value AS couponPoint FROM coupon_service.coupon_market cm JOIN coupon_service.coupon_push cp ON cp.tenant_app_id=? AND cp.source_id=cm.id AND cp.source IN (?) JOIN coupon_service.template t ON t.tenant_app_id=? AND t.id=cp.template_id JOIN coupon_service.template_grant_limit tgl ON tgl.tenant_app_id=? AND tgl.coupon_push_id=cp.id WHERE cm.tenant_id=? AND cm.tenant_app_id=? AND cm.type=? AND cm.state=? AND if(take_effect_way=?,end_time>now(),?=?) AND tgl.get_quantity<tgl.put_quantity AND cm.display_way=? AND (cm.limit_type=? OR (cm.limit_type=? AND find_in_set(?,cm.limit_grade_ids))) UNION ALL SELECT cm.id,?,coupon_pack_name AS packName,?,?,?,?,?,?,?,pay_type,round(cash/?,?) AS cash,point,?,type,?,?,?,?,?,? FROM coupon_service.coupon_market cm WHERE cm.tenant_id=? AND cm.tenant_app_id=? AND cm.type=? AND cm.state=? AND display_way=? AND (cm.limit_type=? OR (cm.limit_type=? AND find_in_set(?,cm.limit_grade_ids))))table_count|1|1|1||0|0|214|214|1|1|
|v4_activity|SELECT ? member_id,(SELECT count(?) FROM lottery_log WHERE activity_id=? AND member_id=? AND tenant_id=? AND tenant_app_id=?)play_count,(SELECT count(?) FROM lottery_log WHERE win_status=? AND activity_id=? AND member_id=? AND tenant_id=? AND tenant_app_id=?)play_count_win|1|1|1||0|0|8056|8056|1|1|
|v4_user|SELECT sales_erp_id,reception_customer_id FROM reception_customer_deal WHERE (reception_customer_id IN (?) AND status=?) AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|1|1|1|1|
|order|SELECT od.id,od.order_no orderNo,od.status,od.take_type takeType,od.create_time createTime,od.remark,od.total_fee totalFee,od.freight_fee freightFee,od.discount_fee discountFee,od.take_id takeId,od.payment_fee paymentFee,dt.product_id productId,dt.price,dt.quantity,dt.sku_id skuId,dt.art_no artNo,dt.image_url imageUrl,dt.product_name productName,dt.take_remark takeRemark,dt.take_day takeDay,od.product_fee productFee,od.finish_type finishType,od.send_time sendTime,od.receive_time receiveTime,od.finish_time finishTime,od.child_status childStatus,od.send_good_remark sendGoodRemark,od.service_flag serviceFlag,od.coupon_id couponId,od.tenant_wechatapp_id tenantAppId,od.tenant_id tenantId,od.pay_id payId,od.user_id userId,od.user_name userName,od.mobile_no buyMobileNo,od.activity_id,od.offline_payment_fee,od.activity_type,dt.spec,od.take_shop_id,od.take_shop_name,od.take_employee_user_id,od.take_employee_user_name FROM order_info od LEFT JOIN order_detail dt ON od.id=dt.order_id WHERE od.status=? AND od.receive_time<=?|1|3|3||0|0|264792|264792|115|115|
|employee|SELECT scene FROM employee.backlog_? WHERE tenant_id=? AND tenant_app_id=? AND shop_id=? AND status=? AND finish_time BETWEEN ? AND ? GROUP BY scene|1|3|3||0|0|27903|27903|5|5|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail WHERE create_time<?|1|1|1||0|0|176389|176389|0|0|
|user_service|UPDATE tenant_member SET tenant_app_id=?,user_id=?,mobile_no=?,user_name=?,head_img_url=?,sex=?,status=?,create_time=?,update_time=? WHERE tenant_id=? AND id=?|1|1|1||0|0|1|1|0|0|
|user_service|UPDATE wx_user SET wx_app_id=?,open_id=?,nick_name=?,is_subscribe=?,subscribe_time=?,sex=?,country=?,province=?,city=?,plat_open_id=?,create_time=?,update_time=? WHERE id=?|1|1|1||0|0|1|1|0|0|
|employee|SELECT count(?) FROM employee.backlog_? WHERE tenant_id=? AND tenant_app_id=? AND shop_id=? AND status=? AND finish_time BETWEEN ? AND ? AND scene=? AND scene NOT IN (?)|1|1|1||0|0|27893|27893|1|1|
|tenant|SELECT id,tenant_id,tenant_app_id,user_id,status,group_label,maintain_level,remark,create_time,create_shop_id,create_employee_id,update_time,update_shop_id,update_employee_id,sales_amount,next_maintain_date,maintain_employee_id,sneak_guest_no,last_maintain_date,finish_date,fail_type,oid,user_type FROM sneak_guest WHERE (tenant_app_id=? AND status=? AND create_time<?)|1|2|2||0|0|4783|4783|6|6|
|order|SELECT count(*)amount FROM order_info od LEFT JOIN order_address oa ON od.id=oa.order_id WHERE od.tenant_wechatapp_id=? AND od.status=? AND od.confirm_time IS ?|1|2|2||0|0|7952|7952|1|1|
|v4_employee|SELECT s.id,s.name FROM shop s JOIN (SELECT DISTINCT shop_id FROM task_task WHERE status!=? AND task_template_id=? AND tenant_id=? AND tenant_app_id=?)t ON s.id=t.shop_id WHERE s.tenant_id=? AND s.tenant_app_id=?|1|1|1||0|0|17055|17055|48|48|
|tenant|SELECT t?.id,t?.sales_erp_id,t?.product_name,t?.product_barcode,t?.sales_type,t?.category_name,t?.gold_weight,t?.stone_weight,t?.total_weight,t?.remark,t?.amount_total AS amount_pay,t?.amount_total,t?.quantity,t?.sales_brand,t?.sales_craft,t?.sales_no,t?.sales_date,t?.employee_name,t?.sales_remark FROM erp_sales_detail t? LEFT JOIN erp_sales_detail_extend t? ON t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.sales_erp_id=t?.sales_erp_id AND t?.sales_index=t?.sales_index LEFT JOIN erp_sales t? ON t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.sales_erp_id=t?.sales_erp_id WHERE t?.tenant_id=? AND t?.tenant_wechatapp_id=? AND t?.tenant_id=t?.tenant_id AND t?.tenant_wechatapp_id=t?.tenant_wechatapp_id AND t?.member_erp_id=? AND t?.sales_status=? AND t?.is_sales=? ORDER BY t?.id DESC LIMIT ?|1|1|1||0|0|743|743|10|10|
|deliver|UPDATE express_address SET is_default=? WHERE user_id=? AND type=?|1|2|2||0|0|12758|12758|0|0|
|gift_mail|SELECT count(?) FROM gift_mail.trade t LEFT OUTER JOIN gift_mail.product p ON p.id=t.product_id LEFT OUTER JOIN gift_mail.trade_take tt ON tt.trade_id=t.id WHERE (t.tenant_wechatapp_id=? AND t.trade_type=? AND t.order_status=? AND tt.shop_id=? AND tt.id IS NOT ?)|1|1|1||0|0|17438|17438|1|1|
|v4_sales|UPDATE v4_sales.erp_sales SET comment_id=? WHERE id=? AND comment_id IS ? AND tenant_id=? AND tenant_app_id=?|1|2|2||0|0|1|1|0|0|
|v4_employee|UPDATE task_task SET batch_no=?,task_type=?,system_task_type=?,task_frequency=?,task_name=?,task_template_id=?,business_id=?,shop_id=?,employee_id=?,member_id=?,start_time=?,end_time=?,finish_time=?,member_name=?,member_mobile_no=?,member_latest_birthday=?,member_sex=?,member_age=?,member_level_id=?,member_level=?,member_sales_amount=?,member_sales_count=?,member_integral_balance=?,member_integral_total=?,status=?,tenant_id=?,tenant_app_id=?,create_time=?,update_time=? WHERE id=? AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|2|2|0|0|
|v4_activity|SELECT COUNT(*) AS total FROM lottery_log l WHERE l.win_status=? AND l.win_prize_id IS NOT ? AND l.activity_id=? AND l.member_id=? AND l.tenant_id=? AND l.tenant_app_id=?|1|1|1||0|0|4028|4028|1|1|
|user_service|UPDATE wx_user SET wx_app_id=?,open_id=?,union_id=?,nick_name=?,user_name=?,mobile_no=?,is_subscribe=?,subscribe_time=?,wx_card_code=?,sex=?,country=?,province=?,city=?,plat_open_id=?,create_time=?,update_time=? WHERE id=?|1|1|1||0|0|1|1|0|0|
|v4_user|UPDATE member SET shop_id=?,mobile_no=?,member_name=?,head_img_url=?,sex=?,birthday=?,birthday_is_lunar=?,memorial_day_is_lunar=?,h5_open_id=?,wx_card_code=?,recommend_id=?,external_user_id=?,status=?,combine_status=?,combine_id=?,tenant_id=?,tenant_app_id=?,create_time=?,update_time=? WHERE id=? AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|2|2|0|0|
|v4_employee|UPDATE task_task SET batch_no=?,task_type=?,system_task_type=?,task_frequency=?,task_name=?,task_template_id=?,business_id=?,shop_id=?,employee_id=?,member_id=?,start_time=?,end_time=?,finish_time=?,member_name=?,member_mobile_no=?,member_latest_birthday=?,member_sex=?,member_age=?,member_level_id=?,member_level=?,member_sales_amount=?,member_sales_count=?,member_integral_balance=?,member_integral_total=?,status=?,remark=?,tenant_id=?,tenant_app_id=?,create_time=?,update_time=? WHERE id=? AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|2|2|0|0|
|user_service|UPDATE wx_user SET wx_app_id=?,open_id=?,union_id=?,nick_name=?,user_name=?,mobile_no=?,is_subscribe=?,subscribe_time=?,unsubscribe_time=?,wx_card_code=?,sex=?,country=?,province=?,city=?,create_time=?,update_time=? WHERE id=?|1|1|1||0|0|1|1|0|0|
|v4_employee|SELECT COUNT(*) AS total FROM employee e JOIN (SELECT employee_id,count(*) AS total_count,count(finish_time) AS finish_count,count(accept_time) AS accept_count,count(arrival_shop_time) AS arrival_shop_count,count(trade_time) AS trade_count FROM task_task t WHERE t.task_type=? AND t.status=? AND shop_id=? AND task_template_id=? AND t.tenant_id=? AND t.tenant_app_id=? GROUP BY employee_id)x ON x.employee_id=e.employee_id WHERE e.shop_id=? AND e.tenant_id=? AND e.tenant_app_id=?|1|2|2||0|0|675|675|1|1|
|mysql|DELETE FROM wx_gateway.wx_template_msg WHERE create_time<DATE_SUB(now(),interval ? day)|1|22|22||0|0|628894|628894|0|0|
|tenant|UPDATE employee SET head_img_url=? WHERE id=?|1|1|1||0|0|1|1|0|0|
|v4_sales|SELECT COUNT(*) AS total FROM comment_prize WHERE (member_id=? AND prize_setting_id=? AND type=?) AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|22898|22898|1|1|
|v4_sales|SELECT DISTINCT t?.sales_type FROM v4_sales.erp_sales_detail t? LEFT JOIN v4_sales.erp_sales t? ON t?.sales_erp_id=t?.sales_erp_id AND t?.tenant_id=t?.tenant_id AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE ifnull(t?.sales_type,?)!=? AND t?.member_erp_id=? AND t?.sales_status=? AND t?.is_sales=? AND t?.tenant_id=? AND t?.tenant_app_id=?|1|1|1||0|0|5|5|2|2|
|v4_employee|SELECT count(*) AS total_count,count(finish_time) AS finish_count,count(send_coupons) AS coupon_send_count,count(recv_coupons) AS coupon_recv_count,count(accept_time) AS accept_count,count(arrival_shop_time) AS arrival_shop_count,count(trade_time) AS trade_count FROM task_task WHERE task_type=? AND status!=? AND shop_id=? AND task_template_id=? AND tenant_id=? AND tenant_app_id=?|1|2|2||0|0|655|655|1|1|
|user_service|SELECT count(?) FROM user_service.tenant_member tm JOIN user_service.tenant_member_info tmi ON tmi.tenant_id=? AND tmi.tenant_app_id=? AND tm.id=tmi.id WHERE tm.tenant_id=? AND tm.tenant_app_id=? AND tm.user_id IN|1|1|1||0|0|1948|1948|1|1|
|tenant|SELECT count(*) FROM sneak_guest WHERE (tenant_app_id=? AND status=? AND create_shop_id=?)|1|2|2||0|0|1121|1121|1|1|
|v4_user|INSERT INTO employee_external_bind_log(id,external_user_id,corp_user_id,employee_id,dept_erp_id,oper_type,create_time,update_time,tenant_id) VALUES (?,?,?,?,?,?,?,?,?)|1|1|1||0|0|0|0|0|0|
|v4_user|SELECT id,potential_customer_id,should_maintain_date,should_maintain_shop_id,should_maintain_employee_id,should_maintain_employee_name,oper_status,oper_shop_id,oper_employee_id,oper_employee_name,remark,is_required,tenant_id,tenant_app_id,create_time,update_time FROM potential_customer_follow WHERE (potential_customer_id IN (?)) AND tenant_id=? AND tenant_app_id=? ORDER BY potential_customer_id ASC,should_maintain_date ASC|1|2|2||0|0|250|250|125|125|
|tenant|SELECT t?.id,t?.shop_name AS createShopName,t?.employee_name AS createEmployeeName,t?.create_time AS createTime,t?.intention_info AS intentionInfo FROM tenant.sneak_guest_maintain t? JOIN tenant.employee t? ON t?.employee_id=t?.id JOIN tenant.tenant_wechatapp_shop t? ON t?.shop_id=t?.id WHERE t?.tenant_app_id=? AND t?.sneak_guest_id=? AND t?.event_type=? ORDER BY id DESC|1|1|1||0|0|3|3|1|1|
|tenant|SELECT count(?) FROM sneak_guest_maintain gm LEFT JOIN tenant_wechatapp_shop ws ON gm.shop_id=ws.id LEFT JOIN employee ey ON gm.employee_id=ey.id WHERE gm.tenant_app_id=? AND gm.sneak_guest_id=? AND gm.event_type IN (?)|1|1|1||0|0|1|1|1|1|
|v4_user|UPDATE reception_customer SET oper_status=?,update_time=? WHERE (id=?) AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|1|1|0|0|
|v4_user|INSERT INTO wx_user(id,app_type,app_id,open_id,union_id,nick_name,head_img_url,is_subscribe,subscribe_time,sex,country,province,city) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)|1|1|1||0|0|0|0|0|0|
|activity_service|SELECT count(t.user_id) AS partakeCount,count(DISTINCT t.user_id) AS partakeNum FROM lottery_user t WHERE t.lottery_activity_id=?|1|1|1||0|0|2716|2716|1|1|
|payment|UPDATE pay_order SET goods_order_no=?,fee_type=?,user_sub_identify=?,order_start_time=?,order_expire_time=?,prepay_id=?,pay_status=?,pay_status_desc=?,wxappid=?,sub_wxappid=?,mch_id=?,sub_mch_id=? WHERE id=?|1|1|1||0|0|1|1|0|0|
|v4_employee|SELECT LEFT(start_time,?) AS day,count(*) AS undo_count,datediff(end_time,?) AS left_days FROM task_task WHERE task_type=? AND status=? AND system_task_type=? AND finish_time IS ? AND end_time>? AND shop_id=? AND tenant_id=? AND tenant_app_id=? GROUP BY LEFT(start_time,?),end_time|1|1|1||0|0|88603|88603|0|0|
|corpwx|UPDATE external_user_bind SET tenant_app_id=?,external_user_id=?,wx_user_id=? WHERE id=? AND tenant_id=?|1|1|1||0|0|1|1|0|0|
||SELECT egc.id,egc.put_id,cp.display_name,cp.type AS putType,cp.take_effect_way,cp.take_start_day,cp.take_effect_day,cp.begin_time,cp.end_time,if(egr.id IS ?,?,egr.status) AS status FROM v4_coupon.employee_grant_coupon egc JOIN v4_coupon.coupon_put cp ON egc.put_id=cp.id JOIN v4_coupon.coupon_put_limit cpl ON cpl.put_id=cp.id LEFT JOIN v4_coupon.employee_grant_record egr ON egr.employee_grant_id=egc.id AND egr.employee_id=? AND egr.shop_id=? AND (egr.external_user_id=? OR egr.member_id=?) WHERE cp.tenant_id=? AND cp.tenant_app_id=? AND cp.put_scene=? AND cp.status=? AND if(cp.take_effect_way=?,cp.end_time>now(),?) AND (egc.limit_grant_time=? OR (egc.grant_begin_time<=now() AND egc.grant_end_time>now())) AND (cpl.put_quantity>get_quantity OR cpl.put_quantity=?) AND (egc.limit_shop=? OR EXISTS(SELECT ? FROM v4_coupon.employee_grant_shop cs WHERE egc.id=cs.employee_grant_id AND cs.shop_id=?)) AND limit_role IN (?)|1|1|1||0|0|35840|35840|3|3|
|corpwx_license|SELECT corp_id,agent_id,corp_wx_user_id,max(blocked_time)blocked_time FROM app_blocked WHERE corp_wx_user_id=? AND tenant_id=? GROUP BY corp_id,agent_id,corp_wx_user_id|1|1|1||0|0|21029|21029|0|0|
|warranty_service|INSERT INTO warranty(id,tenant_wechatapp_id,user_id,erp_sales_id,warranty_no,is_disable,update_employee_id,employee_erp_id,dept_erp_id,sales_no,sales_date,style_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)|1|2|2||0|0|0|0|0|0|
|v4_coupon|SELECT COUNT(*) AS total FROM v4_coupon.coupon c JOIN v4_coupon.coupon_extend ce ON ce.id=c.id AND ce.tenant_id=? AND ce.tenant_app_id=? LEFT JOIN v4_coupon.coupon_write_off cwo ON cwo.coupon_id=c.id AND cwo.status=? AND cwo.tenant_id=? AND cwo.tenant_app_id=? WHERE ce.coupon_name LIKE CONCAT(?,?,?) AND c.coupon_status IN (?) AND c.create_time>=? AND c.create_time<=? AND c.tenant_id=? AND c.tenant_app_id=?|1|1|1||0|0|318|318|1|1|
|v4_user|INSERT INTO member(id,shop_id,mobile_no,member_name,sex,birthday,birthday_is_lunar,status,combine_status,combine_id,create_time,update_time,tenant_id,tenant_app_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)|1|1|1||0|0|0|0|0|0|
|value_added|UPDATE value_added_user SET amount_added=IF(?>(((added_percent_per_day/?)*IF(?>=TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days,TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?,add_days))-((devalue_percent_per_day/?)*IF(?>=TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days-keeping_days,?,TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days-keeping_days)))*amount_pay,?,(((added_percent_per_day/?)*IF(?>=TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days,TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?,add_days))-((devalue_percent_per_day/?)*IF(?>=TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days-keeping_days,?,TIMESTAMPDIFF(DAY,DATE_FORMAT(start_add_time,?),CURRENT_DATE)+?-add_days-keeping_days)))*amount_pay),update_time=now() WHERE state=? AND update_time<=CURDATE() AND (start_add_time>=DATE_ADD(CURDATE(),INTERVAL-(add_days+keeping_days-?)DAY) OR (amount_added>? AND start_add_time<DATE_ADD(CURDATE(),INTERVAL-(add_days+keeping_days-?)DAY)))|1|19|19||0|0|2107799|2107799|0|0|
|user_service|UPDATE user_service.tenant_member_info t? JOIN user_service.user_employee t? ON t?.tenant_id=t?.tenant_id AND t?.tenant_app_id=t?.tenant_wechatapp_id AND t?.user_id=t?.user_id SET t?.shop_id=?,t?.shop_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.employee_id=? AND t?.shop_id=?|1|1|1||0|0|2428|2428|0|0|
|v4_user|SELECT id FROM potential_customer WHERE (status IN (?) AND next_maintain_time<?) AND tenant_id=? AND tenant_app_id=?|1|5|5||0|0|8422|8422|427|427|
|corpwx|UPDATE external_user SET tenant_id=?,cwx_user_id=?,user_id=?,name=?,sex=?,avatar=?,corp_user_id=?,update_time=?,status=? WHERE id=?|1|1|1||0|0|1|1|0|0|
|v4_sales|SELECT es.id salesId,es.sales_no,es.sales_date,es.member_erp_id memberId,w.warranty_no FROM v4_sales.erp_sales es LEFT JOIN v4_sales.warranty w ON w.sales_id=es.id AND w.tenant_id=? AND w.tenant_app_id=? WHERE is_sales=? AND sales_status=? AND (es.sales_no LIKE concat(?,?) OR es.member_erp_id=?) AND w.id IS NOT ? AND es.tenant_id=? AND es.tenant_app_id=? ORDER BY es.sales_date DESC,es.id DESC LIMIT ?,?|1|3|3||0|0|41116|41116|10|10|
|value_added|SELECT ? AS limitDayType,t.tenant_wechatapp_id,t.user_id,min(ue.employee_erp_id)employee_erp_id,ue.dept_erp_id,GROUP_CONCAT(t.product_barcode ORDER BY product_barcode ASC) AS productCode,GROUP_CONCAT(t.product_name ORDER BY product_barcode ASC) AS productName FROM value_added_user t INNER JOIN value_added_user_extend ue ON t.id=ue.id WHERE t.tenant_wechatapp_id=? AND t.state=? AND t.start_add_time>=date_add(DATE_FORMAT(?,?),interval ?*(t.add_days+t.keeping_days?)day) AND t.start_add_time<date_add(DATE_FORMAT(?,?),interval(?*(t.add_days+t.keeping_days?)+?)day) GROUP BY t.tenant_wechatapp_id,t.user_id,ue.dept_erp_id|1|1|1||0|0|473721|473721|112|112|
|v4_user|SELECT COUNT(*) AS total FROM reception_customer WHERE (shop_id=? AND (member_id=? OR external_user_id=?)) AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|0|0|1|1|
|user_service|UPDATE tenant_member_info SET tenant_app_id=?,user_id=?,shop_id=?,birthday=?,birthday_is_lunar=?,address=?,memorial_name=?,memorial_day_is_lunar=?,grade_id=?,create_time=?,update_time=?,member_image_flag=?,member_image_time=?,info_is_perfect=?,erp_card_no=? WHERE tenant_id=? AND id=?|1|1|1||0|0|1|1|0|0|
|v4_user|UPDATE member SET wx_union_id=?,mini_open_id=?,h5_open_id=?,wx_card_code=?,external_user_id=? WHERE id=? AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|1|1|0|0|
|coupon_service|SELECT id,tenant_id,tenant_app_id,template_id,coupon_push_id,coupon_no,coupon_state,user_id,coupon_name,coupon_type,face_value,discount,use_threshold,balance,begin_time,end_time,wx_card_id,wx_card_no,source,source_id,business_id,create_time,update_time FROM coupon WHERE (tenant_id=? AND tenant_app_id=? AND user_id=? AND template_id IN (?) AND coupon_state=? AND begin_time<=? AND end_time>?)|1|1|1||0|0|0|0|0|0|
|erp_sync|INSERT INTO retry_data(id,tenant_id,tenant_app_id,business_type,operation_type,data_id,user_id,erp_member_id,need_erp_member_id,retry_times,msg,send_time,create_time,data) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)|1|1|1||0|0|0|0|0|0|
|v4_user|UPDATE wx_user SET head_img_url=? WHERE id=?|1|2|2||0|0|1|1|0|0|
|user_service|UPDATE user_employee SET shop_id=? WHERE (id=?)|1|1|1||0|0|1|1|0|0|
|goods|SELECT count(*) FROM goods.goods_sku WHERE tenant_id=? AND tenant_app_id=? AND goods_id=? AND activity_id=?|1|2|2||0|0|21672|21672|1|1|
|tenant|SELECT es.id,es.sales_no,es.member_erp_id,es.sales_date,es.sales_erp_id,es.is_sales FROM erp_sales es WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.sales_date>=? AND es.employee_erp_id=? AND es.sales_status=? ORDER BY es.sales_date DESC,es.id DESC LIMIT ?|1|15|15||0|0|2676|2676|20|20|
|v4_coupon|UPDATE coupon SET coupon_status=?,update_time=? WHERE id=? AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|1|1|0|0|
|activity_service|SELECT count(*)>? FROM activity_service.online_sign_user_sign_log WHERE tenant_app_id=? AND user_id=? AND to_days(create_time)=to_days(?)|1|1|1||0|0|1014|1014|1|1|
|v4_employee|SELECT count(*) AS total_count,count(finish_time) AS finish_count,count(send_coupons) AS coupon_send_count,count(recv_coupons) AS coupon_recv_count,count(accept_time) AS accept_count,count(arrival_shop_time) AS arrival_shop_count,count(trade_time) AS trade_count FROM task_task WHERE task_type=? AND status!=? AND system_task_type=? AND end_time>? AND end_time<=? AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|7273|7273|1|1|
|timer|INSERT INTO task_info(id,service,name,callback,params,cron,delay,next_time,status,create_time,update_time) VALUES (?,?,?,?,?,?,?,?,?,?,?)|1|1|1||0|0|0|0|0|0|
|coupon_service|SELECT id,tenant_id,tenant_app_id,coupon_id,remark,user_name,mobile_no,creator_user_id,creator_user_name,creator_mobile_no,product_name,exchange_shop,is_give,writeoff_user_id,writeoff_employee_id,writeoff_time,source_shop_id,source_user_id,source_user_type,member_source_shop,create_time,update_time FROM coupon_extend WHERE id=?|1|1|1||0|0|1|1|1|1|
|coupon_service|SELECT count(*) FROM employee_give_coupon_log WHERE (tenant_app_id=? AND coupon_push_id=?)|1|1|1||0|0|25808|25808|1|1|
|value_added|SELECT ID,tenant_wechatapp_id AS tenantWechatappId,user_id AS userId,template_id AS templateId,sales_erp_id AS saleserpid,product_name AS productName,shop_name AS shopName,product_barcode AS productBarcode,amount_total AS amountTotal,amount_pay AS amountPay,amount_added AS amountAdded,state AS state,add_days,added_percent_per_day AS addedPercentPerDay,devalue_percent_per_day AS devaluePercentPerDay,keeping_days AS keepingDays,exchange_days AS exchangeDays,coupon_user_id AS couponUserId,sales_index AS salesIndex,start_add_time AS createtime,DATE_ADD(start_add_time,INTERVAL add_days? DAY),DATE_ADD(start_add_time,INTERVAL add_days+keeping_days? DAY) FROM value_added_user WHERE keeping_days>? AND state=? AND start_add_time=date_add(CURDATE(),interval ?*(add_days?)day)|1|15|15||0|0|2107809|2107809|481|481|
|v4_coupon|INSERT INTO coupon_extend(id,coupon_name,remark,member_name,mobile_no,is_new_member,can_give,create_time,update_time,tenant_id,tenant_app_id) VALUES (?,?,?,?,?,?,?,?,?,?,?)|1|1|1||0|0|0|0|0|0|
|user_service|UPDATE tenant_member_info SET tenant_app_id=?,user_id=?,shop_id=?,birthday_is_lunar=?,memorial_name=?,memorial_day_is_lunar=?,grade_id=?,create_time=?,update_time=?,member_image_flag=?,info_is_perfect=?,erp_card_no=? WHERE tenant_id=? AND id=?|1|1|1||0|0|1|1|0|0|
|v4_user|UPDATE reception_customer SET oper_status=? WHERE (id=?) AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|1|1|0|0|
|v4_mall|SELECT id FROM order_info WHERE is_delete=? AND (status=? AND end_expire_time IS NOT ? AND end_expire_time<?)|1|1|1||0|0|1238|1238|0|0|
|tenant|SELECT count(?) FROM (SELECT es.sales_no,es.sales_date,es.sales_erp_id,sum(esd.amount_pay) AS amount 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.is_sales=? AND es.member_erp_id=? GROUP BY es.sales_no,es.sales_date,es.sales_erp_id)table_count|1|2|2||0|0|2591|2591|1|1|
|user_service|INSERT INTO tenant_member_bind(tenant_id,id,tenant_app_id,user_id,create_time,update_time) VALUES (?,?,?,?,?,?)|1|1|1||0|0|0|0|0|0|
|v4_sales|SELECT id,sales_erp_id,sales_no,sales_date,member_erp_id,employee_erp_id,employee_name,assist_employee_erp_id,assist_employee_name,dept_erp_id,amount,sales_remark,receipts,sales_status,is_sales,busi_date,erp_create_time,recommend_id,post_time,tenant_id,tenant_app_id,create_time,update_time FROM erp_sales WHERE (sales_no=?) AND tenant_id=? AND tenant_app_id=?|1|2|2||0|0|183265|183265|1|1|
|user_service|UPDATE user_employee SET tenant_id=?,tenant_wechatapp_id=?,shop_id=?,user_id=?,employee_id=?,employee_erp_id=?,create_time=?,update_time=? WHERE id=?|1|1|1||0|0|1|1|0|0|
|tenant|SELECT count(?) FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id=ey.id WHERE sg.tenant_app_id=? AND sg.create_shop_id=? AND EXISTS (SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id=sgm.sneak_guest_id AND sgm.event_type=? AND sgm.intention_info REGEXP ?) AND EXISTS (SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id=sgm.sneak_guest_id AND sgm.event_type=? AND sgm.intention_info REGEXP ?) AND sg.status=?|1|2|2||0|0|4483|4483|1|1|
|tenant|SELECT t.id AS employeeid,t.tenant_id,t.employee_erp_id AS employeeerpid,t.employee_name AS employeename,t.employee_type_id AS employeetypeid,t.employee_type AS employeetype,t.shop_id,sp.shop_name,t.employee_no AS employeeno,t.sex,t.mobile_no AS mobileno,t.corp_wx_user_id,t.head_img_url AS headimgurl,t.dept_erp_id,ed.dept_name AS dept_erp_name,t.status FROM employee t LEFT JOIN tenant_wechatapp_shop sp ON sp.tenant_id=t.tenant_id AND t.shop_id=sp.id LEFT JOIN tenant.erp_department ed ON ed.tenant_id=t.tenant_id AND ed.dept_erp_id=t.dept_erp_id WHERE t.tenant_id=? AND t.dept_erp_id=? AND t.status IN (?) ORDER BY t.id ASC LIMIT ?|1|1|1||0|0|95033|95033|6|6|
|v4_user|INSERT INTO member(id,shop_id,mobile_no,member_name,sex,birthday,birthday_is_lunar,address,interest,status,combine_status,combine_id,create_time,update_time,tenant_id,tenant_app_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)|1|2|2||0|0|0|0|0|0|
|tenant|SELECT id,employee_name,mobile_no FROM tenant.employee WHERE tenant_id=? AND status=? AND (employee_name LIKE concat(?,?,?) OR mobile_no LIKE concat(?,?,?))|1|1|1||0|0|298|298|2|2|
|value_added|SELECT ID,tenant_wechatapp_id AS tenantWechatappId,user_id AS userId,template_id AS templateId,sales_erp_id AS saleserpid,product_name AS productName,shop_name AS shopName,product_barcode AS productBarcode,amount_total AS amountTotal,amount_pay AS amountPay,amount_added AS amountAdded,state AS state,add_days,added_percent_per_day AS addedPercentPerDay,devalue_percent_per_day AS devaluePercentPerDay,keeping_days AS keepingDays,exchange_days AS exchangeDays,coupon_user_id AS couponUserId,sales_index AS salesIndex,start_add_time AS createtime,DATE_ADD(start_add_time,INTERVAL add_days? DAY),DATE_ADD(start_add_time,INTERVAL add_days+keeping_days? DAY) FROM value_added_user WHERE state=? AND start_add_time=date_add(CURDATE(),interval ?*(add_days+keeping_days?)day)|1|3|3||0|0|2107809|2107809|616|616|
|user_service|UPDATE wx_user SET wx_app_id=?,open_id=?,user_name=?,mobile_no=?,wx_card_code=?,create_time=?,update_time=? WHERE id=?|1|2|2||0|0|1|1|0|0|
|user_service|UPDATE tenant_member_info SET tenant_app_id=?,user_id=?,shop_id=?,birthday=?,birthday_is_lunar=?,address=?,memorial_name=?,memorial_day=?,memorial_day_is_lunar=?,grade_id=?,create_time=?,update_time=?,member_image_flag=?,info_is_perfect=?,erp_card_no=? WHERE tenant_id=? AND id=?|1|1|1||0|0|1|1|0|0|
|v4_sales|SELECT COUNT(*) AS total FROM (SELECT a.*,@rank:=@rank+? AS praiseRateRank FROM (SELECT erp_dept_id deptId,count(DISTINCT erp_employee_id)employeeQuantity,count(*)commentQuantity,sum(if(average_score>=low_score,?,?))goodComment,sum(if(average_score<low_score,?,?))badComment,sum(if(average_score>=low_score,?,?))/count(*)*? praiseRate FROM v4_sales.comment WHERE tenant_id=? AND tenant_app_id=? AND not_included=? AND create_time BETWEEN ? AND ? GROUP BY erp_dept_id ORDER BY praiseRate DESC)a,(SELECT @rank:=?)b)a|1|4|4||0|0|65535|65535|1|1|
|order|SELECT od.id,od.order_no orderNo,od.status,od.take_type takeType,od.create_time createTime,od.remark,od.total_fee totalFee,od.freight_fee freightFee,od.discount_fee discountFee,od.take_id takeId,od.payment_fee paymentFee,dt.product_id productId,dt.price,dt.quantity,dt.sku_id skuId,dt.art_no artNo,dt.image_url imageUrl,dt.product_name productName,dt.take_remark takeRemark,dt.take_day takeDay,od.product_fee productFee,ad.user_name receiveName,ad.mobile_no mobileNo,ad.shop_name shopName,ad.address,ad.express_no expressNo,ad.express_company expressCompany,od.finish_type finishType,od.send_time sendTime,od.receive_time receiveTime,od.finish_time finishTime,od.child_status childStatus,od.send_good_remark sendGoodRemark,od.service_flag serviceFlag,od.coupon_id couponId,od.tenant_wechatapp_id tenantAppId,od.tenant_id FROM order_info od LEFT JOIN order_detail dt ON od.id=dt.order_id LEFT JOIN order_address ad ON od.id=ad.order_id WHERE od.status=? AND od.send_time<=? AND od.take_type=?|1|3|3||0|0|264677|264677|0|0|
|order|SELECT count(?) FROM order_info od LEFT JOIN order_detail dt ON od.id=dt.order_id LEFT JOIN order_address ad ON od.id=ad.order_id WHERE od.tenant_id=? AND od.tenant_wechatapp_id=? AND dt.product_name LIKE concat(?,?,?)|1|4|4||0|0|122591|122591|1|1|
|v4_user|SELECT id,grade_id,grade_name,user_id,sale_number,sale_amount,sale_points,tenant_id,tenant_app_id,create_time,update_time FROM member_grade WHERE (user_id=?) AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|1|1|1|1|
|user_service|UPDATE tenant_member_info SET tenant_app_id=?,user_id=?,shop_id=?,birthday_is_lunar=?,address=?,memorial_name=?,memorial_day_is_lunar=?,grade_id=?,create_time=?,update_time=?,member_image_flag=?,info_is_perfect=?,erp_card_no=? WHERE tenant_id=? AND id=?|1|1|1||0|0|1|1|0|0|
