|数据库名称|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 where employee_id in ( :1 ) and ue.tenant_id = :2 and ue.tenant_wechatapp_id = :3 and tmi.shop_id = :4 group by ue.employee_id|105|154|3||0|0|30330780|411616|105|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|68|272|10||0|0|203|5|0|0|
|corpwx|update external_user set un_assign_flag = :1 where ( tenant_id = :2 and un_assign_flag = :3 )|52|58|4||0|0|49402972|951348|0|0|
|user_service|select count ( * ) from user_service.tenant_member tm left join user_service.user_employee t3 on tm.tenant_id = t3.tenant_id and tm.user_id = t3.user_id and tm.tenant_app_id = t3.tenant_wechatapp_id join user_service.tenant_member_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|48|90|3||0|0|13714706|655570|48|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|40|89|8||0|0|4691393|178634|40|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|36|50|3||0|0|18754614|739700|36|1|
|tenant|select es.id , es.sales_no , es.sales_date , es.member_erp_id , es.sales_erp_id , es.is_sales from erp_sales es where es.tenant_id = :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|33|94|10||0|0|22284551|880243|1|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|26|57|4||0|0|1178732|64222|26|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|19|87|6||0|0|3087503|385375|19|1|
|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|14|132|11||0|0|1384967|98952|14|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|12|19|2||0|0|108095|16797|12|1|
|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|11|22|4||0|0|2442075|222258|6303|583|
|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|11|14|1||0|0|61235|12981|27|5|
|user_service|select tm.user_id as userid , tm.head_img_url as headimgurl , tm.user_name as nickname , tm.mobile_no as mobileno , tm.sex , date_format ( tm.create_time , '%y-%m-%d%h:%i:%s' ) as registertime , tm.id as tenantuserid from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id left join user_service.user_employee t3 on tm.user_id = t3.user_id and tm.tenant_id = t3.tenant_id and tm.tenant_app_id = t3.tenant_wechatapp_id where t3.id is null and tmi.shop_id = :1 and tmi.tenant_id = :2 and tmi.tenant_app_id = :3 order by tm.id asc limit :4 , :5|10|11|1||0|0|7733890|773434|100|10|
|coupon_service|update coupon_service.coupon_write_off_log set state = :1 where coupon_id = :2|7|16|2||0|0|4252830|609050|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|7|2||0|0|415983|69346|135|26|
|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|5|19|4||0|0|587616|117525|60|12|
|user_service|select * from user_service.erp_member em join user_service.erp_member_info emi on em.tenant_id = emi.tenant_id and em.tenant_wechatapp_id = emi.tenant_wechatapp_id and em.member_erp_id = emi.erp_member_id where em.tenant_id = :1 and length ( em.mobile_no ) = :2 limit :3 , :4|5|5|1||0|0|142767|31864|4623|1024|
|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 ,|4|6|2||0|0|2464480|713276|965|362|
|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|4|6|2||0|0|1054981|356581|4|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 )|3|4|1||0|0|401310|133770|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 from coupon_service.coupon cu join coupon_service.coupon_extend ce on ce.id = cu.id left join coupon_service.coupon_write_off_log wol on wol.tenant_app_id = cu.tenant_app_id and wol.coupon_id = cu.id and wol.state = :1 left join coupon_service.reservation r on r.coupon_user_id = cu.id and r.state = :2 where cu.tenant_app_id = :3 and cu.template_id = :4 ) tmp_count|3|10|4||0|0|111071|43499|3|1|
||select * from user_service.tenant_member_bind where erp_member_id is null order by id desc limit :1|2|72|40||0|0|18578761|9289616|200|100|
|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|2|2|1||0|0|587435|301929|20|10|
|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 )|2|3|2||0|0|517043|266028|76|38|
|user_service|select ue.user_id as id , tm.user_name as username , tm.head_img_url as headimgurl , tm.user_name as nickname , tm.mobile_no as mobile , tm.sex from user_service.user_employee ue join user_service.tenant_member tm on tm.tenant_id = ue.tenant_id and tm.tenant_app_id = ue.tenant_wechatapp_id and tm.user_id = ue.user_id join user_service.tenant_member_info tmi on tmi.tenant_id = tm.tenant_id and tmi.id = tm.id where ue.employee_id = :1 and ue.tenant_id = :2 and ue.tenant_wechatapp_id = :3 and tmi.shop_id = :4 order by tm.id desc limit :5 , :6|2|2|1||0|0|1217284|713702|17|10|
||delete from user_service.erp_member_info where tenant_id = :1|2|38|37||0|0|395959|386869|0|0|
||delete from user_service.erp_member where tenant_id = :1|2|74|73||0|0|395959|386869|0|0|
|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 )|2|2|1||0|0|59122|29579|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 )|2|2|1||0|0|451699|315144|34|17|
|tenant|select esd.id , esd.sales_erp_id , es.employee_name , esd.product_barcode , es.sales_no , es.member_erp_id , esd.category_name , es.sales_date , esd.category_erp_id , esd.product_name , esd.cert_no , esd.amount_pay , esd.sales_index , ifnull ( ee.not_add_value_plan , 0 ) as not_add_value_plan from erp_sales_detail esd join erp_sales es on es.tenant_wechatapp_id = esd.tenant_wechatapp_id and es.sales_erp_id = esd.sales_erp_id left join erp_sales_extend ee on es.tenant_wechatapp_id = ee.tenant_wechatapp_id and es.sales_erp_id = ee.sales_erp_id and esd.sales_index = ee.sales_index where es.sales_status = :1 and es.tenant_wechatapp_id = :2 and esd.product_barcode = :3 order by es.sales_date desc|2|2|1||0|0|14867|7436|2783|1392|
|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 )|1|1|1||0|0|49194|49194|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 from coupon_service.coupon cu join coupon_service.coupon_extend ce on ce.id = cu.id left join coupon_service.coupon_write_off_log wol on wol.tenant_app_id = cu.tenant_app_id and wol.coupon_id = cu.id and wol.state = :1 left join coupon_service.reservation r on r.coupon_user_id = cu.id and r.state = :2 where cu.tenant_app_id = :3 and cu.coupon_state = :4 and cu.create_time >= :5 and cu.create_time <= :6 and cu.template_id = :7 and cu.source = :8 ) tmp_count|1|2|2||0|0|43450|43450|1|1|
|coupon_service|select count ( 0 ) from ( select cu.id , cu.coupon_name , cu.coupon_type , cu.coupon_no , cu.source as couponchannel , cu.coupon_state , ce.user_name , ce.creator_user_name as creatorname , 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 from coupon_service.coupon cu join coupon_service.coupon_extend ce on ce.id = cu.id left join coupon_service.coupon_write_off_log wol on wol.tenant_app_id = cu.tenant_app_id and wol.coupon_id = cu.id and wol.state = :1 left join coupon_service.reservation r on r.coupon_user_id = cu.id and r.state = :2 where cu.tenant_app_id = :3 and cu.source = :4 ) tmp_count|1|3|3||0|0|52169|52169|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 )|1|13|13||0|0|280622|280622|1|1|
|coupon_service|select count ( 0 ) from ( select cu.id , cu.coupon_name , cu.coupon_type , cu.coupon_no , cu.source as couponchannel , cu.coupon_state , ce.user_name , ce.creator_user_name as creatorname , 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 from coupon_service.coupon cu join coupon_service.coupon_extend ce on ce.id = cu.id left join coupon_service.coupon_write_off_log wol on wol.tenant_app_id = cu.tenant_app_id and wol.coupon_id = cu.id and wol.state = :1 left join coupon_service.reservation r on r.coupon_user_id = cu.id and r.state = :2 where cu.tenant_app_id = :3 and cu.coupon_type = :4 and cu.create_time >= :5 and cu.create_time <= :6 and cu.template_id = :7 ) tmp_count|1|1|1||0|0|49694|49694|1|1|
|value_added|-- 根据添加时间得出当前增值金额 update value_added_user set amount_added = if ( :1 > ( ( ( added_percent_per_day / :2 ) * if ( :3 >= timestampdiff ( day , date_format ( start_add_time , :4 ) , now ( ) ) :5 :6 :7 add_days , timestampdiff ( day , date_format ( start_add_time , :8 ) , now ( ) ) :9 :10 , add_days ) ) :11 ( ( devalue_percent_per_day / :12 ) * if ( :13 >= timestampdiff ( day , date_format ( start_add_time , :14 ) , now ( ) ) :15 :16 :17 add_days :18 keeping_days , :19 , timestampdiff ( day , date_format ( start_add_time , :20 ) , now ( ) ) :21 :22 :23 add_days :24 keeping_days ) ) ) * amount_pay , :25 , ( ( ( added_percent_per_day / :26 ) * if ( :27 >= timestampdiff ( day , date_format ( start_add_time , :28 ) , now ( ) ) :29 :30 :31 add_days , timestampdiff ( day , date_format ( start_add_time , :32 ) , now ( ) ) :33 :34 , add_days ) ) :35 ( ( devalue_percent_per_day / :36 ) * if ( :37 >= timestampdiff ( day , date_format ( start_add_time , :38 ) , now ( ) ) :39 :40 :41 add_days :42 keeping_days , :43 , timestampdiff ( day , date_format ( start_add_time , :44 ) , now ( ) ) :45 :46 :47 add_days :48 keeping_days ) ) ) * amount_pay ) , update_time = now ( ) where state = :49 and update_time <= curdate ( ) and ( start_add_time >= date_add ( curdate ( ) , interval :50 ( add_days :51 keeping_days :52 :53 ) day ) or ( amount_added > :54 and start_add_time < date_add ( curdate ( ) , interval :55 ( add_days :56 keeping_days :57 :58 ) day ) ) ) -- 判断条件 在增值时间内 增值金大于0 状态正常|1|5|5||0|0|673525|673525|0|0|
||load data local infile 'import_data/1060329032291295232_20210610153702_member.csv' replace into table user_service.erp_member_info character set utf8mb4 fields terminated by :1 lines starting by :2 ( tenant_id , tenant_wechatapp_id , erp_member_id , @employee_erp_id , @grade_erp_id , @card_no , @dept_erp_id , mobile_no , @consumption_integral , user_name , sex , birthday , birthday_is_lunar , home_address , memorialday , memorialday_name , memorialday_is_lunar , interested , amount , erp_create_time , @status ) set update_time = now ( )|1|2|2||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 )|1|1|1||0|0|345422|345422|40|40|
|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 wx_user_id in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 ) and un_assign_flag = :15 )|1|2|2||0|0|30825|30825|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 from coupon_service.coupon cu join coupon_service.coupon_extend ce on ce.id = cu.id left join coupon_service.coupon_write_off_log wol on wol.tenant_app_id = cu.tenant_app_id and wol.coupon_id = cu.id and wol.state = :1 left join coupon_service.reservation r on r.coupon_user_id = cu.id and r.state = :2 where cu.tenant_app_id = :3 and cu.coupon_name like concat ( concat ( :4 , :5 ) , :6 ) ) tmp_count|1|3|3||0|0|19867|19867|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 , :106 , :107 , :108 , :109 , :110 , :111 , :112 , :113 , :114 )|1|1|1||0|0|166286|166286|112|112|
|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 )|1|1|1||0|0|104397|104397|15|15|
|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|404883|404883|4|4|
|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 )|1|1|1||0|0|244869|244869|14|14|
|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|2082532|2082532|876|876|
||load data local infile 'import_data/837522899471486976_20210610105338_1_member.csv' replace into table user_service.erp_member character set utf8mb4 fields terminated by :1 lines starting by :2 ( tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , @sex , @birthday , @birthday_is_lunar , @home_address , @memorialday , @memorialday_name , @memorialday_is_lunar , @interested , @amount , erp_create_time , status ) set update_time = now ( )|1|1|1||0|0|0|0|0|0|
|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 , 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|1|2|2||0|0|44265|44265|30|30|
|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|301820|301820|116|116|
|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|110064|110064|63|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 un_assign_flag = :2 and wx_user_id = :3 )|1|1|1||0|0|34249|34249|0|0|
|mysql|delete from wx_gateway.wx_template_msg where create_time < date_sub ( now ( ) , interval :1 day )|1|65|65||0|0|1957683|1957683|0|0|
||load data local infile 'import_data/1060329032291295232_20210610153702_member.csv' replace into table user_service.erp_member character set utf8mb4 fields terminated by :1 lines starting by :2 ( tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , @sex , @birthday , @birthday_is_lunar , @home_address , @memorialday , @memorialday_name , @memorialday_is_lunar , @interested , @amount , erp_create_time , status ) set update_time = now ( )|1|4|4||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 , :83 , :84 , :85 , :86 , :87 , :88 , :89 , :90 , :91 )|1|1|1||0|0|303076|303076|89|89|
|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 from coupon_service.coupon cu join coupon_service.coupon_extend ce on ce.id = cu.id left join coupon_service.coupon_write_off_log wol on wol.tenant_app_id = cu.tenant_app_id and wol.coupon_id = cu.id and wol.state = :1 left join coupon_service.reservation r on r.coupon_user_id = cu.id and r.state = :2 where cu.tenant_app_id = :3 and cu.create_time >= :4 and cu.create_time <= :5 and cu.template_id = :6 ) tmp_count|1|2|2||0|0|8771|8771|1|1|
|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|1|1|1||0|0|4021|4021|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 )|1|3|3||0|0|452844|452844|27|27|
|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 )|1|1|1||0|0|357472|357472|90|90|
|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 from coupon_service.coupon cu join coupon_service.coupon_extend ce on ce.id = cu.id left join coupon_service.coupon_write_off_log wol on wol.tenant_app_id = cu.tenant_app_id and wol.coupon_id = cu.id and wol.state = :1 left join coupon_service.reservation r on r.coupon_user_id = cu.id and r.state = :2 where cu.tenant_app_id = :3 and cu.coupon_type = :4 and cu.template_id = :5 and cu.source = :6 ) tmp_count|1|6|6||0|0|62764|62764|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 )|1|1|1||0|0|136007|136007|19|19|
|order|select count ( * ) amount from order_detail where tenant_wechatapp_id = :1 and sku_id = :2|1|1|1||0|0|110083|110083|1|1|
|mysql|delete from message_push.message_log where create_time < date_sub ( now ( ) , interval :1 day )|1|39|39||0|0|1747271|1747271|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 )|1|3|3||0|0|713238|713238|96|96|
|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 )|1|3|3||0|0|463708|463708|70|70|
|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|773334|773334|10|10|
|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 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 ) and un_assign_flag = :29 )|1|3|3||0|0|16478|16478|0|0|
||select * from erp_sync.sync_record where tenant_id = :1 and user_id = :2|1|35|35||0|0|975846|975846|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|110001|110001|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 )|1|6|6||0|0|548976|548976|111|111|
|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 )|1|3|3||0|0|593000|593000|100|100|
|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 wx_user_id = :2 )|1|1|1||0|0|8697|8697|0|0|
|value_added|select id , tenant_wechatapp_id as tenantwechatappid , user_id as userid , template_id as templateid , sales_erp_id as saleserpid , product_name as productname , shop_name as shopname , product_barcode as productbarcode , amount_total as amounttotal , amount_pay as amountpay , amount_added as amountadded , state as state , add_days , added_percent_per_day as addedpercentperday , devalue_percent_per_day as devaluepercentperday , keeping_days as keepingdays , exchange_days as exchangedays , coupon_user_id as couponuserid , sales_index as salesindex , start_add_time as createtime , date_add ( start_add_time , interval add_days-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|673547|673547|889|889|
|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 )|1|1|1||0|0|152878|152878|1|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|1|1|1||0|0|60321|60321|7|7|
|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 )|1|4|4||0|0|43729|43729|1|1|
|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|2614|2614|2614|2614|
|erp_sync|select * from retry_data where tenant_app_id = :1 and user_id = :2|1|1|1||0|0|6522|6522|1|1|
|warranty_service|select count ( 0 ) from warranty_service.warranty where tenant_wechatapp_id = :1 and is_disable = false and dept_erp_id = :2 and sales_date >= :3 and sales_date <= :4 and employee_erp_id in ( :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 , :31 , :32 , :33 )|1|4|4||0|0|12073|12073|1|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.shop_id = :3|1|1|1||0|0|549030|549030|1|1|
|user_service|select * from user_employee where tenant_wechatapp_id = :1 and employee_id = :2|1|1|1||0|0|17666|17666|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 )|1|1|1||0|0|16772|16772|9|9|
|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 )|1|1|1||0|0|387663|387663|94|94|
|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 )|1|1|1||0|0|171105|171105|40|40|
