|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|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 join user_service.tenant_member tm on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where ue.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|4647|20742|43||0|0|1000032553|521297|4569|1|
|corpwx|update external_user set un_assign_flag = :1 where ( tenant_id = :2 and un_assign_flag = :3 )|563|1711|15||0|0|217273387|1555050|0|0|
|payment|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|478|1625|12||0|0|5044613|11510|5044613|11510|
|tenant|select es.id , es.sales_date as saledate , es.sales_no as saleno , es.amount from tenant.erp_sales es where tenant_wechatapp_id = :1 and member_erp_id = :2 and dept_erp_id = :3 and employee_erp_id = :4 and sales_status = :5 and is_sales = true and create_time > :6 and not exists ( select 1 from tenant.sneak_guest sg join tenant.sneak_guest_sales sgn on sgn.sneak_guest_id = sg.id where sg.tenant_app_id = :7 and es.id = sgn.sales_id and user_id = :8 )|334|85009|830||0|0|5550681789|16620578|384|7|
|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|271|1938|15||0|0|43728594|163280|0|0|
|tenant|select erp_sales_detail.sales_erp_id as saleserpid , erp_sales_detail.sales_index as salesindex , erp_sales_detail.sales_type as salestype , erp_sales_detail.product_barcode as productbarcode , erp_sales_detail.product_name as productname , erp_sales_detail.cert_no as certno , erp_sales_detail.hand_size as handsize , erp_sales_detail.category_erp_id as categoryerpid , erp_sales_detail.category_name as categoryname , erp_sales_detail.stone_weight as stoneweight , erp_sales_detail.gold_weight as goldweight , erp_sales_detail.total_weight as totalweight , erp_sales_detail.quantity as quantity , erp_sales_detail.amount_total as amounttotal , erp_sales_detail.amount_pay as amountpay , erp_sales_detail.integral as integral , erp_sales_detail.remark as remark , erp_sales.employee_erp_id as employeeerpid , erp_sales.employee_name as employeename , erp_department.dept_erp_id as depterpid , erp_department.dept_name as deptname , erp_sales.sales_no as salesno , erp_sales.busi_date as busidate , erp_sales.member_erp_id as erpmemberid , erp_sales.sales_date as salesdate from tenant.erp_sales_detail join tenant.erp_sales on erp_sales_detail.sales_erp_id = erp_sales.sales_erp_id and erp_sales_detail.tenant_wechatapp_id = erp_sales.tenant_wechatapp_id left join tenant.erp_department on erp_department.dept_erp_id = erp_sales.dept_erp_id and erp_department.tenant_id = erp_sales.tenant_id where :1 = :2 and erp_sales_detail.tenant_id = :3 and erp_sales_detail.tenant_wechatapp_id = :4 and erp_sales_detail.sales_erp_id = :5 and erp_sales_detail.sales_index = :6 and erp_sales.sales_status = :7|262|65086|788||0|0|4353826127|16618353|262|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 union_id = :2 )|258|1470|15||0|0|19619866|172505|33|3|
|corpwx|select * from corpwx.external_user eu left join ( select tenant_id , external_user_id from corpwx.external_user_bind where tenant_id = :1 group by tenant_id , external_user_id ) eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :2 and eub.external_user_id is null and eu.un_assign_flag = :3|251|1281|15||0|0|35856749|277166|109397|4501|
|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_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 t3.id is null and tmi.shop_id = :1 and tmi.tenant_app_id = :2 and tmi.tenant_id = :3|247|894|24||0|0|44612340|657142|247|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|243|603|11||0|0|1000|25|0|0|
|corpwx|select id , tenant_id , tenant_app_id , external_user_id , wx_user_id from external_user_bind where ( tenant_id = :1 and wx_user_id = :2 )|230|626|13||0|0|2128341|34596|108|1|
|tenant|select count ( * ) from tenant.sneak_guest_maintain where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and event_type = :4 and create_time between :5 and :6|202|1056|33||0|0|10682896|162652|202|1|
|erp_sync|select * from retry_data where tenant_app_id = :1 and user_id = :2|192|615|13||0|0|921228|10137|50|2|
|tenant|select count ( 0 ) from erp_sales es where es.tenant_id = :1 and es.tenant_wechatapp_id = :2 and es.sales_date >= :3 and es.employee_erp_id = :4 and es.sales_status = :5|157|358|11||0|0|360977|5568|157|1|
|user_service|select count ( 0 ) from ( select tm.user_id as id , tm.user_name as username , tm.head_img_url as headimgurl , tm.user_name as nickname , tm.mobile_no as mobile , tm.sex , if ( ifnull ( wu.is_subscribe , 0 ) = 0 , false , true ) as hassubscribe from user_service.tenant_member tm left join user_service.user_employee ue 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 join user_service.tenant_member_bind tmb on tmb.tenant_id = tm.tenant_id and tmb.tenant_app_id = tm.tenant_app_id and tmb.user_id = tm.user_id left join user_service.wx_user wu on wu.id = tmb.wx_user_id where tm.tenant_id = :1 and tm.tenant_app_id = :2 order by tm.id desc ) tmp_count|122|1690|81||0|0|57686645|1202637|122|1|
|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|111|773|15||0|0|11417678|223160|81|1|
|comment_service|select *from comment_service.comment_reward where comment_id = :1 limit :2|109|260|6||0|0|17792946|167897|32|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|94|631|15||0|0|10790404|117532|884|11|
|item_manage|select id , tenant_id , `name` , `describe` , `type` , parent_id , employee_id , status , start_time , end_time , startup_time , submit_time , sub_num , sub_complete_num , delete_flag , dynamic_update_time , before_status from task where ( tenant_id = :1 and type = :2 and parent_id = :3 )|84|213|13||0|0|5011451|59768|71|1|
|tenant|select count ( * ) from tenant.sneak_guest_maintain s join tenant.sneak_guest sg on sg.tenant_id = s.tenant_id and sg.tenant_app_id = s.tenant_app_id and sg.id = s.sneak_guest_id join tenant.employee e on e.tenant_id = s.tenant_id and e.id = s.employee_id where s.tenant_id = :1 and s.tenant_app_id = :2 and sg.create_shop_id = :3 and s.event_type = :4 and s.create_time between :5 and :6|81|138|3||0|0|189340|3826|81|1|
|user_service|select count ( * ) from user_service.tenant_member_info t where t.tenant_id = :1 and t.tenant_app_id = :2 and t.shop_id = :3|81|215|12||0|0|14370652|398817|81|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 union_id in ( :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 , ...|80|363|15||0|0|4222128|171888|2685|400|
|activity_service|select count ( * ) > 0 from activity_service.online_sign_user_sign_log where tenant_app_id = :1 and user_id = :2 and to_days ( create_time ) = to_days ( :3 )|78|173|5||0|0|15139957|194146|78|1|
|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|75|183|5||0|0|14055739|187457|75|1|
|user_service|select count ( 0 ) from user_service.tenant_member t1 join user_service.tenant_member_info t2 on t1.tenant_id = t2.tenant_id and t1.id = t2.id join user_service.user_employee t3 on t1.tenant_app_id = t3.tenant_wechatapp_id and t1.user_id = t3.user_id and t3.employee_id = :1 where t1.tenant_id = :2 and t1.tenant_app_id = :3 and t2.tenant_app_id = :4 and t2.shop_id = :5|75|199|10||0|0|12244227|474790|75|1|
|youzan|select id , merchant_shop_id , api_name , api_request , api_response , status , error_msg , retry_num , sync_type , create_time , update_time from youzan_platform_sync_log where ( status = :1 and retry_num < :2 and create_time > :3 )|68|211|9||0|0|11128742|163663|0|0|
|user_service|select count ( * ) num from user_service.user_employee_alloc_log where tenant_id = :1 and tenant_wechatapp_id = :2 and alloc_employee_id = :3 and alloc_date_time between :4 and :5|62|106|4||0|0|16415|4937|62|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 )|60|106|3||0|0|533597|10102|60|1|
|coupon_service|select *from coupon_service.coupon_market_order where pay_type in ( :1 , :2 ) and order_state = :3 and update_time <= date_sub ( now ( ) , interval :4 minute )|56|164|8||0|0|10494342|187468|0|0|
|tenant|select es.id , es.sales_no , es.sales_date , es.member_erp_id , es.sales_erp_id , es.is_sales from erp_sales es where es.tenant_id = :1 and es.tenant_wechatapp_id = :2 and es.sales_status = :3 and es.sales_no like concat ( :4 , :5 ) order by es.sales_date desc limit :6|54|546|63||0|0|21447953|745061|6|1|
|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|37|53|2||0|0|587856|15888|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 , tmp.face_value as point , 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 <= ( select count ( * ) from coupon_service.employee_give_coupon_log where employee_give_coupon_id = egc.id ) then :4 else :5 end ) ) as state , tr.type as redpacktype , ifnull ( tr.min_price , :6 ) /100 as minprice from coupon_service.employee_give_coupon egc inner join coupon_service.coupon_push cp on egc.template_id = cp.template_id and cp.source = :7 and egc.id = cp.source_id and cp.state = :8 inner join coupon_service.template tmp on egc.template_id = tmp.id and tmp.state = :9 inner join coupon_service.template_grant_limit tgl on cp.id = tgl.coupon_push_id left join coupon_service.template_redpack tr on tr.template_id = tmp.id where egc.tenant_app_id = :10 and egc.state = :11 and ( egc.limit_grant_time = :12 or egc.grant_begin_time <= now ( ) ) and ( egc.limit_shop = :13 or exists ( select 1 from coupon_service.employee_give_coupon_shop cs where egc.id = cs.employee_give_id and cs.shop_id = :14 ) ) and egc.limit_role in ( :15 , :16 ) order by state asc , egc.id desc ) tmp_count|31|99|8||0|0|34468554|1781170|31|1|
|activity_service|select id , tenant_id , tenant_app_id , activity_id , user_id , day , continuous_day , has_subscribe , user_name , create_time , update_time , first_sign_time , mobile_no from online_sign_user where ( tenant_app_id = :1 and user_id = :2 )|31|42|2||0|0|1661664|53610|15|1|
|employee|update backlog set tenant_id = :1 , tenant_app_id = :2 , status = :3 , scene = :4 , expire_time = :5 , finish_time = :6 where id = :7|28|43|3||0|0|28|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|28|197|15||0|0|4493379|163275|1|1|
|tenant|select id , tenant_id , tenant_app_id , sneak_guest_maintain_id , sneak_guest_id , url , create_time , update_time from sneak_guest_maintain_file where ( tenant_app_id = :1 and sneak_guest_maintain_id in ( :2 ) )|26|76|6||0|0|4516012|173862|16|2|
|shop_work|select * from shop_work.work_report wr where exists ( select * from shop_work.task t where t.tenant_id = wr.tenant_id and t.task_group_id = wr.id and t.status = :1 and t.task_type = :2 ) and tenant_id = :3|25|104|5||0|0|9909947|396514|37792|1520|
|employee|select id , tenant_id , tenant_app_id , backlog_id , url , status , create_time , update_time from backlog_file where ( tenant_id = :1 and tenant_app_id = :2 and backlog_id in ( :3 , :4 , :5 , :6 , :7 , :8 ) and status = :9 )|24|158|15||0|0|13250671|565850|95|6|
|employee|select id , tenant_id , tenant_app_id , backlog_id , url , status , create_time , update_time from backlog_file where ( tenant_id = :1 and tenant_app_id = :2 and backlog_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 ) and status = :13 )|23|133|15||0|0|12819449|565548|100|10|
|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 , p.topping 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 where ( p.topping = :8 )|22|31|2||0|0|235404|10808|22|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|19|29|2||0|0|38|3|38|3|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :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 , :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|18|39|4||0|0|249688|22258|6895|622|
|wx_gateway|select id , tenant_id , tenant_app_id , wx_template_id , employee_id , busi_id , busi_type , url , push_time , category , title , content , status , retry_amount , remark , create_time , update_time , del_flag from wx_template_push where ( push_time <= :1 and status = :2 and category = :3 and del_flag = :4 )|16|19|1||0|0|39336|2459|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 , tmp.face_value as point , 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 <= ( select count ( * ) from coupon_service.employee_give_coupon_log where employee_give_coupon_id = egc.id ) then :4 else :5 end ) ) as state , tr.type as redpacktype , ifnull ( tr.min_price , :6 ) /100 as minprice from coupon_service.employee_give_coupon egc inner join coupon_service.coupon_push cp on egc.template_id = cp.template_id and cp.source = :7 and egc.id = cp.source_id and cp.state = :8 inner join coupon_service.template tmp on egc.template_id = tmp.id and tmp.state = :9 inner join coupon_service.template_grant_limit tgl on cp.id = tgl.coupon_push_id left join coupon_service.template_redpack tr on tr.template_id = tmp.id where egc.tenant_app_id = :10 and egc.state = :11 and ( egc.limit_grant_time = :12 or egc.grant_begin_time <= now ( ) ) and ( egc.limit_shop = :13 or exists ( select 1 from coupon_service.employee_give_coupon_shop cs where egc.id = cs.employee_give_id and cs.shop_id = :14 ) ) and egc.limit_role in ( :15 , :16 , :17 ) order by state asc , egc.id desc ) tmp_count|15|49|8||0|0|24896027|2534607|15|1|
|goods|select * from goods_take_shop where ( tenant_id = :1 and goods_id = :2 and activity_id = :3 ) order by create_time desc|13|16|1||0|0|604929|46547|86|20|
|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|13|269|81||0|0|1864419|343758|13|1|
|tenant|select count ( 0 ) from tenant.sneak_guest sg join tenant.employee e on e.id = sg.maintain_employee_id join ( select sneak_guest_id , count ( * ) as _count , min ( create_time ) as time from tenant.sneak_guest_maintain where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and event_type in ( :4 , :5 , :6 ) and create_time between :7 and :8 group by sneak_guest_id ) smg on smg.sneak_guest_id = sg.id where sg.tenant_id = :9 and sg.tenant_app_id = :10 and sg.maintain_employee_id = :11|13|46|9||0|0|569042|43801|13|1|
|tenant|select distinct s.employee_id as id , e.employee_name from tenant.sneak_guest_maintain s join tenant.sneak_guest sg on sg.id = s.sneak_guest_id join tenant.employee e on s.tenant_id = e.tenant_id and s.employee_id = e.id where s.tenant_id = :1 and s.tenant_app_id = :2 and sg.create_shop_id = :3 and s.event_type = :4 and s.create_time between :5 and :6|12|56|8||0|0|292139|163068|12|8|
|tenant|select count ( * ) from sneak_guest where ( tenant_app_id = :1 and create_shop_id = :2 and maintain_employee_id = :3 and status = :4 and next_maintain_date between :5 and :6 )|11|13|2||0|0|30459|3716|11|1|
|employee|select count ( * ) from employee.backlog where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and status = :4 and finish_time between :5 and :6|11|19|3||0|0|60079|6242|11|1|
|value_added|select count ( 0 ) from ( select t1.id , t2.sales_no as salesno , date_format ( t2.sales_date , '%y-%m-%d' ) as salesdate , date_format ( t1.start_add_time , '%y-%m-%d' ) as valueadddate , t2.dept_erp_id as shopid , t1.shop_name as shopname , t2.employee_erp_id as userid , t2.employee_name as username , t1.product_name as productname , t1.amount_pay as amountpay , t1.id as valueaddno , t1.amount_added as valueaddamount , t1.state , if ( t1.state = 2 , t1.coupon_user_id , null ) as valueaddcoupon , t1.user_id as memberuserid from value_added.value_added_user t1 join value_added.`value_added_user_extend` t2 on t1.id = t2.id where t1.tenant_wechatapp_id = :1 and exists ( select null from value_added.value_added_category t3 join value_added.value_added_template t4 on t3.template_id = t4.id and t4.is_disable = :2 where t1.tenant_wechatapp_id = t3.tenant_wechatapp_id and t2.category_erp_id = t3.erp_product_category_id ) and t2.dept_erp_id = :3 and t2.sales_date >= :4 and t2.sales_date < :5 and t1.state != :6 ) tmp_count|11|54|11||0|0|167648|16750|11|1|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 )|10|18|4||0|0|41997|10212|7|2|
|coupon_service|update coupon_service.coupon_write_off_log set state = :1 where coupon_id = :2|10|69|15||0|0|12669754|1468772|0|0|
|tenant|select count ( * ) from sneak_guest where ( tenant_app_id = :1 and status = :2 and create_shop_id = :3 and maintain_employee_id = :4 )|9|11|2||0|0|24917|3716|9|1|
|tenant|select id , tenant_id , tenant_app_id , sneak_guest_maintain_id , sneak_guest_id , url , create_time , update_time from sneak_guest_maintain_file where ( tenant_app_id = :1 and sneak_guest_maintain_id in ( :2 , :3 ) )|9|28|7||0|0|1562961|173745|15|2|
|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 ) group by tenant_id , tenant_app_id , employee_id , scene , shop_id|9|13|2||0|0|54447|9558|25|7|
|item_manage|select id , tenant_id , business_type , business_id , employee_id , quantity from unread_log where ( tenant_id = :1 and business_type = :2 and business_id = :3 )|9|10|1||0|0|539375|59962|0|0|
|coupon_service|select count ( 0 ) from coupon_service.employee_give_coupon_log egcl where egcl.employee_give_coupon_id = :1|9|20|4||0|0|1739883|193406|9|1|
|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 , p.topping 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 * 100 , 0 ) as price , pi.volume , 0 as category_id , pp.product_status , pi.quantity , 0 as partner_id , 0 as topping 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 where ( p.topping = :10 )|8|13|2||0|0|98623|12454|8|1|
|tenant|select count ( 0 ) from tenant.sneak_guest_maintain s join tenant.sneak_guest sg on sg.tenant_id = s.tenant_id and sg.tenant_app_id = s.tenant_app_id and sg.id = s.sneak_guest_id join tenant.employee e on e.tenant_id = s.tenant_id and e.id = s.employee_id where s.tenant_id = :1 and s.tenant_app_id = :2 and sg.create_shop_id = :3 and s.event_type = :4 and s.create_time between :5 and :6|8|11|2||0|0|14594|3088|8|1|
|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|8|11|1||0|0|1329|431|8|1|
|payment|select id , tenant_id , tenant_app_id , goods_order_source , goods_order_no , pay_order_id , transaction_id , goods_amount , refund_amount , fee_type , refund_reason , refund_account , request_ip , user_id , user_identify , user_sub_identify , order_start_time , refund_id , settlement_refund_amount , refund_recv_accout , refund_request_source , refund_finish_time , refund_status , refund_status_desc , error_msg , wxappid , sub_wxappid , mch_id , sub_mch_id , callback_tag , callback_result , create_time , update_time from refund_order where callback_result in ( :1 , :2 ) and refund_status in ( :3 , :4 ) order by id asc limit :5|8|9|1||0|0|50248|6281|0|0|
|tenant|select count ( * ) from sneak_guest where ( tenant_app_id = :1 and status = :2 and create_shop_id = :3 )|7|11|2||0|0|19604|3716|7|1|
|warranty_service|select id , sales_no , erp_sales_id , employee_erp_id , dept_erp_id , user_id , create_time as warrantydate , warranty_no , version , sales_date , warranty_data- > > '$.amount' as amount from warranty_service.warranty where tenant_wechatapp_id = :1 and is_disable = false and sales_date >= :2 and sales_date <= :3 limit :4|7|94|15||0|0|314126|73588|20|20|
|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 )|7|105|15||0|0|185688|66087|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 , if ( coupon_type in ( 'point' , 'interact_point' ) , cu.face_value , 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 , cu.user_id , ce.source_user_id , ce.source_user_type , cal.create_time as abolishtime , cal.employee_id as abolishemployeeid 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 left join coupon_service.coupon_abolish_log cal on cal.tenant_id = cu.tenant_id and cal.tenant_app_id = cu.tenant_app_id and cal.coupon_id = cu.id where cu.tenant_app_id = :3 and cu.coupon_type = :4 and cu.coupon_state = :5 and ce.mobile_no = :6 ) tmp_count|6|64|15||0|0|190074|46277|2|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|6|20|6||0|0|1102008|227899|6|1|
|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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , 0.00 , 0.00 , 0.00 , :17 ) on duplicate key update update_time = now ( ) , sales_type = :18 , product_barcode = :19 , product_name = :20 , cert_no = :21 , hand_size = :22 , category_erp_id = :23 , category_name = :24 , stone_weight = :25 , gold_weight = :26 , total_weight = :27 , quantity = :28 , amount_total = 0.00 , amount_pay = 0.00 , integral = 0.00 , remark = :29|6|9|1||0|0|0|0|0|0|
|user_service|select count ( 0 ) from user_service.tenant_member t1 join user_service.tenant_member_info t2 on t1.tenant_id = t2.tenant_id and t1.id = t2.id join user_service.user_employee t3 on t1.tenant_app_id = t3.tenant_wechatapp_id and t1.user_id = t3.user_id and t3.employee_id = :1 where t1.tenant_id = :2 and t1.tenant_app_id = :3 and t2.tenant_app_id = :4 and t2.shop_id = :5 and ( t1.mobile_no like concat ( :6 , :7 ) or t1.user_name like concat ( :8 , :9 , :10 ) )|6|14|4||0|0|1035398|241104|6|1|
|user_service|select count ( 0 ) from wx_user where ( wx_app_id = :1 and union_id is null )|6|20|6||0|0|49107|14283|6|1|
|tenant|select count ( * ) from ( select sneak_guest_id from tenant.sneak_guest_maintain where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and event_type = :4 and create_time between :5 and :6 group by sneak_guest_id ) a|6|47|21||0|0|228217|43274|6|1|
|user_service|select * from user_service.user_employee where employee_erp_id = :1 and tenant_id = :2 and tenant_wechatapp_id = :3 and date_format ( update_time , :4 ) = date_format ( now ( ) , :5 )|6|15|3||0|0|628798|296439|79|62|
|mini_app|select id , app_id , page , scene , image_url , create_time , update_time , only_key from app_qrcode where ( app_id = :1 and only_key = :2 )|6|10|2||0|0|369775|61636|0|0|
|account|select id , tenant_id , tenant_wechatapp_id , shop_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|6|25|15||0|0|458619|77629|90|15|
|employee|select employee_id from employee.backlog where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and status = :4 and finish_time between :5 and :6 group by employee_id|5|48|15||0|0|66787|21485|9|4|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 , :3 , :4 , :5 , :6 )|5|8|2||0|0|19508|10219|10|7|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 , :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|5|13|4||0|0|4265639|1110346|1087|403|
|value_added|select t1.id , t2.sales_no as salesno , date_format ( t2.sales_date , '%y-%m-%d' ) as salesdate , date_format ( t1.start_add_time , '%y-%m-%d' ) as valueadddate , t2.dept_erp_id as shopid , t1.shop_name as shopname , t2.employee_erp_id as userid , t2.employee_name as username , t1.product_name as productname , t1.amount_pay as amountpay , t1.id as valueaddno , t1.amount_added as valueaddamount , t1.state , if ( t1.state = 2 , t1.coupon_user_id , null ) as valueaddcoupon , t1.user_id as memberuserid from value_added.value_added_user t1 join value_added.`value_added_user_extend` t2 on t1.id = t2.id where t1.tenant_wechatapp_id = :1 and exists ( select null from value_added.value_added_category t3 join value_added.value_added_template t4 on t3.template_id = t4.id and t4.is_disable = :2 where t1.tenant_wechatapp_id = t3.tenant_wechatapp_id and t2.category_erp_id = t3.erp_product_category_id ) and t2.dept_erp_id = :3 and t2.sales_date >= :4 and t2.sales_date < :5 and t1.state != :6 limit :7|5|38|13||0|0|76195|17107|10|4|
|employee|select scene from employee.backlog where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and status = :4 and finish_time between :5 and :6 group by scene|5|34|15||0|0|57487|21495|11|5|
|tenant|select count ( 0 ) from ( select sg.maintain_employee_id as employeeid , maintain as continuenum , failure as failnum , success as dealnum , employee_name , head_img_url from ( select maintain_employee_id , sum ( maintain ) as maintain , sum ( success ) as success , sum ( failure ) as failure , max ( sgm.create_time ) create_time from tenant.sneak_guest sg join ( select sneak_guest_id , ( if ( event_type = 'maintain' , _count , 0 ) ) as maintain , ( if ( event_type = 'success' , _count , 0 ) ) as success , ( if ( event_type = 'failure' , _count , 0 ) ) as failure , create_time from ( select event_type , sneak_guest_id , 1 as _count , max ( create_time ) as create_time from tenant.sneak_guest_maintain where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and create_time between :4 and :5 and event_type in ( :6 , :7 , :8 ) group by event_type , sneak_guest_id ) a ) sgm on sgm.sneak_guest_id = sg.id where :9 = :10 group by sg.maintain_employee_id ) sg join tenant.employee e on e.id = sg.maintain_employee_id order by sg.create_time desc ) tmp_count|5|12|3||0|0|223128|44661|5|1|
|tenant|select id , tenant_id , tenant_app_id , sneak_guest_maintain_id , sneak_guest_id , url , create_time , update_time from sneak_guest_maintain_file where ( tenant_app_id = :1 and sneak_guest_maintain_id in ( :2 , :3 , :4 , :5 , :6 , :7 ) )|5|21|5||0|0|868288|173724|36|9|
|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 )|4|5|2||0|0|119088|29778|4|1|
|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|6|2||0|0|178|84|8|4|
|user_service|select count ( 0 ) from user_service.tenant_member t1 join user_service.tenant_member_info t2 on t1.tenant_id = t2.tenant_id and t1.id = t2.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and t2.tenant_app_id = :3 and t2.shop_id = :4|4|8|2||0|0|368506|194409|4|1|
|user_service|select count ( 0 ) from user_service.tenant_member t1 join user_service.tenant_member_info t2 on t1.tenant_id = t2.tenant_id and t1.id = t2.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and t2.tenant_app_id = :3 and t2.shop_id = :4 and ( t1.mobile_no like concat ( :5 , :6 ) or t1.user_name like concat ( :7 , :8 , :9 ) )|4|18|6||0|0|887551|221889|4|1|
|employee|select id , scene , employee_id , member_user_name username , finish_time , status from employee.backlog where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and expire_time between :4 and :5 order by id desc limit :6|4|27|15||0|0|1492524|413142|30|10|
|tenant|select count ( * ) amount from sneak_guest where tenant_app_id = :1 and status = :2 and create_shop_id = :3 and maintain_employee_id = :4 and create_time <= :5|4|4|1||0|0|11862|3716|4|1|
|authorization_service|insert into user_login_token ( id , platform_user_id , user_id , wx_user_id , wx_app_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 , null , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , null , null , null )|4|6|1||0|0|0|0|0|0|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 , :3 , :4 )|4|9|3||0|0|19510|10218|10|6|
|sms|select ifnull ( sum ( t2.sms_size ) , 0 ) as amount from sms.sms_send t1 join sms.sms_report t2 on t1.biz_id = t2.biz_id where t1.tenant_app_id = :1 and t1.create_time between date_format ( :2 , :3 ) and date_format ( :4 , :5 ) and t1.code = :6|4|13|9||0|0|6007|1843|4|1|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 )|4|7|3||0|0|20111|10221|24|10|
|user_service|select t1.id , t1.user_id as userid , t1.user_name as username , t1.sex , t1.mobile_no as mobileno , t1.head_img_url as headimg from user_service.tenant_member t1 join user_service.tenant_member_info t2 on t1.tenant_id = t2.tenant_id and t1.id = t2.id join user_service.user_employee t3 on t1.tenant_app_id = t3.tenant_wechatapp_id and t1.user_id = t3.user_id and t3.employee_id = :1 where t1.tenant_id = :2 and t1.tenant_app_id = :3 and t2.tenant_app_id = :4 and t2.shop_id = :5 order by t3.update_time desc , t1.id desc limit :6 , :7|4|7|2||0|0|1714816|428724|40|10|
|tenant|select e.id , e.employee_name from ( select distinct sg.maintain_employee_id from tenant.sneak_guest sg join tenant.sneak_guest_maintain sgm on sgm.sneak_guest_id = sg.id where sg.tenant_id = :1 and sg.tenant_app_id = :2 and sg.update_shop_id = :3 and sgm.create_time between :4 and :5 ) sg join tenant.employee e on e.id = sg.maintain_employee_id|4|7|2||0|0|83791|22398|32|11|
|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 , :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|3|29|11||0|0|512266|170766|3|1|
|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|6|3||0|0|143386|47820|3|1|
|user_service|select tm.user_id as id , tm.user_name as username , tm.head_img_url as headimgurl , tm.user_name as nickname , tm.mobile_no as mobile , tm.sex , if ( ifnull ( wu.is_subscribe , 0 ) = 0 , false , true ) as hassubscribe from user_service.tenant_member tm left join user_service.user_employee ue 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 join user_service.tenant_member_bind tmb on tmb.tenant_id = tm.tenant_id and tmb.tenant_app_id = tm.tenant_app_id and tmb.user_id = tm.user_id left join user_service.wx_user wu on wu.id = tmb.wx_user_id where tm.tenant_id = :1 and tm.tenant_app_id = :2 order by tm.id desc limit :3|3|3|1||0|0|932511|310847|36|12|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 , :3 , :4 , :5 , :6 , :7 )|3|4|1||0|0|15627|10214|13|7|
|user_service|select count ( 0 ) from ( select tm.user_id as id , tm.user_name as username , tm.head_img_url as headimgurl , tm.user_name as nickname , tm.mobile_no as mobile , tm.sex , if ( ifnull ( wu.is_subscribe , 0 ) = 0 , false , true ) as hassubscribe from user_service.tenant_member tm left join user_service.user_employee ue 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 join user_service.tenant_member_bind tmb on tmb.tenant_id = tm.tenant_id and tmb.tenant_app_id = tm.tenant_app_id and tmb.user_id = tm.user_id left join user_service.wx_user wu on wu.id = tmb.wx_user_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 , :54 , :55 , :56|3|34|23||0|0|248391|82797|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 , p.topping 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 where ( p.topping = :8 ) order by p.volume desc , p.id desc limit :9|3|4|1||0|0|32290|10814|17|6|
|tenant|select id , tenant_id , tenant_app_id , sneak_guest_maintain_id , sneak_guest_id , url , create_time , update_time from sneak_guest_maintain_file where ( tenant_app_id = :1 and sneak_guest_maintain_id in ( :2 , :3 , :4 ) )|3|13|8||0|0|520963|173660|10|4|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 , :3 )|3|8|4||0|0|13894|5399|10|5|
|employee|select id , tenant_id , tenant_app_id , backlog_id , url , status , create_time , update_time from backlog_file where ( tenant_id = :1 and tenant_app_id = :2 and backlog_id in ( :3 , :4 ) and status = :5 )|3|5|2||0|0|1690371|565388|4|2|
|tenant|select count ( 0 ) from ( select sg.id , sg.sneak_guest_no , sg.user_id , ey.employee_name maintainemployeename , sg.last_maintain_date , ws.shop_name createshopname , sg.status , sg.create_time , t1.employee_name createemployeename , sg.finish_date , gs.sales_id , gs.sales_no , w1.shop_name salesshopname , gs.sales_date , gs.product_name , gs.product_quantity , gs.amount salesamount , ifnull ( emp.employee_name , if ( sg.`status` = 'fail' , '系统' , '' ) ) as operfailemployeename from sneak_guest sg left join employee ey on sg.maintain_employee_id = ey.id left join tenant_wechatapp_shop ws on sg.create_shop_id = ws.id left join employee t1 on sg.create_employee_id = t1.id left join sneak_guest_sales gs on sg.tenant_app_id = gs.tenant_app_id and sg.id = gs.sneak_guest_id left join tenant_wechatapp_shop w1 on gs.shop_id = w1.id left join tenant.sneak_guest_maintain gm on gm.sneak_guest_id = sg.id and gm.event_type = :1 left join employee emp on gm.employee_id = emp.id where sg.tenant_app_id = :2 order by sg.id desc ) tmp_count|3|9|5||0|0|241774|185793|3|1|
|employee|select count ( 0 ) from employee.backlog where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and status = :4 and finish_time between :5 and :6 and employee_id = :7|3|7|3||0|0|6523|2804|3|1|
|coupon_service|select c.* from coupon_service.coupon c left join coupon_service.coupon_expire_task ct on ct.tenant_id = :1 and ct.tenant_app_id = :2 and c.id = ct.coupon_id where c.tenant_id = :3 and c.tenant_app_id = :4 and c.end_time between :5 and :6 and c.coupon_state in ( :7 ) and ct.id is null|3|17|11||0|0|145483|110426|603|401|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 , :3 , :4 , :5 )|3|8|4||0|0|9075|3096|1|1|
|user_service|select t1.id , t1.user_id as userid , t1.user_name as username , t1.sex , t1.mobile_no as mobileno , t1.head_img_url as headimg from user_service.tenant_member t1 join user_service.tenant_member_info t2 on t1.tenant_id = t2.tenant_id and t1.id = t2.id join user_service.user_employee t3 on t1.tenant_app_id = t3.tenant_wechatapp_id and t1.user_id = t3.user_id and t3.employee_id = :1 where t1.tenant_id = :2 and t1.tenant_app_id = :3 and t2.tenant_app_id = :4 and t2.shop_id = :5 order by t3.update_time desc , t1.id desc limit :6|3|17|9||0|0|560014|231267|30|10|
|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 , if ( coupon_type in ( 'point' , 'interact_point' ) , cu.face_value , 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 , cu.user_id , ce.source_user_id , ce.source_user_type , cal.create_time as abolishtime , cal.employee_id as abolishemployeeid 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 left join coupon_service.coupon_abolish_log cal on cal.tenant_id = cu.tenant_id and cal.tenant_app_id = cu.tenant_app_id and cal.coupon_id = cu.id where cu.tenant_app_id = :3 and ce.mobile_no = :4 ) tmp_count|3|32|15||0|0|244123|176682|2|1|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 , :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 ,|3|6|2||0|0|2232635|1110266|521|286|
|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_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 , :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|3|25|9||0|0|467896|155968|3|1|
|tenant|select id , tenant_id , tenant_app_id , sneak_guest_maintain_id , sneak_guest_id , url , create_time , update_time from sneak_guest_maintain_file where ( tenant_app_id = :1 and sneak_guest_maintain_id in ( :2 , :3 , :4 , :5 ) )|2|3|1||0|0|347300|173651|7|4|
|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|2|7|5||0|0|416031|357722|2|1|
|user_service|select count ( * ) from tenant_member_info where ( tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 )|2|3|2||0|0|372807|186406|2|1|
|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 , tmp.face_value as point , 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 <= ( select count ( * ) from coupon_service.employee_give_coupon_log where employee_give_coupon_id = egc.id ) then :4 else :5 end ) ) as state , tr.type as redpacktype , ifnull ( tr.min_price , :6 ) /100 as minprice from coupon_service.employee_give_coupon egc inner join coupon_service.coupon_push cp on egc.template_id = cp.template_id and cp.source = :7 and egc.id = cp.source_id and cp.state = :8 inner join coupon_service.template tmp on egc.template_id = tmp.id and tmp.state = :9 inner join coupon_service.template_grant_limit tgl on cp.id = tgl.coupon_push_id left join coupon_service.template_redpack tr on tr.template_id = tmp.id where egc.tenant_app_id = :10 and egc.state = :11 and ( egc.limit_grant_time = :12 or egc.grant_begin_time <= now ( ) ) and ( egc.limit_shop = :13 or exists ( select 1 from coupon_service.employee_give_coupon_shop cs where egc.id = cs.employee_give_id and cs.shop_id = :14 ) ) and egc.limit_role in ( :15 , :16 ) order by state asc , egc.id desc limit :17|2|2|1||0|0|2740888|1370444|14|7|
|tenant|select id , tenant_id , tenant_app_id , sneak_guest_maintain_id , sneak_guest_id , url , create_time , update_time from sneak_guest_maintain_file where ( tenant_app_id = :1 and sneak_guest_maintain_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 ) )|2|7|6||0|0|347380|173716|23|12|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :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 , :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|5|3||0|0|34502|17253|894|447|
|tenant|select id , tenant_id , tenant_app_id , sneak_guest_maintain_id , sneak_guest_id , url , create_time , update_time from sneak_guest_maintain_file where ( tenant_app_id = :1 and sneak_guest_maintain_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 ) )|2|6|3||0|0|347395|173708|10|8|
|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 union_id in ( :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 ) and un_assign_flag = :34 )|2|17|11||0|0|50550|25278|0|0|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 )|2|2|1||0|0|19|19|9|9|
|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 )|2|22|15||0|0|20238|12120|1|1|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :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 ) and eu.un_assign_flag = :39|2|7|6||0|0|38120|19063|68|34|
|user_service|select tenant_id , id , tenant_app_id , user_id , wx_user_id , erp_member_id , customer_user_id , wx_union_id , create_time , update_time from tenant_member_bind where ( tenant_id = :1 and tenant_app_id = :2 and user_id 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|2|2|1||0|0|1000|500|1000|500|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 )|2|2|1||0|0|173929|153745|30|15|
|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 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|2|2|1||0|0|1000|500|1000|500|
|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 , p.topping 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 where ( p.topping = :8 ) order by p.volume desc , p.id desc limit :9 , :10|2|2|1||0|0|21488|10771|12|6|
|tenant|select id , tenant_id , tenant_app_id , sneak_guest_maintain_id , sneak_guest_id , url , create_time , update_time from sneak_guest_maintain_file where ( tenant_app_id = :1 and sneak_guest_maintain_id in ( :2 , :3 , :4 , :5 , :6 ) )|2|3|2||0|0|347372|173720|6|4|
|tenant|select id , tenant_id , tenant_app_id , sneak_guest_maintain_id , sneak_guest_id , url , create_time , update_time from sneak_guest_maintain_file where ( tenant_app_id = :1 and sneak_guest_maintain_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 ) )|2|4|3||0|0|347308|173661|15|8|
|tenant|select * from erp_sales_detail where tenant_id = :1 and sales_erp_id = :2 order by sales_index|2|2|1||0|0|3|2|3|2|
|tenant|select count ( * ) from ( select sneak_guest_id from tenant.sneak_guest_maintain where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and create_time between :4 and :5 and event_type in ( :6 , :7 , :8 ) group by sneak_guest_id ) a|2|2|1||0|0|324336|162168|2|1|
|authorization_service|select id , tenant_id , account_id , type , login_name , hash_password , salt , user_id , employee_id , tenant_app_id , status , create_time , update_time from login_account where ( type = :1 and login_name = :2 )|2|2|1||0|0|78288|39144|2|1|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 )|2|2|1||0|0|52|29|30|16|
|tenant|select id , tenant_id , tenant_app_id , sneak_guest_maintain_id , sneak_guest_id , url , create_time , update_time from sneak_guest_maintain_file where ( tenant_app_id = :1 and sneak_guest_maintain_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 ) )|2|5|3||0|0|347382|173714|21|14|
|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 )|2|6|3||0|0|41155|34263|2|1|
|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.shop_id = :4 and bg.status in ( :5 , :6 ) and bg.leave_flag = :7 order by id desc limit :8|2|30|15||0|0|7186148|4676062|16|8|
|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 union_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 ) and un_assign_flag = :21 )|2|6|4||0|0|92836|46418|0|0|
|tenant|update employee_tenant_user set status = :1 where tenant_id = :2 and employee_id = :3|2|2|1||0|0|40670|20335|0|0|
|user_service|select * from user_employee where tenant_wechatapp_id = :1 and employee_id = :2|2|3|2||0|0|42936|23637|34|34|
|employee|update backlog_system set status = :1 , finish_time = now ( ) where tenant_app_id = :2 and scene = :3|2|3|1||0|0|579400|289700|0|0|
|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 like concat ( :8 , :9 ) )|2|3|2||0|0|444719|222811|2|1|
|value_added|-- 增值达到最大天数 select 'value_added_limit_contact' as limitdaytype , t.tenant_wechatapp_id as tenantappid , t.user_id as userid , min ( ue.employee_erp_id ) employee_erp_id , ue.dept_erp_id , group_concat ( t.product_barcode order by product_barcode asc ) as productcode , group_concat ( t.product_name order by product_barcode asc ) as productname from value_added_user t inner join value_added_user_extend ue on t.id = ue.id where t.tenant_wechatapp_id = :1 and t.state = :2 and t.start_add_time >= date_add ( date_format ( :3 , :4 ) , interval :5 * ( t.add_days-1 ) day ) and t.start_add_time < date_add ( date_format ( :6 , :7 ) , interval ( :8 * ( t.add_days-1 ) :9 :10 ) day ) group by t.tenant_wechatapp_id , t.user_id , ue.dept_erp_id|2|5|3||0|0|276650|223395|100|63|
|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 union_id in ( :2 , :3 ) and un_assign_flag = :4 )|1|14|14||0|0|51389|51389|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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , 188.00 , :11 , :12 , :13 , :14 , :15 ) on duplicate key update sales_date = :16 , member_erp_id = :17 , employee_erp_id = :18 , employee_name = :19 , dept_erp_id = :20 , amount = 188.00 , sales_remark = :21 , receipts = :22 , sales_status = :23 , is_sales = :24 , busi_date = :25|1|1|1||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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , 3985.00 , :11 , :12 , :13 , :14 , :15 ) on duplicate key update sales_date = :16 , member_erp_id = :17 , employee_erp_id = :18 , employee_name = :19 , dept_erp_id = :20 , amount = 3985.00 , sales_remark = :21 , receipts = :22 , sales_status = :23 , is_sales = :24 , busi_date = :25|1|1|1||0|0|0|0|0|0|
|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 union_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 ) and un_assign_flag = :17 )|1|1|1||0|0|51384|51384|0|0|
|coupon_service|select count ( 0 ) from coupon_service.template t left join coupon_service.template_redpack r on r.template_id = t.id left join coupon_service.template_activity a on a.template_id = t.id where t.tenant_app_id = :1 and ( t.tenant_app_id = :2 or t.tenant_app_id = :3 ) and t.coupon_type = :4|1|1|1||0|0|12788|12788|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 tmb.tenant_id = :1 and tmb.tenant_app_id = :2 and tmb.erp_member_id in ( :3 , :4 , :5 , :6 )|1|1|1||0|0|9|9|3|3|
|employee|select count ( 0 ) from employee.backlog where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and status = :4 and finish_time between :5 and :6|1|1|1||0|0|6242|6242|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 union_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 ) and un_assign_flag = :23 )|1|5|5||0|0|46418|46418|0|0|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 , :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|1|2|2||0|0|342035|342035|158|158|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 , :54 , :55 , :56 , :57 , :58 , :59 , :60 , :61 , :62 , :63 , :64 , :65 , :66 , :67 )|1|1|1||0|0|792629|792629|65|65|
|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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , -1585.00 , 0.00 , -528.00 , :17 ) on duplicate key update update_time = now ( ) , sales_type = :18 , product_barcode = :19 , product_name = :20 , cert_no = :21 , hand_size = :22 , category_erp_id = :23 , category_name = :24 , stone_weight = :25 , gold_weight = :26 , total_weight = :27 , quantity = :28 , amount_total = -1585.00 , amount_pay = 0.00 , integral = -528.00 , remark = :29|1|1|1||0|0|0|0|0|0|
|wx_gateway|insert into wx_template_msg ( id , tenant_id , tenant_app_id , user_id , push_id , tenant_user_open_id , template_id , template_no , url , data , msg_id , status , err_msg , title , content , create_time , update_time , tenant_short_name , tenant_app_name , user_mobile_no , user_name , user_head_img_url ) values ( :1 , :2 , :3 , :4 , null , :5 , :6 , :7 , :8 , ... , 足金精品挂件 , 硬金精品挂件 , 足金精品挂件 , 本厂足金旧料","color":"#000066"},"remark":{"value":"点击“详情”查看消费明细","color":"#ff3399"},"first":{"value":"感谢惠顾！","color":"#000000"}}' , :9 , null , null , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 )|1|1|1||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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , 659.00 , 659.00 , 659.00 , :17 ) on duplicate key update update_time = now ( ) , sales_type = :18 , product_barcode = :19 , product_name = :20 , cert_no = :21 , hand_size = :22 , category_erp_id = :23 , category_name = :24 , stone_weight = :25 , gold_weight = :26 , total_weight = :27 , quantity = :28 , amount_total = 659.00 , amount_pay = 659.00 , integral = 659.00 , remark = :29|1|1|1||0|0|0|0|0|0|
|erp_sync|delete from erp_sync.retry_data where 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 , :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|1|2|2||0|0|117530|117530|0|0|
|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 union_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 ) and un_assign_flag = :19 )|1|1|1||0|0|46418|46418|0|0|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 , :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 )|1|2|2||0|0|578877|578877|83|83|
|goods|select shop_id from goods.goods_take_shop where goods_id = :1 and activity_id = :2|1|1|1||0|0|46527|46527|26|26|
|employee|select id , scene , employee_id , member_user_name username , finish_time , status from employee.backlog where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and expire_time between :4 and :5 and status != :6 order by id desc limit :7 , :8|1|15|15||0|0|357727|357727|0|0|
|activity_service|select count ( * ) from online_sign_user where ( tenant_app_id = :1 and day > :2 )|1|1|1||0|0|53599|53599|1|1|
|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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , 3087.00 , 3087.00 , 3087.00 , :17 ) on duplicate key update update_time = now ( ) , sales_type = :18 , product_barcode = :19 , product_name = :20 , cert_no = :21 , hand_size = :22 , category_erp_id = :23 , category_name = :24 , stone_weight = :25 , gold_weight = :26 , total_weight = :27 , quantity = :28 , amount_total = 3087.00 , amount_pay = 3087.00 , integral = 3087.00 , remark = :29|1|1|1||0|0|0|0|0|0|
|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 union_id in ( :2 ) and un_assign_flag = :3 )|1|1|1||0|0|17780|17780|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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , 204.00 , 204.00 , 2.00 , :17 ) on duplicate key update update_time = now ( ) , sales_type = :18 , product_barcode = :19 , product_name = :20 , cert_no = :21 , hand_size = :22 , category_erp_id = :23 , category_name = :24 , stone_weight = :25 , gold_weight = :26 , total_weight = :27 , quantity = :28 , amount_total = 204.00 , amount_pay = 204.00 , integral = 2.00 , remark = :29|1|1|1||0|0|0|0|0|0|
|gift_mail|select count ( 0 ) from trade where tenant_wechatapp_id = :1 and user_id = :2|1|1|1||0|0|3119|3119|1|1|
|activity_service|select count ( * ) from online_sign_user_sign_log where ( tenant_app_id = :1 )|1|4|4||0|0|194084|194084|1|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 )|1|1|1||0|0|94659|94659|1|1|
|user_service|select count ( * ) from user_service.user_employee ue join user_service.tenant_member_info tu on tu.tenant_id = ue.tenant_id and 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|1|7|7||0|0|63012|63012|1|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|1|1|1||0|0|763570|763570|10|10|
|employee|update backlog set status = :1 , finish_time = now ( ) where tenant_app_id = :2 and employee_id = :3 and status in ( :4 , :5 ) and shop_id = :6|1|1|1||0|0|218|218|0|0|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 )|1|1|1||0|0|417076|417076|10|10|
|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.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 in ( :3 , :4 , :5 , :6 , :7 , :8 )|1|1|1||0|0|24|24|6|6|
|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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , 2776.00 , 2776.00 , 2776.00 , :17 ) on duplicate key update update_time = now ( ) , sales_type = :18 , product_barcode = :19 , product_name = :20 , cert_no = :21 , hand_size = :22 , category_erp_id = :23 , category_name = :24 , stone_weight = :25 , gold_weight = :26 , total_weight = :27 , quantity = :28 , amount_total = 2776.00 , amount_pay = 2776.00 , integral = 2776.00 , remark = :29|1|2|2||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.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 )|1|1|1||0|0|547474|547474|1|1|
|employee|select id , tenant_id , tenant_app_id , backlog_id , url , status , create_time , update_time from backlog_file where ( tenant_id = :1 and tenant_app_id = :2 and backlog_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 ) and status = :11 )|1|3|3||0|0|560523|560523|0|0|
|payment|select t1.id , t2.goods_order_source as goodsordersource , t2.goods_order_no as goodsorderno , t1.order_start_time as orderstarttime from refund_order t1 join pay_order t2 on t1.pay_order_id = t2.id where t1.refund_status = :1 order by t1.id asc limit :2|1|1|1||0|0|6281|6281|0|0|
|employee|select id , tenant_id , tenant_app_id , backlog_id , url , status , create_time , update_time from backlog_file where ( tenant_id = :1 and tenant_app_id = :2 and backlog_id in ( :3 ) and status = :4 )|1|5|5||0|0|560531|560531|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 )|1|1|1||0|0|3486|3486|1|1|
|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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , 1030.00 , 556.20 , 515.00 , :17 ) on duplicate key update update_time = now ( ) , sales_type = :18 , product_barcode = :19 , product_name = :20 , cert_no = :21 , hand_size = :22 , category_erp_id = :23 , category_name = :24 , stone_weight = :25 , gold_weight = :26 , total_weight = :27 , quantity = :28 , amount_total = 1030.00 , amount_pay = 556.20 , integral = 515.00 , remark = :29|1|1|1||0|0|0|0|0|0|
|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 union_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 ) and un_assign_flag = :13 )|1|1|1||0|0|16783|16783|0|0|
|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 union_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 ) and un_assign_flag = :25 )|1|1|1||0|0|2589|2589|0|0|
|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 union_id in ( :2 , :3 , :4 ) and un_assign_flag = :5 )|1|1|1||0|0|51741|51741|0|0|
|employee|select id , scene , employee_id , member_user_name username , finish_time , status from employee.backlog where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and expire_time between :4 and :5 and status != :6 order by id desc limit :7|1|1|1||0|0|460171|460171|10|10|
|tenant|select id , tenant_id , tenant_app_id , sneak_guest_maintain_id , sneak_guest_id , url , create_time , update_time from sneak_guest_maintain_file where ( tenant_app_id = :1 and sneak_guest_maintain_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 ) )|1|2|2||0|0|173715|173715|6|6|
|account|select id , account_type , act_name , user_name , mobile_no , receive_time , order_status , total_amount , biz_id , mch_billno as orderno , failure_reason as failmsg from account.wx_redpacket_send_order where tenant_id = :1 and tenant_wechatapp_id = :2 order by create_time desc limit :3|1|1|1||0|0|34283|34283|20|20|
|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 union_id in ( :2 , :3 , :4 , :5 ) and un_assign_flag = :6 )|1|2|2||0|0|46418|46418|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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , -1317.00 , 0.00 , -878.00 , :17 ) on duplicate key update update_time = now ( ) , sales_type = :18 , product_barcode = :19 , product_name = :20 , cert_no = :21 , hand_size = :22 , category_erp_id = :23 , category_name = :24 , stone_weight = :25 , gold_weight = :26 , total_weight = :27 , quantity = :28 , amount_total = -1317.00 , amount_pay = 0.00 , integral = -878.00 , remark = :29|1|1|1||0|0|0|0|0|0|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 , :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 )|1|2|2||0|0|349444|349444|80|80|
|warranty_service|select count ( * ) from warranty where user_id = :1 and tenant_wechatapp_id = :2 and is_disable = :3|1|1|1||0|0|790|790|1|1|
|order|select od.id , od.order_no orderno , od.status , od.take_type taketype , od.create_time createtime , od.remark , od.total_fee totalfee , od.freight_fee freightfee , od.discount_fee discountfee , od.take_id takeid , od.payment_fee paymentfee , dt.product_id productid , dt.price , dt.quantity , dt.sku_id skuid , dt.art_no artno , dt.image_url imageurl , dt.product_name productname , dt.take_remark takeremark , dt.take_day takeday , od.product_fee productfee , ad.user_name receivename , ad.mobile_no mobileno , ad.shop_name shopname , ad.address , ad.express_no expressno , ad.express_company expresscompany , od.finish_type finishtype , od.send_time sendtime , od.receive_time receivetime , od.finish_time finishtime , od.child_status childstatus , od.send_good_remark sendgoodremark , od.service_flag serviceflag , od.coupon_id couponid , od.tenant_wechatapp_id tenantappid , od.tenant_id from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.status = :1 and od.send_time <= :2 and od.take_type = :3|1|1|1||0|0|124178|124178|0|0|
|score_player|select superviser0_.id as id1_25_ , superviser0_.create_time as create_t2_25_ , superviser0_.description as descript3_25_ , superviser0_.examine_status as examine_4_25_ , superviser0_.examine_time as examine_5_25_ , superviser0_.primary_user_id as primary_6_25_ , superviser0_.primary_user_name as primary_7_25_ , superviser0_.primary_value as primary_8_25_ , superviser0_.reject_reason as reject_r9_25_ , superviser0_.secondary_user_id as seconda10_25_ , superviser0_.secondary_user_name as seconda11_25_ , superviser0_.secondary_value as seconda12_25_ , superviser0_.shop_id as shop_id13_25_ , superviser0_.status as status14_25_ , superviser0_.supervise_rule_id as supervi15_25_ , superviser0_.supervise_type as supervi16_25_ , superviser0_.supervisor_user_id as supervi17_25_ , superviser0_.tenant_id as tenant_18_25_ , superviser0_.update_time as update_19_25_ from supervise_record superviser0_ where superviser0_.tenant_id = :1 and ( superviser0_.examine_status is null or superviser0_.examine_status = :2 ) order by superviser0_.id desc limit :3|1|1|1||0|0|18399|18399|0|0|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 , :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 )|1|1|1||0|0|244074|244074|99|99|
|corpwx|update external_user set un_assign_flag = :1 where ( tenant_id = :2 and corp_user_id = :3 and user_id = :4 )|1|1|1||0|0|1|1|0|0|
|work_tracer|select * from work_tracer.work_report wr where exists ( select * from work_tracer.task t where t.tenant_id = wr.tenant_id and t.task_group_id = wr.id and t.status = :1 and t.task_type = :2 ) and tenant_id = :3|1|2|2||0|0|22541|22541|248|248|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 )|1|1|1||0|0|5402|5402|8|8|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 )|1|2|2||0|0|143830|143830|36|36|
|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 , 2457.00 , :8 , :9 , :10 , :11 , :12 ) on duplicate key update update_time = now ( )|1|1|1||0|0|0|0|0|0|
|tenant|select id , tenant_id , tenant_app_id , sneak_guest_maintain_id , sneak_guest_id , url , create_time , update_time from sneak_guest_maintain_file where ( tenant_app_id = :1 and sneak_guest_maintain_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 ) )|1|5|5||0|0|173708|173708|4|4|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 ) and eu.un_assign_flag = :11|1|1|1||0|0|34575|34575|0|0|
|mysql|delete from wx_gateway.wx_template_msg where create_time < date_sub ( now ( ) , interval :1 day )|1|19|19||0|0|705888|705888|0|0|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 )|1|2|2||0|0|461296|461296|19|19|
|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 union_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 ) and un_assign_flag = :15 )|1|1|1||0|0|46418|46418|0|0|
|employee|select count ( 0 ) from employee.backlog bg where bg.tenant_app_id = :1 and bg.shop_id = :2 and bg.scene = :3 and bg.leave_flag = :4|1|2|2||0|0|34234|34234|1|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_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 , :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 )|1|1|1||0|0|80798|80798|1|1|
|coupon_service|select * from coupon_service.coupon where datediff ( date_format ( end_time , :1 ) , date_format ( now ( ) , :2 ) ) = :3 and coupon_state in ( :4 )|1|15|15||0|0|143896|143896|0|0|
|employee|select id , tenant_id , tenant_app_id , backlog_id , url , status , create_time , update_time from backlog_file where ( tenant_id = :1 and tenant_app_id = :2 and backlog_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 ) and status = :12 )|1|2|2||0|0|564080|564080|0|0|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :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 , :46 , :47 , :48 , :49 , :50 , :51 , :52 , :53 , :54 , :55 , :56 , :57 , :58 , :59 , :60 , :61 , :62 , :63 ) and eu.un_assign_flag = :64|1|1|1||0|0|21850|21850|71|71|
|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 union_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 ) and un_assign_flag = :9 )|1|1|1||0|0|17780|17780|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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , 9.00 , 9.00 , 0.45 , :17 ) on duplicate key update update_time = now ( ) , sales_type = :18 , product_barcode = :19 , product_name = :20 , cert_no = :21 , hand_size = :22 , category_erp_id = :23 , category_name = :24 , stone_weight = :25 , gold_weight = :26 , total_weight = :27 , quantity = :28 , amount_total = 9.00 , amount_pay = 9.00 , integral = 0.45 , remark = :29|1|1|1||0|0|0|0|0|0|
|user_service|select ue.id as useremployeeid , ue.tenant_id as tenantid , ue.tenant_wechatapp_id as tenantappid , tmi.shop_id as shopid , tu.user_id as userid , tu.user_name as nickname , tu.user_name as username , tu.mobile_no as mobileno , tu.head_img_url as headimgurl from user_service.user_employee ue join user_service.tenant_member tu on tu.tenant_id = ue.tenant_id and ue.tenant_wechatapp_id = tu.tenant_app_id and ue.user_id = tu.user_id join user_service.tenant_member_info tmi on tmi.tenant_id = ue.tenant_id and ue.tenant_wechatapp_id = tmi.tenant_app_id and ue.user_id = tmi.user_id where ue.tenant_id = :1 and ue.tenant_wechatapp_id = :2 and ue.employee_id = :3 and tmi.shop_id = :4|1|1|1||0|0|130720|130720|84|84|
|activity_service|select date_format ( create_time , '%y-%m-%d' ) as `date` , count ( * ) as quantity from activity_service.online_sign_user_sign_log where tenant_app_id = :1 and date_format ( create_time , :2 ) between :3 and :4 group by date_format ( create_time , '%y-%m-%d' )|1|6|6||0|0|194144|194144|30|30|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 ) and eu.un_assign_flag = :9|1|1|1||0|0|6063|6063|0|0|
|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 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 , :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 ,|1|1|1||0|0|2661|2661|2661|2661|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :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 , :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|1|1|1||0|0|19516|19516|471|471|
|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 )|1|1|1||0|0|94656|94656|1|1|
|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 , tmp.face_value as point , 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 <= ( select count ( * ) from coupon_service.employee_give_coupon_log where employee_give_coupon_id = egc.id ) then :4 else :5 end ) ) as state , tr.type as redpacktype , ifnull ( tr.min_price , :6 ) /100 as minprice from coupon_service.employee_give_coupon egc inner join coupon_service.coupon_push cp on egc.template_id = cp.template_id and cp.source = :7 and egc.id = cp.source_id and cp.state = :8 inner join coupon_service.template tmp on egc.template_id = tmp.id and tmp.state = :9 inner join coupon_service.template_grant_limit tgl on cp.id = tgl.coupon_push_id left join coupon_service.template_redpack tr on tr.template_id = tmp.id where egc.tenant_app_id = :10 and egc.state = :11 and ( egc.limit_grant_time = :12 or egc.grant_begin_time <= now ( ) ) and ( egc.limit_shop = :13 or exists ( select 1 from coupon_service.employee_give_coupon_shop cs where egc.id = cs.employee_give_id and cs.shop_id = :14 ) ) and egc.limit_role in ( :15 , :16 , :17 ) order by state asc , egc.id desc limit :18|1|1|1||0|0|1565617|1565617|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|853739|853739|753|753|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 )|1|1|1||0|0|266950|266950|41|41|
|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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , 1970.00 , :11 , :12 , :13 , :14 , :15 ) on duplicate key update sales_date = :16 , member_erp_id = :17 , employee_erp_id = :18 , employee_name = :19 , dept_erp_id = :20 , amount = 1970.00 , sales_remark = :21 , receipts = :22 , sales_status = :23 , is_sales = :24 , busi_date = :25|1|2|2||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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , 5172.00 , 5172.00 , 5172.00 , :17 ) on duplicate key update update_time = now ( ) , sales_type = :18 , product_barcode = :19 , product_name = :20 , cert_no = :21 , hand_size = :22 , category_erp_id = :23 , category_name = :24 , stone_weight = :25 , gold_weight = :26 , total_weight = :27 , quantity = :28 , amount_total = 5172.00 , amount_pay = 5172.00 , integral = 5172.00 , remark = :29|1|1|1||0|0|0|0|0|0|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :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 ) and eu.un_assign_flag = :31|1|1|1||0|0|7012|7012|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 and r.role_code in ( :9 , :10 , :11 , :12 , :13 ) order by field ( r.role_code , 'system' , 'super_admin' , 'admin' , 'financial' , 'tenant_admin' , 'tenant_operation' , 'tenant_wechatapp_admin' , 'tenant_wechatapp_operation' , 'tenant_shop_manager' , 'tenant_sales' , 'no_market_reporting' )|1|1|1||0|0|109409|109409|3|3|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 ) and eu.un_assign_flag = :25|1|1|1||0|0|1017|1017|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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , 128.00 , 128.00 , 128.00 , :17 ) on duplicate key update update_time = now ( ) , sales_type = :18 , product_barcode = :19 , product_name = :20 , cert_no = :21 , hand_size = :22 , category_erp_id = :23 , category_name = :24 , stone_weight = :25 , gold_weight = :26 , total_weight = :27 , quantity = :28 , amount_total = 128.00 , amount_pay = 128.00 , integral = 128.00 , remark = :29|1|1|1||0|0|0|0|0|0|
|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 union_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 ) and un_assign_flag = :14 )|1|1|1||0|0|46419|46419|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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , 5188.00 , 2137.00 , 518.00 , :17 ) on duplicate key update update_time = now ( ) , sales_type = :18 , product_barcode = :19 , product_name = :20 , cert_no = :21 , hand_size = :22 , category_erp_id = :23 , category_name = :24 , stone_weight = :25 , gold_weight = :26 , total_weight = :27 , quantity = :28 , amount_total = 5188.00 , amount_pay = 2137.00 , integral = 518.00 , remark = :29|1|1|1||0|0|0|0|0|0|
|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|1|2|2||0|0|47805|47805|15|15|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :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 , :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|1|2|2||0|0|22245|22245|467|467|
|tenant|select id , tenant_id , tenant_app_id , sneak_guest_maintain_id , sneak_guest_id , url , create_time , update_time from sneak_guest_maintain_file where ( tenant_app_id = :1 and sneak_guest_maintain_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 ) )|1|3|3||0|0|173668|173668|14|14|
|corpwx|select * from corpwx.external_user eu join corpwx.external_user_bind eub on eu.tenant_id = eub.tenant_id and eu.user_id = eub.external_user_id where eu.tenant_id = :1 and eub.wx_user_id in ( :2 ) and eu.un_assign_flag = :3|1|1|1||0|0|6063|6063|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 )|1|1|1||0|0|0|0|0|0|
|tenant|update erp_sales set sales_status = :1 where tenant_id = :2 and tenant_wechatapp_id = :3 and sales_erp_id = :4 and sales_no = :5|1|1|1||0|0|1|1|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 ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , 2660.80 , 2660.80 , 8.00 , :17 ) on duplicate key update update_time = now ( ) , sales_type = :18 , product_barcode = :19 , product_name = :20 , cert_no = :21 , hand_size = :22 , category_erp_id = :23 , category_name = :24 , stone_weight = :25 , gold_weight = :26 , total_weight = :27 , quantity = :28 , amount_total = 2660.80 , amount_pay = 2660.80 , integral = 8.00 , remark = :29|1|1|1||0|0|0|0|0|0|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 )|1|1|1||0|0|281983|281983|47|47|
|wx_gateway|insert into wx_template_msg ( id , tenant_id , tenant_app_id , user_id , push_id , tenant_user_open_id , template_id , template_no , url , data , msg_id , status , err_msg , title , content , create_time , update_time , tenant_short_name , tenant_app_name , user_mobile_no , user_name , user_head_img_url ) values ( :1 , :2 , :3 , :4 , null , :5 , :6 , :7 , :8 , ... ( 1.00 ) ... 客服电话：4006564465","color":"#ff3399"},"first":{"value":"尊敬的张兰松，您好","color":"#000000"}}' , :9 , null , null , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , null )|1|1|1||0|0|0|0|0|0|
|message_push|insert into message_log ( id , tenant_id , tenant_app_id , user_id , scene_type , msg_id , content , post_data , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , ... = 1095869969419313152#/member/shopping_record","scenetype":"sales","paramsobj":"{\\\\"first\\\\":\\\\"感谢惠顾！\\\\" , \\\\"keyword1\\\\":\\\\"怀化中国珠宝迎丰路店\\\\" , \\\\"keyword2\\\\":\\\\"足金耳饰,足金999旧料,套碗,物料\\\\" , \\\\"keyword3\\\\":\\\\"695.00\\\\" , \\\\"keyword4\\\\":\\\\"2021-11-17\\\\" , \\\\"keyword5\\\\":\\\\"qtxsd-0020-00006875\\\\" , \\\\"keyword6\\\\":null , \\\\"keyword7\\\\":null , \\\\"keyword8\\\\":null , \\\\"keyword9\\\\":null , \\\\"remark\\\\":\\\\"点击“详情”查看消费明细\\\\"}"}' , :8 , :9 )|1|1|1||0|0|0|0|0|0|
|tenant|select count ( 0 ) from sneak_guest sg left join employee ey on sg.maintain_employee_id = ey.id where sg.tenant_app_id = :1 and sg.create_shop_id = :2 and sg.maintain_employee_id = :3 and sg.create_time <= :4 and sg.status = :5|1|1|1||0|0|2511|2511|1|1|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id in ( :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 )|1|1|1||0|0|159187|159187|16|16|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 , :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|1|2|2||0|0|311371|311371|147|147|
|tenant|select sum ( tt.createnum ) as createnum , sum ( tt.maintainnum ) as maintainnum , sum ( tt.successnum ) as successnum , sum ( tt.failnum ) as failnum from ( select count ( * ) as createnum , 0 as maintainnum , 0 as successnum , 0 as failnum from tenant.sneak_guest g where g.tenant_app_id = :1 and g.create_time >= :2 and g.create_time < :3 union all select 0 as createnum , count ( distinct t.sneak_guest_id ) as maintainnum , 0 as successnum , 0 as failnum from tenant.sneak_guest g join tenant.sneak_guest_maintain t on t.sneak_guest_id = g.id where g.tenant_app_id = :4 and t.event_type in ( :5 , :6 , :7 ) and t.create_time >= :8 and t.create_time < :9 union all select 0 as createnum , 0 as maintainnum , count ( distinct t.sneak_guest_id ) as successnum , 0 as failnum from tenant.sneak_guest g join tenant.sneak_guest_maintain t on t.sneak_guest_id = g.id where g.tenant_app_id = :10 and t.event_type in ( :11 ) and t.create_time >= :12 and t.create_time < :13 union all select 0 as createnum , 0 as maintainnum , 0 as successnum , count ( distinct t.sneak_guest_id ) as failnum from tenant.sneak_guest g join tenant.sneak_guest_maintain t on t.sneak_guest_id = g.id where g.tenant_app_id = :14 and t.event_type in ( :15 ) and t.create_time >= :16 and t.create_time < :17 ) tt|1|2|2||0|0|186451|186451|1|1|
|coupon_service|select count ( 0 ) from coupon_service.template t left join coupon_service.template_redpack r on r.template_id = t.id left join coupon_service.template_activity a on a.template_id = t.id where t.tenant_app_id = :1 and ( t.tenant_app_id = :2 or t.tenant_app_id = :3 )|1|1|1||0|0|12788|12788|1|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 )|1|1|1||0|0|94662|94662|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 , od.finish_type finishtype , od.send_time sendtime , od.receive_time receivetime , od.finish_time finishtime , od.child_status childstatus , od.send_good_remark sendgoodremark , od.service_flag serviceflag , od.coupon_id couponid , od.tenant_wechatapp_id tenantappid , od.tenant_id tenantid , od.pay_id payid , od.user_id userid , od.user_name username , od.mobile_no buymobileno , od.activity_id , od.offline_payment_fee , od.activity_type , dt.spec , od.take_shop_id , od.take_shop_name , od.take_employee_user_id , od.take_employee_user_name from order_info od left join order_detail dt on od.id = dt.order_id where od.status = :1 and od.receive_time <= :2|1|1|1||0|0|124183|124183|5|5|
|employee|select id , tenant_id , tenant_app_id , backlog_id , url , status , create_time , update_time from backlog_file where ( tenant_id = :1 and tenant_app_id = :2 and backlog_id in ( :3 , :4 , :5 , :6 ) and status = :7 )|1|1|1||0|0|564908|564908|0|0|
|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 ) 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 , :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 ,|1|1|1||0|0|3608|3608|1|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 )|1|1|1||0|0|92913|92913|1|1|
|gift_mail|select count ( * ) from gift_mail.trade t where t.tenant_wechatapp_id = :1 and t.trade_type = :2 and t.order_status = :3|1|1|1||0|0|2772|2772|1|1|
|employee|select count ( * ) from employee.backlog where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and status = :4 and expire_time between :5 and :6|1|1|1||0|0|614|614|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 union_id in ( :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 ) and un_assign_flag = :31 )|1|2|2||0|0|38172|38172|0|0|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 , :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 )|1|1|1||0|0|792649|792649|85|85|
|coupon_service|select id , tenant_id , tenant_app_id , template_id , coupon_push_id , coupon_no , coupon_state , user_id , coupon_name , coupon_type , face_value , discount , use_threshold , begin_time , end_time , wx_card_id , wx_card_no , source , source_id , business_id , create_time , update_time from coupon where ( tenant_id = :1 and tenant_app_id = :2 and wx_card_no = :3 )|1|5|5||0|0|34843|34843|1|1|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id in ( :3 , :4 , :5 , :6 )|1|1|1||0|0|50085|50085|4|4|
|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 )|1|1|1||0|0|94657|94657|1|1|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 , :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 )|1|2|2||0|0|505606|505606|103|103|
|mysql|delete from message_push.message_log where create_time < date_sub ( now ( ) , interval :1 day )|1|29|29||0|0|1720253|1720253|0|0|
|user_service|select tu.user_id , tm.shop_id , mb.erp_member_id membererpid , tu.mobile_no , tu.user_name , ue.employee_id , tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and mb.erp_member_id 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 , :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 ,|1|2|2||0|0|407593|407593|128|128|
|user_service|select tu.user_name as membername , tu.mobile_no as mobile , emg.grade_name as gradelevel , tu.user_id as memberuserid , tu.tenant_id as tenantid , tu.tenant_app_id as tenantappid , ue.employee_id as employeeid , ue.employee_erp_id as employeeerpid , tmb.erp_member_id as membererpid , tmi.shop_id from user_service.tenant_member tu join user_service.tenant_member_info tmi on tu.tenant_id = tmi.tenant_id and tu.id = tmi.id left join user_service.tenant_member_bind tmb on tu.tenant_id = tmb.tenant_id and tu.id = tmb.id left join user_service.erp_member_grade emg on tu.tenant_id = emg.tenant_id and tmi.grade_id = emg.grade_erp_id left join user_service.user_employee ue on tu.tenant_id = ue.tenant_id and tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = :1 and tu.tenant_app_id = :2 and tu.user_id 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 , :54 , :55 , :56 , :57 , :58 , :59 , :60 , :61 , :62 , :63 , :64 , :65 , :66 , :67 , :68 , :69 , :70 , :71 , :72|1|1|1||0|0|2005|2005|401|401|
|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 goods.goods_up_app t on gs.id = t.goods_id and t.tenant_app_id = :1 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 = :2 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 > :3 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 :4 = :5 and gs.topping = :6 ) tmp|1|1|1||0|0|80183|80183|1|1|
