|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|user_service|select tenant_id , id , tenant_app_id , user_id , shop_id , birthday , birthday_is_lunar , address , memorial_name , memorial_day , memorial_day_is_lunar , interest , grade_id , create_time , update_time from tenant_member_info where ( tenant_id = :1 and tenant_app_id = :2 and user_id = :3 )|5643|10836|6||1|0|1196032944|235645|5642|1|
|user_service|select * from user_service.erp_member em join user_service.erp_member_info emi on em.tenant_id = emi.tenant_id and em.tenant_wechatapp_id = emi.tenant_wechatapp_id and em.member_erp_id = emi.erp_member_id where em.tenant_id = :1 and length ( em.mobile_no ) = :2 order by em.id limit :3 , :4|3881|22580|115||0|0|1499121632|1162696|2892558|1024|
|authorization_service|select id , user_id , tenant_id , tenant_wx_app_id , account_id , login_way , login_code , login_token , roles , status , expire_time , create_time , update_time , login_ip , login_time , login_data , employee_id , shop_id , platform_user_id , wx_user_id from user_login_token where employee_id = :1 and tenant_id = :2 and tenant_wx_app_id = :3 and shop_id = :4 and login_way = :5 and status = :6|1785|9189|16||0|0|72045336|100983|1795|2|
|user_service|select tm.tenant_id , tm.tenant_app_id , tm.user_id , tm.mobile_no , tm.sex , tm.user_name , tm.head_img_url , tmi.birthday , tmi.birthday_is_lunar , tmi.shop_id , tmi.memorial_day_is_lunar , tmi.memorial_day , tmi.memorial_name , tmi.interest , tmi.address , tmb.erp_member_id , wu.open_id as tenantappopenid , wu.is_subscribe as issubscribe from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id in ( :3 )|1712|23300|38||0|0|5288892764|5224275|511|1|
|authorization_service|update user_login_token set status = :1 , update_time = now ( ) where employee_id = :2 and tenant_id = :3 and tenant_wx_app_id = :4 and shop_id = :5 and login_way = :6 and status = :7|1587|9057|16||1561|14|50754398|100907|0|0|
|user_service|select tenant_id , id , tenant_app_id , user_id , wx_user_id , erp_member_id , customer_user_id , create_time , update_time from tenant_member_bind where ( tenant_id = :1 and tenant_app_id = :2 and user_id = :3 )|1194|2169|13||0|0|206040707|235643|1194|1|
|authorization_service|select id , user_id , tenant_id , tenant_wx_app_id , account_id , login_way , login_code , login_token , roles , status , expire_time , create_time , update_time , login_ip , login_time , login_data , employee_id , shop_id , platform_user_id , wx_user_id from user_login_token where wx_user_id = :1 and tenant_id = :2 and login_way = :3 and expire_time > now ( ) and status = :4 and user_id = :5|1123|10684|15||0|0|104347334|231394|65|2|
|platform|select `tasktype` , `tasktime` , `taskstatus` , `bid` , `vendorid` , `uid` , `completetime` , `remark` , `createtime` , `id` from `taskassignment` where tasktype = :1 and vendorid = :2 and date_format ( tasktime , :3 ) >= curdate ( ) and ( taskstatus = :4 or taskstatus = :5 )|630|2601|29||0|0|478960884|760256|130|21|
|user_service|select tm.tenant_id , tm.tenant_app_id , tm.user_id , tm.mobile_no , tm.sex , tm.user_name , tm.head_img_url , tmi.birthday , tmi.birthday_is_lunar , tmi.shop_id , tmi.memorial_day_is_lunar , tmi.memorial_day , tmi.memorial_name , tmi.interest , tmi.address , tmb.erp_member_id , wu.open_id as tenantappopenid , wu.is_subscribe as issubscribe from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id in ( :3 , :4 )|510|7618|30||0|0|520103078|5313414|85|2|
|user_service|select ue.employee_id as employeeid , count ( * ) as quantity from user_service.user_employee ue join user_service.tenant_member_info tmi on ue.tenant_id = tmi.tenant_id and ue.tenant_wechatapp_id = tmi.tenant_app_id and ue.user_id = tmi.user_id where employee_id in ( :1 ) and ue.tenant_id = :2 and ue.tenant_wechatapp_id = :3 and tmi.shop_id = :4 group by ue.employee_id|496|1043|14||0|0|44369200|349672|491|1|
|gift_mail|select count ( 0 ) from ( select p.* , sp.take_type , ifnull ( pp.integral_price , ifnull ( ( select min ( inventory.price ) from inventory where inventory.product_id = p.id ) , :1 ) ) as price , ifnull ( t.quantity , :2 ) quantity , pt.partner_name vendorname , 0.0 distance , c.categroy_name categroy_name , pp.partner_id from product p inner join category c on c.id = p.category_id left outer join self_product sp on p.id = sp.product_id left outer join partner_product pp on p.id = pp.product_id left outer join partner pt on pt.id = pp.partner_id left outer join ( select product_id , sum ( quantity ) quantity from gift_mail.inventory group by product_id ) t on p.id = t.product_id where ( ( p.is_disable is null or p.is_disable = :3 ) ) ) as p where ( p.tenant_id = :4 and p.product_type = :5 )|472|2097|15||0|0|8964587|19469|425|1|
|coupon_service|select count ( * ) from coupon where ( coupon_state = :1 and user_id = :2 and tenant_app_id = :3 and end_time > :4 )|406|1280|15||0|0|24988056|122860|393|1|
|gift_mail|select * from ( select p.* , sp.take_type , ifnull ( pp.integral_price , ifnull ( ( select min ( inventory.price ) from inventory where inventory.product_id = p.id ) , :1 ) ) as price , ifnull ( t.quantity , :2 ) quantity , pt.partner_name vendorname , 0.0 distance , c.categroy_name categroy_name , pp.partner_id from product p inner join category c on c.id = p.category_id left outer join self_product sp on p.id = sp.product_id left outer join partner_product pp on p.id = pp.product_id left outer join partner pt on pt.id = pp.partner_id left outer join ( select product_id , sum ( quantity ) quantity from gift_mail.inventory group by product_id ) t on p.id = t.product_id where ( ( p.is_disable is null or p.is_disable = :3 ) ) ) as p where ( p.tenant_id = :4 and p.product_type = :5 ) order by p.id desc limit :6|301|1136|15||0|0|5801883|19489|3566|20|
|employee|select count ( 0 ) from backlog where tenant_app_id = :1 and employee_id = :2 and status in ( :3 , :4 ) and shop_id = :5 and scene = :6 and expire_time >= :7|300|1159|15||0|0|293527|4369|292|1|
|payment|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|256|819|29||0|0|2685454|10833|2685454|10833|
|user_service|select tm.tenant_id , tm.tenant_app_id , tm.user_id , tm.mobile_no , tm.sex , tm.user_name , tm.head_img_url , tmi.birthday , tmi.birthday_is_lunar , tmi.shop_id , tmi.memorial_day_is_lunar , tmi.memorial_day , tmi.memorial_name , tmi.interest , tmi.address , tmb.erp_member_id , wu.open_id as tenantappopenid , wu.is_subscribe as issubscribe from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id in ( :3 , :4 , :5 )|242|3783|120||0|0|282162329|5332969|61|3|
|user_service|select count ( * ) from user_service.user_employee ue join user_service.tenant_member_info tu on ue.tenant_wechatapp_id = tu.tenant_app_id and ue.user_id = tu.user_id where ue.tenant_id = :1 and ue.employee_id = :2 and ue.tenant_wechatapp_id = :3 and tu.shop_id = :4|175|629|15||0|0|722952480|5504023|171|1|
|user_service|select count ( * ) from user_service.user_employee ue join user_service.tenant_member_info tu on tu.user_id = ue.user_id and tu.tenant_app_id = ue.tenant_wechatapp_id where ue.tenant_id = :1 and ue.employee_id = :2 and ue.tenant_wechatapp_id = :3 and tu.shop_id = :4|164|1121|15||0|0|405395381|2667785|154|1|
|employee|select * from backlog where tenant_app_id = :1 and employee_id = :2 and status in ( :3 , :4 ) and shop_id = :5 and scene = :6 and expire_time >= :7 order by create_time desc limit :8|160|470|15||0|0|5842131|194043|405|8|
|erp_sync|select * from erp_sync.retry_data where ( need_erp_member_id = :1 or ( need_erp_member_id = :2 and erp_member_id is not null ) ) and retry_times > :3 order by id asc|126|669|15||0|0|14066170|118606|250|3|
|payment|select id , tenant_id , tenant_app_id , goods_order_source , goods_order_no , goods_name , goods_amount , fee_type , request_ip , user_id , user_identify , user_sub_identify , pay_way , trade_type , order_start_time , order_expire_time , prepay_id , transaction_id , pay_amount , pay_finish_time , pay_status , pay_status_desc , error_msg , wxappid , sub_wxappid , mch_id , sub_mch_id , callback_tag , callback_result , create_time , update_time from pay_order where callback_result in ( :1 , :2 ) and pay_status in ( :3 , :4 ) order by id asc limit :5|126|473|15||0|0|11370541|91119|0|0|
|user_service|select tm.tenant_id , tm.tenant_app_id , tm.user_id , tm.mobile_no , tm.sex , tm.user_name , tm.head_img_url , tmi.birthday , tmi.birthday_is_lunar , tmi.shop_id , tmi.memorial_day_is_lunar , tmi.memorial_day , tmi.memorial_name , tmi.interest , tmi.address , tmb.erp_member_id , wu.open_id as tenantappopenid , wu.is_subscribe as issubscribe from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id in ( :3 , :4 , :5 , :6 )|119|1782|15||0|0|121692272|4701103|32|4|
|facepass_sync|select id , tenant_id , tenant_wechatapp_id , shop_id , status , create_time , update_time , receive_data , response_data from customer_face_sync_message where status = :1 and create_time < date_add ( now ( ) , interval :2 minute ) order by id asc limit :3|112|276|15||0|0|4349470|43279|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 from user_login_token where ( tenant_id = :1 and account_id = :2 and status = :3 )|108|636|15||0|0|11627909|373373|235|5|
|value_added|select id , template_name as templatename , added_percent_per_day as addedpercentperday , add_days as adddays , keeping_days as keepingdays , devalue_percent_per_day as devaluepercentperday , exchange_days as exchangedays , is_disable as isdisable , effective_days as effectivedays , ifnull ( usenumber , 0 ) as usenumber , generator_method as generatormethod , remark as remark from value_added_template left join ( select template_id , count ( * ) usenumber from value_added_user where tenant_wechatapp_id = :1 group by template_id ) value_added_user on value_added_template.id = value_added_user.template_id where tenant_wechatapp_id = :2 and id = :3|106|374|15||0|0|5494676|77482|100|1|
|platform|select count ( 1 ) from `salesdetaillog` where `vendorid` = :1 and `noteid` = :2|102|537|39||0|0|2926685|34982|102|1|
|corpwx|update external_user set wx_user_id = :1 where ( tenant_id = :2 and user_id = :3 )|95|282|10||0|0|11707059|145512|0|0|
|platform|select count ( 1 ) from coupondetail cd where getuid = :1 and ( couponstate = :2 or couponstate = :3 ) and date_format ( expirytime , :4 ) >= curdate ( )|91|527|40||0|0|29323294|322234|91|1|
|user_service|select tm.tenant_id , tm.tenant_app_id , tm.user_id , tm.mobile_no , tm.sex , tm.user_name , tm.head_img_url , tmi.birthday , tmi.birthday_is_lunar , tmi.shop_id , tmi.memorial_day_is_lunar , tmi.memorial_day , tmi.memorial_name , tmi.interest , tmi.address , tmb.erp_member_id , wu.open_id as tenantappopenid , wu.is_subscribe as issubscribe from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 )|83|1250|15||0|0|89491475|4396716|52|8|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 )|70|474|15||0|0|11869048|329295|876|20|
|employee|select count ( * ) as record from backlog where tenant_app_id = :1 and employee_id = :2 and status = :3 and expire_time between :4 and :5 and shop_id = :6|69|103|3||0|0|22810|729|69|1|
|platform|select `typefullname` , `methodname` , `arguments` , `partition` , `offset` , `createtime` , `updatetime` , `retried` , `errormsg` , `id` from `pushlog` where `typefullname` = :1 and `methodname` = :2 and `arguments` = :3|67|374|34||0|0|14641467|254905|7|1|
|user_service|select tm.tenant_id , tm.tenant_app_id , tm.user_id , tm.mobile_no , tm.sex , tm.user_name , tm.head_img_url , tmi.birthday , tmi.birthday_is_lunar , tmi.shop_id , tmi.memorial_day_is_lunar , tmi.memorial_day , tmi.memorial_name , tmi.interest , tmi.address , tmb.erp_member_id , wu.open_id as tenantappopenid , wu.is_subscribe as issubscribe from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id in ( :3 , :4 , :5 , :6 , :7 , :8 )|53|795|15||0|0|64154214|4821352|12|6|
|platform|select count ( 1 ) from `integrallog` where `vendorid` = :1 and `changefrom` = :2 and `changeid` = :3|53|158|15||0|0|1380553|32770|53|1|
|user_service|select tm.tenant_id , tm.tenant_app_id , tm.user_id , tm.mobile_no , tm.sex , tm.user_name , tm.head_img_url , tmi.birthday , tmi.birthday_is_lunar , tmi.shop_id , tmi.memorial_day_is_lunar , tmi.memorial_day , tmi.memorial_name , tmi.interest , tmi.address , tmb.erp_member_id , wu.open_id as tenantappopenid , wu.is_subscribe as issubscribe from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id in ( :3 , :4 , :5 , :6 , :7 )|51|766|15||0|0|42864413|4383864|5|5|
|order|select id from order_operator_log where tenant_wechatapp_id = :1 and order_id = :2 and ( src_child_status = :3 and dst_child_status = :4 ) order by create_time desc limit :5|47|124|15||0|0|14253673|304724|0|0|
|goods|select count ( 0 ) from ( select gs.id , gs.category_id , gs.goods_name , gs.style_no , gs.status , gs.thumbnail_img , gs.express_type , gs.take_stock_day , gs.take_remark , gs.express_fee , ifnull ( gs.base_sale_number , 0 ) + ifnull ( t1.sales_volume , 0 ) total_sales_volume , ifnull ( ifnull ( t2.quantity , t3.quantity ) , 0 ) total_quantity , ifnull ( ifnull ( t2.price , t3.price ) , 0 ) min_price , gs.create_time , gs.exchange_money from goods.goods gs left join goods.goods_category cg on gs.category_id = cg.id inner join ( select tenant_app_id , goods_id from goods.goods_take_shop group by tenant_app_id , goods_id ) t on gs.id = t.goods_id left join ( select tenant_app_id , goods_id , sum ( sales_volume ) sales_volume from goods.goods_sku group by tenant_app_id , goods_id ) t1 on t.tenant_app_id = t1.tenant_app_id and t.goods_id = t1.goods_id left join ( select tenant_app_id , goods_id , sum ( quantity ) quantity , min ( price ) price from goods.goods_sku where activity_id = :1 group by tenant_app_id , goods_id ) t2 on t.tenant_app_id = t2.tenant_app_id and t.goods_id = t2.goods_id left join ( select tenant_app_id , goods_id , sum ( quantity ) quantity , min ( price ) price from goods.goods_sku where activity_id > :2 group by tenant_app_id , goods_id ) t3 on t.tenant_app_id = t3.tenant_app_id and t.goods_id = t3.goods_id where t.tenant_app_id = :3 and gs.status = :4 ) tmp|44|59|3||0|0|4571479|108735|44|1|
|tenant|select id , sales_no , sales_date , member_erp_id , sales_erp_id , is_sales from erp_sales where sales_no like concat ( :1 , :2 , :3 ) and sales_status = :4 and tenant_id = :5 and tenant_wechatapp_id = :6 order by sales_date desc limit :7|42|234|15||0|0|5393696|520881|23|1|
|user_service|select * from user_service.erp_member em join user_service.erp_member_info emi on em.tenant_id = emi.tenant_id and em.tenant_wechatapp_id = emi.tenant_wechatapp_id and em.member_erp_id = emi.erp_member_id where em.tenant_id = :1 and length ( em.mobile_no ) = :2 order by em.id limit :3|40|271|15||0|0|4140014|845686|29696|1024|
|comment_service|select *from comment_service.comment_reward where comment_id = :1 limit :2|39|120|9||0|0|2895965|78151|8|1|
|account|insert into account ( id , tenant_id , tenant_app_id , account_type , owner_type , owner_id , balance , platform_balance , cumulation , status , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 )|36|48|2||0|0|0|0|0|0|
|order|select od.id from order_info od left join order_detail dt on od.id = dt.order_id where od.status = :1 and dt.sku_id = :2 and od.user_id = :3|36|136|14||0|0|2809927|78348|0|0|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 )|36|277|15||0|0|6071944|680270|88|4|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 )|36|268|15||0|0|9323368|680248|28|1|
|user_service|select count ( 0 ) 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 join user_service.tenant_member_info tmi on tmi.tenant_id = tm.tenant_id and tmi.id = tm.id where ue.employee_id = :1 and ue.tenant_id = :2 and ue.tenant_wechatapp_id = :3 and tmi.shop_id = :4|34|80|9||0|0|4208909|477317|34|1|
|user_service|select tm.tenant_id , tm.tenant_app_id , tm.user_id , tm.mobile_no , tm.sex , tm.user_name , tm.head_img_url , tmi.birthday , tmi.birthday_is_lunar , tmi.shop_id , tmi.memorial_day_is_lunar , tmi.memorial_day , tmi.memorial_name , tmi.interest , tmi.address , tmb.erp_member_id , wu.open_id as tenantappopenid , wu.is_subscribe as issubscribe from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 )|30|441|15||0|0|52528475|4777385|42|7|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 )|30|202|15||0|0|7465615|680264|55|2|
|user_service|select count ( 0 ) from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id not in ( :3 ) and tm.user_id in ( :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 , :31 , :32 , :33 , :34 , :35 , :36 , :37 , :38 , :39 , :40 , :41 , :42 , :43 , :44 , :45 , :46 , :47 , :48 , :49 , :50 , :51 , :52 , :53 )|28|423|15||0|0|24395311|3362517|0|0|
||select count ( * ) from user_service.tenant_member|28|354|86||0|0|106409971|5503076|28|1|
|authorization_service|insert into user_login_token ( 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 ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , null , :13 , :14 , :15 , :16 , :17 , null , null )|27|83|14||0|0|0|0|0|0|
|user_service|select count ( * ) from user_service.tenant_member tm left join user_service.user_employee t3 on tm.tenant_id = t3.tenant_id and tm.user_id = t3.user_id and tm.tenant_app_id = t3.tenant_wechatapp_id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where t3.id is null and tmi.shop_id = :1 and tmi.tenant_app_id = :2 and tmi.tenant_id = :3|27|65|8||0|0|3872343|376774|27|1|
|corpwx|update external_user set un_assign_flag = :1 where ( tenant_id = :2 and corp_user_id = :3 and user_id = :4 )|26|40|3||0|0|1524091|145415|0|0|
|user_service|select count ( 0 ) from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id not in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 , :31 , :32 , :33 , :34 , :35 , :36 , :37 , :38 , :39 , :40 , :41 , :42 , :43 , :44 , :45 , :46 , :47 , :48 , :49 , :50 , :51 , :52 , :53 )|25|378|15||0|0|12195884|899884|0|0|
|platform|update vendormember vm inner join ( select sum ( integral ) as integral , sum ( if ( integral > 0 , integral , 0 ) ) as hisintegral from integrallog where vendorid = :1 and memberid = :2 and isdeleted = :3 ) s on :4 = :5 set vm.integral = ifnull ( s.integral , :6 ) , vm.hisintegral = ifnull ( s.hisintegral , :7 ) , vm.updatetime = now ( ) where vendorid = :8 and memberid = :9|24|182|28||32|16|397|34|0|0|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 )|23|163|15||0|0|5272382|680225|46|3|
|coupon_service|select count ( 0 ) from ( select c.id , c.coupon_name , c.coupon_type , round ( c.face_value / 100 , 2 ) as facevalue , round ( c.discount / 10 , 1 ) as discount , c.begin_time , c.end_time , c.wx_card_id , c.wx_card_no , c.template_id , round ( c.use_threshold / 100 ) as usethreshold , t.scope , ce.product_name , ( case when c.end_time < now ( ) then 'invalid' when c.begin_time > now ( ) then 'not_effective' else c.coupon_state end ) as state from coupon_service.coupon c join coupon_service.coupon_extend ce on ce.id = c.id join coupon_service.template t on t.id = c.template_id where c.tenant_app_id = :1 and c.user_id = :2 ) as c|22|64|7||0|0|1504271|122862|22|1|
|corpwx|update external_user set un_assign_flag = :1 where ( tenant_id = :2 and un_assign_flag = :3 )|21|45|5||0|0|1650747|145465|0|0|
|user_service|insert into user_source ( id , tenant_id , tenant_wechatapp_id , user_id , from_id , source_type , create_time , update_time , shop_id ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 )|21|65|4||0|0|0|0|0|0|
|goods|select tmp.id , tmp.category_id , tmp.goods_name , tmp.style_no , tmp.status , tmp.thumbnail_img , tmp.express_type , tmp.take_stock_day , tmp.take_remark , tmp.express_fee , tmp.total_quantity , tmp.total_sales_volume , tmp.min_price , tmp.create_time , tmp.exchange_money from ( select gs.id , gs.category_id , gs.goods_name , gs.style_no , gs.status , gs.thumbnail_img , gs.express_type , gs.take_stock_day , gs.take_remark , gs.express_fee , ifnull ( gs.base_sale_number , 0 ) +ifnull ( t1.sales_volume , 0 ) total_sales_volume , ifnull ( ifnull ( t2.quantity , t3.quantity ) , 0 ) total_quantity , ifnull ( ifnull ( t2.price , t3.price ) , 0 ) min_price , gs.create_time , gs.exchange_money from goods.goods gs left join goods.goods_category cg on gs.category_id = cg.id inner join ( select tenant_app_id , goods_id from goods.goods_take_shop group by tenant_app_id , goods_id ) t on gs.id = t.goods_id left join ( select tenant_app_id , goods_id , sum ( sales_volume ) sales_volume from goods.goods_sku group by tenant_app_id , goods_id ) t1 on t.tenant_app_id = t1.tenant_app_id and t.goods_id = t1.goods_id left join ( select tenant_app_id , goods_id , sum ( quantity ) quantity , min ( price ) price from goods.goods_sku where activity_id = :1 group by tenant_app_id , goods_id ) t2 on t.tenant_app_id = t2.tenant_app_id and t.goods_id = t2.goods_id left join ( select tenant_app_id , goods_id , sum ( quantity ) quantity , min ( price ) price from goods.goods_sku where activity_id > :2 group by tenant_app_id , goods_id ) t3 on t.tenant_app_id = t3.tenant_app_id and t.goods_id = t3.goods_id where t.tenant_app_id = :3 and gs.status = :4 ) tmp order by tmp.create_time desc limit :5 , :6|19|24|1||0|0|2055708|108553|110|6|
|bespoke|select count ( * ) from bespoke.bespoke_trade where user_id = :1 and tenant_app_id = :2 and status <> :3|19|25|3||0|0|1088016|57264|19|1|
|user_service|select count ( 0 ) from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id not in ( :3 ) and tm.user_id in ( :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 , :31 , :32 , :33 , :34 , :35 )|18|271|15||0|0|15641531|1878182|0|0|
|user_service|select * from erp_integral_log where tenant_id = :1 and update_time >= :2 and update_time <= :3 order by tenant_wechatapp_id , member_erp_id|17|62|15||0|0|2735483|560976|2735328|560976|
|gift_mail|select * from trade_take where trade_id = :1 limit :2|17|46|4||0|0|560139|33404|17|1|
|user_service|select * from user_employee where employee_erp_id = :1 and tenant_id = :2 and date_format ( update_time , :3 ) = date_format ( now ( ) , :4 )|17|74|16||0|0|29625662|1990310|18670|5869|
|user_service|insert low_priority ignore into `user_service`.`_erp_member_new` ( `id` , `tenant_id` , `tenant_wechatapp_id` , `member_erp_id` , `employee_erp_id` , `grade_erp_id` , `card_no` , `dept_erp_id` , `mobile_no` , `consumption_integral` , `user_name` , `status` , `erp_create_time` , `create_time` , `update_time` ) select `id` , `tenant_id` , `tenant_wechatapp_id` , `member_erp_id` , `employee_erp_id` , `grade_erp_id` , `card_no` , `dept_erp_id` , `mobile_no` , `consumption_integral` , `user_name` , `status` , `erp_create_time` , `create_time` , `update_time` from `user_service`.`erp_member` force index ( `primary` ) where ( ( `id` >= :1 ) ) and ( ( `id` <= :2 ) ) lock in share mode /*pt-online-schema-change :3 copy nibble*/|17|19|1||0|0|135005|12590|0|0|
|user_service|insert into tenant_member ( tenant_id , id , tenant_app_id , user_id , mobile_no , user_name , head_img_url , sex , status , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , null , :7 , :8 , :9 , :10 )|16|60|11||0|0|0|0|0|0|
|user_service|select count ( 0 ) from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id not in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 , :31 , :32 , :33 , :34 , :35 )|16|242|15||0|0|13113207|1865608|0|0|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 )|15|37|10||0|0|1974122|680270|58|5|
|warranty_service|select *from warranty_service.warranty where tenant_wechatapp_id = :1 and upload_frequency <= :2 and version = :3 and warranty_img_url is null|14|38|9||0|0|536914|90497|0|0|
|facepass_sync|select id , tenant_id , tenant_wechatapp_id , shop_id , status , retries , success_time , send_fail_msg , create_time , update_time , send_data from customer_face_register_message where status in ( :1 , :2 ) and retries < :3 limit :4|14|35|4||0|0|221438|15817|0|0|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 )|14|94|15||0|0|1160996|193469|69|6|
|account|select id , tenant_id , tenant_app_id , account_type , owner_type , owner_id , balance , platform_balance , cumulation , status , create_time , update_time from account where tenant_app_id = :1 and account_type = :2 and owner_type = :3 and owner_id = :4|13|22|4||0|0|8|1|8|1|
|tenant|select * from erp_sales where member_erp_id = :1 and tenant_wechatapp_id = :2 and sales_status = :3|13|22|4||0|0|21360|5232|19520|4778|
|coupon_service|select * from ( select c.id , c.coupon_name , c.coupon_type , round ( c.face_value / 100 , 2 ) as facevalue , round ( c.discount/ 10 , 1 ) as discount , c.begin_time , c.end_time , c.wx_card_id , c.wx_card_no , c.template_id , round ( c.use_threshold/100 ) as usethreshold , t.scope , ce.product_name , ( case when c.end_time < now ( ) then 'invalid' when c.begin_time > now ( ) then 'not_effective' else c.coupon_state end ) as state from coupon_service.coupon c join coupon_service.coupon_extend ce on ce.id = c.id join coupon_service.template t on t.id = c.template_id where c.tenant_app_id = :1 and c.user_id = :2 ) as c order by field ( state , 'received' , 'not_effective' , 'used' , 'invalid' ) , id desc limit :3|13|25|3||0|0|952203|122863|28|6|
|user_service|select count ( * ) from user_service.user_employee ue join user_service.tenant_member_info tu on ue.tenant_wechatapp_id = tu.tenant_app_id and ue.user_id = tu.user_id where ue.tenant_id = :1 and ue.tenant_wechatapp_id = :2 and ue.employee_id = :3 and tu.shop_id = :4|13|96|14||0|0|45391082|5504020|13|1|
|authorization_service|insert into user_login_token ( 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 ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , null , null , null )|13|31|7||0|0|0|0|0|0|
|user_service|select count ( * ) from user_service.wx_user wx where wx_app_id = :1 and is_subscribe = :2 and not exists ( select null from user_service.tenant_member_bind mb where mb.tenant_id = :3 and mb.tenant_app_id = :4 and mb.wx_user_id = wx.id )|12|71|15||0|0|351932|104197|10|1|
|platform|select `noteid` , `vendorid` , `detailindex` , `productname` , `productbarcode` , `category` , `salestype` , `quantity` , `amount` , `integral` , `productdesc` , `slid` , `paidamount` , `id` from `salesdetaillog` where `noteid` = :1 and `vendorid` = :2|12|43|14||0|0|298990|34988|25|5|
|employee|select count ( 0 ) from backlog where tenant_app_id = :1 and employee_id = :2 and status in ( :3 , :4 ) and shop_id = :5 and scene in ( :6 , :7 ) and expire_time >= :8|12|47|10||0|0|18960|2009|12|1|
|user_service|select count ( 0 ) from ( select tm.user_id as userid , tm.head_img_url as headimgurl , tm.user_name as nickname , tm.mobile_no as mobileno , tm.sex , date_format ( tm.create_time , '%y-%m-%d%h:%i:%s' ) as registertime , tm.id as tenantuserid from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id left join user_service.user_employee t3 on tm.user_id = t3.user_id and tm.tenant_id = t3.tenant_id and tm.tenant_app_id = t3.tenant_wechatapp_id where t3.id is null and tmi.shop_id = :1 and tmi.tenant_id = :2 and tmi.tenant_app_id = :3 ) table_count|12|84|15||0|0|291014|63115|8|1|
|user_service|select count ( 0 ) from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id not in ( :3 ) and tm.user_id in ( :4 )|11|165|15||0|0|41420057|5097615|1|1|
|user_service|select count ( 0 ) from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id not in ( :3 , :4 )|11|166|15||0|0|10932005|1716408|0|0|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 )|10|73|15||0|0|476423|96642|85|14|
|tenant|select id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_no , sales_date , member_erp_id , employee_erp_id , employee_name , dept_erp_id , amount , sales_remark , receipts , sales_status , is_sales , busi_date , create_time , update_time , comment_id from erp_sales where id = :1|10|26|5||0|0|10|1|10|1|
|tenant|select count ( 0 ) from erp_sales where tenant_id = :1 and tenant_wechatapp_id = :2 and sales_date >= :3 and employee_erp_id = :4 and sales_status = :5|10|17|4||0|0|29930|14320|10|1|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 )|10|139|15||0|0|709244|118462|47|8|
|gift_mail|select count ( 0 ) from ( select p.id , p.default_image_url , p.product_name , p.product_type , p.tag_price , ifnull ( pp.integral_price , ifnull ( ( select min ( inventory.price ) from gift_mail.inventory where inventory.product_id = p.id ) , :1 ) ) as price , p.volume , p.category_id , p.product_status , :2 as quantity , pp.partner_id as partner_id from gift_mail.product p left join gift_mail.partner_product pp on p.id = pp.product_id left join gift_mail.product_status ps on ps.product_id = p.id where p.tenant_id = :3 and product_status = :4 and ( p.is_disable is null or p.is_disable = :5 ) and ( ps.tenant_wechatapp_id = :6 or p.product_type = :7 ) ) as p|10|12|2||0|0|61067|6107|10|1|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 )|9|34|9||0|0|876506|193463|60|8|
|warranty_service|select count ( * ) from warranty where user_id = :1 and tenant_wechatapp_id = :2 and is_disable = :3|9|30|8||0|0|9307|2239|9|1|
|authorization_service|update user_login_token set status = :1 where login_token in ( :2 )|9|17|3||0|0|9|1|0|0|
|payment|select t.id , t.goods_order_source as goodsordersource , t.goods_order_no as goodsorderno , t.order_start_time as orderstarttime from pay_order t where t.pay_status = :1 order by id asc limit :2|8|31|9||0|0|727424|90960|4|2|
|user_service|insert into tenant_member_bind ( tenant_id , id , tenant_app_id , user_id , wx_user_id , erp_member_id , customer_user_id , create_time , update_time ) values ( :1 , :2 , :3 , :4 , null , :5 , null , :6 , :7 )|8|25|12||0|0|0|0|0|0|
|employee|select * from backlog where tenant_app_id = :1 and employee_id = :2 and status in ( :3 , :4 ) and shop_id = :5 and scene in ( :6 , :7 ) and expire_time >= :8 order by create_time desc limit :9|8|21|6||0|0|205270|194043|41|8|
|goods|select tmp.id , tmp.category_id , tmp.goods_name , tmp.style_no , tmp.status , tmp.thumbnail_img , tmp.express_type , tmp.take_stock_day , tmp.take_remark , tmp.express_fee , tmp.total_quantity , tmp.total_sales_volume , tmp.min_price , tmp.create_time , tmp.exchange_money from ( select gs.id , gs.category_id , gs.goods_name , gs.style_no , gs.status , gs.thumbnail_img , gs.express_type , gs.take_stock_day , gs.take_remark , gs.express_fee , ifnull ( gs.base_sale_number , 0 ) +ifnull ( t1.sales_volume , 0 ) total_sales_volume , ifnull ( ifnull ( t2.quantity , t3.quantity ) , 0 ) total_quantity , ifnull ( ifnull ( t2.price , t3.price ) , 0 ) min_price , gs.create_time , gs.exchange_money from goods.goods gs left join goods.goods_category cg on gs.category_id = cg.id inner join ( select tenant_app_id , goods_id from goods.goods_take_shop group by tenant_app_id , goods_id ) t on gs.id = t.goods_id left join ( select tenant_app_id , goods_id , sum ( sales_volume ) sales_volume from goods.goods_sku group by tenant_app_id , goods_id ) t1 on t.tenant_app_id = t1.tenant_app_id and t.goods_id = t1.goods_id left join ( select tenant_app_id , goods_id , sum ( quantity ) quantity , min ( price ) price from goods.goods_sku where activity_id = :1 group by tenant_app_id , goods_id ) t2 on t.tenant_app_id = t2.tenant_app_id and t.goods_id = t2.goods_id left join ( select tenant_app_id , goods_id , sum ( quantity ) quantity , min ( price ) price from goods.goods_sku where activity_id > :2 group by tenant_app_id , goods_id ) t3 on t.tenant_app_id = t3.tenant_app_id and t.goods_id = t3.goods_id where t.tenant_app_id = :3 and gs.status = :4 ) tmp order by tmp.create_time desc limit :5|8|9|1||0|0|862738|108433|42|6|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 )|7|52|15||0|0|476765|98802|32|7|
|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 = :1 and login_name = :2 )|7|9|1||0|0|147155|21024|7|1|
|gift_mail|select ifnull ( count ( 1 ) , 0 ) amount from trade where tenant_wechatapp_id = :1 and user_id = :2 and order_status in ( :3 , :4 )|7|12|4||0|0|20498|3190|7|1|
|user_service|select count ( 0 ) 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.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id not in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 , :31 , :32 , :33 , :34 , :35 , :36 , :37 , :38 , :39 , :40 , :41 , :42 , :43 , :44 , :45 , :46 , :47 , :48 , :49 , :50 , :51 , :52 , :53 )|6|56|15||0|0|4509583|902513|4|1|
|user_service|insert low_priority ignore into `user_service`.`_tenant_member_bind_new` ( `id` , `tenant_id` , `tenant_app_id` , `user_id` , `wx_user_id` , `erp_member_id` , `customer_user_id` , `create_time` , `update_time` ) select `id` , `tenant_id` , `tenant_app_id` , `user_id` , `wx_user_id` , `erp_member_id` , `customer_user_id` , `create_time` , `update_time` from `user_service`.`tenant_member_bind` force index ( `primary` ) where ( ( `tenant_id` > :1 ) or ( `tenant_id` = :2 and `id` >= :3 ) ) and ( ( `tenant_id` < :4 ) or ( `tenant_id` = :5 and `id` <= :6 ) ) lock in share mode /*pt-online-schema-change :7 copy nibble*/|6|8|1||0|0|73749|17014|0|0|
|user_service|select count ( * ) from user_service.erp_member where tenant_id = :1|6|8|1||0|0|1851973|392169|6|1|
|user_service|select ue.user_id as id , tm.user_name as username , tm.head_img_url as headimgurl , tm.user_name as nickname , tm.mobile_no as mobile , tm.sex from user_service.user_employee ue join user_service.tenant_member tm on tm.tenant_id = ue.tenant_id and tm.tenant_app_id = ue.tenant_wechatapp_id and tm.user_id = ue.user_id join user_service.tenant_member_info tmi on tmi.tenant_id = tm.tenant_id and tmi.id = tm.id where ue.employee_id = :1 and ue.tenant_id = :2 and ue.tenant_wechatapp_id = :3 and tmi.shop_id = :4 order by tm.id desc limit :5|6|14|4||0|0|384100|111607|51|10|
|order|select max ( create_time ) from `order`.order_operator_log where tenant_wechatapp_id = :1 and order_id = :2|6|19|13||0|0|1820096|303941|6|1|
|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 = :1 and tenant_app_id = :2 and mobile_no = :3 )|6|36|11||0|0|0|0|0|0|
|authorization_service|select ar.tenant_id , ar.tenant_app_id , a.employee_id , ar.shop_id , ar.role_code , ar.role_name , a.status as account_status , ar.status as role_status from authorization_service.account_role2 ar join authorization_service.account a on ar.account_id = a.id where ar.tenant_id = :1 and ar.tenant_app_id = :2 and a.employee_id in ( :3 )|5|5|1||0|0|71402|14348|34|29|
|value_added|-- 根据添加时间得出当前增值金额 update value_added_user set amount_added = if ( :1 > ( ( ( added_percent_per_day / :2 ) * if ( :3 >= timestampdiff ( day , date_format ( start_add_time , :4 ) , now ( ) ) :5 :6 :7 add_days , timestampdiff ( day , date_format ( start_add_time , :8 ) , now ( ) ) :9 :10 , add_days ) ) :11 ( ( devalue_percent_per_day / :12 ) * if ( :13 >= timestampdiff ( day , date_format ( start_add_time , :14 ) , now ( ) ) :15 :16 :17 add_days :18 keeping_days , :19 , timestampdiff ( day , date_format ( start_add_time , :20 ) , now ( ) ) :21 :22 :23 add_days :24 keeping_days ) ) ) * amount_pay , :25 , ( ( ( added_percent_per_day / :26 ) * if ( :27 >= timestampdiff ( day , date_format ( start_add_time , :28 ) , now ( ) ) :29 :30 :31 add_days , timestampdiff ( day , date_format ( start_add_time , :32 ) , now ( ) ) :33 :34 , add_days ) ) :35 ( ( devalue_percent_per_day / :36 ) * if ( :37 >= timestampdiff ( day , date_format ( start_add_time , :38 ) , now ( ) ) :39 :40 :41 add_days :42 keeping_days , :43 , timestampdiff ( day , date_format ( start_add_time , :44 ) , now ( ) ) :45 :46 :47 add_days :48 keeping_days ) ) ) * amount_pay ) , update_time = now ( ) where state = :49 and update_time <= curdate ( ) and ( start_add_time >= date_add ( curdate ( ) , interval :50 ( add_days :51 keeping_days :52 :53 ) day ) or ( amount_added > :54 and start_add_time < date_add ( curdate ( ) , interval :55 ( add_days :56 keeping_days :57 :58 ) day ) ) ) and user_id = :59 and tenant_wechatapp_id = :60 -- 判断条件 在增值时间内 增值金大于0 状态正常|5|6|1||0|0|79|25|0|0|
|authorization_service|select id , user_id , tenant_id , tenant_wx_app_id , account_id , login_way , login_code , login_token , roles , status , expire_time , create_time , update_time , login_ip , login_time , login_data , employee_id , shop_id , platform_user_id , wx_user_id from user_login_token where user_id = :1 and tenant_id = :2 and tenant_wx_app_id = :3 and login_way = :4 and status = :5 and expire_time > now ( )|5|6|2||0|0|4|1|4|1|
|employee|update backlog set leave_flag = :1 where tenant_app_id = :2 and employee_id = :3|5|17|8||0|0|197799|194043|0|0|
|authorization_service|select id , user_id , tenant_id , tenant_wx_app_id , account_id , login_way , login_code , login_token , roles , status , expire_time , create_time , update_time , login_ip , login_time , login_data , employee_id , shop_id , platform_user_id , wx_user_id from user_login_token where tenant_id = :1 and login_way = :2|5|8|3||0|0|5|1|5|1|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 )|5|58|15||0|0|116794|37087|46|15|
|platform|select `no` , `salesid` , `noteno` , `barcode` , `productname` , `customername` , `customertel` , `quantity` , `amount` , `productdesc` , `remark` , `salername` , `productimageid` , `productimageurl` , `shopid` , `vendorid` , `vendormemberid` , `salesdetailid` , `createtime` , `certimageurl` , `certimageid` , `aftersalesremark` , `eid` , `id` from `productcerts` where `vendormemberid` = :1 and `vendorid` = :2|5|12|5||0|0|8207|1642|4|2|
|authorization_service|insert into user_login_token ( 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 ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , null , :8 , :9 , :10 , :11 , null , :12 , :13 , :14 , :15 , :16 , null , null )|4|6|2||0|0|0|0|0|0|
|employee|select tenant_id , tenant_app_id , employee_id , scene , shop_id , count ( * ) as record from backlog where tenant_app_id = :1 and employee_id = :2 and expire_time >= :3 and status in ( :4 , :5 ) and shop_id = :6 group by tenant_id , tenant_app_id , employee_id , scene , shop_id|4|12|6||0|0|8752|4373|11|4|
|coupon_service|select ifnull ( sum ( quantity ) , 0 ) from coupon_service.coupon_market_order where market_id = :1 and user_id = :2 and order_state = :3|4|5|1||0|0|82674|20677|4|1|
|platform|select count ( 1 ) from `taskassignment` ta where ta.tasktype = :1 and ( ta.taskstatus = :2 or ta.taskstatus = :3 ) and vendorid = :4 and uid = :5 and tasktime >= date ( now ( ) )|4|5|1||0|0|3041024|760256|4|1|
||select * from user_service.tenant_member order by id desc limit :1|4|59|18||0|0|20909228|5503176|400|100|
|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 ( :1 , :2 ) and refund_status in ( :3 , :4 ) order by id asc limit :5|4|6|2||0|0|16815|4210|0|0|
|user_service|select ue.employee_id as employeeid , count ( * ) as quantity from user_service.user_employee ue join user_service.tenant_user tu on ue.tenant_wechatapp_id = tu.tenant_app_id and ue.user_id = tu.user_id where employee_id in ( :1 ) and ue.tenant_wechatapp_id = :2 and tu.shop_id = :3 group by ue.employee_id|4|6|2||0|0|236674|101151|4|1|
|user_service|select count ( 0 ) from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and ( tm.user_name like concat ( :3 , :4 , :5 ) or tm.mobile_no = :6 or wu.nick_name like concat ( :7 , :8 , :9 ) ) and tm.user_id not in ( :10 ) and tm.user_id in ( :11 )|4|54|15||0|0|19161172|5091337|1|1|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 )|4|7|2||0|0|386478|96624|22|6|
|coupon_service|select coupon_template_id from coupon_service.coupon_user where end_time > now ( ) and coupon_type = :1 and coupon_state = :2 and tenant_wechatapp_id = :3 and owner_id = :4|4|8|4||0|0|404|201|0|0|
|user_service|select count ( 0 ) from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id not in ( :3 )|4|60|15||0|0|1867678|501891|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 null , false , true ) 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 = :1 and prp.is_recommend = true and prp.platform_product_id = p.id where prp.id is null and p.product_status = :2 order by i.volume desc , p.tag_price asc , p.id desc limit :3|4|4|1||0|0|8852|2213|24|6|
|user_service|select count ( 0 ) from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and ( tm.user_name like concat ( :3 , :4 , :5 ) or tm.mobile_no = :6 or wu.nick_name like concat ( :7 , :8 , :9 ) ) and tm.user_id not in ( :10 ) and tm.user_id in ( :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 , :31 , :32 , :33 , :34 , :35 , :36 , :37 , :38 , :39 , :40 , :41 , :42 )|4|60|15||0|0|7956783|2429604|0|0|
|goods|select id , img_url , img_index from goods_img where goods_id = :1 order by update_time desc|3|4|1||0|0|37322|12442|8|4|
||select count ( * ) from user_service.erp_member|3|7|3||0|0|19442886|6480962|3|1|
|gift_mail|select * from ( select p.id , p.default_image_url , p.product_name , p.product_type , p.tag_price , ifnull ( pp.integral_price , ifnull ( ( select min ( inventory.price ) from gift_mail.inventory where inventory.product_id = p.id ) , :1 ) ) as price , p.volume , p.category_id , p.product_status , :2 as quantity , pp.partner_id as partner_id from gift_mail.product p left join gift_mail.partner_product pp on p.id = pp.product_id left join gift_mail.product_status ps on ps.product_id = p.id where p.tenant_id = :3 and product_status = :4 and ( p.is_disable is null or p.is_disable = :5 ) and ( ps.tenant_wechatapp_id = :6 or p.product_type = :7 ) ) as p order by p.volume desc , p.id desc limit :8|3|3|1||0|0|18339|6113|18|6|
|coupon_service|select count ( 0 ) from ( select c.id , c.coupon_name , c.coupon_type , round ( c.face_value / 100 , 2 ) as facevalue , round ( c.discount / 10 , 1 ) as discount , c.begin_time , c.end_time , c.wx_card_id , c.wx_card_no , c.template_id , round ( c.use_threshold / 100 ) as usethreshold , t.scope , ce.product_name , ( case when c.end_time < now ( ) then 'invalid' when c.begin_time > now ( ) then 'not_effective' else c.coupon_state end ) as state from coupon_service.coupon c join coupon_service.coupon_extend ce on ce.id = c.id join coupon_service.template t on t.id = c.template_id where c.tenant_app_id = :1 and c.user_id = null ) as c|3|16|12||0|0|198666|74484|3|1|
|tenant|select shop.* , dept.dept_name , count ( es.id ) as employeescount from tenant_wechatapp_shop shop left join erp_department dept on shop.dept_erp_id = dept.dept_erp_id and shop.tenant_id = dept.tenant_id left join employee_shop es on shop.id = es.shop_id and es.status in ( :1 , :2 ) where shop.tenant_wechatapp_id = :3 and shop.status in ( :4 , :5 ) group by shop.id order by shop.create_time desc limit :6|3|5|2||0|0|59778|19956|60|20|
|platform|select vm.* from vendormember vm join member m on vm.id = m.vendormemberid and vm.vendorid = m.vendorid where m.employeeid = :1 and vm.vendorid = :2 and ( ( birthdaytype = :3 and month ( birthday ) = month ( date_sub ( curdate ( ) , interval :4 day ) ) and day ( birthday ) = day ( date_sub ( curdate ( ) , interval :5 day ) ) ) or ( birthdaytype = :6 and month ( birthday ) = month ( date_sub ( :7 , interval :8 day ) ) and day ( birthday ) = day ( date_sub ( :9 , interval :10 day ) ) ) )|3|6|2||0|0|98109|62529|50|33|
|sms|select count ( 0 ) from ( select a.phone_numbers as phoneno , concat ( '【' , a.sign_name , '】' , case when b.content is not null then b.content when stc.content is not null then stc.content else a.template_param end ) as content , a.template_code , a.out_id as outid , a.template_param , a.create_time as sendtime , a.create_time as recevietime , a.code as state , a.send_count , a.message , a.source_type from sms_send a left join sms_template b on a.template_code = b.code left join sms_template_custom stc on a.tenant_app_id = stc.tenant_app_id and a.template_code = stc.code and stc.status = :1 where a.tenant_app_id = :2 ) table_count|3|5|3||0|0|35151|16114|3|1|
|order|select count ( 0 ) 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 = :1 and od.tenant_wechatapp_id = :2|3|6|3||0|0|8400|3552|3|1|
|user_service|select tm.user_id as userid , tm.head_img_url as headimgurl , tm.user_name as nickname , tm.mobile_no as mobileno , tm.sex , date_format ( tm.create_time , '%y-%m-%d%h:%i:%s' ) as registertime , tm.id as tenantuserid from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id left join user_service.user_employee t3 on tm.user_id = t3.user_id and tm.tenant_id = t3.tenant_id and tm.tenant_app_id = t3.tenant_wechatapp_id where t3.id is null and tmi.shop_id = :1 and tmi.tenant_id = :2 and tmi.tenant_app_id = :3 order by tm.id asc limit :4 , :5|3|5|2||0|0|91750|35276|12|8|
|tenant|select count ( 0 ) from ( select shop.* , dept.dept_name , count ( es.id ) as employeescount from tenant_wechatapp_shop shop left join erp_department dept on shop.dept_erp_id = dept.dept_erp_id and shop.tenant_id = dept.tenant_id left join employee_shop es on shop.id = es.shop_id and es.status in ( :1 , :2 ) where shop.tenant_wechatapp_id = :3 and shop.status in ( :4 , :5 ) group by shop.id ) table_count|3|5|2||0|0|59951|20010|3|1|
|authorization_service|select id , user_id , tenant_id , tenant_wx_app_id , account_id , login_way , login_code , login_token , roles , status , expire_time , create_time , update_time , login_ip , login_time , login_data , employee_id , shop_id from user_login_token where employee_id = :1 and tenant_id = :2 and tenant_wx_app_id = :3 and shop_id = :4 and login_way = :5 and status = :6|3|12|9||0|0|101916|77651|3|1|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 )|3|5|2||0|0|112569|37551|39|19|
|user_service|select count ( * ) from tenant_user t1 left join user_employee t3 on t1.user_id = t3.user_id and t1.tenant_app_id = t3.tenant_wechatapp_id where t3.id is null and t1.mobile_no is not null and t1.mobile_no != :1 and t1.shop_id = :2 and t1.tenant_app_id = :3|3|8|4||0|0|52796|32688|3|1|
|gift_mail|select * from ( select p.id , p.default_image_url , p.product_name , p.product_type , p.tag_price , ifnull ( pp.integral_price , ifnull ( ( select min ( inventory.price ) from gift_mail.inventory where inventory.product_id = p.id ) , :1 ) ) as price , p.volume , p.category_id , p.product_status , :2 as quantity , pp.partner_id as partner_id from gift_mail.product p left join gift_mail.partner_product pp on p.id = pp.product_id left join gift_mail.product_status ps on ps.product_id = p.id where p.tenant_id = :3 and product_status = :4 and ( p.is_disable is null or p.is_disable = :5 ) and ( ps.tenant_wechatapp_id = :6 or p.product_type = :7 ) ) as p order by p.volume desc , p.id desc limit :8 , :9|3|3|1||0|0|18381|6131|18|6|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 )|2|30|15||0|0|198728|114216|8|6|
|user_service|select count ( 0 ) from ( select t1.user_id as userid , t2.head_img_url as headimgurl , t2.nick_name as nickname , t1.mobile_no as mobileno , t1.is_subscribe as subscribe , t1.sex , t1.tenant_union_id as tenantunionid , date_format ( t1.bind_time , '%y-%m-%d%h:%i:%s' ) as registertime , t1.id as tenantuserid from tenant_user t1 join `user` t2 on t1.user_id = t2.id left join user_employee t3 on t1.user_id = t3.user_id and t1.tenant_id = t3.tenant_id and t1.tenant_app_id = t3.tenant_wechatapp_id where t3.id is null and t1.mobile_no is not null and t1.mobile_no != :1 and t1.shop_id = :2 and t1.tenant_id = :3 and t1.tenant_app_id = :4 ) table_count|2|2|1||0|0|27093|17095|2|1|
|wx_gateway|select id , tenant_id , tenant_app_id , union_id , open_id , wx_app_id , cm_open_id , user_id , status from wx_user where wx_app_id = :1 and cm_open_id = :2|2|8|4||0|0|0|0|0|0|
|customize_page|select count ( * ) from gift_qualified where ( tenant_app_id = :1 and receive_status = :2 and push_id = :3 )|2|6|4||0|0|606|563|2|1|
|gift_mail|select count ( 0 ) from ( select p.* , sp.take_type , ifnull ( pp.integral_price , ifnull ( ( select min ( inventory.price ) from inventory where inventory.product_id = p.id ) , :1 ) ) as price , ifnull ( t.quantity , :2 ) quantity , pt.partner_name vendorname , 0.0 distance , c.categroy_name categroy_name , pp.partner_id from product p inner join category c on c.id = p.category_id left outer join self_product sp on p.id = sp.product_id left outer join partner_product pp on p.id = pp.product_id left outer join partner pt on pt.id = pp.partner_id left outer join ( select product_id , sum ( quantity ) quantity from gift_mail.inventory group by product_id ) t on p.id = t.product_id where ( ( p.is_disable is null or p.is_disable = :3 ) ) ) as p where ( p.product_status = :4 and p.tenant_id = :5 )|2|2|1||0|0|38644|19322|2|1|
|coupon_service|select count ( 0 ) from ( select egc.id , tmp.coupon_name , tmp.coupon_type , tmp.remark , cp.take_effect_way , cp.take_start_day , cp.take_effect_day , date_format ( cp.begin_time , '%y-%m-%d' ) as begin_time , date_format ( cp.end_time , '%y-%m-%d' ) as end_time , egc.limit_grant_time , date_format ( egc.grant_begin_time , '%y-%m-%d' ) as grant_begin_time , date_format ( egc.grant_end_time , '%y-%m-%d' ) as grant_end_time , ifnull ( tmp.face_value , 0 ) /100 as face_value , ifnull ( tmp.discount , 0 ) /10 as discount , tmp.scope , tmp.product_name , if ( egc.state = 'down' , 1 , ( case when cp.end_time is not null and cp.end_time < now ( ) then :1 when egc.limit_grant_time = :2 and egc.grant_end_time < now ( ) then :3 when tgl.put_quantity <= tgl.get_quantity then :4 else :5 end ) ) as state from coupon_service.employee_give_coupon egc inner join coupon_service.coupon_push cp on egc.template_id = cp.template_id and cp.source = :6 and egc.id = cp.source_id and cp.state = :7 inner join coupon_service.template tmp on egc.template_id = tmp.id and tmp.state = :8 inner join coupon_service.template_grant_limit tgl on cp.id = tgl.coupon_push_id where egc.tenant_app_id = :9 and ( egc.limit_grant_time = :10 or egc.grant_begin_time <= now ( ) ) and ( egc.limit_shop = :11 or exists ( select 1 from coupon_service.employee_give_coupon_shop cs where egc.id = cs.employee_give_id and cs.shop_id = :12 ) ) and egc.limit_role in ( :13 , :14 ) order by state asc , egc.id desc ) tmp_count|2|2|1||0|0|30202|16564|2|1|
|activity_service|select count ( t.user_id ) as lotterycount , count ( distinct t.user_id ) as lotterynum from lottery_winner t where t.lottery_activity_id = :1|2|3|2||0|0|1018|733|2|1|
|account|select id , tenant_id , tenant_wechatapp_id , account_type , user_id , mch_billno , send_name , mch_id , sub_mch_id , wxappid , msgappid , re_openid , total_amount , total_num , wishing , client_ip , act_name , remark , scene_id , risk_info , consume_mch_id , send_time , order_status , failure_reason , biz_id , biz_type , biz_tag , send_listid , need_callback , create_time , update_time , user_name , mobile_no , receive_time , refund_amount , refund_time from wx_redpacket_send_order where order_status in ( :1 , :2 ) order by id desc|2|10|8||0|0|80860|40446|20|15|
|sms|select count ( 0 ) from ( select a.phone_numbers as phoneno , concat ( '【' , a.sign_name , '】' , case when b.content is not null then b.content when stc.content is not null then stc.content else a.template_param end ) as content , a.template_code , a.out_id as outid , a.template_param , a.create_time as sendtime , a.create_time as recevietime , a.code as state , a.send_count , a.message , a.source_type from sms_send a left join sms_template b on a.template_code = b.code left join sms_template_custom stc on a.tenant_app_id = stc.tenant_app_id and a.template_code = stc.code and stc.status = :1 ) table_count|2|51|27||0|0|15716137|7859919|2|1|
|sms|insert into sms_send ( id , sign_name , template_code , out_id , request_id , biz_id , code , message , create_time , tenant_id , tenant_app_id , send_count , source_id , source_type , phone_numbers , template_param ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 )|2|2|1||0|0|0|0|0|0|
|order|select id , tenant_id , tenant_wechatapp_id , order_id , user_id , user_name , shop_id , shop_name , operator_type , src_status , dst_status , full_message , remark , create_time , update_time , src_child_status , dst_child_status from order_operator_log where tenant_wechatapp_id = :1 and order_id = :2 and dst_status = :3 order by create_time desc|2|3|1||0|0|606600|303300|2|1|
|gift_mail|select count ( 0 ) from ( select p.id , p.product_name , p.tag_price , i.volume , p.product_status as status , p.default_image_url , i.quantity , i.market_price , if ( prp.id is null , false , true ) 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 = :1 and prp.is_recommend = true and prp.platform_product_id = p.id where prp.id is null and p.product_status = :2 order by i.volume desc , p.tag_price asc , p.id desc ) tmp_count|2|2|1||0|0|3486|1743|2|1|
|platform|select * from ( select * from coupondetail where getuid = :1 and ( couponstate = :2 or couponstate = :3 ) and expirytime >= now ( ) ) as tv limit :4 , :5|2|4|2||0|0|644468|322234|0|0|
|platform|select count ( 1 ) from `taskassignment` ta where ta.tasktype = :1 and ( ta.taskstatus = :2 or ta.taskstatus = :3 ) and vendorid = :4 and uid = :5|2|2|1||0|0|1520512|760256|2|1|
|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 from user_login_token where ( tenant_id = :1 and account_id = :2 and status = :3 and tenant_wx_app_id = :4 )|2|5|3||0|0|106869|100505|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 = :1 and tenant_app_id = :2 and user_id = :3 )|2|4|3||0|0|1|1|1|1|
|tenant|select id , tenant_id as tenantid , tenant_wechatapp_id as tenantwechatappid , sales_erp_id as saleserpid , sales_index as salesindex , sales_type as salestype , product_barcode as productbarcode , product_name as productname , cert_no as certno , hand_size as handsize , category_erp_id as categoryerpid , category_name as categoryname , stone_weight as stoneweight , gold_weight as goldweight , total_weight as totalweight , quantity , amount_total as amounttotal , amount_pay as amountpay , integral , remark from erp_sales_detail where tenant_id = :1 and tenant_wechatapp_id = :2 and sales_erp_id = :3 order by sales_index|2|5|3||0|0|7|6|7|6|
||select * from authorization_service.user_login_token where tenant_id = :1 and tenant_wx_app_id = :2 and wx_user_id = :3|2|4|2||0|0|112488|56261|6|4|
|sms|select a.phone_numbers as phoneno , concat ( '【' , a.sign_name , '】' , case when b.content is not null then b.content when stc.content is not null then stc.content else a.template_param end ) as content , a.template_code , a.out_id as outid , a.template_param , a.create_time as sendtime , a.create_time as recevietime , a.code as state , a.send_count , a.message , a.source_type from sms_send a left join sms_template b on a.template_code = b.code left join sms_template_custom stc on a.tenant_app_id = stc.tenant_app_id and a.template_code = stc.code and stc.status = :1 order by a.create_time desc limit :2|2|3|1||0|0|4459759|2230344|40|20|
|tenant|update erp_sales set comment_id = :1 where id = :2|2|2|1||0|0|2|1|0|0|
|account|update account set balance = -13200171.00 , platform_balance = 0.00 , cumulation = 42541030.00 where balance = -13200159.00 and platform_balance = 0.00 and cumulation = 42541030.00 and id = :1|1|1|1||0|0|1|1|0|0|
|platform|select ifnull ( eid , 0 ) as eid , ifnull ( shopid , 0 ) as sid , vendorid , count ( 1 ) as quantity from productcerts where vendorid = :1 and to_days ( :2 ) :3 to_days ( createtime ) = :4 group by eid , shopid , vendorid|1|1|1||0|0|28984|28984|0|0|
|gift_mail|select * from ( select p.* , sp.take_type , ifnull ( pp.integral_price , ifnull ( ( select min ( inventory.price ) from inventory where inventory.product_id = p.id ) , :1 ) ) as price , ifnull ( t.quantity , :2 ) quantity , pt.partner_name vendorname , 0.0 distance , c.categroy_name categroy_name , pp.partner_id from product p inner join category c on c.id = p.category_id left outer join self_product sp on p.id = sp.product_id left outer join partner_product pp on p.id = pp.product_id left outer join partner pt on pt.id = pp.partner_id left outer join ( select product_id , sum ( quantity ) quantity from gift_mail.inventory group by product_id ) t on p.id = t.product_id where ( ( p.is_disable is null or p.is_disable = :3 ) ) ) as p where ( p.tenant_id = :4 and p.product_type = :5 ) order by p.id desc limit :6 , :7|1|1|1||0|0|19390|19390|14|14|
|order|select count ( 0 ) 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 = :1 and od.tenant_wechatapp_id = :2 and ( od.mobile_no = :3 or ad.mobile_no = :4 )|1|1|1||0|0|1296|1296|1|1|
|account|select round ( ifnull ( sum ( total_amount ) , 0 ) /100 , 2 ) monthuseamount from account.wx_redpacket_send_order where tenant_id = :1 and tenant_wechatapp_id = :2 and order_status in ( :3 , :4 , :5 )|1|2|2||0|0|5740|5740|1|1|
|message_push|delete from message_log where create_time < :1|1|16|16||0|0|160181|160181|0|0|
|coupon_service|select egc.id , tmp.coupon_name , tmp.coupon_type , tmp.remark , cp.take_effect_way , cp.take_start_day , cp.take_effect_day , date_format ( cp.begin_time , '%y-%m-%d' ) as begin_time , date_format ( cp.end_time , '%y-%m-%d' ) as end_time , egc.limit_grant_time , date_format ( egc.grant_begin_time , '%y-%m-%d' ) as grant_begin_time , date_format ( egc.grant_end_time , '%y-%m-%d' ) as grant_end_time , ifnull ( tmp.face_value , 0 ) /100 as face_value , ifnull ( tmp.discount , 0 ) /10 as discount , tmp.scope , tmp.product_name , if ( egc.state = 'down' , 1 , ( case when cp.end_time is not null and cp.end_time < now ( ) then :1 when egc.limit_grant_time = :2 and egc.grant_end_time < now ( ) then :3 when tgl.put_quantity <= tgl.get_quantity then :4 else :5 end ) ) as state from coupon_service.employee_give_coupon egc inner join coupon_service.coupon_push cp on egc.template_id = cp.template_id and cp.source = :6 and egc.id = cp.source_id and cp.state = :7 inner join coupon_service.template tmp on egc.template_id = tmp.id and tmp.state = :8 inner join coupon_service.template_grant_limit tgl on cp.id = tgl.coupon_push_id where egc.tenant_app_id = :9 and ( egc.limit_grant_time = :10 or egc.grant_begin_time <= now ( ) ) and ( egc.limit_shop = :11 or exists ( select 1 from coupon_service.employee_give_coupon_shop cs where egc.id = cs.employee_give_id and cs.shop_id = :12 ) ) and egc.limit_role in ( :13 , :14 , :15 ) order by state asc , egc.id desc limit :16|1|1|1||0|0|16568|16568|2|2|
||select * from authorization_service.user_login_token where wx_user_id = :1|1|8|8||0|0|4942538|4942538|3|3|
|mysql|delete from wx_gateway.wx_template_msg where create_time < date_sub ( now ( ) , interval :1 day )|1|31|31||0|0|924190|924190|0|0|
|tenant|insert into erp_sales_detail ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_index , sales_type , product_barcode , product_name , cert_no , hand_size , category_erp_id , category_name , stone_weight , gold_weight , total_weight , quantity , amount_total , amount_pay , integral , remark ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , 0.00 , 0.00 , 0.00 , :16 ) on duplicate key update update_time = now ( ) , sales_type = :17 , product_barcode = :18 , product_name = :19 , cert_no = :20 , hand_size = :21 , category_erp_id = :22 , category_name = :23 , stone_weight = :24 , gold_weight = :25 , total_weight = :26 , quantity = :27 , amount_total = 0.00 , amount_pay = 0.00 , integral = 0.00 , remark = :28|1|1|1||0|0|0|0|0|0|
|mysql|create table user_service.tenant_member_bind ( id bigint comment 'tenant_member.id' , tenant_id bigint not null , tenant_app_id bigint not null , user_id bigint not null , wx_user_id bigint comment '微信用户id' , erp_member_id bigint comment 'erp会员id' , customer_user_id bigint comment '人脸识别顾客id' , create_time datetime default current_timestamp comment '创建时间' , update_time datetime default current_timestamp on update current_timestamp comment :1 , primary key ( tenant_id , id ) , unique uk_wx_user ( tenant_id , tenant_app_id , wx_user_id ) , unique uk_erp_member_id ( tenant_id , tenant_app_id , erp_member_id ) , unique uk_customer_id ( tenant_id , customer_user_id ) ) default charset = utf8mb4 comment = :2 partition by key ( tenant_id ) partitions :3|1|1|1||0|0|0|0|0|0|
|sms|select count ( 0 ) from ( select a.phone_numbers as phoneno , concat ( '【' , a.sign_name , '】' , case when b.content is not null then b.content when stc.content is not null then stc.content else a.template_param end ) as content , a.template_code , a.out_id as outid , a.template_param , a.create_time as sendtime , a.create_time as recevietime , a.code as state , a.send_count , a.message , a.source_type from sms_send a left join sms_template b on a.template_code = b.code left join sms_template_custom stc on a.tenant_app_id = stc.tenant_app_id and a.template_code = stc.code and stc.status = :1 where a.phone_numbers like concat ( :2 , :3 , :4 ) ) table_count|1|7|7||0|0|2229336|2229336|1|1|
|authorization_service|update user_login_token set status = :1 where user_id = :2 and tenant_id = :3 and tenant_wx_app_id = :4 and login_way = :5|1|3|3||0|0|743|743|0|0|
||select * from user_service.wx_user where open_id = :1|1|10|10||0|0|939163|939163|0|0|
||select em.id from user_service.erp_member em where em.tenant_id = :1 and length ( em.mobile_no ) = :2 order by em.id limit :3 , :4|1|1|1||0|0|565225|565225|1024|1024|
|platform|select sl.empid , sl.empname , sl.noteid , sl.noteno , sl.salesdate , sdl.productname , sdl.productbarcode , sdl.category , sdl.amount , sdl.quantity , sdl.productdesc , sdl.salestype , ifnull ( s.shopname , '' ) as shopname , v.logopath , vm.username , vm.mobileno , ifnull ( val.id , 0 ) as `valueaddedid` , ifnull ( val. no , '' ) as `valueaddedno` , ifnull ( cert.id , 0 ) as `certid` , ifnull ( cert. no , '' ) as `certno` , ifnull ( cert.certimageurl , '' ) as `certimageurl` from saleslog sl inner join salesdetaillog sdl on sl.id = sdl.slid left join shop s on sl.sid = s.id inner join vendor v on sl.vendorid = v.id inner join employee e on sl.eid = e.id inner join member m on m.id = sl.uid inner join vendormember vm on sl.vendorid = vm.vendorid and sl.memberid = vm.memberid left join valueaddedlog val on val.barcode = sdl.productbarcode and val.vendorid = sdl.vendorid left join productcerts cert on cert.barcode = sdl.productbarcode and cert.vendorid = sdl.vendorid where sdl.salestype = :1 and sl. status = :2 and sl.vendorid = :3 and sl.eid = :4 and sl.salesdate >= current_date ( ) order by sl.salesdate desc , sl.id desc limit :5 , :6|1|5|5||0|0|31923|31923|1|1|
||select count ( * ) from user_service.tenant_member_info|1|5|5||0|0|1994953|1994953|1|1|
|value_added|-- 根据添加时间得出当前增值金额 update value_added_user set amount_added = if ( :1 > ( ( ( added_percent_per_day / :2 ) * if ( :3 >= timestampdiff ( day , date_format ( start_add_time , :4 ) , now ( ) ) :5 :6 :7 add_days , timestampdiff ( day , date_format ( start_add_time , :8 ) , now ( ) ) :9 :10 , add_days ) ) :11 ( ( devalue_percent_per_day / :12 ) * if ( :13 >= timestampdiff ( day , date_format ( start_add_time , :14 ) , now ( ) ) :15 :16 :17 add_days :18 keeping_days , :19 , timestampdiff ( day , date_format ( start_add_time , :20 ) , now ( ) ) :21 :22 :23 add_days :24 keeping_days ) ) ) * amount_pay , :25 , ( ( ( added_percent_per_day / :26 ) * if ( :27 >= timestampdiff ( day , date_format ( start_add_time , :28 ) , now ( ) ) :29 :30 :31 add_days , timestampdiff ( day , date_format ( start_add_time , :32 ) , now ( ) ) :33 :34 , add_days ) ) :35 ( ( devalue_percent_per_day / :36 ) * if ( :37 >= timestampdiff ( day , date_format ( start_add_time , :38 ) , now ( ) ) :39 :40 :41 add_days :42 keeping_days , :43 , timestampdiff ( day , date_format ( start_add_time , :44 ) , now ( ) ) :45 :46 :47 add_days :48 keeping_days ) ) ) * amount_pay ) , update_time = now ( ) where state = :49 and update_time <= curdate ( ) and ( start_add_time >= date_add ( curdate ( ) , interval :50 ( add_days :51 keeping_days :52 :53 ) day ) or ( amount_added > :54 and start_add_time < date_add ( curdate ( ) , interval :55 ( add_days :56 keeping_days :57 :58 ) day ) ) ) and tenant_wechatapp_id = :59 -- 判断条件 在增值时间内 增值金大于0 状态正常|1|5|5||0|0|31987|31987|0|0|
|h5link|select id , tenant_wechatapp_id , func_id , link_url , link_text , link_image_url , detail_id , create_time , update_time from h5_link where tenant_wechatapp_id = :1 and link_url = :2|1|1|1||0|0|847|847|0|0|
|tenant|update authorization_service.user_login_token ut join user_service.tenant_member_bind tm on ut.tenant_id = tm.tenant_id and ut.tenant_wx_app_id = tm.tenant_app_id and ut.user_id = tm.user_id set ut.platform_user_id = :1 , ut.wx_user_id = tm.wx_user_id where tm.wx_user_id is not null and ut.status = :2 and ut.expire_time > now ( ) and ut.wx_user_id is null|1|25|25||0|0|4928474|4928474|0|0|
||select * from user_service.tenant_member where user_id = :1|1|11|11||0|0|2690418|2690418|19|19|
|platform|select count ( 1 ) from coupondetail where vendorid = :1 and coupontype = :2 and couponstate = :3 and to_days ( :4 ) :5 to_days ( createtime ) = :6|1|3|3||0|0|322234|322234|1|1|
||select * from user_service.erp_member em join user_service.erp_member_info emi on em.tenant_id = emi.tenant_id and em.tenant_wechatapp_id = emi.tenant_wechatapp_id and em.member_erp_id = emi.erp_member_id where em.tenant_id = :1 and length ( em.mobile_no ) = :2 limit :3 , :4|1|2|2||0|0|349481|349481|1024|1024|
|user_service|select count ( 0 ) 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 join user_service.tenant_member_info tmi on tmi.tenant_id = tm.tenant_id and tmi.id = tm.id where ue.employee_id = :1 and ue.tenant_id = :2 and ue.tenant_wechatapp_id = :3 and tmi.shop_id = :4 and ( tm.user_name like concat ( :5 , :6 , :7 ) or tm.mobile_no = :8 )|1|5|5||0|0|8511|8511|1|1|
|goods|select * from goods where id = :1 limit :2|1|5|5||0|0|1|1|1|1|
|authorization_service|insert into user_login_token ( 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 ) values ( :1 , :2 , :3 , :4 , :5 , null , :6 , :7 , :8 , :9 , :10 , :11 , null , :12 , :13 , :14 , :15 , :16 , null , ... = = ... )|1|2|2||0|0|0|0|0|0|
|account|select id from account_flow where src_tenant_app_id = :1 and src_account_id = :2 and dst_account_id = :3 and busi_type = :4 and busi_id = :5 limit :6|1|5|5||0|0|0|0|0|0|
|platform|select `vendorid` , `memberid` , `salesdate` , `noteid` , `noteno` , `empid` , `empname` , `amounttotal` , `quantitytotal` , `integraltotal` , `salesstoreid` , `staffattitude` , `professionallevel` , `appearance` , `storeimage` , `productdisplay` , `salescomment` , `commenttime` , `replycontent` , `replytime` , `replyuser` , `tipfee` , `tipmorderid` , `tippayno` , `tippaytime` , `status` , `aftersalesremark` , `uid` , `eid` , `sid` , `id` from `saleslog` where vendorid = :1 and tipfee > :2 and tippayno is not null and date_sub ( date ( :3 ) , interval :4 day ) = date_format ( tippaytime , :5 )|1|5|5||0|0|120774|120774|0|0|
||select * from user_service.erp_member em join user_service.erp_member_info emi on em.tenant_id = emi.tenant_id and em.tenant_wechatapp_id = emi.tenant_wechatapp_id and em.member_erp_id = emi.erp_member_id where em.tenant_id = :1 and length ( em.mobile_no ) = :2 order by em.employee_erp_id limit :3 , :4|1|2|2||0|0|349481|349481|1024|1024|
|gift_mail|select *from gift_mail.platform_product_desc where product_id = :1 limit :2|1|1|1||0|0|376|376|1|1|
|sms|select count ( 0 ) from ( select a.phone_numbers as phoneno , concat ( '【' , a.sign_name , '】' , case when b.content is not null then b.content when stc.content is not null then stc.content else a.template_param end ) as content , a.template_code , a.out_id as outid , a.template_param , a.create_time as sendtime , a.create_time as recevietime , a.code as state , a.send_count , a.message , a.source_type from sms_send a left join sms_template b on a.template_code = b.code left join sms_template_custom stc on a.tenant_app_id = stc.tenant_app_id and a.template_code = stc.code and stc.status = :1 where a.phone_numbers like concat ( :2 , :3 , :4 ) and a.create_time >= :5 and a.create_time < :6 ) table_count|1|18|18||0|0|2228896|2228896|1|1|
|user_service|update tenant_member_info set tenant_app_id = :1 , user_id = :2 , shop_id = :3 , birthday = :4 , birthday_is_lunar = :5 , memorial_name = :6 , memorial_day_is_lunar = :7 , grade_id = :8 , create_time = :9 , update_time = :10 where tenant_id = :11 and id = :12|1|1|1||0|0|1|1|0|0|
|coupon_service|select ifnull ( sum ( quantity ) , 0 ) from coupon_service.coupon_market_order where market_id = :1 and user_id = null and order_state = :2|1|2|2||0|0|20684|20684|1|1|
|platform|select `vendorid` , `memberid` , `salesdate` , `noteid` , `noteno` , `empid` , `empname` , `amounttotal` , `quantitytotal` , `integraltotal` , `salesstoreid` , `staffattitude` , `professionallevel` , `appearance` , `storeimage` , `productdisplay` , `salescomment` , `commenttime` , `replycontent` , `replytime` , `replyuser` , `tipfee` , `tipmorderid` , `tippayno` , `tippaytime` , `status` , `aftersalesremark` , `uid` , `eid` , `sid` , `id` from `saleslog` where vendorid = :1 and status = :2 and date_sub ( curdate ( ) , interval :3 day ) = date_format ( salesdate , :4 )|1|7|7||0|0|120774|120774|0|0|
|mysql|update user_service.tenant_member_bind t join user_service.user_relation ur on t.tenant_app_id = ur.tenant_app_id and t.user_id = ur.user_id set t.customer_user_id = ur.customer_user_id where ur.customer_user_id is not null|1|5|5||0|0|2016109|2016109|0|0|
|order|select count ( 1 ) amount from order_info where user_id = :1 and tenant_wechatapp_id = :2 and finish_type is null and status <> :3|1|1|1||0|0|0|0|1|1|
|user_service|insert into erp_integral_log ( id , tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time , busi_type , busi_id ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , 631.00 , :8 , :9 , :10 , :11 , :12 ) on duplicate key update update_time = now ( )|1|3|3||0|0|0|0|0|0|
|user_service|drop table if exists `user_service`.`_tenant_member_bind_old`|1|1|1||0|0|0|0|0|0|
|activity_service|select count ( 0 ) from activity_service.user_trace ut left join activity_service.activity at on ut.activity_id = at.id where ut.step = :1 and ut.status = :2 and ut.activity_id = :3|1|10|10||0|0|1106475|1106475|1|1|
|user_service|select scene_id , count ( * ) as quantity , scene_type from user_service.user_source where scene_type = :1 and scene_id in ( :2 ) and tenant_wechatapp_id = :3 group by scene_id|1|2|2||0|0|32083|32083|0|0|
||alter table user_service.erp_member add index idx_tenant ( tenant_id )|1|66|66||0|0|0|0|0|0|
|user_service|analyze table `user_service`.`_tenant_member_bind_new` /* pt-online-schema-change */|1|2|2||0|0|0|0|0|0|
|tenant|insert into erp_sales ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_no , sales_date , member_erp_id , employee_erp_id , employee_name , dept_erp_id , amount , sales_remark , receipts , sales_status , is_sales , busi_date ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , 132.00 , :10 , :11 , :12 , :13 , :14 ) on duplicate key update sales_date = :15 , member_erp_id = :16 , employee_erp_id = :17 , employee_name = :18 , dept_erp_id = :19 , amount = 132.00 , sales_remark = :20 , receipts = :21 , sales_status = :22 , is_sales = :23 , busi_date = :24|1|1|1||0|0|0|0|0|0|
|order|select count ( 1 ) total , ifnull ( sum ( if ( od.status > 1 , od.payment_fee , 0 ) ) , 0 ) paymentfee , ifnull ( sum ( if ( od.status > 1 , od.offline_payment_fee , 0 ) ) , 0 ) offlinepaymentfee , ifnull ( sum ( if ( od.status > 1 , od.payment_fee+od.offline_payment_fee , 0 ) ) , 0 ) 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 = :1 and od.tenant_wechatapp_id = :2|1|1|1||0|0|1296|1296|1|1|
|goods|select * from goods_take_shop where ( tenant_id = :1 and goods_id = :2 and activity_id = :3 ) order by create_time desc|1|1|1||0|0|35940|35940|6|6|
|comment_service|select c.* , cr.busi_id , cr.give_prize , cr.give_type from comment_service.comment c left join comment_service.comment_reward cr on cr.comment_id = c.id where c.id in ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 )|1|1|1||0|0|78139|78139|8|8|
|user_service|select tm.tenant_id , tm.tenant_app_id , tm.user_id , tm.mobile_no , tm.sex , tm.user_name , tm.head_img_url , tmi.birthday , tmi.birthday_is_lunar , tmi.shop_id , tmi.memorial_day_is_lunar , tmi.memorial_day , tmi.memorial_name , tmi.interest , tmi.address , tmb.erp_member_id , wu.open_id as tenantappopenid , wu.is_subscribe as issubscribe , wu.nick_name from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tm.user_id not in ( :3 ) and tm.user_id in ( :4 ) order by tm.id limit :5|1|15|15||0|0|3538212|3538212|0|0|
|warranty_service|select count ( 0 ) from warranty_service.warranty where tenant_wechatapp_id = :1 and is_disable = false and sales_date >= :2 and sales_date <= :3|1|1|1||0|0|4709|4709|1|1|
|timer|update task_info set service = :1 , name = :2 , callback = :3 , params = :4 , cron = :5 , delay = null , next_time = null , status = :6 , create_time = :7 , update_time = :8 where id = :9|1|1|1||0|0|1|1|0|0|
|mysql|insert into erp_sync.sync_record_20190924 select * from erp_sync.sync_record where create_time < date_sub ( now ( ) , interval :1 day )|1|10|10||0|0|572629|572629|0|0|
|account|insert into account_flow ( id , src_tenant_id , src_tenant_app_id , src_account_type , src_account_id , src_account_balance , dst_tenant_id , dst_tenant_app_id , dst_account_type , dst_account_id , dst_account_balance , is_platform_account , amount , busi_type , busi_id , remark , oper_type , create_time ) values ( :1 , :2 , :3 , :4 , :5 , -282017890.88 , :6 , :7 , :8 , :9 , 0.00 , :10 , :11 , :12 , :13 , :14 , :15 , :16 )|1|5|5||0|0|0|0|0|0|
|value_added|-- 增值达到最大天数 select 'value_added_limit_contact' as limitdaytype , tenant_wechatapp_id as tenantappid , user_id as userid , 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 where tenant_wechatapp_id = :1 and state = :2 and t.start_add_time >= date_add ( date_format ( :3 , :4 ) , interval :5 * ( add_days-1 ) day ) and t.start_add_time < date_add ( date_format ( :6 , :7 ) , interval ( :8 * ( add_days-1 ) :9 :10 ) day ) group by tenant_wechatapp_id , user_id|1|1|1||0|0|18149|18149|9|9|
|user_service|create trigger `pt_osc_user_service_tenant_member_info_del` after delete on `user_service`.`tenant_member_info` for each row delete ignore from `user_service`.`_tenant_member_info_new` where `user_service`.`_tenant_member_info_new`.`tenant_id` <=> old.`tenant_id` and `user_service`.`_tenant_member_info_new`.`id` <=> old.`id`|1|2|2||0|0|0|0|0|0|
|mysql|insert into user_service.tenant_member_info ( id , tenant_id , tenant_app_id , user_id , shop_id , birthday , birthday_is_lunar , address , memorial_name , memorial_day , memorial_day_is_lunar , interest , grade_id , create_time , update_time ) ( select tu.id , tu.tenant_id , tu.tenant_app_id , tu.user_id , tu.shop_id , tu.birthday , tu.birthday_is_lunar , tu.address , tu.memorial_name , tu.memorial_day , tu.memorial_day_is_lunar , tu.interest , em.grade_erp_id , tu.create_time , tu.update_time from user_service.tenant_user tu left join user_service.erp_member em on tu.tenant_id = em.tenant_id and tu.tenant_app_id = em.tenant_wechatapp_id and tu.erp_member_id = em.member_erp_id where tu.mobile_no is not null )|1|77|77||0|0|5789148|5789148|0|0|
||select count ( * ) from user_service.tenant_user where mobile_no is not null|1|2|2||0|0|1994992|1994992|1|1|
|coupon_service|select count ( 0 ) from ( select cu.id , cu.coupon_name , cu.coupon_type , cu.coupon_no , cu.source as couponchannel , cu.coupon_state , ce.user_name , ce.creator_user_name as creatorname , round ( cu.face_value/100 , 2 ) as facevalue , cu.begin_time , cu.end_time , ce.remark , ce.mobile_no , ce.creator_mobile_no , cu.create_time , wol.create_time as writeofftime , r.create_time as reservationdate , r.shop_name as reservationshopname , if ( wol.employee_id is null , wol.user_name , wol.employee_name ) writeoffusername , wol.shop_id as shopid , wol.dept_erp_id as erpdeptid from coupon_service.coupon cu join coupon_service.coupon_extend ce on ce.id = cu.id left join coupon_service.coupon_write_off_log wol on wol.tenant_app_id = cu.tenant_app_id and wol.coupon_id = cu.id and wol.state = :1 left join coupon_service.reservation r on r.coupon_user_id = cu.id and r.state = :2 where cu.tenant_app_id = :3 and cu.coupon_name like concat ( concat ( :4 , :5 ) , :6 ) and cu.coupon_state = :7 and cu.create_time >= :8 and cu.create_time <= :9 and cu.template_id = :10 and cu.source = :11 ) tmp_count|1|1|1||0|0|2878|2878|1|1|
|platform|select `empcode` , `empname` , `empdesc` , `picpath` , `fileresid` , `sex` , `age` , `workhours` , `duty` , `status` , `createtime` , `updatetime` , `updateuser` , `mobileno` , `vendorid` , `vendorshopid` , `accountid` , `account` , `vendorempid` , `uid` , `id` from `employee` where `vendorid` = :1 and `mobileno` = :2|1|3|3||0|0|9743|9743|0|0|
|user_service|select tm.user_id as userid , tm.head_img_url as headimgurl , tm.user_name as nickname , tm.mobile_no as mobileno , tm.sex , date_format ( tm.create_time , '%y-%m-%d%h:%i:%s' ) as registertime , tm.id as tenantuserid from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id left join user_service.user_employee t3 on tm.user_id = t3.user_id and tm.tenant_id = t3.tenant_id and tm.tenant_app_id = t3.tenant_wechatapp_id where t3.id is null and tmi.shop_id = :1 and tmi.tenant_id = :2 and tmi.tenant_app_id = :3 order by tm.id asc limit :4|1|2|2||0|0|28227|28227|8|8|
|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-1 day ) , date_add ( start_add_time , interval add_days + keeping_days-1 day ) from value_added_user where keeping_days > :1 and state = :2 and start_add_time = date_add ( curdate ( ) , interval :3 * ( add_days-1 ) day )|1|1|1||0|0|325232|325232|609|609|
|mysql|alter table authorization_service.user_login_token add column platform_user_id bigint default 0 comment '平台用户id' after id , add column wx_user_id bigint default 0 comment '微信用户id' after user_id|1|225|225||0|0|0|0|0|0|
|account|update account set balance = -11415412.00 , platform_balance = 0.00 , cumulation = 726003.00 where balance = -11414154.00 and platform_balance = 0.00 and cumulation = 726003.00 and id = :1|1|3|3||0|0|1|1|0|0|
|mysql|alter table authorization_service.user_login_token add index idx_wx_user ( tenant_id , tenant_wx_app_id , status , wx_user_id ) , add index idx_user ( tenant_id , tenant_wx_app_id , status , user_id ) , add index idx_platform_user ( tenant_id , tenant_wx_app_id , status , platform_user_id )|1|214|214||0|0|0|0|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 = :1 and id = :2|1|1|1||0|0|1|1|1|1|
|corpwx|select id , tenant_id , cwx_user_id , user_id , union_id , name , create_time , update_time , sex , avatar , tenant_user_id , un_assign_flag , corp_user_id , wx_user_id from external_user where ( tenant_id = :1 and un_assign_flag = :2 and wx_user_id = :3 )|1|1|1||0|0|5118|5118|12|12|
||select * from user_service.tenant_member where tenant_id = :1 and mobile_no = :2|1|12|12||0|0|235627|235627|1|1|
|mysql|alter table corpwx.external_user add wx_user_id bigint default 0 null|1|3|3||0|0|0|0|0|0|
|tenant|insert into erp_sales_detail ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_index , sales_type , product_barcode , product_name , cert_no , hand_size , category_erp_id , category_name , stone_weight , gold_weight , total_weight , quantity , amount_total , amount_pay , integral , remark ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , 1300.00 , 1300.00 , 1300.00 , :16 ) on duplicate key update update_time = now ( ) , sales_type = :17 , product_barcode = :18 , product_name = :19 , cert_no = :20 , hand_size = :21 , category_erp_id = :22 , category_name = :23 , stone_weight = :24 , gold_weight = :25 , total_weight = :26 , quantity = :27 , amount_total = 1300.00 , amount_pay = 1300.00 , integral = 1300.00 , remark = :28|1|1|1||0|0|0|0|0|0|
||select if ( count ( distinct tenant_id , tenant_app_id , user_id ) = count ( * ) , 'yes,thedesireduniqueindexcurrentlycontainsonlyuniquevalues' , 'no,thedesireduniqueindexcontainsduplicatedvalues.therewillbedataloss' ) as isthereuniqueness from `user_service`.`tenant_member_info`|1|3|3||0|0|2624323|2624323|1|1|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 )|1|1|1||0|0|121769|121769|8|8|
|coupon_service|select count ( 0 ) from coupon_service.template where tenant_app_id = :1 and coupon_name like concat ( :2 , :3 , :4 )|1|1|1||0|0|6613|6613|1|1|
|gift_mail|select p.* , sp.take_type , sp.lead_day , ifnull ( sp.price , ifnull ( pp.integral_price , 0 ) ) price , pp.can_get_per_day , c.categroy_name categroy_name , part.partner_name vendorname from product p left join self_product sp on p.id = sp.id left join partner_product pp on p.id = pp.id inner join category c on c.id = p.category_id left join partner part on part.id = pp.partner_id where p.id in ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 , :31 , :32 , :33 , :34 , :35 , :36 , :37 , :38 , :39 , :40 , :41 , :42 , :43 , :44 , :45 ) and ( p.is_disable is null or p.is_disable = :46 )|1|1|1||0|0|225|225|45|45|
|user_service|analyze table `user_service`.`_tenant_member_info_new` /* pt-online-schema-change */|1|2|2||0|0|0|0|0|0|
|value_added|-- 根据添加时间得出当前增值金额 update value_added_user set amount_added = if ( :1 > ( ( ( added_percent_per_day / :2 ) * if ( :3 >= timestampdiff ( day , date_format ( start_add_time , :4 ) , now ( ) ) :5 :6 :7 add_days , timestampdiff ( day , date_format ( start_add_time , :8 ) , now ( ) ) :9 :10 , add_days ) ) :11 ( ( devalue_percent_per_day / :12 ) * if ( :13 >= timestampdiff ( day , date_format ( start_add_time , :14 ) , now ( ) ) :15 :16 :17 add_days :18 keeping_days , :19 , timestampdiff ( day , date_format ( start_add_time , :20 ) , now ( ) ) :21 :22 :23 add_days :24 keeping_days ) ) ) * amount_pay , :25 , ( ( ( added_percent_per_day / :26 ) * if ( :27 >= timestampdiff ( day , date_format ( start_add_time , :28 ) , now ( ) ) :29 :30 :31 add_days , timestampdiff ( day , date_format ( start_add_time , :32 ) , now ( ) ) :33 :34 , add_days ) ) :35 ( ( devalue_percent_per_day / :36 ) * if ( :37 >= timestampdiff ( day , date_format ( start_add_time , :38 ) , now ( ) ) :39 :40 :41 add_days :42 keeping_days , :43 , timestampdiff ( day , date_format ( start_add_time , :44 ) , now ( ) ) :45 :46 :47 add_days :48 keeping_days ) ) ) * amount_pay ) , update_time = now ( ) where state = :49 and update_time <= curdate ( ) and ( start_add_time >= date_add ( curdate ( ) , interval :50 ( add_days :51 keeping_days :52 :53 ) day ) or ( amount_added > :54 and start_add_time < date_add ( curdate ( ) , interval :55 ( add_days :56 keeping_days :57 :58 ) day ) ) ) -- 判断条件 在增值时间内 增值金大于0 状态正常|1|2|2||0|0|325223|325223|0|0|
|authorization_service|select r.* , ( select count ( * ) from authorization_service.account a join authorization_service.account_role2 ar on a.id = ar.account_id where ( ar.tenant_id = :1 or :2 = :3 ) and ( ar.tenant_app_id = :4 or :5 = :6 ) and ar.role_code = r.role_code ) as count from authorization_service.role r where :7 = :8 order by field ( r.role_code , 'system' , 'admin' , 'financial' , 'tenant_admin' , 'tenant_operation' , 'tenant_wechatapp_admin' , 'tenant_wechatapp_operation' , 'tenant_shop_manager' , 'tenant_sales' )|1|2|2||0|0|112941|112941|7|7|
|goods|select shop_id from goods.goods_take_shop where goods_id = :1 and activity_id = :2|1|1|1||0|0|35934|35934|6|6|
|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 = :1 and t.tenant_id = :2 and t.tenant_app_id = :3 and ( t.scope = :4 or ( s.scope = :5 and s.product_id = :6 ) or ( s.scope = :7 and s.classify_id = :8 ) )|1|1|1||0|0|6613|6613|0|0|
|timer|insert into task_execute_log ( id , task_id , task_name , task_params , success , error_msg , create_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 )|1|1|1||0|0|0|0|0|0|
|erp_sync|insert into sync_record ( id , tenant_id , tenant_app_id , data_id , business_type , operate_type , user_id , erp_member_id , data , send_time , create_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 )|1|1|1||0|0|0|0|0|0|
|user_service|insert into erp_integral_log ( id , tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time , busi_type , busi_id ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , 1300.00 , :8 , :9 , :10 , :11 , :12 ) on duplicate key update update_time = now ( )|1|1|1||0|0|0|0|0|0|
|account|update account set balance = -1508147.00 , platform_balance = 0.00 , cumulation = 496404.00 where balance = -1508132.00 and platform_balance = 0.00 and cumulation = 496404.00 and id = :1|1|5|5||0|0|1|1|0|0|
|message_push|insert into message_log ( id , tenant_id , tenant_app_id , user_id , scene_type , post_data , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , ... = 969362574963437568#/member/shopping_record","data":{"keyword5":{"value":"qtxsd-0009-00032264","color":"#000066"},"keyword3":{"value":"1724.40","color":"#000066"},"keyword4":{"value":"2020-04-26","color":"#000066"},"keyword1":{"value":"老凤祥银楼","color":"#000066"},"keyword2":{"value":"足金999手链 , 黄金旧料","color":"#000066"},"remark":{"value":"点击“详情”查看消费明细","color":"#ff3399"},"first":{"value":"感谢惠顾！","color":"#000000"}},"appid":null,"pagepath":null}' , :6 , :7 )|1|1|1||0|0|0|0|0|0|
|sms|select a.phone_numbers as phoneno , concat ( '【' , a.sign_name , '】' , case when b.content is not null then b.content when stc.content is not null then stc.content else a.template_param end ) as content , a.template_code , a.out_id as outid , a.template_param , a.create_time as sendtime , a.create_time as recevietime , a.code as state , a.send_count , a.message , a.source_type from sms_send a left join sms_template b on a.template_code = b.code left join sms_template_custom stc on a.tenant_app_id = stc.tenant_app_id and a.template_code = stc.code and stc.status = :1 where a.phone_numbers like concat ( :2 , :3 , :4 ) and a.create_time >= :5 and a.create_time < :6 order by a.create_time desc limit :7|1|2|2||0|0|2228909|2228909|9|9|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 )|1|2|2||0|0|32510|32510|8|8|
|user_service|update user_service.tenant_member_bind set wx_user_id = null where tenant_id = :1 and tenant_app_id = :2 and erp_member_id = :3|1|2|2||0|0|0|0|0|0|
|timer|update task_info set service = :1 , name = :2 , callback = :3 , params = :4 , cron = :5 , delay = null , next_time = :6 , status = :7 , create_time = :8 , update_time = :9 where id = :10|1|3|3||0|0|1|1|0|0|
|user_service|update tenant_member_info set tenant_app_id = :1 , user_id = :2 , shop_id = :3 , birthday_is_lunar = :4 , memorial_name = :5 , memorial_day_is_lunar = :6 , grade_id = :7 , create_time = :8 , update_time = :9 where tenant_id = :10 and id = :11|1|4|4||0|0|1|1|0|0|
|tenant|select id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_index , sales_type , product_barcode , product_name , cert_no , hand_size , category_erp_id , category_name , stone_weight , gold_weight , total_weight , quantity , amount_total , amount_pay , integral , remark , create_time , update_time from erp_sales_detail where sales_erp_id = :1 and tenant_wechatapp_id = :2|1|1|1||0|0|2|2|2|2|
|warranty_service|insert into warranty ( id , tenant_wechatapp_id , user_id , erp_sales_id , warranty_no , is_disable , warranty_data , update_employee_id , employee_erp_id , dept_erp_id , sales_no , sales_date ) values ( :1 , :2 , :3 , :4 , :5 , :6 , ... 中行2819：10653.00","userid":"827657681916432384","amount":10653,"detail":[{"id":"477929656579548341","saleserpid":"751592","salestype":"销售","productbarcode":"051267732","productname":"足金项链","certno":"000162","categoryname":"硬足金类","totalweight":"25.18g","stoneweight":"0.000","goldweight":"25.18g","remark":"","quantity":1,"amounttotal":13471,"imgurls":["https://api.weixin.qq.com/cgi-bin/media/get?access_token = 32_snfueuacvssd7fu63thtvce_b8h-bowrg_-0vpf__vpyaenxi-cyt3bso6esp5l5nawokqn9anta3wjfxvkrjt9hybpxvirzniw4-hxyzwv_yuftnhavv9-_nbxlk74drvvkdw9tpeeeyjiqpxsjaldaid&media_id = a8t0dfgp0py4nbp4dythgzrz8vmqwaahq5qfwbs4q7mkghe2egkuufaancv5hgsu"],"serverids":["a8t0dfgp0py4nbp4dythgzrz8vmqwaahq5qfwbs4q7mkghe2egkuufaancv5hgsu"]},{"id":"477929656579548342","saleserpid":"751592","salestype":"旧货建档","productbarcode":"051377798_jh1","productname":"足金金粒","certno":"000093","categoryname":"硬|1|2|2||0|0|0|0|0|0|
|tenant|select count ( 0 ) from tenant.erp_sales es left join tenant.tenant_wechatapp_shop shop on shop.tenant_wechatapp_id = es.tenant_wechatapp_id and shop.dept_erp_id = es.dept_erp_id join tenant.employee e on e.tenant_id = es.tenant_id and e.employee_erp_id = es.employee_erp_id join tenant.employee_shop esh on esh.tenant_app_id = es.tenant_wechatapp_id and esh.employee_id = e.id and esh.dept_erp_id = es.dept_erp_id where es.tenant_wechatapp_id = :1 and es.sales_status = :2|1|4|4||0|0|1135945|1135945|1|1|
|user_service|select tenant_id , id , tenant_app_id , user_id , wx_user_id , erp_member_id , customer_user_id , create_time , update_time from tenant_member_bind where tenant_id = :1 and id = :2|1|1|1||0|0|1|1|1|1|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 )|1|1|1||0|0|9816|9816|11|11|
|platform|select `empcode` , `empname` , `empdesc` , `picpath` , `fileresid` , `sex` , `age` , `workhours` , `duty` , `status` , `createtime` , `updatetime` , `updateuser` , `mobileno` , `vendorid` , `vendorshopid` , `accountid` , `account` , `vendorempid` , `uid` , `id` from `employee` where `vendorid` = :1 and `vendorempid` = :2|1|1|1||0|0|9743|9743|1|1|
|user_service|rename table `user_service`.`tenant_member_info` to `user_service`.`_tenant_member_info_old` , `user_service`.`_tenant_member_info_new` to `user_service`.`tenant_member_info`|1|9|9||0|0|0|0|0|0|
|platform|select count ( 1 ) from `smssent` where vendorid = :1 and success = true and date_sub ( date ( :2 ) , interval :3 day ) = date_format ( senttime , :4 )|1|2|2||0|0|66068|66068|1|1|
|gift_mail|select id , tenant_wechatapp_id , shop_id , shop_name , product_id , create_time , update_time from take_shop where product_id = :1|1|1|1||0|0|13737|13737|21|21|
|basepublish|select * from publish_item order by id desc|1|1|1||0|0|1597|1597|1597|1597|
|gift_mail|select count ( 0 ) 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 = 3 , pl.id , it.barcode ) as barcode , if ( t.trade_type = 3 or t.trade_type = :1 , 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 where ( t.tenant_wechatapp_id = :2 and t.trade_type in ( :3 , :4 ) ) order by create_time desc ) tmp_count|1|1|1||0|0|0|0|1|1|
|platform|select s.* , ifnull ( pc.certsquantity , 0 ) as certsquantity , ifnull ( va.addvaluequantity , 0 ) as addvaluequantity from ( /*昨天的销售记录*/ select eid , vendorid , sid , count ( 1 ) as salesquantity from saleslog sl where vendorid = :1 and to_days ( :2 ) :3 to_days ( salesdate ) = :4 group by eid , vendorid , sid ) s left join ( /*昨天质保单*/ select eid , count ( 1 ) as certsquantity from productcerts where vendorid = :5 and to_days ( :6 ) :7 to_days ( createtime ) = :8 group by eid ) pc on s.eid = pc.eid left join ( /*昨天的增值计划*/ select empid ,|1|2|2||0|0|47925|47925|0|0|
|coupon_service|select count ( 0 ) from ( select cu.id , cu.coupon_name , cu.coupon_type , cu.coupon_no , cu.source as couponchannel , cu.coupon_state , ce.user_name , ce.creator_user_name as creatorname , round ( cu.face_value/100 , 2 ) as facevalue , cu.begin_time , cu.end_time , ce.remark , ce.mobile_no , ce.creator_mobile_no , cu.create_time , wol.create_time as writeofftime , r.create_time as reservationdate , r.shop_name as reservationshopname , if ( wol.employee_id is null , wol.user_name , wol.employee_name ) writeoffusername , wol.shop_id as shopid , wol.dept_erp_id as erpdeptid from coupon_service.coupon cu join coupon_service.coupon_extend ce on ce.id = cu.id left join coupon_service.coupon_write_off_log wol on wol.tenant_app_id = cu.tenant_app_id and wol.coupon_id = cu.id and wol.state = :1 left join coupon_service.reservation r on r.coupon_user_id = cu.id and r.state = :2 where cu.tenant_app_id = :3 and cu.coupon_name like concat ( concat ( :4 , :5 ) , :6 ) and cu.coupon_state = :7 and cu.template_id = :8 and cu.source = :9 ) tmp_count|1|1|1||0|0|12676|12676|1|1|
|gift_mail|select * from ( select p.id , p.default_image_url , p.product_name , p.product_type , p.tag_price , ifnull ( pp.integral_price , ifnull ( ( select min ( inventory.price ) from gift_mail.inventory where inventory.product_id = p.id ) , :1 ) ) as price , p.volume , p.category_id , p.product_status , :2 as quantity , pp.partner_id as partner_id from gift_mail.product p left join gift_mail.partner_product pp on p.id = pp.product_id left join gift_mail.product_status ps on ps.product_id = p.id where p.tenant_id = :3 and product_status = :4 and ( p.is_disable is null or p.is_disable = :5 ) and ( ps.tenant_wechatapp_id = :6 or p.product_type = :7 ) union all select pp.id , pp.default_image_url , pp.product_name , 3 as product_type , pi.market_price as tag_price , round ( pp.tag_price*300 , 0 ) as price , pi.volume , 0 as category_id , pp.product_status , pi.quantity , 0 as partner_id from gift_mail.platform_recommend_product prp join gift_mail.platform_product pp on pp.id = prp.platform_product_id join gift_mail.platform_inventory pi on pi.product_id = pp.id where prp.is_recommend = true and tenant_app_id = :8 and pp.product_status = :9 ) as p order by p.volume desc , p.id desc limit :10 , :11|1|1|1||0|0|7505|7505|6|6|
|position|select * from geo_position where tenant_id = :1 and tenant_app_id = :2 and object_type = :3 and object_id = :4|1|4|4||0|0|1|1|1|1|
|customer|insert into customer_face_pass ( id , msg_id , tenant_id , tenant_wechatapp_id , shop_id , enter_shop_time , photo_url , sex , age , is_checkin , person_ids , repeats ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 )|1|7|7||0|0|0|0|0|0|
|tenant|delete etu from tenant.employee_tenant_user etu join tenant.employee e on etu.employee_id = e.id join user_service.tenant_user tu on etu.tenant_app_id = tu.tenant_app_id and etu.user_id = tu.user_id where e.status = :1 and e.mobile_no != tu.mobile_no|1|3|3||0|0|38599|38599|0|0|
|coupon_service|select * from coupon_user where datediff ( date_format ( end_time , :1 ) , date_format ( now ( ) , :2 ) ) = :3 and coupon_state in ( :4 )|1|15|15||0|0|55246|55246|0|0|
|sms|select a.phone_numbers as phoneno , concat ( '【' , a.sign_name , '】' , case when b.content is not null then b.content when stc.content is not null then stc.content else a.template_param end ) as content , a.template_code , a.out_id as outid , a.template_param , a.create_time as sendtime , a.create_time as recevietime , a.code as state , a.send_count , a.message , a.source_type from sms_send a left join sms_template b on a.template_code = b.code left join sms_template_custom stc on a.tenant_app_id = stc.tenant_app_id and a.template_code = stc.code and stc.status = :1 where a.phone_numbers like concat ( :2 , :3 , :4 ) order by a.create_time desc limit :5|1|2|2||0|0|2229339|2229339|1|1|
|platform|select getuid , count ( id ) as qty from ( select * from coupondetail where couponstate = :1 and vendorid = :2 and month ( expirytime ) = month ( date_sub ( curdate ( ) , interval :3 day ) ) and day ( expirytime ) = day ( date_sub ( curdate ( ) , interval :4 day ) ) ) as t group by getuid|1|1|1||0|0|322234|322234|0|0|
|value_added|-- 根据模板id查订单数量 select count ( * ) from value_added_user where template_id = :1 and state != :2|1|1|1||0|0|325700|325700|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.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.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 = :1 and od.tenant_wechatapp_id = :2 and ( od.mobile_no = :3 or ad.mobile_no = :4 ) order by od.create_time desc limit :5|1|1|1||0|0|1296|1296|1|1|
|corpwx|select id , tenant_id , corp_user_id , cwx_user_id , scene_type , state , qr_code , config_id from contact_me where ( tenant_id = :1 and cwx_user_id = :2 and state = :3 and scene_type = :4 )|1|4|4||0|0|1|1|1|1|
|order|select id , type , operator_type operatortype , operator_result operatorresult , reason_label reasonlabel , reason_value reasonvalue , remark , create_time createtime , status from order_service_log where order_id = :1 order by create_time desc|1|2|2||0|0|8451|8451|0|0|
|tenant|update erp_sales set sales_status = :1 where tenant_wechatapp_id = :2 and sales_erp_id = :3 and sales_no = :4|1|1|1||0|0|1|1|0|0|
|coupon_service|select count ( 0 ) from ( select egc.id , tmp.coupon_name , tmp.coupon_type , tmp.remark , cp.take_effect_way , cp.take_start_day , cp.take_effect_day , date_format ( cp.begin_time , '%y-%m-%d' ) as begin_time , date_format ( cp.end_time , '%y-%m-%d' ) as end_time , egc.limit_grant_time , date_format ( egc.grant_begin_time , '%y-%m-%d' ) as grant_begin_time , date_format ( egc.grant_end_time , '%y-%m-%d' ) as grant_end_time , ifnull ( tmp.face_value , 0 ) /100 as face_value , ifnull ( tmp.discount , 0 ) /10 as discount , tmp.scope , tmp.product_name , if ( egc.state = 'down' , 1 , ( case when cp.end_time is not null and cp.end_time < now ( ) then :1 when egc.limit_grant_time = :2 and egc.grant_end_time < now ( ) then :3 when tgl.put_quantity <= tgl.get_quantity then :4 else :5 end ) ) as state from coupon_service.employee_give_coupon egc inner join coupon_service.coupon_push cp on egc.template_id = cp.template_id and cp.source = :6 and egc.id = cp.source_id and cp.state = :7 inner join coupon_service.template tmp on egc.template_id = tmp.id and tmp.state = :8 inner join coupon_service.template_grant_limit tgl on cp.id = tgl.coupon_push_id where egc.tenant_app_id = :9 and ( egc.limit_grant_time = :10 or egc.grant_begin_time <= now ( ) ) and ( egc.limit_shop = :11 or exists ( select 1 from coupon_service.employee_give_coupon_shop cs where egc.id = cs.employee_give_id and cs.shop_id = :12 ) ) and egc.limit_role in ( :13 , :14 , :15 ) order by state asc , egc.id desc ) tmp_count|1|1|1||0|0|16564|16564|1|1|
|order|select * from user_service.tenant_member where mobile_no = :1|1|7|7||0|0|110286|110286|0|0|
|user_service|update user_service.user_employee set employee_id = :1 , employee_erp_id = :2 , create_time = now ( ) , update_time = now ( ) where tenant_wechatapp_id = :3 and user_id in ( :4 , :5 , :6 , :7 ) and employee_id = :8|1|5|5||0|0|4|4|0|0|
|user_service|update tenant_member set tenant_app_id = :1 , user_id = :2 , mobile_no = :3 , user_name = :4 , head_img_url = :5 , sex = :6 , status = :7 , create_time = :8 , update_time = :9 where tenant_id = :10 and id = :11|1|6|6||0|0|1|1|0|0|
|user_service|select tmb.erp_member_id as member_erp_id , tm.tenant_id , tm.tenant_app_id , tm.mobile_no , tm.user_name , tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 )|1|1|1||0|0|42792|42792|13|13|
|user_service|drop table if exists `user_service`.`_erp_member_old`|1|4|4||0|0|0|0|0|0|
|tenant|select esd.id , esd.sales_erp_id , es.employee_name , esd.product_barcode , es.sales_no , es.member_erp_id , esd.category_name , es.sales_date , esd.category_erp_id , esd.product_name , esd.cert_no , esd.amount_pay , esd.sales_index from erp_sales_detail esd join erp_sales es on es.tenant_wechatapp_id = esd.tenant_wechatapp_id and es.sales_erp_id = esd.sales_erp_id where es.sales_status = :1 and es.tenant_wechatapp_id = :2 and esd.product_barcode = :3 order by es.sales_date desc|1|4|4||0|0|1560|1560|384|384|
||select c.constraint_name , c.table_name , c.constraint_type , group_concat ( replace ( replace ( u.column_name , '\\' , '\\\\' ) , '' , '\' ) order by u.ordinal_position separator '' ) as column_names , u.referenced_table_schema , u.referenced_table_name , group_concat ( replace ( replace ( u.referenced_column_name , '\\' , '\\\\' ) , '' , '\' ) order by u.position_in_unique_constraint separator '' ) as ref_column_names , r.match_option , r.update_rule , r.delete_rule from information_schema.table_constraints c left join information_schema.key_column_usage u on u.constraint_schema = c.constraint_schema and u.constraint_name = c.constraint_name and u.table_name = c.table_name and u.table_schema = :1 and if ( c.constraint_type collate utf8_general_ci /* c.constraint_type */ = :2 , u.referenced_table_name is null , true ) left join information_schema.referential_constraints r on r.constraint_schema = c.constraint_schema and r.constraint_name = c.constraint_name where c.table_schema = :3 and u.table_schema = :4 group by c.constraint_schema , c.constraint_name , c.table_schema , c.table_name , c.constraint_type , u.referenced_table_schema , u.referenced_table_name , r.match_option , r.update_rule , r.delete_rule order by c.table_schema , c.table_name , c.constraint_schema , c.constraint_name|1|1|1||0|0|145|145|21|21|
|user_service|select tm.tenant_id , tm.tenant_app_id , tm.user_id , tm.mobile_no , tm.sex , tm.user_name , tm.head_img_url , tmi.birthday , tmi.birthday_is_lunar , tmi.shop_id , tmi.memorial_day_is_lunar , tmi.memorial_day , tmi.memorial_name , tmi.interest , tmi.address , tmb.erp_member_id , wu.open_id as tenantappopenid , wu.is_subscribe as issubscribe , wu.nick_name from user_service.tenant_member tm join user_service.tenant_member_info tmi on tm.id = tmi.id left join user_service.tenant_member_bind tmb on tm.id = tmb.id left join user_service.wx_user wu on tmb.wx_user_id = wu.id where tm.tenant_id = :1 and tm.tenant_app_id = :2 and ( tm.user_name like concat ( :3 , :4 , :5 ) or tm.mobile_no = :6 or wu.nick_name like concat ( :7 , :8 , :9 ) ) and tm.user_id not in ( :10 ) and tm.user_id in ( :11 ) order by tm.id limit :12|1|15|15||0|0|5085570|5085570|1|1|
|mysql|insert into user_service.tenant_member ( id , tenant_id , tenant_app_id , user_id , mobile_no , user_name , head_img_url , sex , create_time , update_time ) ( select tu.id , tu.tenant_id , tu.tenant_app_id , tu.user_id , tu.mobile_no , tu.user_name , tu.head_img_url , tu.sex , tu.create_time , tu.update_time from user_service.tenant_user tu where mobile_no is not null )|1|78|78||0|0|3794195|3794195|0|0|
|tenant|update authorization_service.user_login_token ut join user_service.platform_user pu on ut.user_id = pu.id set ut.platform_user_id = pu.id where ut.status = :1 and ut.expire_time > now ( ) and ut.platform_user_id is null|1|8|8||0|0|4928474|4928474|0|0|
