|数据库名称|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=?|648|1084|7||0|0|2926457|28469|648|1|
|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<?)|171|470|11||0|0|19700010|115206|0|0|
|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|144|208|4||0|0|189569|2329|87327|1042|
|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|141|215|4||0|0|534163|7388|229|5|
|tenant|SELECT sales_date FROM tenant.erp_sales WHERE tenant_id=? AND tenant_wechatapp_id=? AND member_erp_id=? AND sales_erp_id<? AND is_sales=? AND sales_status=? ORDER BY sales_erp_id ASC LIMIT ?|127|294|7||0|0|2165585|39682|127|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=?|109|151|3||0|0|29986645|275860|545|5|
|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 (?)|92|259|21||0|0|39327582|1902983|5238|409|
|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>?)|63|108|5||0|0|11071408|175740|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=? 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=?|63|103|4||0|0|399924|18306|63|1|
|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=?|30|44|3||0|0|8248930|276010|30|1|
|corpwx|UPDATE external_user SET un_assign_flag=? WHERE (tenant_id=? AND status=? AND un_assign_flag=?)|28|99|8||0|0|743462|73914|0|0|
|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=?|26|75|8||0|0|570294|36522|26|1|
|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(),?)|25|246|18||0|0|2660697|145441|3877|1503|
|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=?|24|62|5||0|0|4098048|276367|24|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|24|62|5||0|0|191747|8258|10|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=?|24|31|2||0|0|71877|5780|24|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|71|9||0|0|5333525|1003142|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=? OR external_user_id=?) AND status IN (?)) AND tenant_id=? AND tenant_app_id=?|18|49|5||0|0|148451|8259|6|1|
|tenant|SELECT count(?) FROM (SELECT es.id,es.sales_no,es.sales_date,es.sales_erp_id,es.amount,ifnull(shop.shop_name,ed.dept_name)dept_name,es.employee_name FROM tenant.erp_sales es JOIN tenant.erp_department ed ON ed.dept_erp_id=es.dept_erp_id AND ed.tenant_id=? LEFT JOIN tenant.tenant_wechatapp_shop shop ON shop.dept_erp_id=ed.dept_erp_id AND shop.tenant_wechatapp_id=? WHERE es.member_erp_id=? AND es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.sales_status=? AND NOT EXISTS (SELECT i.id FROM tenant.erp_sales_ignore i WHERE i.tenant_id=? AND i.tenant_app_id=? AND es.sales_erp_id=i.erp_sales_id))table_count|16|56|35||0|0|208196844|136491855|16|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|16|19|1||0|0|62336|6618|151|55|
|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=?|16|83|12||0|0|8778606|658505|16|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=?|15|24|3||0|0|91388|9956|15|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=?|15|27|4||0|0|178026|14838|15|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 ?|15|51|33||0|0|207868284|136460889|150|10|
|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 ?|14|27|4||0|0|5604917|400375|14|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=?|12|17|2||0|0|49314|5948|12|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=?|12|17|2||0|0|54853|7000|12|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 ?|12|20|2||0|0|505798|54281|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 (?) AND t.un_assign_flag=?|10|15|2||0|0|6470|647|3050|305|
|warranty_service|SELECT count(*) FROM warranty WHERE user_id=? AND tenant_wechatapp_id=? AND is_disable=?|9|73|12||0|0|119313|16470|9|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=?|9|36|10||0|0|322369|115737|9|1|
|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=?|9|71|20||0|0|707388|99351|9|1|
|coupon_service|SELECT market_id AS id,count(market_id) AS quantity FROM (SELECT market_id FROM coupon_service.coupon_market_order WHERE market_id IN (?) AND order_state=? GROUP BY user_id,market_id)number GROUP BY market_id|8|35|6||0|0|4566276|571219|122|16|
|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=?|8|42|10||0|0|257062|39681|8|1|
|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=?|8|9|1||0|0|524565|65602|195|58|
|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=?)|8|12|2||0|0|2141585|480730|8|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|19|7||0|0|931923|175164|7|1|
|v4_coupon|UPDATE v4_coupon.coupon SET coupon_status=? WHERE tenant_id=? AND tenant_app_id=? AND coupon_status=? AND end_time<now()|7|11|3||0|0|2843807|933973|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 c.scene IN (?) AND c.coupon_status IN (?) AND c.tenant_id=? AND c.tenant_app_id=?|7|14|3||0|0|559570|231646|7|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=?|7|11|2||0|0|71556|10224|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=?|7|21|8||0|0|2341344|629463|7|1|
|v4_sales|SELECT * FROM v4_sales.value_added_record WHERE value_added_id=? AND date_format(create_time,?)=? AND tenant_id=? AND tenant_app_id=?|6|10|5||0|0|13498570|2250174|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=?) AND status IN (?) AND maintain_shop_id=?) AND tenant_id=? AND tenant_app_id=?|6|9|2||0|0|14012|2345|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=?|6|16|4||0|0|3023854|881122|6|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|5|6|1||0|0|49497|24948|24636|12474|
|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|1361838|471440|383|289|
|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|5|56|18||0|0|609233|121847|69|14|
|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 ?|5|18|4||0|0|2239960|500043|17|7|
|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=?|5|10|4||0|0|581709|175158|5|1|
|user_service|SELECT * FROM user_employee WHERE tenant_wechatapp_id=? AND employee_id=?|4|4|1||0|0|132958|113883|25709|12667|
|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=?|4|6|1||0|0|548701|236385|4|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=?|4|5|2||0|0|23876|7514|11938|3757|
|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=?|4|6|3||0|0|10665|3047|4|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 ?,?|4|22|9||0|0|2000187|500055|16|4|
|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=?|4|13|6||0|0|374413|295499|4|1|
|tenant|SELECT count(*)amount FROM sneak_guest WHERE tenant_app_id=? AND status=? AND create_shop_id=? AND create_time<=?|4|5|1||0|0|12513|4180|4|1|
||SELECT * FROM tenant.erp_sales e JOIN tenant.erp_sales_detail esd ON e.tenant_id=esd.tenant_id AND e.sales_erp_id=esd.sales_erp_id WHERE e.tenant_id=? AND esd.category_name IN(?)|4|63|33||0|0|5579204|3003416|1503|501|
|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 ?|4|4|1||0|0|36276|16234|40|10|
|tenant|SELECT count(?) FROM (SELECT sg.id,sg.sneak_guest_no,sg.user_id,sg.user_type,ey.employee_name AS maintainEmployeeName,sg.last_maintain_date,ws.shop_name AS createShopName,sg.status,sg.create_time,t?.employee_name AS createEmployeeName,sg.finish_date,sg.fail_type,gs.sales_id,gs.sales_no,w?.shop_name salesShopName,gs.create_time AS salesDate,gs.product_name,gs.product_quantity,gs.amount salesAmount,if(sg.status=?,(CASE WHEN sg.fail_type=? THEN ? ELSE ifnull(emp.employee_name,?) END),?) AS operFailEmployeeName FROM sneak_guest sg LEFT JOIN employee ey ON sg.maintain_employee_id=ey.id LEFT JOIN tenant_wechatapp_shop ws ON sg.create_shop_id=ws.id LEFT JOIN employee t? ON sg.create_employee_id=t?.id LEFT JOIN sneak_guest_sales gs ON sg.tenant_app_id=gs.tenant_app_id AND sg.id=gs.sneak_guest_id LEFT JOIN tenant_wechatapp_shop w? ON gs.shop_id=w?.id LEFT JOIN tenant.sneak_guest_maintain gm ON gm.sneak_guest_id=sg.id AND gm.event_type=? LEFT JOIN employee emp ON gm.employee_id=emp.id WHERE sg.tenant_app_id=? ORDER BY sg.id DESC)tmp_count|4|20|13||0|0|1609212|767472|4|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|4|5|1||0|0|25026|8360|12513|4180|
|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 ?|4|5|2||0|0|1695771|629571|5|2|
|erp_app|INSERT INTO app_status(id,tenant_id,app_name,version,pid) VALUES (?,?,?,?,?) ON DUPLICATE key UPDATE version=?,pid=?,online_status_time=?|3|4|1||0|0|0|0|0|0|
|v4_employee|SELECT count(*) AS total_count,count(finish_time) AS finish_count,ifnull(sum(if(finish_time>=? AND finish_time<?,?,?)),?) AS todayFinishCount,count(send_coupons) AS coupon_send_count,count(recv_coupons) AS coupon_recv_count,count(accept_time) AS accept_count,count(arrival_shop_time) AS arrival_shop_count,count(trade_time) AS trade_count FROM task_task WHERE task_type=? AND status=? AND shop_id=? AND employee_id=? AND system_task_type=? AND start_time<=? AND end_time>? AND tenant_id=? AND tenant_app_id=?|3|4|1||0|0|4747|1748|3|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 ?|3|5|2||0|0|1041452|629679|4|2|
|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 ?|3|6|2||0|0|945700|330479|2|1|
|coupon_service|SELECT t.id FROM coupon_service.template t LEFT JOIN coupon_service.coupon_scope s ON s.tenant_id=t.tenant_id AND s.tenant_app_id=t.tenant_app_id AND s.template_id=t.id WHERE t.coupon_type=? AND t.tenant_id=? AND t.tenant_app_id=? AND (t.scope=? OR (s.scope=? AND s.product_id=?) OR (s.scope=? AND s.classify_id=?))|3|3|1||0|0|65935|21982|2|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 ?|3|3|1||0|0|42546|14182|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|2|5|3||0|0|12842|7268|8|8|
|order|SELECT max(create_time) FROM `order`.order_operator_log WHERE tenant_wechatapp_id=? AND order_id=?|2|10|5||0|0|2158991|1079516|2|1|
|coupon_service|SELECT tenant_id,tenant_app_id,employee_id,count(DISTINCT user_id) AS count FROM coupon_service.coupon_expire_task WHERE tenant_id=? AND tenant_app_id=? AND status=? AND expire_time>now() AND expire_time BETWEEN ? AND ? GROUP BY tenant_id,tenant_app_id,employee_id|2|13|9||0|0|226384|176579|59|43|
|v4_sales|SELECT COUNT(*) AS total FROM value_added_record WHERE (value_added_id=?) AND tenant_id=? AND tenant_app_id=?|2|16|10||0|0|4506910|2253455|2|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=?)|2|2|1||0|0|6567|3288|2|1|
|user_service|SELECT count(?) FROM user_service.tenant_member tm JOIN user_service.tenant_member_info tmi ON tmi.tenant_id=? AND tmi.tenant_app_id=? AND tm.id=tmi.id WHERE tm.tenant_id=? AND tm.tenant_app_id=? AND (tm.user_name LIKE concat(?,?,?) OR tm.mobile_no=?)|2|2|1||0|0|269907|231489|2|1|
|gift_mail|SELECT tt.shop_id FROM gift_mail.trade t JOIN gift_mail.trade_take tt ON tt.tenant_wechatapp_id=t.tenant_wechatapp_id AND tt.trade_id=t.id WHERE t.tenant_id=? AND t.tenant_wechatapp_id=? AND tt.shop_id IS NOT ?|2|2|1||0|0|38576|26792|19288|13396|
|v4_coupon|SELECT tenant_id,tenant_app_id,member_id,count(?)total FROM v4_coupon.coupon WHERE DATEDIFF(DATE_FORMAT(end_time,?),DATE_FORMAT(now(),?))=? AND coupon_status IN (?) GROUP BY tenant_id,tenant_app_id,member_id|2|29|15||0|0|1869269|935135|158|80|
|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 ?|2|7|4||0|0|350211|175110|4|2|
|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=?)|2|5|2||0|0|350211|175110|2|1|
|gift_mail|SELECT count(?) FROM (SELECT t.*,tt.can_take_date,tt.shop_id,tt.shop_name,tt.take_shop_name,tt.take_employee_name,ta.recipients,ta.user_tel,CONCAT(ta.area,ta.address)address,if(t.trade_type=? OR t.trade_type=?,pl.id,it.barcode) AS barcode,if(t.trade_type=? OR t.trade_type=?,pl.default_image_url,p.default_image_url) AS defaultImageUrl FROM trade t LEFT OUTER JOIN trade_take tt ON t.tenant_wechatapp_id=tt.tenant_wechatapp_id AND t.id=tt.trade_id LEFT OUTER JOIN trade_addr ta ON t.tenant_wechatapp_id=ta.tenant_wechatapp_id AND t.id=ta.trade_id LEFT OUTER JOIN product p ON p.id=t.product_id LEFT OUTER JOIN platform_product pl ON pl.id=t.product_id LEFT OUTER JOIN inventory it ON it.product_id=t.product_id AND it.specification=t.specification LEFT OUTER JOIN trade_express te ON te.tenant_wechatapp_id=t.tenant_wechatapp_id AND te.trade_id=t.id WHERE (t.tenant_wechatapp_id=? AND t.trade_type=?) ORDER BY create_time DESC)tmp_count|2|2|1||0|0|135016|93772|2|1|
||SELECT * FROM v4_coupon.coupon WHERE tenant_id=? AND template_id=?|2|5|2||0|0|292636|146318|1002|501|
|authorization_service|UPDATE user_login_token SET status=? WHERE login_token IN|2|2|1||0|0|3274|1906|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?.employee_erp_id=? AND t?.post_time>=? AND t?.post_time<=? AND t?.is_sales=? AND t?.sales_status=? AND t?.tenant_id=? AND t?.tenant_app_id=?|2|2|1||0|0|15100|11380|4|3|
|employee|UPDATE backlog_system SET status=?,finish_time=now() WHERE tenant_app_id=? AND scene=?|2|8|6||0|0|1603950|1419250|0|0|
|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|8|7||0|0|15920|8927|496|333|
|gift_mail|SELECT count(*) FROM gift_mail.trade t WHERE t.tenant_wechatapp_id=? AND t.trade_type=? AND t.order_status=?|2|4|2||0|0|18398|9200|2|1|
|tenant|SELECT sum(tt.maintainCount) AS maintainCount,sum(tt.maintainNum) AS maintainNum,sum(tt.successNum) AS successNum,sum(tt.failNum) AS failNum,sum(tt.saleMoney) AS saleMoney FROM (SELECT count(?) AS maintainCount,count(DISTINCT t.sneak_guest_id) AS maintainNum,? AS successNum,? AS failNum,? AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id=g.id WHERE g.tenant_app_id=? AND (g.fail_type IS ? OR g.fail_type=?) AND t.event_type IN (?) AND t.create_time>=? AND t.create_time<? UNION ALL SELECT ? AS maintainCount,? AS maintainNum,count(sgs.sneak_guest_id) AS successNum,? AS failNum,sum(sgs.`amount`) AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_sales sgs ON g.id=sgs.sneak_guest_id WHERE g.tenant_app_id=? AND sgs.create_time>=? AND sgs.create_time<? UNION ALL SELECT ? AS maintainCount,? AS maintainNum,? AS successNum,count(DISTINCT t.sneak_guest_id) AS failNum,? AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id=g.id WHERE g.tenant_app_id=? AND g.fail_type=? AND t.event_type IN (?) AND t.create_time>=? AND t.create_time<?)tt|2|8|6||0|0|779429|750796|2|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_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|2|3|2||0|0|102848|51424|2|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|260495|260495|45|45|
|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|8264|8264|539|539|
|mysql|DELETE FROM message_push.message_log WHERE create_time<DATE_SUB(now(),interval ? day)|1|68|68||0|0|2421267|2421267|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|5|5||0|0|2131488|2131488|755|755|
|v4_coupon|SELECT shop_id FROM v4_coupon.tag_push_coupon_log WHERE tag_push_coupon_id=? AND push_coupon_state=? AND tenant_id=? AND tenant_app_id=? GROUP BY shop_id|1|1|1||0|0|320274|320274|49|49|
|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=?|1|1|1||0|0|3458|3458|103|103|
|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(?,?,?))|1|2|2||0|0|2363|2363|1|1|
||UPDATE v4_coupon.coupon SET coupon_status=? WHERE tenant_id=? AND template_id=?|1|10|10||0|0|934618|934618|0|0|
|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(?,?))|1|2|2||0|0|3378|3378|1|1|
|v4_coupon|SELECT tag_push_coupon_id id,count(?)pushQuantity,count(if(push_coupon_state=?,?,?))pushedQuantity FROM v4_coupon.tag_push_coupon_log WHERE tag_push_coupon_id=? AND tenant_id=? AND tenant_app_id=? GROUP BY tag_push_coupon_id|1|1|1||0|0|320176|320176|1|1|
|v4_coupon|SELECT id,tag_push_coupon_id,member_id,employee_id,shop_id,push_coupon_state,push_fail_reason,call_state,tenant_id,tenant_app_id,create_time,update_time FROM tag_push_coupon_log WHERE (tag_push_coupon_id=? AND push_coupon_state=?) AND tenant_id=? AND tenant_app_id=?|1|3|3||0|0|320176|320176|7|7|
|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|2131470|2131470|0|0|
|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=?|1|1|1||0|0|635|635|1|1|
|user_service|COMMIT ?|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|1|1||0|0|113442|113442|0|0|
|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|2344|2344|82|82|
|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|260450|260450|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=?)|1|2|2||0|0|175101|175101|1|1|
|coupon_service|SELECT * FROM coupon_service.coupon WHERE DATEDIFF(DATE_FORMAT(end_time,?),DATE_FORMAT(now(),?))=? AND coupon_state IN(?)|1|131|131||0|0|11838155|11838155|1608|1608|
||SELECT table_name,index_name,index_comment,index_type,non_unique,column_name,sub_part,collation,? expression FROM information_schema.statistics WHERE table_schema=? AND index_schema=? AND index_name COLLATE utf8_general_ci<>? ORDER BY index_schema,table_name,index_name,seq_in_index|1|1|1||0|0|32357|32357|15793|15793|
|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|1|1||0|0|9948|9948|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?.tenant_id=? AND t?.tenant_app_id=?|1|1|1||0|0|1626|1626|1|1|
|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.event_type=? AND s.create_time BETWEEN ? AND ? GROUP BY s.sneak_guest_id)a|1|2|2||0|0|6859|6859|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|13|13||0|0|2131488|2131488|847|847|
|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|1|1|1||0|0|320289|320289|1|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=?)|1|1|1||0|0|65382|65382|1|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<=?|1|1|1||0|0|755|755|1|1|
|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 (?)|1|4|4||0|0|113442|113442|19|19|
|tenant|SELECT sp.id AS shopId,sp.shop_name AS shopName,ifnull(sum(tt.maintainCount),?) AS maintainCount,ifnull(sum(tt.maintainNum),?) AS maintainNum,ifnull(sum(tt.successNum),?) AS successNum,ifnull(sum(tt.failNum),?) AS failNum,ifnull(sum(tt.saleMoney),?) AS saleMoney FROM tenant.tenant_wechatapp_shop sp LEFT JOIN (SELECT g.create_shop_id AS shop_id,count(?) AS maintainCount,count(DISTINCT t.sneak_guest_id) AS maintainNum,? AS successNum,? AS failNum,? AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id=g.id WHERE g.tenant_app_id=? AND (g.fail_type IS ? OR g.fail_type=?) AND t.event_type IN (?) AND t.create_time>=? AND t.create_time<? GROUP BY g.create_shop_id UNION ALL SELECT g.create_shop_id AS shop_id,? AS maintainCount,? AS maintainNum,count(sgs.sneak_guest_id) AS successNum,? AS failNum,sum(sgs.`amount`) AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_sales sgs ON g.tenant_app_id=sgs.tenant_app_id AND g.id=sgs.sneak_guest_id WHERE g.tenant_app_id=? AND sgs.create_time>=? AND sgs.create_time<? GROUP BY g.create_shop_id UNION ALL SELECT g.create_shop_id AS shop_id,? AS maintainCount,? AS maintainNum,? AS successNum,count(DISTINCT t.sneak_guest_id) AS failNum,? AS saleMoney FROM tenant.sneak_guest g JOIN tenant.sneak_guest_maintain t ON t.sneak_guest_id=g.id WHERE g.tenant_app_id=? AND g.fail_type=? AND t.event_type IN (?) AND t.create_time>=? AND t.create_time<? GROUP BY g.create_shop_id)tt ON sp.id=tt.shop_id WHERE sp.status=? AND sp.tenant_wechatapp_id=? GROUP BY sp.id,sp.shop_name ORDER BY sp.id|1|1|1||0|0|883370|883370|23|23|
|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 ?|1|1|1||0|0|8904|8904|6|6|
|message_push|INSERT INTO message_push.message_log_back SELECT * FROM message_push.message_log WHERE tenant_id=? AND create_time<?|1|1|1||0|0|26363|26363|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 dt.product_name LIKE concat(?,?,?)|1|1|1||0|0|9948|9948|1|1|
|employee|UPDATE backlog_? SET status=?,finish_time=now() WHERE tenant_app_id=? AND employee_id=? AND status IN (?) AND shop_id=?|1|1|1||0|0|82429|82429|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=?)|1|1|1||0|0|1906|1906|1906|1906|
|v4_coupon|SELECT COUNT(*) AS total FROM tag_push_coupon_log WHERE (tag_push_coupon_id=? AND push_coupon_state=?) AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|320176|320176|1|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=?|1|1|1||0|0|21669|21669|1|1|
|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|
|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|471623|471623|58|58|
|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 ?|1|1|1||0|0|295499|295499|1|1|
|value_added|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?.dept_erp_id=? AND t?.employee_erp_id IN (?) AND t?.employee_erp_id=? AND t?.sales_date>=? AND t?.sales_date<? AND t?.state!=? LIMIT ?|1|6|6||0|0|17114|17114|3|3|
|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 ?) AND ef.export_code IN (?)|1|1|1||0|0|62256|62256|1|1|
|tenant|SELECT count(?) FROM (SELECT es.id,es.sales_no,es.sales_date,es.sales_erp_id,es.amount,ifnull(shop.shop_name,ed.dept_name)dept_name,es.employee_name FROM tenant.erp_sales es JOIN tenant.erp_department ed ON ed.dept_erp_id=es.dept_erp_id AND ed.tenant_id=? LEFT JOIN tenant.tenant_wechatapp_shop shop ON shop.dept_erp_id=ed.dept_erp_id AND shop.tenant_wechatapp_id=? WHERE es.member_erp_id=? AND es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.sales_status=?)table_count|1|1|1||0|0|69241|69241|1|1|
|mysql|DELETE FROM wx_gateway.wx_template_msg WHERE create_time<DATE_SUB(now(),interval ? day)|1|26|26||0|0|775484|775484|0|0|
|v4_sales|SELECT id,sales_id,status,tenant_id,tenant_app_id,create_time,update_time FROM comment_not_remind_sales WHERE (status=?)|1|1|1||0|0|113255|113255|416|416|
|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=?|1|1|1||0|0|2344|2344|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?.dept_erp_id=? AND t?.employee_erp_id IN (?) AND t?.employee_erp_id=? AND t?.sales_date>=? AND t?.sales_date<? AND t?.state!=?)tmp_count|1|2|2||0|0|16698|16698|1|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.employee_id=? AND t.tenant_id=? AND t.tenant_app_id=?|1|1|1||0|0|11863|11863|1|1|
||DELETE FROM tenant.sjfx_dct_erp_sales_detail WHERE create_time<?|1|1|1||0|0|214833|214833|0|0|
|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 ?)|1|1|1||0|0|2322|2322|2321|2321|
||SELECT count(*) FROM v4_coupon.coupon WHERE tenant_id=? AND template_id=? AND status=?|1|3|3||0|0|154394|154394|1|1|
|v4_sales|SELECT COUNT(*) AS total FROM comment WHERE (order_id=? AND member_id=?) AND tenant_id=? AND tenant_app_id=?|1|1|1||0|0|54953|54953|1|1|
|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|88259|88259|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|2|2||0|0|4610|4610|11|11|
|v4_coupon|SELECT c.id,c.coupon_no,ce.member_name,ce.mobile_no,c.type AS couponType,c.member_id,ce.coupon_name,c.scene,c.begin_time,c.end_time,c.coupon_status status 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 c.scene IN (?) AND c.coupon_status IN (?) AND c.tenant_id=? AND c.tenant_app_id=? ORDER BY c.id DESC LIMIT ?|1|1|1||0|0|40644|40644|50|50|
|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|2|2||0|0|274770|274770|4|4|
|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 ?|1|1|1||0|0|17229|17229|1|1|
|user_service|SELECT tu.user_id,tm.shop_id,mb.erp_member_id memberErpId,tu.mobile_no,tu.user_name,ue.employee_id,tm.grade_id FROM user_service.tenant_member tu INNER JOIN user_service.tenant_member_info tm ON tu.tenant_id=tm.tenant_id AND tu.id=tm.id INNER JOIN user_service.tenant_member_bind mb ON tu.tenant_id=mb.tenant_id AND tu.id=mb.id LEFT JOIN user_service.user_employee ue ON tu.tenant_app_id=ue.tenant_wechatapp_id AND tu.user_id=ue.user_id WHERE tu.tenant_id=? AND tu.tenant_app_id=? AND tu.status=? AND mb.erp_member_id IN|1|1|1||0|0|1222093|1222093|798|798|
|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|1|1||0|0|21669|21669|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 sg.maintain_employee_id=? AND sg.status=?|1|1|1||0|0|1510|1510|1|1|
|v4_sales|SELECT id,sales_erp_id,sales_no,sales_date,member_erp_id,employee_erp_id,employee_name,assist_employee_erp_id,assist_employee_name,dept_erp_id,amount,sales_remark,receipts,sales_status,is_sales,busi_date,erp_create_time,recommend_id,post_time,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|182533|182533|0|0|
|coupon_service|SELECT count(?) FROM coupon_service.coupon cu JOIN coupon_service.coupon_extend ce ON ce.tenant_id=? AND ce.tenant_app_id=? AND ce.id=cu.id WHERE cu.tenant_id=? AND cu.tenant_app_id=? AND cu.create_time>=? AND cu.create_time<=?|1|7|7||0|0|25118|25118|1|1|
||SELECT * FROM warranty_service.warranty WHERE erp_sales_id=?|1|4|4||0|0|566719|566719|0|0|
|erp_sync|UPDATE retry_data SET 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=?,update_time=?,data=? WHERE id=?|1|1|1||0|0|1|1|0|0|
||UPDATE v4_coupon.coupon SET status=? WHERE tenant_id=? AND template_id=? AND status=?|1|6|6||0|0|934484|934484|0|0|
|v4_employee|SELECT ? AS task_type,t?.type AS system_task_type,t.task_template_id,count(?) AS total_count,count(finish_time) AS finish_count FROM task_task t JOIN task_system_task_template t? ON t.task_template_id=t?.id AND t?.status=? AND t?.tenant_id=? AND t?.tenant_app_id=? WHERE t.task_type=? AND t.status=? AND t.start_time>=? AND t.start_time<? AND t.shop_id=? AND t.tenant_id=? AND t.tenant_app_id=? GROUP BY t.task_template_id,t?.type|1|2|2||0|0|276375|276375|4|4|
|coupon_service|SELECT * FROM coupon_service.coupon_can_give WHERE coupon_id=? LIMIT ?|1|1|1||0|0|332737|332737|1|1|
