|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|employee|select count ( 0 ) from employee.backlog bg inner join employee.employee el on bg.tenant_app_id = el.tenant_app_id and bg.user_id = el.user_id where bg.tenant_app_id = :1 and bg.leave_flag = :2 and el.shop_id = :3|1|2|2||0|0|94677|94677|1|1|
|user_service|select tenantuser.* , user.nick_name from tenant_user tenantuser join user_service.user user on tenantuser.user_id = user.id where ( tenantuser.tenant_id = :1 and tenantuser.tenant_app_id = :2 and tenantuser.user_id not in ( :3 ) ) order by tenantuser.user_id asc limit :4|1|3|3||0|0|150167|150167|8|8|
|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|1|1|1||0|0|13604|13604|0|0|
|warranty_service|select count ( 0 ) from warranty_service.warranty where tenant_wechatapp_id = :1 and is_disable = false and dept_erp_id = :2 and sales_date >= :3 and sales_date <= :4 and employee_erp_id in ( :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 , :54 , :55 , :56 , :57 , :58 , :59 , :60 , :61 , :62 , :63 , :64 , :65 , :66 , :67 , :68 , :69 , :70 , :71 , :72 , :73 , :74 , :75 , :76 , :77 , :78 , :79 , :80 , :81 , :82 , :83 , :84 , :85 , :86 , :87 , :88 , :89 , :90 , :91 , :92 , :93 , :94 , :95 , :96 , :97 , :98 , :99 , :100 , :101 , :102 , :103 , :104 , :105 , :106 , :107 , :108 , :109 , :110 , :111 , :112 , :113 , :114 , :115 , :116 , :117 , :118 , :119 , :120 , :121 , :122 , :123 , :124 , :125 , :126 , :127 , :128 , :129 , :130 , :131 , :132 , :133 , :134 , :135 , :136 , :137 , :138 , :139 , :140 , :141 , :142 , :143 , :144 , :145 , :146 , :147 , :148 , :149 , :150 , :151 , :152 , :153 , :154 , :155 , :156 , :157 , :158 , :159 , :160 , :161 , :162 , :163 , :164 , :165 , :166 , :167 , :168 , :169 , :170 , :171 , :172 , :173 , :174 , :175 , :176 , :177 , :178 , :179 , :180 , :181 , :182 , :183 , :184 , :185 , :186 , :187 , :188 , :189 , :190 , :191 , :192 , :193 , :194 , :195 , :196 , :197 , :198 , :199 , :200 , :201 , :202 , :203 , :204 , :205 , :206 , :207 , :208 , :209 , :210 , :211 , :212 , :213 , :214 , :215 , :216 , :217 , :218 , :219 , :220 , :221 , :222 , :223 , :224 , :225 , :226 , :227 , :228 , :229 , :230 , :231 , :232 , :233 , :234 , :235 , :236 , :237 , :238 , :239 , :240 , :241 , :242 , :243 , :244 , :245 , :246 , :247 )|1|8|8||0|0|66109|66109|1|1|
|activity_service|select assist_task_activity_id as id , count ( distinct user_id ) as partakenum , sum ( if ( partake_type = 'appoint' and status = :1 , :2 , :3 ) ) as appointnum , sum ( if ( partake_type = :4 , :5 , :6 ) ) as applynum , sum ( if ( partake_type = :7 and status >= :8 , :9 , :10 ) ) as finishnum from assist_task_user where assist_task_activity_id in ( :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 ) group by assist_task_activity_id|1|2|2||0|0|369457|369457|17|17|
||/* applicationname = intellij idea 2019.1 */ select * from user_service.tenant_user where mobile_no is not null and erp_member_id is null and shop_id is not null|1|4|4||0|0|1511510|1511510|131|131|
||/* applicationname = intellij idea 2019.1 */ select id from user_service.tenant_user where mobile_no is not null and erp_member_id is null|1|4|4||0|0|1511796|1511796|436|436|
|user_service|select count ( 0 ) from tenant_user tu join user u on u.id = tu.user_id where tu.tenant_id = :1 and ( tu.user_name like concat ( :2 , :3 , :4 ) or tu.mobile_no = :5 or u.nick_name like concat ( :6 , :7 , :8 ) ) and tenant_app_id = :9|1|2|2||0|0|212410|212410|1|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|1|1|1||0|0|19920|19920|10|10|
|platform|select * from ( select * from coupondetail where getuid = :1 and ( couponstate = :2 or couponstate = :3 ) and expirytime >= now ( ) ) as tv limit :4 , :5|1|2|2||0|0|318771|318771|0|0|
||/* applicationname = intellij idea 2019.1 */ select tu.tenant_app_id , tu.mobile_no , em.dept_erp_id , s.id from user_service.tenant_user tu 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 left join tenant.tenant_wechatapp_shop s on s.tenant_id = em.tenant_id and s.tenant_wechatapp_id = em.tenant_wechatapp_id and s.dept_erp_id = em.dept_erp_id where tu.mobile_no is not null and shop_id is null|1|13|13||0|0|1228778|1228778|291|291|
||/* applicationname = intellij idea 2019.1 */ select id , bind_time from user_service.tenant_user where mobile_no is not null and erp_member_id is null|1|3|3||0|0|1511796|1511796|436|436|
|user_service|select count ( * ) from tenant_user where tenant_app_id = :1 and shop_id = :2 and mobile_no is not null and mobile_no != :3|1|3|3||0|0|106205|106205|1|1|
|activity_service|select t1.user_id as userid , t2.user_name as username , t2.data as userheadimg , ifnull ( t1.finished_time , t1.update_time ) as time , t1.cutdown_amount as cutdownamount , t2.partake_data as partakedata from activity_service.cutdown_price_activity_apply t1 join activity_service.user_trace t2 on t1.id = t2.user_apply_id and t2.step = :1 where t1.activity_id = :2|1|1|1||0|0|22313|22313|2976|2976|
|employee|select count ( 0 ) from employee.backlog bg inner join employee.employee el on bg.tenant_app_id = el.tenant_app_id and bg.user_id = el.user_id where bg.tenant_app_id = :1 and bg.leave_flag = :2 and el.shop_id = :3 and bg.status in ( :4 , :5 , :6 )|1|1|1||0|0|94389|94389|1|1|
||/* applicationname = datagrip 2018.2.2 */ select distinct tenant_app_id from user_service.tenant_user where mobile_no is not null and shop_id is null order by bind_time desc|1|7|7||0|0|2739407|2739407|68|68|
|employee|update backlog set employee_id = :1 , user_id = :2 where ( employee_id = :3 and tenant_app_id = :4 and status in ( :5 , :6 ) )|1|1|1||0|0|27808|27808|0|0|
|employee|select bg.id , bg.user_id , el.employee_name user_name , el.mobile mobileno , el.shop_name , bg.scene , bg.status , bg.create_time , bg.begin_time , bg.expire_time , bg.member_user_name , bg.mobile_no member_mobile_no from employee.backlog bg inner join employee.employee el on bg.tenant_app_id = el.tenant_app_id and bg.user_id = el.user_id where bg.tenant_app_id = :1 and bg.leave_flag = :2 and bg.expire_time between :3 and :4 and bg.scene = :5 order by id desc limit :6|1|1|1||0|0|49739|49739|20|20|
|activity_service|select count ( distinct ( user_id ) ) from user_trace where tenant_app_id = :1 and activity_id = :2 and status != :3|1|1|1||0|0|19337|19337|1|1|
||/* applicationname = datagrip 2018.2.2 */ select * from user_service.tenant_user where mobile_no is not null and shop_id is null|1|17|17||0|0|603009|603009|502|502|
|warranty_service|select count ( 0 ) from warranty_service.warranty where tenant_wechatapp_id = :1 and is_disable = false and dept_erp_id = :2 and sales_date >= :3 and sales_date <= :4 and employee_erp_id in ( :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 , :54 , :55 , :56 , :57 , :58 , :59 , :60 , :61 , :62 , :63 , :64 , :65 , :66 , :67 , :68 , :69 , :70 , :71 , :72 , :73 , :74 , :75 , :76 , :77 , :78 , :79 , :80 , :81 , :82 , :83 , :84 , :85 , :86 , :87 , :88 )|1|4|4||0|0|17375|17375|1|1|
|user_service|select t1.erp_member_id as membererpid , t2.head_img_url as headimgurl , t2.nick_name as nickname , t1.mobile_no as mobileno , date_format ( t1.bind_time , '%y-%m-%d%h:%i:%s' ) as registertime 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.erp_member_id is not null and t1.shop_id = :2 and t1.tenant_id = :3 and t1.tenant_app_id = :4 -- and t1.bind_time < current_date order by t1.bind_time asc limit :5|2|3|2||0|0|207482|110840|11|8|
|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|2|2|1||0|0|11784|5900|2734|1369|
|coupon_service|select id as usercouponid , coupon_no as couponno , end_time as endtime , begin_time as begintime , face_value as facevalue , coupon_name as couponname , coupon_type as coupontype , remark , exchange_shop , off_type from coupon_user where owner_id = :1 and coupon_template_id = :2 and coupon_state = :3 and end_time > now ( ) limit :4|2|4|2||0|0|795022|483787|1|1|
||/* applicationname = intellij idea 2019.1 */ update user_service.tenant_user tu 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 join tenant.tenant_wechatapp_shop s on s.tenant_id = em.tenant_id and s.tenant_wechatapp_id = em.tenant_wechatapp_id and s.dept_erp_id = em.dept_erp_id set tu.shop_id = s.id where tu.mobile_no is not null and shop_id is null|2|83|51||0|0|12148317|6074160|0|0|
||/* applicationname = intellij idea 2019.1 */ select tu.tenant_app_id , tu.mobile_no , s.id from user_service.tenant_user tu 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 left join tenant.tenant_wechatapp_shop s on s.tenant_id = em.tenant_id and s.tenant_wechatapp_id = em.tenant_wechatapp_id and s.dept_erp_id = em.dept_erp_id where tu.mobile_no is not null and shop_id is null|2|10|5||0|0|2313054|1228694|1293|1002|
|order|select tenant_wechatapp_id from order_info where status = :1 and child_status is null group by tenant_wechatapp_id|2|6|4||0|0|91306|45653|0|0|
||/* applicationname = intellij idea 2019.1 */ update user_service.tenant_user tu 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 set shop_id = ( select id from tenant.tenant_wechatapp_shop s where s.tenant_id = em.tenant_id and s.tenant_wechatapp_id = em.tenant_wechatapp_id group by tenant_wechatapp_id ) where tu.mobile_no is not null and shop_id is null|2|7|4||0|0|5493018|2746513|0|0|
|activity_service|select id , tenant_id , tenant_app_id , activity_id , user_id , tenant_app_open_id , customize_page_id , qualitied_id , status , remark , create_time , update_time from intelligent_marketing_activity_gift where `status` = :1 limit :2 , :3|2|7|4||0|0|241514|120757|0|0|
|qrcode_service|select *from qrcode_service.qrcode_scan_log where open_id = :1 and tenant_app_id = :2 order by create_time desc limit :3|2|2|1||0|0|1959017|979577|1|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|2|5|4||0|0|956574|478287|0|0|
||/* applicationname = intellij idea 2019.1 */ update user_service.tenant_user tu 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 set shop_id = ( select id from tenant.tenant_wechatapp_shop s where s.tenant_id = em.tenant_id and s.tenant_wechatapp_id = em.tenant_wechatapp_id group by tenant_app_id ) where tu.mobile_no is not null and shop_id is null|2|8|4||0|0|5486636|2747079|0|0|
|warranty_service|select count ( 0 ) from warranty_service.warranty where tenant_wechatapp_id = :1 and is_disable = false and dept_erp_id = :2 and employee_erp_id = :3 and sales_date >= :4 and sales_date <= :5 and employee_erp_id in ( :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 , :54 , :55 , :56 , :57 , :58 , :59 , :60 , :61 , :62 , :63 , :64 , :65 , :66 , :67 , :68 , :69 , :70 , :71 , :72 , :73 , :74 , :75 , :76 , :77 , :78 , :79 , :80 , :81 , :82 , :83 , :84 , :85 , :86 , :87 , :88 , :89 )|2|8|4||0|0|34740|17376|2|1|
|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|3|11|6||0|0|193871|64883|3|1|
|user_service|select count ( 0 ) from tenant_user tenantuser join user user on tenantuser.user_id = user.id where user_id != :1 and tenant_app_id = :2|3|11|7||0|0|357045|208341|3|1|
|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|3|3|1||0|0|26|18|0|0|
|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|3|6|3||0|0|180691|60414|0|0|
|gift_mail|select t.* , tt.can_take_date , 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 tt.trade_id = t.id left outer join trade_addr ta on ta.trade_id = t.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 ) order by create_time desc limit :3|4|9|2||0|0|57900|14531|80|20|
|gift_mail|select count ( 0 ) from ( select t.* , tt.can_take_date , 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 tt.trade_id = t.id left outer join trade_addr ta on ta.trade_id = t.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 ) order by create_time desc ) tmp_count|4|6|2||0|0|55027|13802|4|1|
||/* applicationname = datagrip 2018.2.2 */ select * from user_service.tenant_user where mobile_no is not null and shop_id is null order by bind_time desc|4|5|1||0|0|10959768|2740446|2682|1176|
||/* applicationname = intellij idea 2019.1 */ select id , bind_time from user_service.tenant_user where mobile_no is not null and erp_member_id is null and shop_id is not null|4|11|3||0|0|6046324|1511799|820|427|
|erp_sync|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|4|10|4||0|0|34911|8732|34911|8732|
|platform|select `noteid` , `vendorid` , `detailindex` , `productname` , `productbarcode` , `category` , `salestype` , `quantity` , `amount` , `integral` , `productdesc` , `slid` , `paidamount` , `id` from `salesdetaillog` where `noteid` = :1 and `vendorid` = :2|4|9|3||0|0|257252|108349|4|1|
||/* applicationname = intellij idea 2019.1 */ select * from user_service.tenant_user where mobile_no is not null and shop_id is null order by bind_time desc|5|14|9||0|0|13699198|2740440|1405|1002|
|platform|select count ( 1 ) from coupondetail cd where getuid = :1 and ( couponstate = :2 or couponstate = :3 ) and date_format ( expirytime , :4 ) >= curdate ( )|5|12|3||0|0|1593855|318771|5|1|
|user_service|select tu.user_id as userid , tu.mobile_no as mobileno , tu.user_name as username , u.nick_name as nickname , u.head_img_url as headimgurl from tenant_user tu join `user` u on tu.user_id = u.id where tu.tenant_app_id = :1 and ( tu.mobile_no = :2 or u.nick_name like concat ( :3 , :4 ) or tu.user_name like concat ( :5 , :6 ) )|6|21|5||0|0|300574|50116|30|30|
|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|6|11|2||0|0|1177002|196248|6|1|
|platform|select `typefullname` , `methodname` , `arguments` , `partition` , `offset` , `createtime` , `updatetime` , `retried` , `errormsg` , `id` from `pushlog` where `typefullname` = :1 and `methodname` = :2 and `arguments` = :3|7|9|2||0|0|1702081|243160|0|0|
|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 )|7|8|2||0|0|4413850|630550|2|2|
|customer|select count ( 0 ) from customer_face_pass t where :1 = :2 and t.is_checkin = :3 and t.shop_id = :4 and t.person_type not in ( :5 )|8|45|14||0|0|409184|176356|8|1|
|employee|select * from backlog where tenant_app_id = :1 and user_id = :2 and status in ( :3 , :4 ) and scene = :5 and expire_time >= :6 order by create_time desc limit :7|9|33|4||0|0|1018845|113205|15|3|
|user_service|select count ( 0 ) from ( select t1.erp_member_id as membererpid , t2.head_img_url as headimgurl , t2.nick_name as nickname , t1.mobile_no as mobileno , date_format ( t1.bind_time , '%y-%m-%d%h:%i:%s' ) as registertime 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.erp_member_id is not null and t1.shop_id = :2 and t1.tenant_id = :3 and t1.tenant_app_id = :4 ) table_count|9|23|5||0|0|343730|64373|9|1|
|facepass_sync|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|10|38|5||0|0|87268|8731|87268|8731|
|platform|select count ( 1 ) from `integrallog` where `vendorid` = :1 and `changefrom` = :2 and `changeid` = :3|14|24|3||0|0|267547|38120|14|1|
|account|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|15|49|5||0|0|130891|8731|130891|8731|
|platform|select count ( 1 ) from `salesdetaillog` where `vendorid` = :1 and `noteid` = :2|24|50|4||0|0|1256915|108368|24|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|40|111|11||0|0|6086|726|0|0|
