|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|mysql|delete from wx_gateway.wx_template_msg where create_time < date_sub ( now ( ) , interval :1 day )|1|54|54||0|0|1511174|1511174|0|0|
|platform|select * from ( select * from coupondetail where getuid = :1 and ( couponstate = :2 or couponstate = :3 ) and expirytime >= now ( ) ) as tv limit :4 , :5|1|3|3||0|0|322223|322223|1|1|
|order|select tenant_wechatapp_id from order_info where status = :1 and child_status is null group by tenant_wechatapp_id|1|3|3||0|0|53001|53001|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 tipfee > :2 and tippayno is not null and date_sub ( date ( :3 ) , interval :4 day ) = date_format ( tippaytime , :5 )|1|6|6||0|0|120774|120774|0|0|
|user_service|select count ( 0 ) 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 , :4 , :5 , :6 ) )|1|2|2||0|0|30197|30197|1|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|1|4|4||0|0|36413|36413|1|1|
|platform|select * from ( select shop.shopname , employee.empname , a.addvaluequantity , b.salesquantity , c.certsquantity from shop left join ( select count ( * ) as addvaluequantity , shopid from valueaddedlog where vendorid = :1 group by shopid ) a on a.shopid = shop.vendorshopid left join ( select count ( * ) as salesquantity , sid from saleslog where vendorid = :2 group by sid ) b on b.sid = shop.id left join ( select count ( * ) as certsquantity , shopid from productcerts where vendorid = :3 group by shopid ) c on c.shopid = shop.id left join ( select * from employee where vendorid = :4 and uid != :5 ) as employee on shop.membermanageruid = employee.uid where :6 = :7 and shop.vendorid = :8 order by addvaluequantity desc , certsquantity desc , salesquantity desc ) as tv limit :9 , :10|1|2|2||0|0|53149|53149|10|10|
|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|1|1|1||0|0|638266|638266|1|1|
|account|/* applicationname = datagrip 2019.1.2 */ select *from user_service.erp_member where tenant_wechatapp_id = :1 and employee_erp_id = :2|1|2|2||0|0|18903|18903|27|27|
|platform|select * from ( select c.* , cd.getamount , useamount from coupon c left join ( select couponid , sum ( if ( couponstate in ( 3 , 6 , 4 ) , 1 , 0 ) ) as getamount , sum ( if ( couponstate = 4 , 1 , 0 ) ) as useamount from coupondetail group by couponid ) cd on c.id = cd.couponid ) as tv where :1 = :2 and vendorid = :3 order by effectivedate desc limit :4 , :5|1|3|3||0|0|322836|322836|11|11|
|mysql|delete from message_push.message_log where create_time < date_sub ( now ( ) , interval :1 day )|1|2|2||0|0|24894|24894|0|0|
|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|322223|322223|1|1|
|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|3|3||0|0|66068|66068|1|1|
|mysql|delete from erp_sync.sync_record where create_time < date_sub ( now ( ) , interval :1 day )|1|2|2||0|0|1048152|1048152|0|0|
|gift_mail|select count ( 0 ) from ( select t.id , t.user_name , t.mobile_no , t.specification , i.barcode , t.product_name , t.trade_no , t.create_time , t.quantity , if ( if ( t.trade_type = 2 , tpw.employee_id , take.take_employee_id ) is not null , t.quantity , 0 ) as takequantity , take.take_shop_name , if ( t.trade_type = 2 , tpw.employee_name , take.take_employee_name ) as take_employee_name , if ( t.trade_type = 2 , tpw.update_time , if ( take.take_employee_id is not null , take.update_time , null ) ) as taketime , p.partner_name from gift_mail.trade t left outer join gift_mail.trade_take take on take.trade_id = t.id left outer join gift_mail.partner_product pp on pp.product_id = t.product_id left outer join gift_mail.partner p on p.id = pp.partner_id left outer join gift_mail.trade_partner_wipe tpw on tpw.trade_id = t.id left outer join gift_mail.inventory i on i.id = t.inventory_id where ( t.tenant_wechatapp_id = :1 and t.order_status not in ( :2 ) and t.product_id = :3 and t.inventory_id = :4 ) ) tmp_count|1|2|2||0|0|17859|17859|1|1|
|mysql|delete from erp_to_platform.sync_log where create_time < date_sub ( now ( ) , interval :1 day )|1|1|1||0|0|165433|165433|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|1|1||0|0|569285|569285|1208|1208|
|customize_page|select id , tenant_id , tenant_wechatapp_id , page_id , user_id , tenant_app_open_id , create_time , update_time , business_id , src_type , user_name , mobile_no , head_img from award_qualified where tenant_wechatapp_id = :1 and page_id = :2 and ( user_id = :3 or tenant_app_open_id = :4 )|1|1|1||0|0|35340|35340|0|0|
|mysql|insert into erp_to_platform.sync_log_20190924 select * from erp_to_platform.sync_log where create_time < date_sub ( now ( ) , interval :1 day )|1|2|2||0|0|165433|165433|0|0|
|employee|select bg.id , bg.employee_id , bg.shop_id , 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 where bg.tenant_app_id = :1 and bg.expire_time between :2 and :3 and bg.scene = :4 and bg.leave_flag = :5 order by id desc limit :6|1|1|1||0|0|59569|59569|20|20|
|warranty_service|select *from warranty_service.warranty where upload_frequency <= :1 and version = :2 and warranty_img_url is null|1|15|15||0|0|447831|447831|0|0|
|message_push|delete from message_log where create_time < :1|1|16|16||0|0|198649|198649|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|2|2||0|0|28984|28984|0|0|
|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|64341|64341|1|1|
|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 )|1|7|7||0|0|43219|43219|1|1|
|account|/* applicationname = datagrip 2019.1.2 */ select *from qrcode_service.qrcode_scan_log where from_type like :1|1|4|4||0|0|1202562|1202562|0|0|
|gift_mail|select t.id , t.user_name , t.mobile_no , t.specification , i.barcode , t.product_name , t.trade_no , t.create_time , t.quantity , if ( if ( t.trade_type = 2 , tpw.employee_id , take.take_employee_id ) is not null , t.quantity , 0 ) as takequantity , take.take_shop_name , if ( t.trade_type = 2 , tpw.employee_name , take.take_employee_name ) as take_employee_name , if ( t.trade_type = 2 , tpw.update_time , if ( take.take_employee_id is not null , take.update_time , null ) ) as taketime , p.partner_name from gift_mail.trade t left outer join gift_mail.trade_take take on take.trade_id = t.id left outer join gift_mail.partner_product pp on pp.product_id = t.product_id left outer join gift_mail.partner p on p.id = pp.partner_id left outer join gift_mail.trade_partner_wipe tpw on tpw.trade_id = t.id left outer join gift_mail.inventory i on i.id = t.inventory_id where ( t.tenant_wechatapp_id = :1 and t.order_status not in ( :2 ) and t.product_id = :3 and t.inventory_id = :4 ) limit :5|1|2|2||0|0|17200|17200|20|20|
|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|1|3|3||0|0|42489|42489|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|3|3||0|0|209000|209000|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|33|33||0|0|1048152|1048152|0|0|
|platform|select `tasktype` , `tasktime` , `taskstatus` , `bid` , `vendorid` , `uid` , `completetime` , `remark` , `createtime` , `id` from `taskassignment` where `bid` = :1 and `tasktype` = :2 and `tasktime` = :3 and `vendorid` = :4 and `uid` = :5|1|1|1||0|0|638118|638118|0|0|
|platform|select * from ( select sl.id , sl.noteno as `no` , sl.empname as salername , sl.amounttotal as amount , sl.status , s.shopname , vm.username as customername , sl.salesdate from saleslog sl join shop s on s.id = sl.sid join member m on m.id = sl.uid join vendormember vm on vm.id = m.vendormemberid where sl.vendorid = :1 ) p where :2 = :3 and status != :4 order by salesdate desc limit :5 , :6|1|2|2||0|0|10778|10778|10|10|
|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|14522|14522|0|0|
|platform|select sum ( quantity ) from salesdetaillog where salestype = :1 and slid in ( select id from saleslog where vendorid = :2 and `status` = :3 and date_format ( salesdate , :4 ) >= :5 and date_format ( salesdate , :6 ) < :7 )|1|2|2||0|0|11498|11498|1|1|
|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 )|1|7|7||0|0|43196|43196|1|1|
|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|1|2|2||0|0|75514|75514|15|15|
|employee|select bg.id , bg.employee_id , bg.shop_id , 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 where bg.tenant_app_id = :1 and bg.shop_id = :2 and bg.scene = :3 and bg.leave_flag = :4 order by id desc limit :5|1|1|1||0|0|120779|120779|20|20|
|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|2|4|3||0|0|191431|95736|2|1|
|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|2|8|6||0|0|39007|22346|1600|1274|
|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|13768|6884|3182|1591|
|platform|select `noteid` , `vendorid` , `detailindex` , `productname` , `productbarcode` , `category` , `salestype` , `quantity` , `amount` , `integral` , `productdesc` , `slid` , `paidamount` , `id` from `salesdetaillog` where `noteid` = :1 and `vendorid` = :2|2|6|4||0|0|37633|19179|4|2|
|coupon_service|select id , tenant_id , tenant_wechatapp_id , coupon_template_id , coupon_no , coupon_state , owner_id , creator_id , creator_mobile_no , creator_name , user_name , mobile_no , create_channel , coupon_name , face_value , coupon_type , use_threshold , begin_time , end_time , remark , create_time , update_time , product_name , exchange_shop , channel_id , writeoff_user_id , off_type , is_give , writeoff_time from coupon_user where coupon_template_id = :1 and owner_id = :2|2|13|7||0|0|1138493|569247|4|3|
|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|3|15|7||0|0|1708897|570154|1|1|
|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|3|17|7||0|0|89915|36780|60|20|
|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|4|5|2||0|0|184108|58997|4|1|
|customer|select t.id as customerfacepassid , t.photo_url as photourl , t.user_name as username , t.mobile_no as mobileno , t.sex , t.age , t.enter_shop_time as entershoptime , t.person_type 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 ) order by t.person_type asc , t.enter_shop_time desc limit :6|4|6|1||0|0|877320|219330|32|8|
|facepass_sync|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|4|5|1||0|0|8456|2114|8456|2114|
|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 ) ) ) )|4|9|3||0|0|113159|62547|53|48|
|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|4|6|2||0|0|1294|440|0|0|
|account|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|5|6|1||0|0|10568|2114|10568|2114|
|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|5|8|2||0|0|244402|78090|5|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|6|13|3||0|0|920155|214963|3|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|7|14|2||0|0|1504461|215028|7|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 ( tenant_id = :1 and account_id = :2 and status = :3 )|8|15|3||0|0|906097|150235|16|2|
|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|9|14|3||0|0|1326|408|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 )|10|13|1||0|0|6382660|638266|16|9|
|platform|select `typefullname` , `methodname` , `arguments` , `partition` , `offset` , `createtime` , `updatetime` , `retried` , `errormsg` , `id` from `pushlog` where `typefullname` = :1 and `methodname` = :2 and `arguments` = :3|11|18|2||0|0|2716776|246993|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|12|15|2||0|0|3426324|285527|0|0|
|platform|select count ( 1 ) from coupondetail cd where getuid = :1 and ( couponstate = :2 or couponstate = :3 ) and date_format ( expirytime , :4 ) >= curdate ( )|14|36|4||0|0|4511122|322223|14|1|
|platform|select count ( 1 ) from `integrallog` where `vendorid` = :1 and `changefrom` = :2 and `changeid` = :3|15|25|2||0|0|153131|11738|15|1|
|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|18|44|4||0|0|333252|20777|18|1|
|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|19|72|8||0|0|385192|36740|380|20|
|platform|select count ( 1 ) from `salesdetaillog` where `vendorid` = :1 and `noteid` = :2|34|66|3||0|0|673767|23006|34|1|
|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 )|54|414|15||0|0|5657890|219322|50|1|
|user_service|select count ( * ) 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|95|257|11||0|0|9926933|159162|95|1|
