|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|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 ?|111|163|3||0|0|2281460|42191|111|1|
|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=?|88|104|1||0|0|590866|28834|88|1|
|user_service|SELECT tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id FROM user_service.tenant_member tu INNER JOIN user_service.tenant_member_info tm ON tu.tenant_id=tm.tenant_id AND tu.id=tm.id INNER JOIN user_service.tenant_member_bind mb ON tu.tenant_id=mb.tenant_id AND tu.id=mb.id LEFT JOIN user_service.user_employee ue ON tu.tenant_app_id=ue.tenant_wechatapp_id AND tu.user_id=ue.user_id WHERE tu.tenant_id=? AND tu.tenant_app_id=? AND tu.status=? AND mb.erp_member_id IN (?)|64|146|6||0|0|39867010|1439369|6033|464|
|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=?|56|91|2||0|0|1586731|42663|56|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=?|55|82|2||0|0|512456|9363|12|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|48|72|2||0|0|442758|9362|27|1|
|tenant|SELECT es.id,es.sales_no,es.sales_date,es.member_erp_id,es.sales_erp_id,es.is_sales FROM erp_sales es WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.sales_status=? AND es.sales_no LIKE concat(?,?) ORDER BY es.sales_date DESC LIMIT ?|21|32|3||0|0|9066664|477188|2|1|
|corpwx|UPDATE external_user SET un_assign_flag=? WHERE (tenant_id=? AND status=? AND un_assign_flag=?)|19|52|6||0|0|621402|77310|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=?|14|19|2||0|0|4012336|381813|14|1|
|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|13|32|3||0|0|496875|44140|80|8|
|warranty_service|SELECT count(*) FROM warranty WHERE user_id=? AND tenant_wechatapp_id=? AND is_disable=?|12|47|4||0|0|213711|17819|12|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=?|12|13|1||0|0|213020|17770|12|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=?|12|27|2||0|0|506193|42192|12|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|10|12|1||0|0|15946|1983|7147|875|
|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 ?|7|10|1||0|0|3559055|677634|10|2|
|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=?|7|38|7||0|0|623538|103152|7|1|
|v4_sales|SELECT s.*,if(va.id IS NOT ?,?,?)hasAdded FROM (SELECT es.tenant_id,es.tenant_app_id,max(es.sales_no)sales_no,max(es.id)id,max(es.sales_date)sales_date,max(es.member_erp_id)memberId,es.sales_erp_id erpSalesId,esd.product_barcode,max(esd.product_name)product_name,max(category_erp_id)category_erp_id,max(category_name)category_name,sum(amount_total)amount_total,sum(amount_pay)amount_pay,count(esd.id)quantity 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=? LEFT JOIN v4_sales.value_added_ignore i ON i.erp_sales_id=es.sales_erp_id AND i.product_barcode=esd.product_barcode AND i.tenant_id=? AND i.tenant_app_id=? WHERE es.sales_status=? AND is_sales=? AND i.id IS ? 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 va ON va.erp_sales_id=s.erpSalesId AND va.product_barcode=s.product_barcode AND va.tenant_id=? AND va.tenant_app_id=? WHERE ?=? AND (s.sales_no LIKE concat(?,?) OR s.memberId=?) ORDER BY s.sales_date DESC,s.id DESC LIMIT ?|5|17|3||0|0|4957546|991889|15|3|
|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|9|4||0|0|1400627|483812|262|174|
|erp_app|INSERT INTO app_status(id,tenant_id,app_name,version,pid) VALUES (?,?,?,?,?) ON DUPLICATE key UPDATE version=?,pid=?,online_status_time=?|5|7|1||0|0|0|0|0|0|
|v4_coupon|UPDATE v4_coupon.coupon SET coupon_status=? WHERE tenant_id=? AND tenant_app_id=? AND coupon_status=? AND end_time<now()|5|8|3||0|0|4003838|1325708|0|0|
|v4_sales|SELECT COUNT(*) AS total FROM (SELECT es.tenant_id,es.tenant_app_id,max(es.sales_no)sales_no,max(es.id)id,max(es.sales_date)sales_date,max(es.member_erp_id)memberId,es.sales_erp_id erpSalesId,esd.product_barcode,max(esd.product_name)product_name,max(category_erp_id)category_erp_id,max(category_name)category_name,sum(amount_total)amount_total,sum(amount_pay)amount_pay,count(esd.id)quantity 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=? LEFT JOIN v4_sales.value_added_ignore i ON i.erp_sales_id=es.sales_erp_id AND i.product_barcode=esd.product_barcode AND i.tenant_id=? AND i.tenant_app_id=? WHERE es.sales_status=? AND is_sales=? AND i.id IS ? 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 WHERE ?=? AND (s.sales_no LIKE concat(?,?) OR s.memberId=?)|5|16|3||0|0|4957516|991883|5|1|
|v4_sales|SELECT * FROM erp_sales WHERE member_erp_id=? AND is_sales=? AND sales_status=? AND id<? AND tenant_id=? AND tenant_app_id=? ORDER BY sales_date ASC,sales_erp_id ASC LIMIT ?|5|6|2||0|0|247701|54281|5|1|
|v4_sales|SELECT COUNT(*) AS total FROM (SELECT es.tenant_id,es.tenant_app_id,max(es.sales_no)sales_no,max(es.id)id,max(es.sales_date)sales_date,max(es.member_erp_id)memberId,es.sales_erp_id erpSalesId,esd.product_barcode,max(esd.product_name)product_name,max(category_erp_id)category_erp_id,max(category_name)category_name,sum(amount_total)amount_total,sum(amount_pay)amount_pay,count(esd.id)quantity 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=? LEFT JOIN v4_sales.value_added_ignore i ON i.erp_sales_id=es.sales_erp_id AND i.product_barcode=esd.product_barcode AND i.tenant_id=? AND i.tenant_app_id=? WHERE es.sales_status=? AND is_sales=? AND i.id IS ? 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 va ON va.erp_sales_id=s.erpSalesId AND va.product_barcode=s.product_barcode AND va.tenant_id=? AND va.tenant_app_id=? LEFT 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=? LEFT 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 ?=? AND if(ifnull(vat.effective_date,?)!=?,s.sales_date>vat.effective_date,?=?) AND (s.sales_no LIKE concat(?,?) OR s.memberId=?) AND va.id IS ? AND vat.id IS NOT ?|4|17|4||0|0|3288429|824741|4|1|
|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|6|1||0|0|2412161|676809|4|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=?|4|5|1||0|0|756699|189183|4|1|
|employee|SELECT count(*) FROM employee.backlog_? WHERE tenant_id=? AND tenant_app_id=? AND shop_id=? AND status=? AND expire_time BETWEEN ? AND ?|4|9|3||0|0|62166|20702|4|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=?|3|4|1||0|0|567528|189183|3|1|
|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|3|3|1||0|0|19039|8046|9451|4016|
|v4_sales|SELECT COUNT(*) AS total FROM (SELECT es.tenant_id,es.tenant_app_id,max(es.sales_no)sales_no,max(es.id)id,max(es.sales_date)sales_date,max(es.member_erp_id)memberId,es.sales_erp_id erpSalesId,esd.product_barcode,max(esd.product_name)product_name,max(category_erp_id)category_erp_id,max(category_name)category_name,sum(amount_total)amount_total,sum(amount_pay)amount_pay,count(esd.id)quantity 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=? LEFT JOIN v4_sales.value_added_ignore i ON i.erp_sales_id=es.sales_erp_id AND i.product_barcode=esd.product_barcode AND i.tenant_id=? AND i.tenant_app_id=? WHERE es.sales_status=? AND is_sales=? AND i.id IS ? 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 va ON va.erp_sales_id=s.erpSalesId AND va.product_barcode=s.product_barcode AND va.tenant_id=? AND va.tenant_app_id=? WHERE ?=? AND (s.sales_no LIKE concat(?,?) OR s.memberId=?) AND va.id IS NOT ?|3|10|3||0|0|2801707|991885|3|1|
|v4_sales|SELECT COUNT(*) AS total FROM (SELECT max(e.dept_erp_id)deptId,max(employee_erp_id)erpEmployeeId,max(sales_no)salesNo,max(member_erp_id)memberId,max(sales_date)salesDate,ed.sales_erp_id,ed.category_erp_id,ed.product_barcode,max(ed.product_name)productName,count(ed.product_barcode)productQuantity,sum(ed.amount_pay)amountPay FROM v4_sales.erp_sales e JOIN v4_sales.erp_sales_detail ed ON ed.sales_erp_id=e.sales_erp_id AND ed.tenant_id=? AND ed.tenant_app_id=? WHERE e.is_sales=? AND sales_status=? AND NOT EXISTS (SELECT ? FROM v4_sales.value_added_ignore i WHERE i.erp_sales_id=ed.sales_erp_id AND i.product_barcode=ed.product_barcode AND i.tenant_id=ed.tenant_id AND i.tenant_app_id=ed.tenant_app_id AND i.tenant_id=? AND i.tenant_app_id=?) AND e.sales_date BETWEEN ? AND ? AND e.tenant_id=? AND e.tenant_app_id=? GROUP BY ed.sales_erp_id,ed.category_erp_id,ed.product_barcode)e LEFT JOIN v4_sales.value_added_category vc ON vc.erp_category_id=e.category_erp_id AND vc.status=? AND vc.tenant_id=? AND vc.tenant_app_id=? LEFT JOIN v4_sales.value_added_template vt ON vt.id=vc.template_id AND vt.status=? AND vt.tenant_id=? AND vt.tenant_app_id=? LEFT JOIN v4_sales.value_added v ON v.erp_sales_id=e.sales_erp_id AND v.product_barcode=e.product_barcode AND v.tenant_id=? AND v.tenant_app_id=? WHERE v.id IS NOT ?|3|12|4||0|0|1806636|629952|3|1|
|v4_sales|SELECT e.*,if(v.id IS ?,?,?)hasAdded,v.no valueAddedNo,v.added_amount addedAmount,v.status,v.coupon_id couponNo,v.added_time addTime FROM (SELECT max(e.dept_erp_id)deptId,max(employee_erp_id)erpEmployeeId,max(sales_no)salesNo,max(member_erp_id)memberId,max(sales_date)salesDate,ed.sales_erp_id,ed.category_erp_id,ed.product_barcode,max(ed.product_name)productName,count(ed.product_barcode)productQuantity,sum(ed.amount_pay)amountPay FROM v4_sales.erp_sales e JOIN v4_sales.erp_sales_detail ed ON ed.sales_erp_id=e.sales_erp_id AND ed.tenant_id=? AND ed.tenant_app_id=? WHERE e.is_sales=? AND sales_status=? AND NOT EXISTS (SELECT ? FROM v4_sales.value_added_ignore i WHERE i.erp_sales_id=ed.sales_erp_id AND i.product_barcode=ed.product_barcode AND i.tenant_id=ed.tenant_id AND i.tenant_app_id=ed.tenant_app_id AND i.tenant_id=? AND i.tenant_app_id=?) AND e.sales_date BETWEEN ? AND ? AND e.tenant_id=? AND e.tenant_app_id=? GROUP BY ed.sales_erp_id,ed.category_erp_id,ed.product_barcode)e LEFT JOIN v4_sales.value_added_category vc ON vc.erp_category_id=e.category_erp_id AND vc.status=? AND vc.tenant_id=? AND vc.tenant_app_id=? LEFT JOIN v4_sales.value_added_template vt ON vt.id=vc.template_id AND vt.status=? AND vt.tenant_id=? AND vt.tenant_app_id=? LEFT JOIN v4_sales.value_added v ON v.erp_sales_id=e.sales_erp_id AND v.product_barcode=e.product_barcode AND v.tenant_id=? AND v.tenant_app_id=? WHERE v.id IS NOT ? LIMIT ?|3|10|3||0|0|1806636|629952|4|2|
|v4_sales|SELECT count(DISTINCT es.id) FROM v4_sales.erp_sales es JOIN v4_sales.erp_sales_detail esd ON esd.sales_erp_id=es.sales_erp_id AND esd.sales_type IN (?) AND member_erp_id IN (?) AND esd.tenant_id=? AND esd.tenant_app_id=? WHERE es.tenant_id=? AND es.tenant_app_id=?|3|7|3||0|0|154659|64406|3|1|
|v4_sales|SELECT COUNT(*) AS total FROM (SELECT es.tenant_id,es.tenant_app_id,max(es.sales_no)sales_no,max(es.id)id,max(es.sales_date)sales_date,max(es.member_erp_id)memberId,es.sales_erp_id erpSalesId,esd.product_barcode,max(esd.product_name)product_name,max(category_erp_id)category_erp_id,max(category_name)category_name,sum(amount_total)amount_total,sum(amount_pay)amount_pay,count(esd.id)quantity 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=? LEFT JOIN v4_sales.value_added_ignore i ON i.erp_sales_id=es.sales_erp_id AND i.product_barcode=esd.product_barcode AND i.tenant_id=? AND i.tenant_app_id=? WHERE es.sales_status=? AND is_sales=? AND i.id IS ? 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 va ON va.erp_sales_id=s.erpSalesId AND va.product_barcode=s.product_barcode AND va.tenant_id=? AND va.tenant_app_id=? LEFT 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=? LEFT 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 ?=? AND if(ifnull(vat.effective_date,?)!=?,s.sales_date>vat.effective_date,?=?) AND (s.sales_no LIKE concat(?,?) OR s.memberId=?) AND vat.id IS NOT ?|3|11|3||0|0|2463690|824741|3|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=?|3|6|2||0|0|23686|8914|3|1|
|gift_mail|SELECT count(*) FROM gift_mail.trade t LEFT JOIN gift_mail.trade_take tt ON tt.trade_id=t.id WHERE t.tenant_id=? AND t.tenant_wechatapp_id=? AND t.trade_type=? AND t.order_status=? AND t.take_type=? AND tt.shop_id=?|2|2|1||0|0|23066|15772|2|1|
|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|15|7||0|0|2666375|1334359|6297|3149|
|v4_sales|SELECT sum(if(vat.id IS NOT ?,?,?))total,count(v.id)added,sum(v.added_amount)addedAmount,sum(if(v.id IS ? AND vat.id IS NOT ?,?,?))notAdd FROM (SELECT esd.sales_erp_id,category_erp_id,product_barcode 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.is_sales=? AND es.sales_status=? AND NOT EXISTS (SELECT ? FROM v4_sales.value_added_ignore i WHERE i.erp_sales_id=esd.sales_erp_id AND i.product_barcode=esd.product_barcode AND i.tenant_id=esd.tenant_id AND i.tenant_app_id=esd.tenant_app_id AND i.tenant_id=? AND i.tenant_app_id=?) AND es.sales_date BETWEEN ? AND ? AND es.tenant_id=? AND es.tenant_app_id=? GROUP BY esd.sales_erp_id,category_erp_id,product_barcode)e LEFT JOIN v4_sales.value_added_category vac ON vac.erp_category_id=e.category_erp_id AND vac.status IN (?) AND vac.tenant_id=? AND vac.tenant_app_id=? LEFT JOIN v4_sales.value_added_template vat ON vat.id=vac.template_id AND vat.status IN (?) AND vat.tenant_id=? AND vat.tenant_app_id=? LEFT JOIN v4_sales.value_added v ON e.sales_erp_id=v.erp_sales_id AND e.product_barcode=v.product_barcode AND v.tenant_id=? AND v.tenant_app_id=?|2|11|5||0|0|2204557|1147736|2|1|
|v4_sales|SELECT s.*,if(va.id IS NOT ?,?,?)hasAdded FROM (SELECT es.tenant_id,es.tenant_app_id,max(es.sales_no)sales_no,max(es.id)id,max(es.sales_date)sales_date,max(es.member_erp_id)memberId,es.sales_erp_id erpSalesId,esd.product_barcode,max(esd.product_name)product_name,max(category_erp_id)category_erp_id,max(category_name)category_name,sum(amount_total)amount_total,sum(amount_pay)amount_pay,count(esd.id)quantity 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=? LEFT JOIN v4_sales.value_added_ignore i ON i.erp_sales_id=es.sales_erp_id AND i.product_barcode=esd.product_barcode AND i.tenant_id=? AND i.tenant_app_id=? WHERE es.sales_status=? AND is_sales=? AND i.id IS ? 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 va ON va.erp_sales_id=s.erpSalesId AND va.product_barcode=s.product_barcode AND va.tenant_id=? AND va.tenant_app_id=? WHERE ?=? AND (s.sales_no LIKE concat(?,?) OR s.memberId=?) AND va.id IS NOT ? ORDER BY s.sales_date DESC,s.id DESC LIMIT ?|2|6|3||0|0|1983775|991888|3|2|
|v4_sales|SELECT id,sales_erp_id,sales_no,sales_date,member_erp_id,employee_erp_id,employee_name,assist_employee_erp_id,assist_employee_name,dept_erp_id,amount,sales_remark,receipts,sales_status,is_sales,busi_date,erp_create_time,recommend_id,post_time,should_comment,tenant_id,tenant_app_id,create_time,update_time FROM erp_sales WHERE (sales_no=?) AND tenant_id=? AND tenant_app_id=?|2|3|2||0|0|570935|342371|2|1|
|v4_sales|SELECT t.id templateId,sum(if(t.status IN (?),?,?))total,count(v.id)added,ifnull(sum(v.added_amount),?)addedAmount,sum(if(v.id IS ? AND t.status IN (?),?,?))notAdd FROM v4_sales.value_added_template t JOIN v4_sales.value_added_category c ON c.template_id=t.id AND c.tenant_id=? AND c.tenant_app_id=? JOIN (SELECT esd.sales_erp_id,product_barcode,category_erp_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.tenant_id=? AND esd.tenant_app_id=? WHERE es.is_sales=? AND es.sales_status=? AND NOT EXISTS (SELECT ? FROM v4_sales.value_added_ignore i WHERE i.erp_sales_id=esd.sales_erp_id AND i.product_barcode=esd.product_barcode AND i.tenant_id=esd.tenant_id AND i.tenant_app_id=esd.tenant_app_id AND i.tenant_id=? AND i.tenant_app_id=?) AND es.sales_date BETWEEN ? AND ? AND es.tenant_id=? AND es.tenant_app_id=? GROUP BY esd.sales_erp_id,product_barcode,category_erp_id)e ON e.category_erp_id=c.erp_category_id LEFT JOIN v4_sales.value_added v ON e.sales_erp_id=v.erp_sales_id AND e.product_barcode=v.product_barcode AND v.tenant_id=? AND v.tenant_app_id=? WHERE t.tenant_id=? AND t.tenant_app_id=? GROUP BY t.id|2|7|4||0|0|1208149|630795|3|2|
|employee|UPDATE backlog_? SET employee_id=?,update_time=now() WHERE tenant_app_id=? AND shop_id=? AND employee_id=? AND status IN (?)|2|3|2||0|0|20310|12388|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=?|2|5|3||0|0|174243|87122|2|1|
|user_service|SELECT count(?) FROM user_service.tenant_member tm JOIN user_service.tenant_member_info tmi ON tm.tenant_id=tmi.tenant_id AND tm.id=tmi.id LEFT JOIN user_service.user_employee t? ON tm.user_id=t?.user_id AND tm.tenant_id=t?.tenant_id AND tm.tenant_app_id=t?.tenant_wechatapp_id WHERE t?.id IS ? AND tmi.shop_id=? AND tmi.tenant_id=? AND tmi.tenant_app_id=?|2|4|2||0|0|81822|73459|2|1|
|v4_sales|SELECT s.*,if(va.id IS NOT ?,?,?)hasAdded FROM (SELECT es.tenant_id,es.tenant_app_id,max(es.sales_no)sales_no,max(es.id)id,max(es.sales_date)sales_date,max(es.member_erp_id)memberId,es.sales_erp_id erpSalesId,esd.product_barcode,max(esd.product_name)product_name,max(category_erp_id)category_erp_id,max(category_name)category_name,sum(amount_total)amount_total,sum(amount_pay)amount_pay,count(esd.id)quantity 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=? LEFT JOIN v4_sales.value_added_ignore i ON i.erp_sales_id=es.sales_erp_id AND i.product_barcode=esd.product_barcode AND i.tenant_id=? AND i.tenant_app_id=? WHERE es.sales_status=? AND is_sales=? AND i.id IS ? 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 va ON va.erp_sales_id=s.erpSalesId AND va.product_barcode=s.product_barcode AND va.tenant_id=? AND va.tenant_app_id=? LEFT 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=? LEFT 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 ?=? AND if(ifnull(vat.effective_date,?)!=?,s.sales_date>vat.effective_date,?=?) AND (s.sales_no LIKE concat(?,?) OR s.memberId=?) AND vat.id IS NOT ? ORDER BY s.sales_date DESC,s.id DESC LIMIT ?|2|7|3||0|0|1645426|824743|2|1|
|employee|UPDATE backlog_system SET status=?,finish_time=now() WHERE tenant_app_id=? AND scene=?|2|6|4||0|0|1680273|1483677|0|0|
|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=?|2|3|2||0|0|69510|36267|2|1|
|erp_app|COMMIT ?|2|3|1||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 ?|2|2|1||0|0|17603|8860|12|6|
|v4_coupon|SELECT COUNT(*) AS total FROM coupon WHERE (coupon_status=? AND member_id=?) AND tenant_id=? AND tenant_app_id=?|2|3|1||0|0|26438|13220|2|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|2|2|1||0|0|5794|2928|4|4|
|sjfx_etl|UPDATE etl_task SET cost_time=?,total_count=?,current_count=?,update_time=? WHERE id=?|2|3|1||0|0|2|1|0|0|
|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|1|1|1||0|0|3925666|3925666|1|1|
|mysql|DELETE FROM wx_gateway.wx_template_msg WHERE create_time<DATE_SUB(now(),interval ? day)|1|15|15||0|0|869852|869852|0|0|
|value_added|SELECT ID,tenant_wechatapp_id AS tenantWechatappId,user_id AS userId,template_id AS templateId,sales_erp_id AS saleserpid,product_name AS productName,shop_name AS shopName,product_barcode AS productBarcode,amount_total AS amountTotal,amount_pay AS amountPay,amount_added AS amountAdded,state AS state,add_days,added_percent_per_day AS addedPercentPerDay,devalue_percent_per_day AS devaluePercentPerDay,keeping_days AS keepingDays,exchange_days AS exchangeDays,coupon_user_id AS couponUserId,sales_index AS salesIndex,start_add_time AS createtime,DATE_ADD(start_add_time,INTERVAL add_days? DAY),DATE_ADD(start_add_time,INTERVAL add_days+keeping_days? DAY) FROM value_added_user WHERE state=? AND start_add_time=date_add(CURDATE(),interval ?*(add_days+keeping_days?)day)|1|2|2||0|0|2151733|2151733|727|727|
|coupon_service|SELECT * FROM coupon_service.coupon WHERE DATEDIFF(DATE_FORMAT(end_time,?),DATE_FORMAT(now(),?))=? AND coupon_state IN(?)|1|51|51||0|0|12274536|12274536|18326|18326|
|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|7|7||0|0|2151733|2151733|622|622|
|mysql|DELETE FROM timer.task_execute_log WHERE create_time<DATE_SUB(now(),interval ? day)|1|3|3||0|0|1569256|1569256|0|0|
|order|SELECT max(create_time) FROM `order`.order_operator_log WHERE tenant_wechatapp_id=? AND order_id=?|1|2|2||0|0|1112652|1112652|1|1|
|tenant|SELECT sg.tenant_app_id AS tenantAppId,sg.create_shop_id AS shopId,sg.maintain_employee_id AS employeeId,emp.corp_wx_user_id AS corpwxUserId,count(*) AS waitMaintainNum FROM tenant.sneak_guest sg JOIN tenant.employee emp ON sg.maintain_employee_id=emp.id WHERE sg.tenant_app_id=? AND sg.status=? AND sg.next_maintain_date>=CURRENT_DATE AND sg.next_maintain_date<DATE_ADD(CURRENT_DATE,INTERVAL ? day) GROUP BY sg.tenant_app_id,sg.create_shop_id,sg.maintain_employee_id,emp.corp_wx_user_id|1|1|1||0|0|8022|8022|8|8|
|mysql|DELETE FROM message_push.message_log WHERE create_time<DATE_SUB(now(),interval ? day)|1|36|36||0|0|2740096|2740096|0|0|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail WHERE create_time<?|1|1|1||0|0|261659|261659|0|0|
|v4_user|SELECT checkin_time,id FROM potential_customer WHERE (maintain_shop_id=? AND status IN (?)) AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|2696|2696|102|102|
|authorization_service|SELECT id,platform_user_id,user_id,wx_user_id,employee_id,shop_id,tenant_id,tenant_wx_app_id,account_id,login_way,login_code,login_token,roles,status,expire_time,create_time,update_time,login_ip,login_time,login_data,wx_app_user_id FROM user_login_token WHERE (tenant_id=? AND employee_id=? AND status=?)|1|1|1||0|0|3125|3125|3125|3125|
|order|SELECT od.id,od.order_no orderNo,od.status,od.take_type takeType,od.create_time createTime,od.remark,od.total_fee totalFee,od.freight_fee freightFee,od.discount_fee discountFee,od.take_id takeId,od.payment_fee paymentFee,dt.product_id productId,dt.price,dt.quantity,dt.sku_id skuId,dt.art_no artNo,dt.image_url imageUrl,dt.product_name productName,dt.take_remark takeRemark,dt.take_day takeDay,od.product_fee productFee,od.finish_type finishType,od.send_time sendTime,od.receive_time receiveTime,od.finish_time finishTime,od.child_status childStatus,od.send_good_remark sendGoodRemark,od.service_flag serviceFlag,od.coupon_id couponId,od.tenant_wechatapp_id tenantAppId,od.tenant_id tenantId,od.pay_id payId,od.user_id userId,od.user_name userName,od.mobile_no buyMobileNo,od.activity_id,od.offline_payment_fee,od.activity_type,dt.spec,od.take_shop_id,od.take_shop_name,od.take_employee_user_id,od.take_employee_user_name FROM order_info od LEFT JOIN order_detail dt ON od.id=dt.order_id WHERE od.status=? AND od.receive_time<=?|1|1|1||0|0|267756|267756|17|17|
|sjfx_etl|UPDATE etl_task SET task_type=?,context_id=?,task_status=?,start_time=?,end_time=?,cost_time=?,total_count=?,current_count=?,create_time=?,update_time=? WHERE id=?|1|1|1||0|0|1|1|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|1|1|1||0|0|61246|61246|1|1|
|employee|SELECT id,scene,employee_id,member_user_name userName,finish_time,status FROM employee.backlog_? WHERE tenant_id=? AND tenant_app_id=? AND shop_id=? AND expire_time BETWEEN ? AND ? AND status!=? AND scene NOT IN(?) ORDER BY id DESC LIMIT ?|1|3|3||0|0|1468471|1468471|4|4|
|mysql|DELETE FROM erp_sync.sync_record WHERE create_time<DATE_SUB(now(),interval ? day)|1|25|25||0|0|1832024|1832024|0|0|
|sjfx_etl|INSERT INTO etl_task(id,task_type,context_id,task_status,create_time) 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|13|13||0|0|2151728|2151728|0|0|
|authorization_service|UPDATE user_login_token SET status=? WHERE login_token IN|1|1|1||0|0|3125|3125|0|0|
|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|484013|484013|97|97|
|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=?|1|1|1||0|0|2572|2572|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|1|1||0|0|267741|267741|1|1|
|v4_sales|SELECT COUNT(*) AS total FROM warranty WHERE (member_id IN (?) AND is_disable=?) AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|11747|11747|1|1|
|v4_sales|SELECT s.*,if(va.id IS NOT ?,?,?)hasAdded FROM (SELECT es.tenant_id,es.tenant_app_id,max(es.sales_no)sales_no,max(es.id)id,max(es.sales_date)sales_date,max(es.member_erp_id)memberId,es.sales_erp_id erpSalesId,esd.product_barcode,max(esd.product_name)product_name,max(category_erp_id)category_erp_id,max(category_name)category_name,sum(amount_total)amount_total,sum(amount_pay)amount_pay,count(esd.id)quantity 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=? LEFT JOIN v4_sales.value_added_ignore i ON i.erp_sales_id=es.sales_erp_id AND i.product_barcode=esd.product_barcode AND i.tenant_id=? AND i.tenant_app_id=? WHERE es.sales_status=? AND is_sales=? AND i.id IS ? 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 va ON va.erp_sales_id=s.erpSalesId AND va.product_barcode=s.product_barcode AND va.tenant_id=? AND va.tenant_app_id=? LEFT 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=? LEFT 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 ?=? AND if(ifnull(vat.effective_date,?)!=?,s.sales_date>vat.effective_date,?=?) AND (s.sales_no LIKE concat(?,?) OR s.memberId=?) AND va.id IS ? AND vat.id IS NOT ? ORDER BY s.sales_date DESC,s.id DESC LIMIT ?|1|3|3||0|0|824743|824743|1|1|
|v4_user|SELECT id FROM potential_customer WHERE (status IN (?) AND next_maintain_time<?) AND tenant_id=? AND tenant_app_id=?|1|3|3||0|0|9304|9304|579|579|
|v4_user|SELECT maintain_employee_id,id FROM potential_customer WHERE (maintain_shop_id=? AND status IN (?)) AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|2696|2696|102|102|
|sjfx_etl|SELECT COUNT(*) AS total FROM etl_task|1|10|10||0|0|11368406|11368406|1|1|
|sjfx_etl|SELECT COUNT(*) AS total FROM etl_task WHERE (create_time<?)|1|27|27||0|0|11368406|11368406|1|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=?|1|1|1||0|0|13746|13746|1|1|
|tenant|SELECT count(?) FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id=ey.id WHERE sg.tenant_app_id=? AND sg.create_shop_id=? AND EXISTS (SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id=sgm.sneak_guest_id AND sgm.event_type=? AND sgm.intention_info REGEXP ?) AND EXISTS (SELECT ? FROM tenant.sneak_guest_maintain sgm WHERE sg.id=sgm.sneak_guest_id AND sgm.event_type=? AND sgm.intention_info REGEXP ?) AND sg.status=?|1|1|1||0|0|5163|5163|1|1|
|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|1|3|3||0|0|10046|10046|371|371|
|mysql|INSERT INTO erp_sync.sync_record_? SELECT * FROM erp_sync.sync_record WHERE create_time<DATE_SUB(now(),interval ? day)|1|25|25||0|0|1832019|1832019|0|0|
|tenant|SELECT id,tenant_id,tenant_app_id,user_id,status,group_label,maintain_level,remark,create_time,create_shop_id,create_employee_id,update_time,update_shop_id,update_employee_id,sales_amount,next_maintain_date,maintain_employee_id,sneak_guest_no,last_maintain_date,finish_date,fail_type,oid,user_type FROM sneak_guest WHERE (tenant_app_id=? AND status=? AND create_time<?)|1|1|1||0|0|5057|5057|4|4|
|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=?|1|1|1||0|0|2703|2703|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=?)|1|1|1||0|0|94129|94129|1|1|
