|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|v4_user|select t1.id as memberid, t2.id as potentialcustomerid, t2.checkin_time as checkintime from member t1 join potential_customer t2 on t1.tenant_app_id = t2.tenant_app_id and (t1.id = t2.member_id or (t2.external_user_id != $0 and t1.external_user_id = t2.external_user_id)) and t2.tenant_id = $1 and t2.tenant_app_id = $2 where t2.maintain_shop_id = $3 and t2.id in ($4, $5, $6, $7, $8, $9, $10, $11, $12, $13) and t1.tenant_id = $14 and t1.tenant_app_id = $15|694|1169|4||0|0|1460617800|2114520|5833|10|
|v4_sales|select * from v4_sales.erp_sales_detail where sales_erp_id = $0 and product_barcode = $1|649|1117|27||0|0|1037574603|1599142|655|2|
|v4_user|select t1.id as memberid, t2.id as potentialcustomerid, t2.checkin_time as checkintime from member t1 join potential_customer t2 on t1.tenant_app_id = t2.tenant_app_id and (t1.id = t2.member_id or (t2.external_user_id != $0 and t1.external_user_id = t2.external_user_id)) and t2.tenant_id = $1 and t2.tenant_app_id = $2 where t2.maintain_shop_id = $3 and t2.maintain_employee_id = $4 and t2.`status` in ($5, $6) and t1.tenant_id = $7 and t1.tenant_app_id = $8|339|2368|36||0|0|2959126922|22412774|12640|103|
|user_service|select ue.employee_id as employeeid, count(*) as quantity from user_service.user_employee ue where ue.employee_id in ($0) and ue.tenant_id = $1 and ue.tenant_wechatapp_id = $2 and ue.shop_id = $3 group by ue.employee_id|203|325|6||0|0|999768|69782|203|1|
|corpwx|select id, tenant_id, tenant_app_id, external_user_id, wx_user_id from external_user_bind where (tenant_id = $0 and tenant_app_id = $1 and external_user_id = $2) or (tenant_id = $3 and tenant_app_id = $4 and wx_user_id = $5)|175|450|20||0|0|17791537|214639|109|1|
|gift_mail|select p.id, p.product_name, p.tag_price, i.volume, p.product_status as status, p.default_image_url, i.quantity, i.market_price, if(prp.id is null, false, true) as hasrecommend from gift_mail.platform_product p join gift_mail.platform_inventory i on i.product_id = p.id left join gift_mail.platform_recommend_product prp on prp.tenant_app_id = $0 and prp.is_recommend = true and prp.platform_product_id = p.id where prp.id is null and p.product_status = $1 order by i.volume desc, p.tag_price asc, p.id desc limit $2|121|152|3||0|0|996274|8248|726|6|
|v4_sales|select * from v4_sales.erp_sales_detail where sales_erp_id = $0 and sales_type = $1 order by sales_index|100|1168|35||0|0|159863738|1599152|436|12|
|corpwx|select id, tenant_id, cwx_user_id, user_id, old_user_id, union_id, name, sex, avatar, tenant_user_id, un_assign_flag, corp_user_id, wx_user_id, create_time, update_time from external_user where tenant_id = $0 and cwx_user_id = $1|95|149|7||0|0|204307|5107|204307|5107|
|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)|76|113|3||0|0|30467546|400983|76|1|
|tenant|select sales_date from tenant.erp_sales where tenant_id = $0 and tenant_wechatapp_id = $1 and member_erp_id = $2 and sales_erp_id < $3 and is_sales = $4 and sales_status = $5 order by sales_erp_id asc limit $6|73|140|6||0|0|869706|28096|73|1|
|coupon_service|select count(*) from employee_give_coupon_log where tenant_app_id = $0 and coupon_push_id = $1|67|98|4||0|0|1907358|49414|67|1|
|comment_service|select * from comment_service.comment_reward where comment_id = $0 limit $1|57|80|3||0|0|22243194|396691|9|1|
|v4_sales|select * from erp_sales where sales_erp_id = $0 limit $1|45|231|15||0|0|23715871|872534|45|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 = $0 and sneak_guest_maintain_id in ($1)|44|78|9||0|0|61135543|1390270|39|2|
|gift_mail|select count(0) from ( select p.id, p.product_name, p.tag_price, i.volume, p.product_status as status, p.default_image_url, i.quantity, i.market_price, if(prp.id is null, false, true) as hasrecommend from gift_mail.platform_product p join gift_mail.platform_inventory i on i.product_id = p.id left join gift_mail.platform_recommend_product prp on prp.tenant_app_id = $0 and prp.is_recommend = true and prp.platform_product_id = p.id where prp.id is null and p.product_status = $1 order by i.volume desc, p.tag_price asc, p.id desc ) tmp_count|41|50|1||0|0|297742|7262|41|1|
|employee|select ifnull(sum(task_amount), $0) as shouldmarknum, ifnull(sum(finish_amount), $1) as marklabelnum from backlog t where t.tenant_id = $2 and t.tenant_app_id = $3 and t.employee_id = $4 and t.scene = $5 and t.begin_time >= $6 and t.expire_time < $7|37|196|38||0|0|349317|27887|37|1|
|employee|select count(0) from ( select distinct t.user_id, t.user_type from backlog t where t.tenant_id = $0 and t.tenant_app_id = $1 and t.employee_id = $2 and t.scene = $3 and t.begin_time >= $4 and t.expire_time < $5 and t.finish_amount = $6 ) table_count|37|195|38||0|0|349499|27889|37|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 = $0 and sneak_guest_maintain_id in ($1, $2)|34|44|3||0|0|47244058|1390556|66|3|
|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 and t2.tenant_app_id = $0 and t2.shop_id = $1 join user_service.user_employee ue on t1.tenant_id = ue.tenant_id and t1.tenant_app_id = ue.tenant_wechatapp_id and t1.user_id = ue.user_id and ue.employee_id = $2 and ue.shop_id = $3 where t1.tenant_id = $4 and t1.tenant_app_id = $5|33|49|4||0|0|1410084|188861|33|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3)|28|37|2||0|0|38904068|1390272|74|4|
|v4_sales|select count(*) as total from warranty where member_id in ($0) and is_disable = $1 and tenant_id = $2 and tenant_app_id = $3|26|55|7||0|0|2758274|106108|26|1|
|v4_user|select id, shop_id, mobile_no, member_name, head_img_url, sex, birthday, birthday_is_lunar, memorial_name, memorial_day, memorial_day_is_lunar, address, interest, wx_union_id, mini_open_id, h5_open_id, wx_card_code, recommend_id, recommend_bind_time, external_user_id, status, combine_status, combine_id, tenant_id, tenant_app_id, create_time, update_time from member where (mobile_no = $0 or wx_card_code = $1) and tenant_id = $2 and tenant_app_id = $3 limit $4|25|52|6||0|0|4425767|211450|18|1|
|gift_mail|select p.id, p.product_name, p.tag_price, i.volume, p.product_status as status, p.default_image_url, i.quantity, i.market_price, if(prp.id is null, false, true) as hasrecommend from gift_mail.platform_product p join gift_mail.platform_inventory i on i.product_id = p.id left join gift_mail.platform_recommend_product prp on prp.tenant_app_id = $0 and prp.is_recommend = true and prp.platform_product_id = p.id where prp.id is null and p.product_status = $1 order by p.tag_price asc, p.id desc limit $2, $3|25|29|1||0|0|208552|8530|150|6|
|gift_mail|select p.id, p.product_name, p.tag_price, i.volume, p.product_status as status, p.default_image_url, i.quantity, i.market_price, if(prp.id is null, false, true) as hasrecommend from gift_mail.platform_product p join gift_mail.platform_inventory i on i.product_id = p.id left join gift_mail.platform_recommend_product prp on prp.tenant_app_id = $0 and prp.is_recommend = true and prp.platform_product_id = p.id where prp.id is null and p.product_status = $1 order by i.volume desc, p.tag_price asc, p.id desc limit $2, $3|22|27|1||0|0|183022|8560|132|6|
|v4_user|select count(*) as total from member_source where source_id = $0 and tenant_id = $1 and tenant_app_id = $2|19|28|3||0|0|3851655|211447|19|1|
|v4_coupon|select count(*) from ( select grant_id from v4_coupon.coupon where put_id = $0 and member_id = $1 and tenant_id = $2 and tenant_app_id = $3 group by grant_id ) c|19|35|3||0|0|1670312|88088|19|1|
|v4_employee|select t.id as task_id, task_type, if(task_type = $0, st.description, it.description) as description, if(task_type = $1, st.quick_reply, it.quick_reply) as quick_reply, task_name, member_id, member_name, member_mobile_no, member_sex, member_level, t.start_time, t.end_time, datediff(t.end_time, $2) as left_days, send_coupons, recv_coupons, st.coupons, t.accept_time, t.plan_arrival_shop_time, t.arrival_shop_time, t.trade_time from task_task t left join task_system_task_template st on st.id = t.task_template_id and st.tenant_id = $3 and st.tenant_app_id = $4 left join task_invite_task_template it on it.id = t.task_template_id and it.tenant_id = $5 and it.tenant_app_id = $6 where t.status = $7 and task_type = $8 and system_task_type = $9 and t.start_time <= $10 and t.end_time > $11 and shop_id = $12 and employee_id = $13 and finish_time is null and t.tenant_id = $14 and t.tenant_app_id = $15 order by t.id desc limit $16|18|46|7||0|0|7933042|440730|41|5|
|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 = $0 and es.tenant_wechatapp_id = $1 and es.sales_status = $2 and es.sales_no like concat($3, $4) order by es.sales_date desc limit $5|17|53|10||0|0|7456913|769204|2|1|
|corpwx|select t.tenant_id as tenantid, t.wx_user_id as wxuserid, t.union_id as wxunionid, t.user_id as externaluserid, ifnull(et.raw_external_user_id, t.old_user_id) as rawexternaluserid, t.corp_user_id as employeecorpuserid from corpwx.external_user t left join corpwx.external_userid_transform et on t.tenant_id = et.tenant_id and t.user_id = et.external_user_id where t.tenant_id = $0 and t.user_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, $39wm2wxudqaau7otbdnpq-h8qvan-sepjq$40wm2wxudqaaaxkxqmqzp2nonlvdnh7vgg$41wm2wxudqaazuqia2hleqd38iyewpvbsw$42wm2wxudqaaufdtfvx3i3why9ds1q_2va$43wm2wxudqaalkwitokewmdi17fujgytta$44wm2wxudqaamsjy5gr0_1vpd22iaphklq$45wm2wxudqaadvbd-sm0ta2otcxuxrmfya$46wm2wxudqaajvna6j0jgsh7fquby__kzq$47wm2wxudqaap1z8gfsfxr8iexcldmtmfq$48wm2wxudqaajy9xqfblilc15o55zhhxqw$49wm2wxudqaaubz9z6nfxlposblghdgtwa$50wm2wxudqaa4asbmradza9yiwvvsjay9q$51wm2wxudqaacfvqgsqsj2uwiz9nwajisq$52wm2wxudqaaatcw_z1laocrp9bi_aw0-a$53wm2wxudqaadqolrzui85lluymrzfbgow$54wm2wxudqaanb5d3l35vazjxj1-7iiwiq$55wm2wxudqaa-emycxpauz97i5-jxchs7q$56wm2wxudqaa6rtrx0icljaj3gz0xcnq6w$57wm2wxudqaa-zixy5kutzfhakkpnzdtzq$58wm2wxudqaa21x25ncaq-zdlxo_gefkia$59wm2wxudqaa71v4hld2z74e8-gtggr2aw$60wm2wxudqaapnvop3dyeray_jmdpm60aw$61wm2wxudqaa-g1h-v0kz2attgao03jbbq$62wm2wxudqaabw5yczmk5ifd1apntdqsvq$63wm2wxudqaa2efhdgxk94mvt3v5l8z5ba$64wm2wxudqaavjdpjizecmju2uc7xfplua$65wm2wxudqaa3ynrfmpqptaaeerppundxw$66wm2wxudqaa1jwnydsgnwk1uz_1zayrng$67wm2wxudqaayuh0ezh-o0ppoodn_isnja$68wm2wxudqaafdtjhiobro67tnqmhbb4qw$69wm2wxudqaayberllzmasq9m7x93glqca$70wm2wxudqaayeqr3qggeczbx-ubo-8piq$71wm2wxudqaaxsm_7nwrwkbo7adjxf9l7w$72wm2wxudqaaknvzg4lykq8ucsidfo7d4g$73wm2wxudqaapsvuzyf_39z_ssilb0yh0q$74wm2wxudqaaewsmunusshx4-ucvwcnxhq$75wm2wxudqaawr2bq7mq092rqy_adlpetg$76wm2wxudqaavzfzl-maahblx2f9wcnmaq$77wm2wxudqaarzahhghbflqru0hjv6tqmw$78wm2wxudqaay9o_yolodkqrgxpequb_lq$79wm2wxudqaabyj41pijfirqxc1vf9fk9w$80wm2wxudqaad_zc5ff3suetd-m7bm2f9a$81wm2wxudqaai2qe7kurrxvojdo-hr6spg$82wm2wxudqaahdurau_jz8uzr8i6go9eug$83wm2wxudqaayniaxib-rr4alwq7mqnebg$84wm2wxudqaa2udd3fomv2mq1lqyz_4grq$85wm2wxudqaag-dqmqel0hwvlojfzvovjq$86wm2wxudqaa8jbf5b1iinvs3jmn9xv7uq$87wm2wxudqaacrzucqzpuflxewsicyarkq$88wm2wxudqaa3x2xbbu6mrulf9z-xy4sog$89wm2wxudqaavkgkpgxtvpgnx_krna5hva$90wm2wxudqaau2vgtoazci9s8jd9sx5yjw$91wm2wxudqaalubxg5hnkwu3aalu6vtk2q$92wm2wxudqaamkqyxgvx8wofjar-setvew$93wm2wxudqaaxjr0zg4nf4bygfnwsc0c-g$94wm2wxudqaaoigytuoaxmqespq0bd7f2a$95wm2wxudqaamng8x4saetd12pr_7crckw$96wm2wxudqaaxdvf7u4mzbvwi7vcmbj_oa$97wm2wxudqaawpcdfzexa9_ecglqxxyx_w$98wm2wxudqaamrzidtcj1u4ycl3nx1i1ag$99wm2wxudqaaxpbgc_94dwvrb-mdqbxhlw$100wm2wxudqaahslhhpkgzx8z7hkyw2hz1a$101wm2wxudqaa3hon1ha-kypemue1l_qk-g$102wm2wxudqaasbgj6u4w7file5zbnvudjq$103wm2wxudqaayvankd8kocbqi9ufbjkdkw$104wm2wxudqaagtnub7vh3jryykj4limilw$105wm2wxudqaapkardi_oew3fynlcqdukbq$106wm2wxudqaan7bz5vgojf87zzgu4hurzg$107wm2wxudqaab5jht69pesuz-gaprkrcta$108wm2wxudqaamvawbvs9s5t-fjnzgu9i_q$109wm2wxudqaa8ytlvk1-lczgqpqwr80q9a$110wm2wxudqaart4ryxzndyapjyjzshy_og$111wm2wxudqaa5ceijxxqbqkeljiq92fidq$112wm2wxudqaawdincjsz1ljwjpx_nant1a$113wm2wxudqaaa-myut-wpbotj_z1uuxtja$114wm2wxudqaa_tnd1lryajtheq_t1ggzgq$115wm2wxudqaajnhqew925hri8usojfipsg$116wm2wxudqaag38ofsi5njctq3gbzn6jkg$117wm2wxudqaas7qmo3_6-vxwxs6gvw2mfq$118wm2wxudqaaevmswhw11hsnmvn_yhqyxa$119wm2wxudqaa84zz-9yhdeybzc0ywv52va$120wm2wxudqaaffd_v4ts7fdlskz7i5ozra$121wm2wxudqaap9pok013m97z32wn7_nwwa$122wm2wxudqaa8dx9emsi-k0tl4dhmo4qig$123wm2wxudqaaumbpmbvnd0ajy5cfwc6qla$124wm2wxudqaa_lyi_mqlwcg5p1sz3zvsoq$125wm2wxudqaasgj...|17|29|3||0|0|27090|1594|13396|788|
|tenant|select sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, sg.maintain_level, sg.maintain_employee_id, sg.create_time, sg.last_maintain_date, ey.employee_name as maintainemployeename, sg.status, sg.finish_date, sg.next_maintain_date from sneak_guest sg left join employee ey on sg.maintain_employee_id = ey.id where sg.tenant_app_id = $0 and sg.create_shop_id = $1 and sg.maintain_employee_id = $2 and sg.next_maintain_date >= $3 and sg.next_maintain_date <= $4 and sg.status = $5 order by sg.id desc limit $6|17|35|5||0|0|10421707|622250|78|10|
|corpwx|select t.tenant_id as tenantid, t.wx_user_id as wxuserid, t.union_id as wxunionid, t.user_id as externaluserid, ifnull(et.raw_external_user_id, t.old_user_id) as rawexternaluserid, t.corp_user_id as employeecorpuserid from corpwx.external_user t left join corpwx.external_userid_transform et on t.tenant_id = et.tenant_id and t.user_id = et.external_user_id where t.tenant_id = $0 and t.user_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|16|23|2||0|0|20014|1252|9543|597|
|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4)|16|19|1||0|0|22231532|1390076|57|6|
|order|select max(create_time) from `order`.order_operator_log where tenant_wechatapp_id = $0 and order_id = $1|15|76|18||0|0|13019944|868582|15|1|
|coupon_service|select count(0) from coupon_service.employee_give_coupon_log egcl where egcl.employee_give_coupon_id = $0 and egcl.shop_id = $1 and egcl.employee_id = $2|15|23|2||0|0|213576|21498|15|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5)|13|16|1||0|0|18063959|1389988|50|5|
|corpwx|select msg_type from corpwx.mini_app_msg where tenant_id = $0 group by msg_type union select $1 from corpwx.task_card_send_record where tenant_id = $2|13|269|56||0|0|6489347|499212|0|0|
|corpwx|select count(*) as addednum from external_user t where t.tenant_id = $0 and t.corp_user_id = $1 and t.create_time >= $2 and t.create_time < $3|13|18|3||0|0|315307|25584|13|1|
|corpwx|update external_user set un_assign_flag = $0 where tenant_id = $1 and un_assign_flag = $2|13|38|8||0|0|387944|57322|0|0|
|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|12|27|4||0|0|6284243|523908|12|1|
|coupon_service|select count(1) from coupon_service.coupon_expire_task where tenant_id = $0 and tenant_app_id = $1 and shop_id = $2 and employee_id = $3 and status = $4 and expire_time > now()|12|17|2||0|0|710080|66826|12|1|
|v4_sales|select id, warranty_id, sales_detail_id, tenant_id, tenant_app_id, create_time, update_time from warranty_detail where warranty_id = $0 and tenant_id = $1 and tenant_app_id = $2|11|19|3||0|0|2707071|246413|18|3|
|corpwx|select count(0) from ( select template_id, msg_type, msg_content, err_msg, create_time, to_user from corpwx.mini_app_msg where tenant_id = $0 union select replace(json_extract(msg_content, $1), $2, $3) as templateid, $4, msg_content, err_msg, create_time, to_user from corpwx.task_card_send_record where tenant_id = $5 ) a where 1 = 1|11|243|56||0|0|5491023|499212|11|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)|11|14|2||0|0|15287786|1389957|130|12|
|tenant|select sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, sg.maintain_level, sg.maintain_employee_id, sg.create_time, sg.last_maintain_date, ey.employee_name as maintainemployeename, sg.status, sg.finish_date, sg.next_maintain_date from sneak_guest sg left join employee ey on sg.maintain_employee_id = ey.id where sg.tenant_app_id = $0 and sg.create_shop_id = $1 and sg.maintain_employee_id = $2 and sg.status = $3 order by sg.id desc limit $4, $5|11|13|1||0|0|6520505|622200|60|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20)|11|13|2||0|0|15288913|1390373|216|24|
|v4_user|select t1.id as memberid, t2.id as potentialcustomerid, t2.checkin_time as checkintime from member t1 join potential_customer t2 on t1.tenant_app_id = t2.tenant_app_id and (t1.id = t2.member_id or (t2.external_user_id != $0 and t1.external_user_id = t2.external_user_id)) and t2.tenant_id = $1 and t2.tenant_app_id = $2 where t2.maintain_shop_id = $3 and t2.id in ($4, $5, $6, $7, $8, $9, $10, $11) and t1.tenant_id = $12 and t1.tenant_app_id = $13|10|12|2||0|0|16910688|1691200|64|8|
|corpwx|select template_id, name from corpwx.app_template where template_id in ( select template_id from corpwx.mini_app_msg where tenant_id = $0 and template_id is not null group by template_id union all select templateid from ( select replace(json_extract(msg_content, $1), $2, $3) as templateid from corpwx.task_card_send_record where tenant_id = $4 ) a where templateid is not null group by templateid )|10|437|94||0|0|204665932|20467733|0|0|
|v4_user|select t1.id as memberid, t2.id as potentialcustomerid, t2.checkin_time as checkintime from member t1 join potential_customer t2 on t1.tenant_app_id = t2.tenant_app_id and (t1.id = t2.member_id or (t2.external_user_id != $0 and t1.external_user_id = t2.external_user_id)) and t2.tenant_id = $1 and t2.tenant_app_id = $2 where t2.maintain_shop_id = $3 and t2.id in ($4, $5, $6, $7, $8, $9, $10, $11, $12) and t1.tenant_id = $13 and t1.tenant_app_id = $14|9|12|2||0|0|17122275|1902600|77|9|
|corpwx|select t.tenant_id as tenantid, t.wx_user_id as wxuserid, t.union_id as wxunionid, t.user_id as externaluserid, ifnull(et.raw_external_user_id, t.old_user_id) as rawexternaluserid, t.corp_user_id as employeecorpuserid from corpwx.external_user t left join corpwx.external_userid_transform et on t.tenant_id = et.tenant_id and t.user_id = et.external_user_id where t.tenant_id = $0 and t.user_id in ( $1, $2, $3, $4, $5, $6wm2wxudqaavviu5hu4wb8eneewh18onq$7wm2wxudqaahzgtp2p5_zu9gvpcexlc6a$8wm2wxudqaapubzdpgf_8dk_oor73n-jq$9wm2wxudqaakggksmuabrxql-hmchvk4a$10wm2wxudqaavcpm0eb6wbru6wctukkdfg$11wm2wxudqaaslx1mzawzvktwf0pcyjgew$12wm2wxudqaax956fbzbcig6htkbwnb2pw$13wm2wxudqaasuoepxknfok3qhxecty6nq$14wm2wxudqaamgpqdudyoj1mi_fegg1-ha$15wm2wxudqaaoaoolff5scfwaaogzgtgdg$16wm2wxudqaa8sveddebotcfbinrmsgirw$17wm2wxudqaaunhhc_g97r7xkkd_qjvauq$18wm2wxudqaa-ib8soykohxzewyjgefhjg$19wm2wxudqaaibqkqsyjk0qsuag8dolkoq$20wm2wxudqaa8boq9-l2vhlkus9lrayvjq$21wm2wxudqaaaiaoksqw9015zzyl__tlpw$22wm2wxudqaarjfzf5sdxrw-sijn_1i9lq$23wm2wxudqaa877gvbw3czdxpuixsnbphg$24wm2wxudqaadidob67sjvhnqctqtoa8xg$25wm2wxudqaagdjk98vfpmdesbuqs03lmq$26wm2wxudqaatbgjcrokyvgc3dbvkhodiw$27wm2wxudqaaqwetl37jn61eiqfrdxom-w$28wm2wxudqaav_exb_w4xk7a-zylk__1xg$29wm2wxudqaapxtwyp9utqj9u39cf-gsta$30wm2wxudqaagozhylmbqs1d-iajnsdawq$31wm2wxudqaaapypwrnbjhiwcnmomcdfew$32wm2wxudqaa6g2yofvp1pnlarxueybcsa$33wm2wxudqaajwbi1-abfqh5szkoe1d0fq$34wm2wxudqaad9ybojwrpwprm6g0gnf4bw$35wm2wxudqaasuy7nut8un2hoqz1ypjccw$36wm2wxudqaaovcwpbphtlj36wq_ciymva$37wm2wxudqaaguohzdflacc3khijnnp4bg$38wm2wxudqaa5wbj7xk7phcyau5kfm5e9g$39wm2wxudqaa519qyll_kndbe3rtnyftvq$40wm2wxudqaasj8dszpahz3ddqlcxscaia$41wm2wxudqaarksk3w8aephwezqi3l1kma$42wm2wxudqaarekwqr5kjqjysycvgijbya$43wm2wxudqaaj4i4ighljl6s_zmeme2n1a$44wm2wxudqaaadih0sbdvshfzeg6mmtqsa$45wm2wxudqaaoxidd4l6wgeuzsvp50eftg$46wm2wxudqaas38sbrpikjaohjkemo77ta$47wm2wxudqaaj3jiylmqmp10yeviesr4rg$48wm2wxudqaaold1-w0agzlvlv6vflhtrg$49wm2wxudqaaixzpz_1_qv5m7vgvnlqxfq$50wm2wxudqaa0x5guctzkcb_9i1axurc7q$51wm2wxudqaawi2g4tz8efmzhktoos7ykg$52wm2wxudqaah4to8jwud23yb6y3ikqz0g$53wm2wxudqaadslcyj6tknj6kblx4izbug$54wm2wxudqaaxdmiu9snjrta-qygbvxtmw$55wm2wxudqaawfp2yxte2ztex_jyzdmrbg$56wm2wxudqaa8dgna9cvlb0lk0vbejzmwg$57wm2wxudqaauqxrw6rv5da6jyipmno3xw$58wm2wxudqaamtokiki9sl2agijhexjowg$59wm2wxudqaa9eitxvydbgwjsc45i_zfmg$60wm2wxudqaaa9btmz-5hl-ngbpm-_idqg$61wm2wxudqaamzsnm91eim_xg68fp3gdkq$62wm2wxudqaaj4g4bdhabprx25jh_ndztq$63wm2wxudqaaydxohn-uqhnk6zz1rnpljg$64wm2wxudqaautypy0esjsbny-02gjfn_a$65wm2wxudqaafrbyoqeuwiz9-cr0odzksg$66wm2wxudqaa5adnooobbir6dq3ow1bdvg$67wm2wxudqaaxlqmqj_037fx8z5i6ygfzw$68wm2wxudqaaae7hduo33djozzfpkv9sqa$69wm2wxudqaadkxmikrjgk_h9smjucz7ya$70wm2wxudqaa5u4wcqii2o5v0squfnubta$71wm2wxudqaa5atqj-pzz3u7l1upv0yi2q$72wm2wxudqaanrso3lrazdxefmvxbdqf8a$73wm2wxudqaao431mf3entfdflqtsejlia$74wm2wxudqaa78mrdorbdd8qa6bfhexamg$75wm2wxudqaapc8yxqsyf3d7hlg2ysj5qw$76wm2wxudqaaidxz45_ab8vlsgx5s3tbzq$77wm2wxudqaauoyzptmm43uhq-wbhbhhaa$78wm2wxudqaa-asfwtt7tegghkyogkcx1q$79wm2wxudqaazzb5fiy__vykhqdofqbo5q$80wm2wxudqaansdvrhwejbv5z-qjtslgsq$81wm2wxudqaay4bbm3bo04y-khrmkzwtrg$82wm2wxudqaacgt_ertbnygnzibk5qqdkq$83wm2wxudqaaspillqiwica-oezrwctkgw$84wm2wxudqaaasq16yidwdfk71lk0thxvq$85wm2wxudqaadr1ik7lyrh4q-w_aqbzopg$86wm2wxudqaazayw8io3ufpzaaucyjnpna$87wm2wxudqaagqko-49ovpdhaken668gqg$88wm2wxudqaabya38-e8yxrorryfuz5ydg$89wm2wxudqaaltyovuw9ks_bu7bkyz7wqq$90wm2wxudqaaqzobgozoi4ucd-w2va41va$91wm2wxudqaauafwx_4zomshffrjyvuftq$92wm2wxudqaageo4-dfrq1eld1tqradhhw$93wm2wxudqaarbkud16yuq5xhpkqnyr7sq$94wm2wxudqaamemcev1heyowpcdt5v9tkg$95wm2wxudqaaszzwbjovoervo10qljhmqq$96wm2wxudqaaqbidlkysmdj5kxtcpbbh6q$97wm2wxudqaar-rf, $98, $99, $100, $101, $102, $103, $104, $105, $106, $107, $108, $109, $110, $111, $112, $113, $114, $115, $116, $117, $118, $119wm2wxudqaaps8j9fjsiab53wmu2mi9kw$120wm2wxudqaabetnkzvesqfid5-z5w0wsa$121wm2wxudqaa_gsectyrimo-czq4npkpaw$122wm2wxudqaad8vyoyslkclsrp_rkk2pow$123wm2wxudqaa7dv5kdbwfkcy0sfn4blpag$124wm2wxudqaadly...|9|13|2||0|0|7803|867|3780|420|
|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6)|9|10|1||0|0|12507551|1389957|57|9|
|employee|select count(*) from label_task_employee t1 join label_task_setting t2 on t1.label_task_id = t2.id and t2.disabled = $0 where t1.tenant_app_id = $1 and t1.shop_id = $2 and t1.visit_status > $3 and t1.finish_time >= date_sub(current_date, interval $4 day) and t1.finish_time < current_date|9|13|1||0|0|112841|21730|9|1|
|employee|select id, tenant_id, tenant_app_id, shop_id, employee_id, user_id, external_user_id, mobile_no, scene, status, begin_time, expire_time, create_time, update_time, directional_task_id, member_erp_id, finish_time, md5_str, tenant_open_id, data from backlog_system where tenant_app_id = $0 and scene = $1 and status = $2 and create_time between $3 and $4|9|23|8||0|0|3661830|486865|512|269|
|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 and t2.tenant_app_id = $0 and t2.shop_id = $1 join user_service.user_employee ue on t1.tenant_id = ue.tenant_id and t1.tenant_app_id = ue.tenant_wechatapp_id and t1.user_id = ue.user_id and ue.employee_id = $2 and ue.shop_id = $3 where t1.tenant_id = $4 and t1.tenant_app_id = $5 order by ue.update_time desc, t1.id desc limit $6|9|13|4||0|0|130528|54042|90|10|
|user_service|select * from user_service.user_employee where employee_erp_id = $0 and tenant_id = $1 and tenant_wechatapp_id = $2 and date_format(update_time, '%y-%m-%d %h') = date_format(now(), '%y-%m-%d %h')|8|41|10||0|0|1052666|270484|729|636|
|v4_employee|select $0 as task_type, t1.id as invite_task_id, t1.name, ifnull(t2.undo_count, $1) as undo_count, t1.invite_time as invite_task_start_time, ifnull(t1.interrupt_time, t1.end_time) as invite_task_end_time from task_invite_task_template t1 left join ( select t.task_template_id as id, sum(if(t.finish_time is null, $2, $3)) as undo_count from task_task t where t.task_type = $4 and t.`status` = $5 and t.end_time > $6 and t.shop_id = $7 and t.employee_id = $8 and t.tenant_id = $9 and t.tenant_app_id = $10 group by t.task_template_id ) t2 on t1.id = t2.id where t1.status in ($11, $12, $13) and t1.tenant_id = $14 and t1.tenant_app_id = $15 order by t1.id desc|8|9|1||0|0|51733|8444|32|4|
|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 = $0 and s.tenant_app_id = $1 and sg.create_shop_id = $2 and (sg.fail_type is null or sg.fail_type = $3) and s.event_type = $4 and s.create_time between $5 and $6|8|12|2||0|0|17457|2511|8|1|
|v4_user|select t1.id as memberid, t2.id as potentialcustomerid, t2.checkin_time as checkintime from member t1 join potential_customer t2 on t1.tenant_app_id = t2.tenant_app_id and (t1.id = t2.member_id or (t2.external_user_id != $0 and t1.external_user_id = t2.external_user_id)) and t2.tenant_id = $1 and t2.tenant_app_id = $2 where t2.maintain_shop_id = $3 and t2.id in ($4) and t1.tenant_id = $5 and t1.tenant_app_id = $6|8|10|2||0|0|1113401|211451|8|1|
|coupon_service|select * from coupon_service.coupon_market_order where pay_type in ($0, $1) and order_state = $2 and update_time <= date_sub(now(), interval $3 minute)|8|24|9||0|0|4189095|523948|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 and t2.tenant_app_id = $0 and t2.shop_id = $1 where t1.tenant_id = $2 and t1.tenant_app_id = $3|8|19|5||0|0|1760340|824135|8|1|
|tenant|select count(*) from sneak_guest where tenant_app_id = $0 and status = $1 and create_shop_id = $2 and maintain_employee_id = $3|8|12|2||0|0|48331|10933|8|1|
|user_service|select count(0) from user_service.tenant_member tm join user_service.user_employee ue on ue.tenant_id = $0 and ue.tenant_wechatapp_id = $1 and tm.user_id = ue.user_id and ue.employee_id = $2 and ue.shop_id = $3 where tm.tenant_id = $4 and tm.tenant_app_id = $5|8|35|7||0|0|598863|79723|8|1|
|warranty_service|select count(*) from warranty where user_id = $0 and tenant_wechatapp_id = $1 and is_disable = $2|8|59|11||0|0|71745|13052|8|1|
|tenant|select count(*) from sneak_guest where tenant_app_id = $0 and create_shop_id = $1 and maintain_employee_id = $2 and status = $3 and next_maintain_date between $4 and $5|8|12|2||0|0|48331|10933|8|1|
|v4_employee|select count(*) as total from task_task t join employee e on e.employee_id = t.employee_id and e.shop_id = t.shop_id and e.tenant_id = $0 and e.tenant_app_id = $1 left join ( select task_id, group_concat(file_url separator '|') as task_attaches from task_task_attach where tenant_id = $2 and tenant_app_id = $3 group by task_id ) tta on t.id = tta.task_id where t.status = $4 and system_task_type = $5 and t.shop_id = $6 and finish_time >= $7 and finish_time < $8 and t.employee_id = $9 and t.tenant_id = $10 and t.tenant_app_id = $11|7|9|2||0|0|681650|98512|7|1|
|user_service|select tenant_id, id, tenant_app_id, user_id, mobile_no, user_name, head_img_url, sex, status, create_time, update_time from tenant_member where tenant_id = $0 and tenant_app_id = $1 and user_name like $2|7|13|3||0|0|3162702|453707|0|0|
|tenant|select count(distinct concat(dept_erp_id, $0, sales_date)) as total from tenant.erp_sales where tenant_id = $1 and tenant_wechatapp_id = $2 and member_erp_id = $3 and sales_status = $4 and is_sales = $5|7|24|5||0|0|164771|28094|7|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)|7|9|1||0|0|9728447|1389957|76|11|
|tenant|select count(0) from erp_sales es where es.tenant_id = $0 and es.tenant_wechatapp_id = $1 and es.sales_date >= $2 and es.employee_erp_id = $3 and es.sales_status = $4|7|10|2||0|0|21376|4934|7|1|
|user_service|select count(0) from user_service.tenant_member tm where tm.tenant_id = $0 and tm.tenant_app_id = $1 and (tm.user_name like concat($2, $3, $4) or tm.mobile_no = $5)|7|11|2||0|0|1744363|453699|7|1|
|tenant|select count(*) as amount from sneak_guest where tenant_app_id = $0 and status = $1 and create_shop_id = $2 and maintain_employee_id = $3 and create_time <= $4|7|9|1||0|0|43900|10933|7|1|
|v4_coupon|select count(*) as total from coupon where member_id = $0 and scene = $1 and scene_id = $2 and tenant_id = $3 and tenant_app_id = $4|6|8|1||0|0|527282|87909|6|1|
|order|select od.id, od.order_no as orderno, od.status, od.take_type as taketype, od.create_time as createtime, od.remark, od.total_fee as totalfee, od.freight_fee as freightfee, od.discount_fee as discountfee, od.take_id as takeid, od.payment_fee as paymentfee, dt.product_id as productid, dt.price, dt.quantity, dt.sku_id as skuid, dt.art_no as artno, dt.image_url as imageurl, dt.product_name as productname, dt.take_remark as takeremark, dt.take_day as takeday, od.product_fee as productfee, ad.user_name as receivename, ad.mobile_no as mobileno, ad.shop_name as shopname, ad.address, ad.express_no as expressno, ad.express_company as expresscompany, od.user_name as username, od.update_time as updatetime, od.child_status as childstatus, od.finish_type as finishtype, od.receive_time as receivetime, od.user_id as userid, od.mobile_no as buymobileno, od.edit_fee_flag as editfeeflag, dt.spec as spec, od.source, od.take_shop_id, od.take_shop_name, od.take_employee_user_id, od.take_employee_user_name, od.activity_type, od.activity_id, od.offline_payment_fee, od.online_wait_fee, od.offline_wait_fee, od.pay_way, od.take_employee_id, od.pay_id from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $0 and od.tenant_wechatapp_id = $1 and (od.mobile_no = $2 or ad.mobile_no = $3) and (od.status = $4 or od.status = $5 or od.status = $6 or od.status = $7) order by od.create_time desc limit $8|6|8|1||0|0|464694|77638|15|5|
|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7, $8)|6|9|3||0|0|8340170|1390519|47|8|
|v4_sales|select id, warranty_id, sales_detail_id, tenant_id, tenant_app_id, create_time, update_time from warranty_detail where warranty_id = $0 and sales_detail_id = $1 and tenant_id = $2 and tenant_app_id = $3|6|10|3||0|0|1476454|246271|0|0|
|order|select count(0) from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $0 and od.tenant_wechatapp_id = $1 and (od.mobile_no = $2 or ad.mobile_no = $3) and (od.status = $4 or od.status = $5 or od.status = $6 or od.status = $7)|6|10|2||0|0|410610|68568|6|1|
|order|select od.id, od.order_no as orderno, od.status, od.take_type as taketype, od.create_time as createtime, od.remark, od.total_fee as totalfee, od.freight_fee as freightfee, od.discount_fee as discountfee, od.take_id as takeid, od.payment_fee as paymentfee, dt.product_id as productid, dt.price, dt.quantity, dt.sku_id as skuid, dt.art_no as artno, dt.image_url as imageurl, dt.product_name as productname, dt.take_remark as takeremark, dt.take_day as takeday, od.product_fee as productfee, ad.user_name as receivename, ad.mobile_no as mobileno, ad.shop_name as shopname, ad.address, ad.express_no as expressno, ad.express_company as expresscompany, od.user_name as username, od.update_time as updatetime, od.child_status as childstatus, od.finish_type as finishtype, od.receive_time as receivetime, od.user_id as userid, od.mobile_no as buymobileno, od.edit_fee_flag as editfeeflag, dt.spec as spec, od.source, od.take_shop_id, od.take_shop_name, od.take_employee_user_id, od.take_employee_user_name, od.activity_type, od.activity_id, od.offline_payment_fee, od.online_wait_fee, od.offline_wait_fee, od.pay_way, od.take_employee_id, od.pay_id from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $0 and od.tenant_wechatapp_id = $1 and (od.mobile_no = $2 or ad.mobile_no = $3) order by od.create_time desc limit $4|6|9|2||0|0|571941|95952|37|20|
|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7)|6|7|1||0|0|8337072|1390333|32|7|
|corpwx|select t.tenant_id as tenantid, t.wx_user_id as wxuserid, t.union_id as wxunionid, t.user_id as externaluserid, ifnull(et.raw_external_user_id, t.old_user_id) as rawexternaluserid, t.corp_user_id as employeecorpuserid from corpwx.external_user t left join corpwx.external_userid_transform et on t.tenant_id = et.tenant_id and t.user_id = et.external_user_id where t.tenant_id = $0 and t.user_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, $39wm2wxudqaau7otbdnpq-h8qvan-sepjq$40wm2wxudqaaaxkxqmqzp2nonlvdnh7vgg$41wm2wxudqaazuqia2hleqd38iyewpvbsw$42wm2wxudqaaufdtfvx3i3why9ds1q_2va$43wm2wxudqaalkwitokewmdi17fujgytta$44wm2wxudqaamsjy5gr0_1vpd22iaphklq$45wm2wxudqaadvbd-sm0ta2otcxuxrmfya$46wm2wxudqaajvna6j0jgsh7fquby__kzq$47wm2wxudqaap1z8gfsfxr8iexcldmtmfq$48wm2wxudqaajy9xqfblilc15o55zhhxqw$49wm2wxudqaaubz9z6nfxlposblghdgtwa$50wm2wxudqaa4asbmradza9yiwvvsjay9q$51wm2wxudqaacfvqgsqsj2uwiz9nwajisq$52wm2wxudqaaatcw_z1laocrp9bi_aw0-a$53wm2wxudqaadqolrzui85lluymrzfbgow$54wm2wxudqaanb5d3l35vazjxj1-7iiwiq$55wm2wxudqaa-emycxpauz97i5-jxchs7q$56wm2wxudqaa6rtrx0icljaj3gz0xcnq6w$57wm2wxudqaa-zixy5kutzfhakkpnzdtzq$58wm2wxudqaa21x25ncaq-zdlxo_gefkia$59wm2wxudqaa71v4hld2z74e8-gtggr2aw$60wm2wxudqaapnvop3dyeray_jmdpm60aw$61wm2wxudqaa-g1h-v0kz2attgao03jbbq$62wm2wxudqaabw5yczmk5ifd1apntdqsvq$63wm2wxudqaa2efhdgxk94mvt3v5l8z5ba$64wm2wxudqaavjdpjizecmju2uc7xfplua$65wm2wxudqaa3ynrfmpqptaaeerppundxw$66wm2wxudqaa1jwnydsgnwk1uz_1zayrng$67wm2wxudqaayuh0ezh-o0ppoodn_isnja$68wm2wxudqaafdtjhiobro67tnqmhbb4qw$69wm2wxudqaayberllzmasq9m7x93glqca$70wm2wxudqaayeqr3qggeczbx-ubo-8piq$71wm2wxudqaaxsm_7nwrwkbo7adjxf9l7w$72wm2wxudqaaknvzg4lykq8ucsidfo7d4g$73wm2wxudqaapsvuzyf_39z_ssilb0yh0q$74wm2wxudqaaewsmunusshx4-ucvwcnxhq$75wm2wxudqaawr2bq7mq092rqy_adlpetg$76wm2wxudqaavzfzl-maahblx2f9wcnmaq$77wm2wxudqaarzahhghbflqru0hjv6tqmw$78wm2wxudqaay9o_yolodkqrgxpequb_lq$79wm2wxudqaabyj41pijfirqxc1vf9fk9w$80wm2wxudqaad_zc5ff3suetd-m7bm2f9a$81wm2wxudqaai2qe7kurrxvojdo-hr6spg$82wm2wxudqaahdurau_jz8uzr8i6go9eug$83wm2wxudqaayniaxib-rr4alwq7mqnebg$84wm2wxudqaa2udd3fomv2mq1lqyz_4grq$85wm2wxudqaag-dqmqel0hwvlojfzvovjq$86wm2wxudqaa8jbf5b1iinvs3jmn9xv7uq$87wm2wxudqaacrzucqzpuflxewsicyarkq$88wm2wxudqaa3x2xbbu6mrulf9z-xy4sog$89wm2wxudqaavkgkpgxtvpgnx_krna5hva$90wm2wxudqaau2vgtoazci9s8jd9sx5yjw$91wm2wxudqaalubxg5hnkwu3aalu6vtk2q$92wm2wxudqaamkqyxgvx8wofjar-setvew$93wm2wxudqaaxjr0zg4nf4bygfnwsc0c-g$94wm2wxudqaaoigytuoaxmqespq0bd7f2a$95wm2wxudqaamng8x4saetd12pr_7crckw$96wm2wxudqaaxdvf7u4mzbvwi7vcmbj_oa$97wm2wxudqaawpcdfzexa9_ecglqxxyx_w$98wm2wxudqaamrzidtcj1u4ycl3nx1i1ag$99wm2wxudqaaxpbgc_94dwvrb-mdqbxhlw$100wm2wxudqaahslhhpkgzx8z7hkyw2hz1a$101wm2wxudqaa3hon1ha-kypemue1l_qk-g$102wm2wxudqaasbgj6u4w7file5zbnvudjq$103wm2wxudqaayvankd8kocbqi9ufbjkdkw$104wm2wxudqaagtnub7vh3jryykj4limilw$105wm2wxudqaapkardi_oew3fynlcqdukbq$106wm2wxudqaan7bz5vgojf87zzgu4hurzg$107wm2wxudqaaddjujavcd9omjqqds-_daw$108wm2wxudqaab5jht69pesuz-gaprkrcta$109wm2wxudqaamvawbvs9s5t-fjnzgu9i_q$110wm2wxudqaa8ytlvk1-lczgqpqwr80q9a$111wm2wxudqaart4ryxzndyapjyjzshy_og$112wm2wxudqaa5ceijxxqbqkeljiq92fidq$113wm2wxudqaawdincjsz1ljwjpx_nant1a$114wm2wxudqaaa-myut-wpbotj_z1uuxtja$115wm2wxudqaa_tnd1lryajtheq_t1ggzgq$116wm2wxudqaajnhqew925hri8usojfipsg$117wm2wxudqaag38ofsi5njctq3gbzn6jkg$118wm2wxudqaas7qmo3_6-vxwxs6gvw2mfq$119wm2wxudqaaevmswhw11hsnmvn_yhqyxa$120wm2wxudqaa84zz-9yhdeybzc0ywv52va$121wm2wxudqaaffd_v4ts7fdlskz7i5ozra$122wm2wxudqaap9pok013m97z32wn7_nwwa$123wm2wxudqaa8dx9emsi-k0tl4dhmo4qig$124wm2wxudqaavzhjwvo9nupqiwtu7fl90w$125wm2wxudqaaumb...|5|6|1||0|0|8050|1610|3980|796|
|order|select ifnull(sum(if(od.status = $0, $1, $2)), $3) as "2", ifnull(sum(if(od.status = $4, $5, $6)), $7) as "3", ifnull(sum(if(od.status = $8, $9, $10)), $11) as "4", ifnull(sum(if(od.status = $12, $13, $14)), $15) as "5", count(1) as total, ifnull(sum(if(od.status > $16, od.payment_fee, $17)), $18) as paymentfee, ifnull(sum(if(od.status > $19, od.offline_payment_fee, $20)), $21) as offlinepaymentfee, ifnull(sum(if(od.status > $22, od.payment_fee + od.offline_payment_fee, $23)), $24) as paytotalfee from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $25 and od.tenant_wechatapp_id = $26 and (od.mobile_no = $27 or ad.mobile_no = $28) and (od.status = $29 or od.status = $30 or od.status = $31 or od.status = $32)|5|9|2||0|0|342336|68568|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7, $8, $9)|5|6|1||0|0|6948842|1390700|40|10|
|tenant|select sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, sg.maintain_level, sg.maintain_employee_id, sg.create_time, sg.last_maintain_date, ey.employee_name as maintainemployeename, sg.status, sg.finish_date, sg.next_maintain_date from sneak_guest sg left join employee ey on sg.maintain_employee_id = ey.id where sg.tenant_app_id = $0 and sg.create_shop_id = $1 and sg.maintain_employee_id = $2 and sg.next_maintain_date >= $3 and sg.next_maintain_date <= $4 and sg.status = $5 order by sg.id desc limit $6, $7|5|8|3||0|0|3109780|622167|16|6|
|v4_user|select t1.id as memberid, t2.id as potentialcustomerid, t2.checkin_time as checkintime from member t1 join potential_customer t2 on t1.tenant_app_id = t2.tenant_app_id and (t1.id = t2.member_id or (t2.external_user_id != $0 and t1.external_user_id = t2.external_user_id)) and t2.tenant_id = $1 and t2.tenant_app_id = $2 where t2.maintain_shop_id = $3 and t2.id in ($4, $5, $6) and t1.tenant_id = $7 and t1.tenant_app_id = $8|5|7|2||0|0|1993545|634347|14|3|
|user_service|select obj.id, obj.shop_id, obj.total, case when @rowtotal = obj.total then @rownum when @rowtotal := obj.total then @rownum := @rownum + $0 when @rowtotal = $1 then @rownum := @rownum + $2 end as rank_idx from ( select us.from_id as id, us.shop_id, count(1) as total from user_source us where us.tenant_id = $3 and us.tenant_wechatapp_id = $4 and us.create_time >= $5 and us.create_time < $6 and us.source_type = $7 and us.from_id is not null and us.shop_id is not null group by us.from_id, us.shop_id order by count(1) desc ) obj, ( select @rownum := $8, @rowtotal := null ) r|5|9|3||0|0|48141|23005|814|277|
|v4_user|select count(*) from member_change_log t1 where t1.change_type in ($0, $1) and t1.change_time >= $2 and t1.change_time < $3 and t1.new_shop_id = $4 and t1.tenant_id = $5 and t1.tenant_app_id = $6|5|5|1||0|0|434984|87848|5|1|
|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_id = esd.tenant_id and es.tenant_wechatapp_id = esd.tenant_wechatapp_id and es.sales_erp_id = esd.sales_erp_id left join erp_sales_extend ee on ee.tenant_id = es.tenant_id and 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 esd.tenant_id = $1 and es.sales_status = $2 and es.tenant_wechatapp_id = $3 and esd.product_barcode = $4 order by es.sales_date desc|5|23|7||0|0|135733|31334|25756|5925|
|tenant|select count(*) from ( select s.sneak_guest_id from tenant.sneak_guest_maintain s join tenant.sneak_guest sg on sg.id = s.sneak_guest_id and (sg.fail_type is null or sg.fail_type = $0) where s.tenant_id = $1 and s.tenant_app_id = $2 and s.shop_id = $3 and s.event_type = $4 and s.create_time between $5 and $6 group by s.sneak_guest_id ) a|5|67|21||0|0|565209|204670|5|1|
|value_added|select $0 as limitdaytype, t.tenant_wechatapp_id as tenantappid, t.user_id as userid, min(ue.employee_erp_id) as 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, '%y-%m-%d'), interval $4 * (t.add_days - $5) day) and t.start_add_time < date_add(date_format($6, '%y-%m-%d'), interval $7 * (t.add_days - $8) + $9 day) group by t.tenant_wechatapp_id, t.user_id, ue.dept_erp_id|5|14|9||0|0|1154347|417160|370|155|
|gift_mail|select count(*) from gift_mail.trade t left join gift_mail.trade_take tt on tt.trade_id = t.id where t.tenant_id = $0 and t.tenant_wechatapp_id = $1 and t.trade_type = $2 and t.order_status = $3 and t.take_type = $4 and tt.shop_id = $5|5|5|1||0|0|51584|14191|5|1|
|v4_coupon|select * from v4_coupon.sales_give_coupon_record where put_id = $0 and sales_id = $1 and rule_id = $2 and tenant_id = $3 and tenant_app_id = $4 limit $5|5|8|2||0|0|420646|84182|0|0|
|v4_user|select t1.id as memberid, t2.id as potentialcustomerid, t2.checkin_time as checkintime from member t1 join potential_customer t2 on t1.tenant_app_id = t2.tenant_app_id and (t1.id = t2.member_id or (t2.external_user_id != $0 and t1.external_user_id = t2.external_user_id)) and t2.tenant_id = $1 and t2.tenant_app_id = $2 where t2.maintain_shop_id = $3 and t2.id in ($4, $5, $6, $7, $8, $9) and t1.tenant_id = $10 and t1.tenant_app_id = $11|5|8|2||0|0|4853760|1268574|23|6|
|user_service|select obj.id, obj.total, case when @rowtotal = obj.total then @rownum when @rowtotal := obj.total then @rownum := @rownum + $0 when @rowtotal = $1 then @rownum := @rownum + $2 end as rank_idx from ( select us.from_id as id, count(1) as total from user_source us where us.tenant_id = $3 and us.tenant_wechatapp_id = $4 and us.shop_id = $5 and us.create_time >= $6 and us.create_time < $7 and us.source_type = $8 and us.from_id is not null and us.shop_id is not null group by us.from_id order by count(1) desc ) obj, ( select @rownum := $9, @rowtotal := null ) r|5|9|3||0|0|45813|22192|38|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)|5|5|1||0|0|6949332|1390270|53|13|
|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 and t2.tenant_app_id = $0 and t2.shop_id = $1 join user_service.user_employee ue on t1.tenant_id = ue.tenant_id and t1.tenant_app_id = ue.tenant_wechatapp_id and t1.user_id = ue.user_id and ue.employee_id = $2 and ue.shop_id = $3 where t1.tenant_id = $4 and t1.tenant_app_id = $5 order by ue.update_time desc, t1.id desc limit $6, $7|4|4|1||0|0|812100|203840|40|10|
|v4_sales|select ifnull(sum(integral), $0) as points from v4_sales.erp_sales es join v4_sales.erp_sales_detail esd on esd.sales_erp_id = es.sales_erp_id and esd.tenant_id = $1 and esd.tenant_app_id = $2 where es.member_erp_id = $3 and es.sales_status = $4 and es.is_sales = true and esd.sales_type = $5 and es.tenant_id = $6 and es.tenant_app_id = $7|4|12|6||0|0|72260|22293|4|1|
|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 <= $0 and status = $1 and category = $2 and del_flag = $3|4|9|4||0|0|33148|8287|0|0|
|order|select count(0) from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $0 and od.tenant_wechatapp_id = $1 and (od.mobile_no = $2 or ad.mobile_no = $3)|4|6|2||0|0|382839|95868|4|1|
|tenant|select sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, sg.maintain_level, sg.maintain_employee_id, sg.create_time, sg.last_maintain_date, ey.employee_name as maintainemployeename, sg.status, sg.finish_date, sg.next_maintain_date from sneak_guest sg left join employee ey on sg.maintain_employee_id = ey.id where sg.tenant_app_id = $0 and sg.create_shop_id = $1 and sg.maintain_employee_id = $2 and sg.status = $3 order by sg.id desc limit $4|4|9|3||0|0|2487162|621989|24|9|
|v4_sales|select count(*) as total from v4_sales.erp_sales es join v4_sales.warranty_can_added wca on wca.sales_id = es.id and wca.tenant_id = $0 and wca.tenant_app_id = $1 left join v4_sales.warranty w on w.sales_id = es.id and w.tenant_id = $2 and w.tenant_app_id = $3 where is_sales = true and sales_status = $4 and (es.sales_no like concat($5, $6) or es.member_erp_id = $7) and es.tenant_id = $8 and es.tenant_app_id = $9|4|8|2||0|0|1487784|488596|4|1|
|order|select count(1) as total, ifnull(sum(if(od.status > $0, od.payment_fee, $1)), $2) as paymentfee, ifnull(sum(if(od.status > $3, od.offline_payment_fee, $4)), $5) as offlinepaymentfee, ifnull(sum(if(od.status > $6, od.payment_fee + od.offline_payment_fee, $7)), $8) as paytotalfee from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $9 and od.tenant_wechatapp_id = $10 and (od.mobile_no = $11 or ad.mobile_no = $12)|4|6|2||0|0|382839|95868|4|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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $92, $93, $94, $95, $96, $97, $98, $99, $100, $101, $102, $103, $104, $105, $106, $107, $108, $109, $110, $111, $112, $113, $114, $115, $116, $117, $118, $119, $120, $121, $122, $123, $124, $125, $126, $127, $128, $129, $130, $131, $132, $133, $134, $135, $136, $137, $138, $139, $140, $141, $142, $143, $144, $145, $146, $147, $148, $149, $150, $151, $152, $153, $154, $155, $156, $157, $158, $159, $160, $161, $162, $163, $164, $165, $166, $167, $168, $169, $170, $171, $172, $173, $174, $175, $176, $177, $178, $179, $180, $181, $182, $183, $184, $185, $186, $187, $188, $189, $190, $191, $192, $193, $194, $195, $196, $197, $198, $199, $200, $201, $202, $203, $204, $205, $206, $207, $208, $209, $210, $211, $212, $213, $214, $215, $216, $217, $218, $219, $220, $221, $222, $223, $224, $225, $226, $227, $228, $229, $230, $231, $232, ...|4|11|5||0|0|4293053|1321895|1051|272|
|goods|select * from goods_take_shop where tenant_id = $0 and goods_id = $1 and activity_id = $2 order by create_time desc|3|4|1||0|0|306882|102311|165|72|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|3|3|1||0|0|2250324|1230175|249|83|
|v4_user|select t1.id as memberid, t2.id as potentialcustomerid, t2.checkin_time as checkintime from member t1 join potential_customer t2 on t1.tenant_app_id = t2.tenant_app_id and (t1.id = t2.member_id or (t2.external_user_id != $0 and t1.external_user_id = t2.external_user_id)) and t2.tenant_id = $1 and t2.tenant_app_id = $2 where t2.maintain_shop_id = $3 and t2.id in ($4, $5, $6, $7) and t1.tenant_id = $8 and t1.tenant_app_id = $9|3|5|3||0|0|2205852|845500|12|4|
|employee|update backlog set status = $0, finish_time = now() where tenant_app_id = $1 and employee_id = $2 and status in ($3, $4) and shop_id = $5|3|6|2||0|0|17774|8074|0|0|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|3|3|1||0|0|1183036|773100|183|61|
|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)|3|3|1||0|0|4169158|1389849|44|19|
|v4_sales|select ifnull(count(*), $0) as sales_count, ifnull(sum(amount), $1) as sales_amount from erp_sales where member_erp_id in ($2) and is_sales = true and sales_status = $3 and tenant_id = $4 and tenant_app_id = $5|3|10|6||0|0|26293|8766|3|1|
|corpwx|select t.tenant_id as tenantid, t.wx_user_id as wxuserid, t.union_id as wxunionid, t.user_id as externaluserid, ifnull(et.raw_external_user_id, t.old_user_id) as rawexternaluserid, t.corp_user_id as employeecorpuserid from corpwx.external_user t left join corpwx.external_userid_transform et on t.tenant_id = et.tenant_id and t.user_id = et.external_user_id where t.tenant_id = $0 and t.user_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, $40wm2wxudqaau7otbdnpq-h8qvan-sepjq$41wm2wxudqaaaxkxqmqzp2nonlvdnh7vgg$42wm2wxudqaazuqia2hleqd38iyewpvbsw$43wm2wxudqaaufdtfvx3i3why9ds1q_2va$44wm2wxudqaalkwitokewmdi17fujgytta$45wm2wxudqaamsjy5gr0_1vpd22iaphklq$46wm2wxudqaadvbd-sm0ta2otcxuxrmfya$47wm2wxudqaajvna6j0jgsh7fquby__kzq$48wm2wxudqaap1z8gfsfxr8iexcldmtmfq$49wm2wxudqaajy9xqfblilc15o55zhhxqw$50wm2wxudqaaubz9z6nfxlposblghdgtwa$51wm2wxudqaa4asbmradza9yiwvvsjay9q$52wm2wxudqaacfvqgsqsj2uwiz9nwajisq$53wm2wxudqaaatcw_z1laocrp9bi_aw0-a$54wm2wxudqaadqolrzui85lluymrzfbgow$55wm2wxudqaanb5d3l35vazjxj1-7iiwiq$56wm2wxudqaa-emycxpauz97i5-jxchs7q$57wm2wxudqaa6rtrx0icljaj3gz0xcnq6w$58wm2wxudqaa-zixy5kutzfhakkpnzdtzq$59wm2wxudqaa21x25ncaq-zdlxo_gefkia$60wm2wxudqaa71v4hld2z74e8-gtggr2aw$61wm2wxudqaapnvop3dyeray_jmdpm60aw$62wm2wxudqaa-g1h-v0kz2attgao03jbbq$63wm2wxudqaabw5yczmk5ifd1apntdqsvq$64wm2wxudqaa2efhdgxk94mvt3v5l8z5ba$65wm2wxudqaavjdpjizecmju2uc7xfplua$66wm2wxudqaa3ynrfmpqptaaeerppundxw$67wm2wxudqaa1jwnydsgnwk1uz_1zayrng$68wm2wxudqaayuh0ezh-o0ppoodn_isnja$69wm2wxudqaafdtjhiobro67tnqmhbb4qw$70wm2wxudqaayberllzmasq9m7x93glqca$71wm2wxudqaayeqr3qggeczbx-ubo-8piq$72wm2wxudqaaxsm_7nwrwkbo7adjxf9l7w$73wm2wxudqaaknvzg4lykq8ucsidfo7d4g$74wm2wxudqaapsvuzyf_39z_ssilb0yh0q$75wm2wxudqaaewsmunusshx4-ucvwcnxhq$76wm2wxudqaawr2bq7mq092rqy_adlpetg$77wm2wxudqaavzfzl-maahblx2f9wcnmaq$78wm2wxudqaarzahhghbflqru0hjv6tqmw$79wm2wxudqaay9o_yolodkqrgxpequb_lq$80wm2wxudqaabyj41pijfirqxc1vf9fk9w$81wm2wxudqaad_zc5ff3suetd-m7bm2f9a$82wm2wxudqaai2qe7kurrxvojdo-hr6spg$83wm2wxudqaahdurau_jz8uzr8i6go9eug$84wm2wxudqaayniaxib-rr4alwq7mqnebg$85wm2wxudqaa2udd3fomv2mq1lqyz_4grq$86wm2wxudqaag-dqmqel0hwvlojfzvovjq$87wm2wxudqaa8jbf5b1iinvs3jmn9xv7uq$88wm2wxudqaacrzucqzpuflxewsicyarkq$89wm2wxudqaa3x2xbbu6mrulf9z-xy4sog$90wm2wxudqaavkgkpgxtvpgnx_krna5hva$91wm2wxudqaau2vgtoazci9s8jd9sx5yjw$92wm2wxudqaalubxg5hnkwu3aalu6vtk2q$93wm2wxudqaamkqyxgvx8wofjar-setvew$94wm2wxudqaaxjr0zg4nf4bygfnwsc0c-g$95wm2wxudqaaoigytuoaxmqespq0bd7f2a$96wm2wxudqaamng8x4saetd12pr_7crckw$97wm2wxudqaaxdvf7u4mzbvwi7vcmbj_oa$98wm2wxudqaawpcdfzexa9_ecglqxxyx_w$99wm2wxudqaamrzidtcj1u4ycl3nx1i1ag$100wm2wxudqaaxpbgc_94dwvrb-mdqbxhlw$101wm2wxudqaahslhhpkgzx8z7hkyw2hz1a$102wm2wxudqaa3hon1ha-kypemue1l_qk-g$103wm2wxudqaasbgj6u4w7file5zbnvudjq$104wm2wxudqaayvankd8kocbqi9ufbjkdkw$105wm2wxudqaagtnub7vh3jryykj4limilw$106wm2wxudqaapkardi_oew3fynlcqdukbq$107wm2wxudqaan7bz5vgojf87zzgu4hurzg$108wm2wxudqaaddjujavcd9omjqqds-_daw$109wm2wxudqaab5jht69pesuz-gaprkrcta$110wm2wxudqaamvawbvs9s5t-fjnzgu9i_q$111wm2wxudqaa8ytlvk1-lczgqpqwr80q9a$112wm2wxudqaart4ryxzndyapjyjzshy_og$113wm2wxudqaa5ceijxxqbqkeljiq92fidq$114wm2wxudqaawdincjsz1ljwjpx_nant1a$115wm2wxudqaaa-myut-wpbotj_z1uuxtja$116wm2wxudqaa_tnd1lryajtheq_t1ggzgq$117wm2wxudqaajnhqew925hri8usojfipsg$118wm2wxudqaag38ofsi5njctq3gbzn6jkg$119wm2wxudqaas7qmo3_6-vxwxs6gvw2mfq$120wm2wxudqaaevmswhw11hsnmvn_yhqyxa$121wm2wxudqaa84zz-9yhdeybzc0ywv52va$122wm2wxudqaaffd_v4ts7fdlskz7i5ozra$123wm2wxudqaap9pok013m97z32wn7_nwwa$124wm2wxudqaa8dx9emsi-k0tl4dhmo4qig$125wm2wxudqaavzh...|3|3|1||0|0|4818|1606|2382|794|
|order|select count(0) from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $0 and od.tenant_wechatapp_id = $1|3|4|1||0|0|222345|96036|3|1|
|v4_sales|select count(*) from v4_sales.erp_sales where employee_erp_id = $0 and sales_status = $1 and is_sales = true and tenant_id = $2 and tenant_app_id = $3|3|3|1||0|0|11141|5406|3|1|
|user_service|select count(0) from user_service.tenant_member tm join user_service.tenant_member_info tmi on tmi.tenant_id = $0 and tmi.tenant_app_id = $1 and tm.id = tmi.id where tm.tenant_id = $2 and tm.tenant_app_id = $3 and (tm.user_name like concat($4, $5, $6) or tm.mobile_no = $7)|3|3|1||0|0|437743|271761|3|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 = $0 and user_id = $1|3|3|1||0|0|358946|119655|0|0|
|v4_user|select id, member_id, external_user_id, serial_number, checkin_shop_id, checkin_employee_id, checkin_employee_name, checkin_time, maintain_shop_id, maintain_employee_id, maintain_employee_name, first_maintain_time, last_maintain_time, next_maintain_time, maintain_num, intention_num, latest_intention, status, finish_time, finish_shop_id, deal_employee_id, deal_employee_name, deal_sale_amount, fail_employee_id, fail_employee_name, fail_reason, remark, sex, cutomer_grade, maintain_level, tenant_id, tenant_app_id, create_time, update_time from potential_customer where (member_id = $0 or external_user_id = $1) and status in ($2, $3) and tenant_id = $4 and tenant_app_id = $5|3|3|1||0|0|23518|7856|0|0|
|tenant|select e.id, e.employee_name from ( select distinct sgm.employee_id from tenant.sneak_guest sg join tenant.sneak_guest_maintain sgm on sgm.sneak_guest_id = sg.id where sg.tenant_id = $0 and sg.tenant_app_id = $1 and sg.update_shop_id = $2 and sgm.event_type in ($3, $4, $5) and (sg.fail_type is null or sg.fail_type = $6) and sgm.create_time between $7 and $8 ) t join tenant.employee e on e.id = t.employee_id|3|4|2||0|0|160329|94849|26|12|
|v4_employee|select count(*) from ( select t.id as task_id, task_type, if(task_type = $0, st.description, it.description) as description, if(task_type = $1, st.quick_reply, it.quick_reply) as quick_reply, task_name, member_id, member_name, member_mobile_no, member_sex, member_level, t.start_time, t.end_time, datediff(t.end_time, $2) as left_days, send_coupons, recv_coupons, st.coupons, t.accept_time, t.plan_arrival_shop_time, t.arrival_shop_time, t.trade_time from task_task t left join task_system_task_template st on st.id = t.task_template_id and st.tenant_id = $3 and st.tenant_app_id = $4 left join task_invite_task_template it on it.id = t.task_template_id and it.tenant_id = $5 and it.tenant_app_id = $6 where t.status = $7 and task_type = $8 and system_task_type = $9 and t.start_time <= $10 and t.end_time > $11 and shop_id = $12 and employee_id = $13 and finish_time is null and t.tenant_id = $14 and t.tenant_app_id = $15 ) total|2|3|2||0|0|12729|6771|2|1|
|coupon_service|select cet.id, cet.coupon_id, cet.user_id, cet.coupon_type, cet.expire_time, if(cet.expire_time < now() and cet.status = $0, $1, cet.status) as status from coupon_service.coupon_expire_task cet join coupon_service.coupon_extend ce on ce.tenant_id = $2 and ce.tenant_app_id = $3 and ce.coupon_id = cet.coupon_id where cet.tenant_id = $4 and cet.tenant_app_id = $5 and cet.employee_id = $6 and cet.shop_id = $7|2|2|1||0|0|83498|67497|999|671|
|order|select count(1) as total, ifnull(sum(if(od.status > $0, od.payment_fee, $1)), $2) as paymentfee, ifnull(sum(if(od.status > $3, od.offline_payment_fee, $4)), $5) as offlinepaymentfee, ifnull(sum(if(od.status > $6, od.payment_fee + od.offline_payment_fee, $7)), $8) as paytotalfee from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $9 and od.tenant_wechatapp_id = $10 and dt.product_name like concat($11, $12, $13)|2|4|2||0|0|127739|64134|2|1|
|erp_app|insert into app_status(id, tenant_id, app_name, version, pid) values (?, ?, ?, ?, ?) on duplicate key update version = $0, pid = $1, online_status_time = $2|2|3|1||0|0|0|0|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 = $0 and tenant_app_id = $1 and 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, $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|2|2|1||0|0|5969|3116|5969|3116|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_id in ($2, $3, $4, $5, $6, $7)|2|3|2||0|0|210727|141227|12|6|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $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)|2|3|1||0|0|1583405|1230273|362|181|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_id in ($2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19)|2|4|3||0|0|311887|241461|36|18|
|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15)|2|2|1||0|0|2778516|1389566|31|18|
|v4_user|select count(*) as total from member where status = $0 and member_name like $1 and tenant_id = $2 and tenant_app_id = $3|2|4|2||0|0|422854|211445|2|1|
||load data local infile $0 replace into table v4_user.member_import character set utf8mb4 fields terminated by $1 (@type, tenant_id, tenant_app_id, shop_id, mobile_no, member_name, sex, birthday, birthday_is_lunar, memorial_name, memorial_day, address, point_balance, total_sale_point, butler_employee_mobile_no, register_time) set update_time = now()|2|4|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.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 = $0 and tmi.tenant_id = $1 and tmi.tenant_app_id = $2|2|2|1||0|0|21996|18843|2|1|
|coupon_service|select cmod.coupon_id, cmo.pay_type from coupon_service.coupon_market_order_detail cmod join coupon_service.coupon_market_order cmo on cmo.tenant_id = $0 and cmo.tenant_app_id = $1 and cmo.id = cmod.order_id where cmod.tenant_id = $2 and cmod.tenant_app_id = $3 and cmod.coupon_id in ($4, $5, $6, $7, $8)|2|6|4||0|0|20931|10466|10|5|
|employee|update backlog_system set status = $0, finish_time = now() where tenant_app_id = $1 and scene = $2|2|5|3||0|0|2255858|1127929|0|0|
|gift_mail|select ifnull(count(1), $0) as amount from trade where tenant_wechatapp_id = $1 and user_id = $2 and order_status in ($3, $4)|2|2|1||0|0|16821|12299|2|1|
|order|select count(1) as total, ifnull(sum(if(od.status > $0, od.payment_fee, $1)), $2) as paymentfee, ifnull(sum(if(od.status > $3, od.offline_payment_fee, $4)), $5) as offlinepaymentfee, ifnull(sum(if(od.status > $6, od.payment_fee + od.offline_payment_fee, $7)), $8) as paytotalfee from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $9 and od.tenant_wechatapp_id = $10|2|2|1||0|0|126309|95580|2|1|
|tenant|select count(*) from tenant.sneak_guest_maintain s join tenant.sneak_guest sg on sg.id = s.sneak_guest_id where s.tenant_id = $0 and s.tenant_app_id = $1 and s.shop_id = $2 and s.event_type = $3 and s.create_time between $4 and $5|2|2|1||0|0|5827|3285|2|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14)|2|2|1||0|0|2779163|1389584|30|17|
|v4_user|select t1.id as memberid, t2.id as potentialcustomerid, t2.checkin_time as checkintime from member t1 join potential_customer t2 on t1.tenant_app_id = t2.tenant_app_id and (t1.id = t2.member_id or (t2.external_user_id != $0 and t1.external_user_id = t2.external_user_id)) and t2.tenant_id = $1 and t2.tenant_app_id = $2 where t2.maintain_shop_id = $3 and t2.id in ($4, $5, $6, $7, $8, $9, $10) and t1.tenant_id = $11 and t1.tenant_app_id = $12|2|3|2||0|0|1369592|901033|3|3|
|v4_sales|select count(distinct es.id) from v4_sales.erp_sales es join v4_sales.erp_sales_detail esd on esd.sales_erp_id = es.sales_erp_id and esd.sales_type in ($0, $1, $2, $3, $4, $5, $6, $7) and member_erp_id in ($8) and esd.tenant_id = $9 and esd.tenant_app_id = $10 where es.tenant_id = $11 and es.tenant_app_id = $12|2|3|1||0|0|10880|5440|2|1|
|corpwx|select t.tenant_id as tenantid, t.wx_user_id as wxuserid, t.union_id as wxunionid, t.user_id as externaluserid, ifnull(et.raw_external_user_id, t.old_user_id) as rawexternaluserid, t.corp_user_id as employeecorpuserid from corpwx.external_user t left join corpwx.external_userid_transform et on t.tenant_id = et.tenant_id and t.user_id = et.external_user_id where t.tenant_id = $0 and t.user_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, $39wm2wxudqaau7otbdnpq-h8qvan-sepjq$40wm2wxudqaaaxkxqmqzp2nonlvdnh7vgg$41wm2wxudqaazuqia2hleqd38iyewpvbsw$42wm2wxudqaaufdtfvx3i3why9ds1q_2va$43wm2wxudqaalkwitokewmdi17fujgytta$44wm2wxudqaamsjy5gr0_1vpd22iaphklq$45wm2wxudqaadvbd-sm0ta2otcxuxrmfya$46wm2wxudqaajvna6j0jgsh7fquby__kzq$47wm2wxudqaap1z8gfsfxr8iexcldmtmfq$48wm2wxudqaajy9xqfblilc15o55zhhxqw$49wm2wxudqaaubz9z6nfxlposblghdgtwa$50wm2wxudqaa4asbmradza9yiwvvsjay9q$51wm2wxudqaacfvqgsqsj2uwiz9nwajisq$52wm2wxudqaaatcw_z1laocrp9bi_aw0-a$53wm2wxudqaadqolrzui85lluymrzfbgow$54wm2wxudqaanb5d3l35vazjxj1-7iiwiq$55wm2wxudqaa-emycxpauz97i5-jxchs7q$56wm2wxudqaa6rtrx0icljaj3gz0xcnq6w$57wm2wxudqaa-zixy5kutzfhakkpnzdtzq$58wm2wxudqaa21x25ncaq-zdlxo_gefkia$59wm2wxudqaa71v4hld2z74e8-gtggr2aw$60wm2wxudqaapnvop3dyeray_jmdpm60aw$61wm2wxudqaa-g1h-v0kz2attgao03jbbq$62wm2wxudqaabw5yczmk5ifd1apntdqsvq$63wm2wxudqaa2efhdgxk94mvt3v5l8z5ba$64wm2wxudqaavjdpjizecmju2uc7xfplua$65wm2wxudqaa3ynrfmpqptaaeerppundxw$66wm2wxudqaa1jwnydsgnwk1uz_1zayrng$67wm2wxudqaayuh0ezh-o0ppoodn_isnja$68wm2wxudqaafdtjhiobro67tnqmhbb4qw$69wm2wxudqaayberllzmasq9m7x93glqca$70wm2wxudqaayeqr3qggeczbx-ubo-8piq$71wm2wxudqaaxsm_7nwrwkbo7adjxf9l7w$72wm2wxudqaaknvzg4lykq8ucsidfo7d4g$73wm2wxudqaapsvuzyf_39z_ssilb0yh0q$74wm2wxudqaaewsmunusshx4-ucvwcnxhq$75wm2wxudqaawr2bq7mq092rqy_adlpetg$76wm2wxudqaavzfzl-maahblx2f9wcnmaq$77wm2wxudqaarzahhghbflqru0hjv6tqmw$78wm2wxudqaay9o_yolodkqrgxpequb_lq$79wm2wxudqaabyj41pijfirqxc1vf9fk9w$80wm2wxudqaad_zc5ff3suetd-m7bm2f9a$81wm2wxudqaai2qe7kurrxvojdo-hr6spg$82wm2wxudqaahdurau_jz8uzr8i6go9eug$83wm2wxudqaayniaxib-rr4alwq7mqnebg$84wm2wxudqaa2udd3fomv2mq1lqyz_4grq$85wm2wxudqaag-dqmqel0hwvlojfzvovjq$86wm2wxudqaa8jbf5b1iinvs3jmn9xv7uq$87wm2wxudqaacrzucqzpuflxewsicyarkq$88wm2wxudqaa3x2xbbu6mrulf9z-xy4sog$89wm2wxudqaavkgkpgxtvpgnx_krna5hva$90wm2wxudqaau2vgtoazci9s8jd9sx5yjw$91wm2wxudqaalubxg5hnkwu3aalu6vtk2q$92wm2wxudqaamkqyxgvx8wofjar-setvew$93wm2wxudqaaxjr0zg4nf4bygfnwsc0c-g$94wm2wxudqaaoigytuoaxmqespq0bd7f2a$95wm2wxudqaamng8x4saetd12pr_7crckw$96wm2wxudqaaxdvf7u4mzbvwi7vcmbj_oa$97wm2wxudqaawpcdfzexa9_ecglqxxyx_w$98wm2wxudqaamrzidtcj1u4ycl3nx1i1ag$99wm2wxudqaaxpbgc_94dwvrb-mdqbxhlw$100wm2wxudqaahslhhpkgzx8z7hkyw2hz1a$101wm2wxudqaa3hon1ha-kypemue1l_qk-g$102wm2wxudqaasbgj6u4w7file5zbnvudjq$103wm2wxudqaayvankd8kocbqi9ufbjkdkw$104wm2wxudqaagtnub7vh3jryykj4limilw$105wm2wxudqaapkardi_oew3fynlcqdukbq$106wm2wxudqaan7bz5vgojf87zzgu4hurzg$107wm2wxudqaaddjujavcd9omjqqds-_daw$108wm2wxudqaab5jht69pesuz-gaprkrcta$109wm2wxudqaamvawbvs9s5t-fjnzgu9i_q$110wm2wxudqaa8ytlvk1-lczgqpqwr80q9a$111wm2wxudqaart4ryxzndyapjyjzshy_og$112wm2wxudqaa5ceijxxqbqkeljiq92fidq$113wm2wxudqaawdincjsz1ljwjpx_nant1a$114wm2wxudqaaa-myut-wpbotj_z1uuxtja$115wm2wxudqaa_tnd1lryajtheq_t1ggzgq$116wm2wxudqaajnhqew925hri8usojfipsg$117wm2wxudqaag38ofsi5njctq3gbzn6jkg$118wm2wxudqaas7qmo3_6-vxwxs6gvw2mfq$119wm2wxudqaaevmswhw11hsnmvn_yhqyxa$120wm2wxudqaa84zz-9yhdeybzc0ywv52va$121wm2wxudqaaffd_v4ts7fdlskz7i5ozra$122wm2wxudqaap9pok013m97z32wn7_nwwa$123wm2wxudqaa8dx9emsi-k0tl4dhmo4qig$124wm2wxudqaaumbpmbvnd0ajy5cfwc6qla$125wm2wxudqaa_ly...|2|3|1||0|0|3192|1596|1578|789|
|sms|select ifnull(sum(ifnull(t2.sms_size, $0) * t1.send_count), $1) as amount from sms_send t1 left join sms.sms_send_extend t2 on t1.biz_id = t2.biz_id where t1.tenant_app_id = $2 and t1.code = $3 and t1.create_time >= $4 and t1.create_time < $5|2|2|1||0|0|6520|3274|2|1|
|order|select count(0) from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $0 and od.tenant_wechatapp_id = $1 and dt.product_name like concat($2, $3, $4)|2|4|2||0|0|127739|64134|2|1|
|user_service|select count(0) from ( select count(1) from user_source us where us.tenant_id = $0 and us.tenant_wechatapp_id = $1 and us.from_id = $2 and us.shop_id = $3 and us.create_time >= $4 and us.create_time < $5 and us.source_type = $6 and us.from_id is not null and us.shop_id is not null ) table_count|2|2|1||0|0|2675|1350|2|1|
|authorization_service|update user_login_token set status = $0 where login_token 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|2|2|1||0|0|2552|1323|0|0|
|sms|commit|2|2|1||0|0|0|0|0|0|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_id in ($2, $3, $4, $5, $6)|2|2|1||0|0|509863|456764|10|5|
|gift_mail|select p.id, p.product_name, p.tag_price, i.volume, p.product_status as status, p.default_image_url, i.quantity, i.market_price, if(prp.id is null, false, true) as hasrecommend from gift_mail.platform_product p join gift_mail.platform_inventory i on i.product_id = p.id left join gift_mail.platform_recommend_product prp on prp.tenant_app_id = $0 and prp.is_recommend = true and prp.platform_product_id = p.id where prp.id is null and p.product_status = $1 order by p.tag_price asc, p.id desc limit $2|2|2|1||0|0|16496|8248|12|6|
|order|select count(0) from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $0 and od.tenant_wechatapp_id = $1 and (od.status = $2 or od.status = $3 or od.status = $4 or od.status = $5)|1|1|1||0|0|68415|68415|1|1|
|employee|select count(*) from employee.backlog where tenant_id = $0 and tenant_app_id = $1 and shop_id = $2 and status = $3 and expire_time between $4 and $5|1|2|2||0|0|7929|7929|1|1|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $92, $93, $94, $95, $96, $97, $98, $99, $100, $101, $102, $103, $104, $105, $106, $107)|1|5|5||0|0|1230198|1230198|106|106|
|v4_sales|select * from erp_sales where member_erp_id = $0 and is_sales = true and sales_status = $1 and id < $2 and tenant_id = $3 and tenant_app_id = $4 order by sales_date asc, sales_erp_id asc limit $5|1|1|1||0|0|2290|2290|1|1|
|order|select od.id, od.order_no as orderno, od.status, od.take_type as taketype, od.create_time as createtime, od.remark, od.total_fee as totalfee, od.freight_fee as freightfee, od.discount_fee as discountfee, od.take_id as takeid, od.payment_fee as paymentfee, dt.product_id as productid, dt.price, dt.quantity, dt.sku_id as skuid, dt.art_no as artno, dt.image_url as imageurl, dt.product_name as productname, dt.take_remark as takeremark, dt.take_day as takeday, od.product_fee as productfee, ad.user_name as receivename, ad.mobile_no as mobileno, ad.shop_name as shopname, ad.address, ad.express_no as expressno, ad.express_company as expresscompany, od.user_name as username, od.update_time as updatetime, od.child_status as childstatus, od.finish_type as finishtype, od.receive_time as receivetime, od.user_id as userid, od.mobile_no as buymobileno, od.edit_fee_flag as editfeeflag, dt.spec as spec, od.source, od.take_shop_id, od.take_shop_name, od.take_employee_user_id, od.take_employee_user_name, od.activity_type, od.activity_id, od.offline_payment_fee, od.online_wait_fee, od.offline_wait_fee, od.pay_way, od.take_employee_id, od.pay_id from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $0 and od.tenant_wechatapp_id = $1 and (od.mobile_no = $2 or ad.mobile_no = $3) and od.status = $4 and od.finish_type = $5 order by od.create_time desc limit $6|1|1|1||0|0|37503|37503|2|2|
|v4_employee|select t.id as task_id, task_type, if(task_type = $0, st.description, it.description) as description, if(task_type = $1, st.quick_reply, it.quick_reply) as quick_reply, task_name, member_id, member_name, member_mobile_no, member_sex, member_level, t.start_time, t.end_time, datediff(t.end_time, null) as left_days, send_coupons, recv_coupons, st.coupons, t.accept_time, t.plan_arrival_shop_time, t.arrival_shop_time, t.trade_time from task_task t left join task_system_task_template st on st.id = t.task_template_id and st.tenant_id = $2 and st.tenant_app_id = $3 left join task_invite_task_template it on it.id = t.task_template_id and it.tenant_id = $4 and it.tenant_app_id = $5 where t.status = $6 and task_type = $7 and task_template_id = $8 and shop_id = $9 and employee_id = $10 and finish_time is null and t.end_time > now() and t.tenant_id = $11 and t.tenant_app_id = $12 order by t.id desc limit $13|1|1|1||0|0|54806|54806|10|10|
|value_added|select $0 as limitdaytype, t.tenant_wechatapp_id, t.user_id, min(ue.employee_erp_id) as 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, '%y-%m-%d'), interval $4 * (t.add_days + t.keeping_days - $5) day) and t.start_add_time < date_add(date_format($6, '%y-%m-%d'), interval $7 * (t.add_days + t.keeping_days - $8) + $9 day) group by t.tenant_wechatapp_id, t.user_id, ue.dept_erp_id|1|1|1||0|0|417319|417319|78|78|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $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)|1|3|3||0|0|866090|866090|189|189|
|employee|select ifnull(sum(task_amount), $0) as shouldmarknum, ifnull(sum(finish_amount), $1) as marklabelnum from backlog t where t.tenant_id = $2 and t.tenant_app_id = $3 and t.employee_id in ($4, $5, $6, $7) and t.scene = $8 and t.begin_time >= $9 and t.expire_time < $10|1|1|1||0|0|11207|11207|1|1|
|order|select count(*) as amount from `order`.order_info od left join `order`.order_detail dt on od.id = dt.order_id left join order.order_address ad on od.id = ad.order_id where od.tenant_wechatapp_id = $0 and od.take_type = $1 and od.type = $2 and od.status = $3 and ad.shop_id = $4 and dt.take_start_date = $5|1|1|1||0|0|7689|7689|1|1|
|coupon_service|select cmod.coupon_id, cmo.pay_type from coupon_service.coupon_market_order_detail cmod join coupon_service.coupon_market_order cmo on cmo.tenant_id = $0 and cmo.tenant_app_id = $1 and cmo.id = cmod.order_id where cmod.tenant_id = $2 and cmod.tenant_app_id = $3 and cmod.coupon_id in ($4, $5, $6, $7, $8, $9)|1|1|1||0|0|89044|89044|6|6|
|user_service|select tmb.erp_member_id as member_erp_id, tm.tenant_id, tm.tenant_app_id, tm.mobile_no, tm.user_name, tmi.grade_id as grade_erp_id from user_service.tenant_member tm join user_service.tenant_member_bind tmb on tm.tenant_id = tmb.tenant_id and tm.id = tmb.id join user_service.tenant_member_info tmi on tm.tenant_id = tmi.tenant_id and tm.id = tmi.id where tmb.tenant_id = $0 and tmb.tenant_app_id = $1 and tmb.erp_member_id in ($2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21)|1|1|1||0|0|57|57|19|19|
|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 and t2.tenant_app_id = $0 and t2.shop_id = $1 join user_service.user_employee ue on t1.tenant_id = ue.tenant_id and t1.tenant_app_id = ue.tenant_wechatapp_id and t1.user_id = ue.user_id and ue.employee_id = $2 and ue.shop_id = $3 where t1.tenant_id = $4 and t1.tenant_app_id = $5 and (t1.mobile_no like concat($6, $7) or t1.user_name like concat($8, $9, $10))|1|1|1||0|0|1448|1448|1|1|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $92, $93, $94, $95, $96, $97, $98, $99, $100, $101, $102, $103)|1|2|2||0|0|928140|928140|102|102|
|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 = $0, t1.coupon_user_id, null) as valueaddcoupon, t1.user_id as memberuserid, case when start_add_time > $1 then $2 when date_add(start_add_time, interval add_days day) > $3 and state = $4 then $5 when date_add(start_add_time, interval add_days + keeping_days day) > $6 and date_add(start_add_time, interval add_days day) < $7 and state = $8 then $9 when date_add(start_add_time, interval add_days + keeping_days day) < $10 and amount_added > $11 and state = $12 then $13 else $14 end as addedstatus 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 = $15 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 = $16 where t1.tenant_wechatapp_id = t3.tenant_wechatapp_id and t2.category_erp_id = t3.erp_product_category_id ) and t2.sales_date >= $17 and t2.sales_date < $18 and t1.state != $19 limit $20|1|3|3||0|0|38012|38012|7|7|
|order|select id from order_operator_log where tenant_wechatapp_id = $0 and order_id = $1 and src_child_status = $2 and dst_child_status = $3 order by create_time desc limit $4|1|3|3||0|0|867803|867803|0|0|
|employee|select ifnull(sum(task_amount), $0) as shouldmarknum, ifnull(sum(finish_amount), $1) as marklabelnum from backlog t where t.tenant_id = $2 and t.tenant_app_id = $3 and t.employee_id in ($4, $5, $6, $7, $8, $9, $10, $11, $12) and t.scene = $13 and t.begin_time >= $14 and t.expire_time < $15|1|1|1||0|0|9954|9954|1|1|
|user_service|update user_service.tenant_member_info t1 join user_service.user_employee t2 on t1.tenant_id = t2.tenant_id and t1.tenant_app_id = t2.tenant_wechatapp_id and t1.user_id = t2.user_id set t1.shop_id = $0, t2.shop_id = $1 where t1.tenant_id = $2 and t1.tenant_app_id = $3 and t2.employee_id = $4 and t1.shop_id = $5|1|2|2||0|0|2228|2228|0|0|
|order|select count(*) from `order`.order_info where tenant_id = $0 and tenant_wechatapp_id = $1 and take_type = $2 and status = $3 and (wait_take_shop_id = $4 or take_shop_id = $5)|1|1|1||0|0|5662|5662|1|1|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|1|8|8||0|0|349708|349708|37|37|
|v4_user|select t1.maintain_shop_id, t1.maintain_employee_id, t1.maintain_level, count(*) as maintainnum from potential_customer t1 where t1.tenant_app_id = $0 and t1.`status` in ($1, $2) and t1.next_maintain_time >= $3 and t1.tenant_id = $4 and t1.tenant_app_id = $5 group by t1.maintain_shop_id, t1.maintain_employee_id, t1.maintain_level|1|1|1||0|0|8457|8457|313|313|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|1|2|2||0|0|928140|928140|81|81|
|v4_employee|select sum(ifnull(member_sales_amount <= $0, $1)) as `amount_total_consume|2000元以下`, sum(ifnull(member_sales_amount between $2 and $3, $4)) as `amount_total_consume|2001-10000元`, sum(ifnull(member_sales_amount between $5 and $6, $7)) as `amount_total_consume|10001-50000元`, sum(ifnull(member_sales_amount between $8 and $9, $10)) as `amount_total_consume|50001-99999元`, sum(ifnull(member_sales_amount >= $11, $12)) as `amount_total_consume|100000元以上`, sum(ifnull(member_level_id = $13, $14)) as `member_level|福运卡`, sum(ifnull(member_level_id = $15, $16)) as `member_level|福囍卡`, sum(ifnull(member_level_id = $17, $18)) as `member_level|福源卡`, sum(ifnull(member_level_id = $19, $20)) as `member_level|万福卡`, sum(ifnull(member_level_id = $21, $22)) as `member_level|粉丝会员`, sum(ifnull(member_integral_total <= $23, $24)) as `integral_total|2000分以下`, sum(ifnull(member_integral_total between $25 and $26, $27)) as `integral_total|2001-10000分`, sum(ifnull(member_integral_total between $28 and $29, $30)) as `integral_total|10001-50000分`, sum(ifnull(member_integral_total between $31 and $32, $33)) as `integral_total|50001-99999分`, sum(ifnull(member_integral_total >= $34, $35)) as `integral_total|100000分以上`, sum(ifnull(member_sex = $36, $37)) as `sex|男`, sum(ifnull(member_sex = $38, $39)) as `sex|女`, sum(ifnull(member_sex = $40, $41)) as `sex|其他`, sum(ifnull(member_sales_count = $42, $43)) as `consume_num|0次`, sum(ifnull(member_sales_count = $44, $45)) as `consume_num|1次`, sum(ifnull(member_sales_count = $46, $47)) as `consume_num|2次`, sum(ifnull(member_sales_count between $48 and $49, $50)) as `consume_num|3-5次`, sum(ifnull(member_sales_count >= $51, $52)) as `consume_num|6次以上`, sum(ifnull(member_integral_balance <= $53, $54)) as `integral_balance|2000分以下`, sum(ifnull(member_integral_balance between $55 and $56, $57)) as `integral_balance|2001-10000分`, sum(ifnull(member_integral_balance between $58 and $59, $60)) as `integral_balance|10001-30000分`, sum(ifnull(member_integral_balance between $61 and $62, $63)) as `integral_balance|30001-50000分`, sum(ifnull(member_integral_balance >= $64, $65)) as `integral_balance|50001分以上`, sum(ifnull(member_age <= $66, $67)) as `age|25岁以下`, sum(ifnull(member_age between $68 and $69, $70)) as `age|26-35岁`, sum(ifnull(member_age between $71 and $72, $73)) as `age|36-40岁`, sum(ifnull(member_age between $74 and $75, $76)) as `age|41-55岁`, sum(ifnull(member_age >= $77, $78)) as `age|56岁以上`, sum(ifnull(shop_id = $79, $80)) as `shop|振河印象店`, sum(ifnull(shop_id = $81, $82)) as `shop|万博形象店`, sum(ifnull(shop_id = $83, $84)) as `shop|星光时尚店` from task_task where task_template_id = $85|1|4|4||0|0|440720|440720|1|1|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_id in ($2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21)|1|1|1||0|0|275975|275975|20|20|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $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)|1|1|1||0|0|376967|376967|144|144|
|v4_employee|select t.id as task_id, t.employee_id, e.employee_name, t.member_id, t.member_name, t.finish_time, t.plan_arrival_shop_time, tta.task_attaches from task_task t join employee e on e.employee_id = t.employee_id and e.shop_id = t.shop_id and e.tenant_id = $0 and e.tenant_app_id = $1 left join ( select task_id, group_concat(file_url separator '|') as task_attaches from task_task_attach where tenant_id = $2 and tenant_app_id = $3 group by task_id ) tta on t.id = tta.task_id where t.status = $4 and system_task_type = $5 and t.shop_id = $6 and finish_time >= $7 and finish_time < $8 and t.employee_id = $9 and t.tenant_id = $10 and t.tenant_app_id = $11 order by t.finish_time desc, t.id desc limit $12|1|1|1||0|0|97034|97034|2|2|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|1|1|1||0|0|865882|865882|85|85|
|order|select od.id, od.order_no as orderno, od.status, od.take_type as taketype, od.create_time as createtime, od.remark, od.total_fee as totalfee, od.freight_fee as freightfee, od.discount_fee as discountfee, od.take_id as takeid, od.payment_fee as paymentfee, dt.product_id as productid, dt.price, dt.quantity, dt.sku_id as skuid, dt.art_no as artno, dt.image_url as imageurl, dt.product_name as productname, dt.take_remark as takeremark, dt.take_day as takeday, od.product_fee as productfee, od.finish_type as finishtype, od.send_time as sendtime, od.receive_time as receivetime, od.finish_time as finishtime, od.child_status as childstatus, od.send_good_remark as sendgoodremark, od.service_flag as serviceflag, od.coupon_id as couponid, od.tenant_wechatapp_id as tenantappid, od.tenant_id as tenantid, od.pay_id as payid, od.user_id as userid, od.user_name as username, od.mobile_no as 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 = $0 and od.receive_time <= $1|1|2|2||0|0|213442|213442|220|220|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $92, $93, $94, $95, $96, $97, $98, $99, $100)|1|1|1||0|0|130401|130401|99|99|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|1|1|1||0|0|108636|108636|27|27|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_id in ($2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14)|1|6|6||0|0|181135|181135|13|13|
|v4_employee|select t.id as task_id, task_type, if(task_type = $0, st.description, it.description) as description, if(task_type = $1, st.quick_reply, it.quick_reply) as quick_reply, task_name, member_id, member_name, member_mobile_no, member_sex, member_level, t.start_time, t.end_time, datediff(t.end_time, $2) as left_days, send_coupons, recv_coupons, st.coupons, t.accept_time, t.plan_arrival_shop_time, t.arrival_shop_time, t.trade_time from task_task t left join task_system_task_template st on st.id = t.task_template_id and st.tenant_id = $3 and st.tenant_app_id = $4 left join task_invite_task_template it on it.id = t.task_template_id and it.tenant_id = $5 and it.tenant_app_id = $6 where t.status = $7 and task_type = $8 and task_template_id = $9 and shop_id = $10 and employee_id = $11 and finish_time >= $12 and finish_time < $13 and finish_time is not null and t.tenant_id = $14 and t.tenant_app_id = $15 order by t.id desc limit $16|1|3|3||0|0|440722|440722|1|1|
|value_added|update value_added_user set amount_added = if($0 > (added_percent_per_day / $1 * if($2 >= timestampdiff(day, date_format(start_add_time, '%y-%m-%d'), current_date) + $3 - add_days, timestampdiff(day, date_format(start_add_time, '%y-%m-%d'), current_date) + $4, add_days) - devalue_percent_per_day / $5 * if($6 >= timestampdiff(day, date_format(start_add_time, '%y-%m-%d'), current_date) + $7 - add_days - keeping_days, $8, timestampdiff(day, date_format(start_add_time, '%y-%m-%d'), current_date) + $9 - add_days - keeping_days)) * amount_pay, $10, (added_percent_per_day / $11 * if($12 >= timestampdiff(day, date_format(start_add_time, '%y-%m-%d'), current_date) + $13 - add_days, timestampdiff(day, date_format(start_add_time, '%y-%m-%d'), current_date) + $14, add_days) - devalue_percent_per_day / $15 * if($16 >= timestampdiff(day, date_format(start_add_time, '%y-%m-%d'), current_date) + $17 - add_days - keeping_days, $18, timestampdiff(day, date_format(start_add_time, '%y-%m-%d'), current_date) + $19 - add_days - keeping_days)) * amount_pay), update_time = now() where state = $20 and update_time <= curdate() and (start_add_time >= date_add(curdate(), interval -(add_days + keeping_days - $21) day) or (amount_added > $22 and start_add_time < date_add(curdate(), interval -(add_days + keeping_days - $23) day)))|1|20|20||0|0|1845930|1845930|0|0|
|employee|select t1.employee_id, t1.shop_id, t1.shouldaddnum, t1.addednum, ifnull(t2.marklabelnum, $0) as marklabelnum from ( select t.employee_id, t.shop_id, t.task_amount as shouldaddnum, t.finish_amount as addednum from employee.backlog t where t.tenant_id = $1 and t.tenant_app_id = $2 and t.shop_id = $3 and t.begin_time >= $4 and t.expire_time < $5 and t.scene = $6 ) t1 left join ( select t.employee_id, sum(t.finish_amount) as marklabelnum from employee.backlog t where t.tenant_id = $7 and t.tenant_app_id = $8 and t.begin_time >= $9 and t.expire_time < $10 and t.scene = $11 group by t.employee_id ) t2 on t1.employee_id = t2.employee_id order by t1.shop_id, t1.employee_id|1|3|3||0|0|417902|417902|8|8|
|gift_mail|select p.id, p.product_name, p.tag_price, i.volume, p.product_status as status, p.default_image_url, i.quantity, i.market_price, if(prp.id is null, false, true) as hasrecommend from gift_mail.platform_product p join gift_mail.platform_inventory i on i.product_id = p.id left join gift_mail.platform_recommend_product prp on prp.tenant_app_id = $0 and prp.is_recommend = true and prp.platform_product_id = p.id where prp.id is null and p.product_status = $1 order by i.volume asc, p.id desc limit $2, $3|1|1|1||0|0|8314|8314|6|6|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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|865892|865892|90|90|
|tenant|select count(0) from sneak_guest sg left join employee ey on sg.maintain_employee_id = ey.id where sg.tenant_app_id = $0 and sg.create_shop_id = $1 and exists ( select $2 from tenant.sneak_guest_maintain sgm where sg.id = sgm.sneak_guest_id and sgm.event_type = $3 and sgm.intention_info regexp $4 ) and sg.status = $5|1|11|11||0|0|23711|23711|1|1|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|1|1|1||0|0|364616|364616|54|54|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|1|1|1||0|0|276198|276198|59|59|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|1|3|3||0|0|955446|955446|67|67|
||update v4_user.member_import set memorial_day = null where memorial_day = $0 and tenant_id = $1|1|1|1||0|0|309500|309500|0|0|
||delete from tenant.sjfx_dct_erp_sales_detail where create_time < $0|1|1|1||0|0|234145|234145|0|0|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|1|1|1||0|0|955423|955423|44|44|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $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)|1|3|3||0|0|779882|779882|173|173|
|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 = $0, t1.coupon_user_id, null) as valueaddcoupon, t1.user_id as memberuserid, case when start_add_time > $1 then $2 when date_add(start_add_time, interval add_days day) > $3 and state = $4 then $5 when date_add(start_add_time, interval add_days + keeping_days day) > $6 and date_add(start_add_time, interval add_days day) < $7 and state = $8 then $9 when date_add(start_add_time, interval add_days + keeping_days day) < $10 and amount_added > $11 and state = $12 then $13 else $14 end as addedstatus 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 = $15 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 = $16 where t1.tenant_wechatapp_id = t3.tenant_wechatapp_id and t2.category_erp_id = t3.erp_product_category_id ) and t2.sales_date >= $17 and t2.sales_date < $18 and t1.state != $19 ) tmp_count|1|2|2||0|0|37480|37480|1|1|
|v4_employee|select count(*) as total_count, count(finish_time) as finish_count, ifnull(sum(if(finish_time >= $0 and finish_time < $1, $2, $3)), $4) as todayfinishcount, count(send_coupons) as coupon_send_count, count(recv_coupons) as coupon_recv_count, count(accept_time) as accept_count, count(arrival_shop_time) as arrival_shop_count, count(trade_time) as trade_count from task_task where task_type = $5 and status = $6 and shop_id = $7 and employee_id = $8 and system_task_type = $9 and start_time <= $10 and end_time > $11 and tenant_id = $12 and tenant_app_id = $13|1|1|1||0|0|4061|4061|1|1|
|v4_coupon|select count(*) as total from ( select c.id, c.display_name, c.type as coupontype, round(c.face_value / $0, $1) as facevalue, round(c.face_value / $2, $3) as points, c.face_value as discount, c.begin_time, c.end_time, c.template_id, round(c.use_threshold / $4) as usethreshold, ce.exchange_goods, case when c.begin_time > now() and c.coupon_status = $5 then $6 else c.coupon_status end as coupon_status from v4_coupon.coupon c join v4_coupon.coupon_extend ce on ce.id = c.id and ce.tenant_id = $7 and ce.tenant_app_id = $8 where c.member_id = $9 and c.tenant_id = $10 and c.tenant_app_id = $11 ) c|1|2|2||0|0|87900|87900|1|1|
|gift_mail|select p.id, p.product_name, p.tag_price, i.volume, p.product_status as status, p.default_image_url, i.quantity, i.market_price, if(prp.id is null, false, true) as hasrecommend from gift_mail.platform_product p join gift_mail.platform_inventory i on i.product_id = p.id left join gift_mail.platform_recommend_product prp on prp.tenant_app_id = $0 and prp.is_recommend = true and prp.platform_product_id = p.id where prp.id is null and p.product_status = $1 order by p.tag_price desc, p.id desc limit $2|1|1|1||0|0|8248|8248|6|6|
|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 and t2.tenant_app_id = $0 and t2.shop_id = $1 where t1.tenant_id = $2 and t1.tenant_app_id = $3 and (t1.mobile_no like concat($4, $5) or t1.user_name like concat($6, $7, $8))|1|1|1||0|0|32500|32500|1|1|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_id in ($2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)|1|1|1||0|0|85738|85738|12|12|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|1|1|1||0|0|955437|955437|58|58|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $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)|1|1|1||0|0|290110|290110|124|124|
|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17)|1|1|1||0|0|1389576|1389576|18|18|
|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 - $0 day), date_add(start_add_time, interval add_days + keeping_days - $1 day) from value_added_user where keeping_days > $2 and state = $3 and start_add_time = date_add(curdate(), interval $4 * (add_days - $5) day)|1|11|11||0|0|1845935|1845935|1014|1014|
|order|select ifnull(sum(if(od.status = $0, $1, $2)), $3) as "2", ifnull(sum(if(od.status = $4, $5, $6)), $7) as "4", ifnull(sum(if(od.status = $8, $9, $10)), $11) as "3", ifnull(sum(if(od.status = $12, $13, $14)), $15) as "5", count(1) as total, ifnull(sum(if(od.status > $16, od.payment_fee, $17)), $18) as paymentfee, ifnull(sum(if(od.status > $19, od.offline_payment_fee, $20)), $21) as offlinepaymentfee, ifnull(sum(if(od.status > $22, od.payment_fee + od.offline_payment_fee, $23)), $24) as paytotalfee from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $25 and od.tenant_wechatapp_id = $26 and (od.mobile_no = $27 or ad.mobile_no = $28) and (od.status = $29 or od.status = $30 or od.status = $31 or od.status = $32)|1|1|1||0|0|68274|68274|1|1|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $92, $93, $94, $95, $96, $97, $98, $99, $100, $101, $102, $103, $104)|1|1|1||0|0|821837|821837|103|103|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $92, $93, $94, $95, $96, $97, $98, $99, $100, $101, $102, $103, $104, $105)|1|3|3||0|0|773143|773143|104|104|
|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 = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16)|1|2|2||0|0|1389569|1389569|19|19|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $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)|1|3|3||0|0|811724|811724|189|189|
|coupon_service|select * from coupon_service.coupon_can_give where coupon_id = $0 limit $1|1|2|2||0|0|244966|244966|1|1|
||delete from tenant.sjfx_dct_erp_sales where create_time < $0|1|6|6||0|0|273244|273244|0|0|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $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)|1|1|1||0|0|821854|821854|120|120|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $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)|1|2|2||0|0|543671|543671|131|131|
|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 = $0 and login_name = $1|1|1|1||0|0|60226|60226|1|1|
|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 - $0 day), date_add(start_add_time, interval add_days + keeping_days - $1 day) from value_added_user where state = $2 and start_add_time = date_add(curdate(), interval $3 * (add_days + keeping_days - $4) day)|1|1|1||0|0|1845935|1845935|786|786|
|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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $92, $93, $94, $95, $96, $97, $98, $99, $100, $101, $102, $103, $104, $105, $106, $107, $108, $109, $110, $111, $112, $113, $114, $115, $116, $117, $118, $119, $120, $121, $122, $123, $124, $125, $126, $127, $128, $129, $130, $131, $132, $133, $134, $135, $136, $137, $138, $139, $140, $141, $142, $143, $144, $145, $146, $147, $148, $149, $150, $151, $152, $153, $154, $155, $156, $157, $158, $159, $160, $161, $162, $163, $164, $165, $166, $167, $168, $169, $170, $171, $172, $173, $174, $175, $176, $177, $178, $179, $180, $181, $182, $183, $184, $185, $186, $187, $188, $189, $190, $191, $192, $193, $194, $195, $196, $197, $198, $199, $200, $201, $202, $203, $204, $205, $206, $207, $208, $209, $210, $211, $212, $213, $214, $215, $216, $217, $218, $219, $220, $221, $222, $223, $224, $225, $226, $227, $228, $229, $230, $231, $232 ...|1|3|3||0|0|784914|784914|443|443|
|tenant|select count(0) from sneak_guest sg left join employee ey on sg.maintain_employee_id = ey.id where sg.tenant_app_id = $0 and sg.create_shop_id = $1 and exists ( select $2 from tenant.sneak_guest_maintain sgm where sg.id = sgm.sneak_guest_id and sgm.event_type = $3 and sgm.intention_info regexp $4 ) and exists ( select $5 from tenant.sneak_guest_maintain sgm where sg.id = sgm.sneak_guest_id and sgm.event_type = $6 and sgm.intention_info regexp $7 ) and sg.status = $8|1|9|9||0|0|34642|34642|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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $92, $93, $94, $95, $96, $97, $98, $99, $100, $101, $102, $103, $104, $105, $106, $107, $108, $109, $110, $111, $112, $113, $114, $115, $116, $117, $118, $119, $120, $121, $122, $123, $124, $125, $126, $127, $128, $129, $130, $131, $132, $133, $134, $135, $136, $137, $138, $139, $140, $141, $142, $143, $144, $145, $146, $147, $148, $149, $150, $151, $152, $153, $154, $155, $156, $157, $158, $159, $160, $161, $162, $163, $164, $165, $166, $167, $168, $169, $170, $171, $172, $173, $174, $175, $176, $177, $178, $179, $180, $181, $182, $183, $184, $185, $186, $187, $188, $189, $190, $191, $192, $193, $194, $195, $196, $197, $198, $199, $200, $201, $202, $203, $204, $205, $206, $207, $208, $209, $210, $211, $212, $213, $214, $215, $216, $217, $218, $219, $220, $221, $222, $223, $224, $225, $226, $227, $228, $229, $230, $231, $232|1|1|1||0|0|1321958|1321958|333|333|
|order|select ifnull(sum(if(od.status = $0, $1, $2)), $3) as "2", ifnull(sum(if(od.status = $4, $5, $6)), $7) as "3", ifnull(sum(if(od.status = $8, $9, $10)), $11) as "4", ifnull(sum(if(od.status = $12, $13, $14)), $15) as "5", count(1) as total, ifnull(sum(if(od.status > $16, od.payment_fee, $17)), $18) as paymentfee, ifnull(sum(if(od.status > $19, od.offline_payment_fee, $20)), $21) as offlinepaymentfee, ifnull(sum(if(od.status > $22, od.payment_fee + od.offline_payment_fee, $23)), $24) as paytotalfee from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $25 and od.tenant_wechatapp_id = $26 and (od.status = $27 or od.status = $28 or od.status = $29 or od.status = $30)|1|1|1||0|0|68415|68415|1|1|
|employee|select date_format(t.create_time, '%d') as monthday, ifnull(sum(task_amount), $0) as shouldmarknum, ifnull(sum(finish_amount), $1) as marklabelnum from backlog t where t.tenant_id = $2 and t.tenant_app_id = $3 and t.employee_id in ($4, $5, $6, $7) and t.scene = $8 and t.begin_time >= $9 and t.expire_time < $10 group by date_format(t.create_time, '%d')|1|1|1||0|0|11247|11247|20|20|
|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 from user_service.tenant_member tm where tm.tenant_id = $0 and tm.tenant_app_id = $1 and (tm.user_name like concat($2, $3, $4) or tm.mobile_no = $5) order by tm.id desc limit $6|1|2|2||0|0|364447|364447|1|1|
|order|select od.id, od.order_no as orderno, od.status, od.take_type as taketype, od.create_time as createtime, od.remark, od.total_fee as totalfee, od.freight_fee as freightfee, od.discount_fee as discountfee, od.take_id as takeid, od.payment_fee as paymentfee, dt.product_id as productid, dt.price, dt.quantity, dt.sku_id as skuid, dt.art_no as artno, dt.image_url as imageurl, dt.product_name as productname, dt.take_remark as takeremark, dt.take_day as takeday, od.product_fee as productfee, ad.user_name as receivename, ad.mobile_no as mobileno, ad.shop_name as shopname, ad.address, ad.express_no as expressno, ad.express_company as expresscompany, od.finish_type as finishtype, od.send_time as sendtime, od.receive_time as receivetime, od.finish_time as finishtime, od.child_status as childstatus, od.send_good_remark as sendgoodremark, od.service_flag as serviceflag, od.coupon_id as couponid, od.tenant_wechatapp_id as 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 = $0 and od.send_time <= $1 and od.take_type = $2|1|2|2||0|0|213222|213222|0|0|
|mysql|delete from message_push.message_log where create_time < date_sub(now(), interval $0 day)|1|62|62||0|0|2298840|2298840|0|0|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_id in ($2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17)|1|1|1||0|0|44382|44382|16|16|
|v4_sales|select id, warranty_detail_id, media_id, wx_img_url, img_url, tenant_id, tenant_app_id, create_time, update_time from warranty_detail_img where warranty_detail_id in ($0) and tenant_id = $1 and tenant_app_id = $2|1|1|1||0|0|20623|20623|0|0|
|employee|select id, scene, employee_id, member_user_name as username, finish_time, status from employee.backlog where tenant_id = $0 and tenant_app_id = $1 and shop_id = $2 and expire_time between $3 and $4 and status != $5 and scene not in ($6, $7) order by id desc limit $8, $9|1|3|3||0|0|802127|802127|3|3|
|tenant|select count(0) from ( select es.id, es.sales_no, es.sales_date, es.sales_erp_id, es.amount, ifnull(shop.shop_name, ed.dept_name) as dept_name, es.employee_name from tenant.erp_sales es join tenant.erp_department ed on ed.dept_erp_id = es.dept_erp_id and ed.tenant_id = $0 left join tenant.tenant_wechatapp_shop shop on shop.dept_erp_id = ed.dept_erp_id and shop.tenant_wechatapp_id = $1 where es.member_erp_id = $2 and es.tenant_id = $3 and es.tenant_wechatapp_id = $4 and es.sales_status = $5 and not exists ( select i.id from tenant.erp_sales_ignore i where i.tenant_id = $6 and i.tenant_app_id = $7 and es.sales_erp_id = i.erp_sales_id ) ) table_count|1|1|1||0|0|1859762|1859762|1|1|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $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)|1|2|2||0|0|821858|821858|124|124|
|employee|select date_format(t.create_time, '%d') as monthday, ifnull(sum(task_amount), $0) as shouldmarknum, ifnull(sum(finish_amount), $1) as marklabelnum from backlog t where t.tenant_id = $2 and t.tenant_app_id = $3 and t.employee_id in ($4, $5, $6, $7, $8, $9, $10, $11, $12) and t.scene = $13 and t.begin_time >= $14 and t.expire_time < $15 group by date_format(t.create_time, '%d')|1|1|1||0|0|9984|9984|15|15|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|1|1|1||0|0|254546|254546|40|40|
|goods|select count(0) from ( select gs.id, gs.tenant_id, gs.tenant_app_id, gs.category_id, gs.activity_id, gs.goods_name, gs.style_no, gs.base_sale_number, gs.limit_sale, if(gs.status = $0, gs.status, if(t.id is null, $1, $2)) as status, gs.thumbnail_img, gs.express_type, gs.take_stock_day, gs.take_remark, gs.express_fee, gs.create_time, gs.update_time, gs.sale_type, gs.take_start_time, gs.page_id, gs.pay_way, gs.advance_payment, gs.exchange_money, ifnull(sku.minprice, $3) as minprice, ifnull(sku.marketprice, $4) as marketprice, ifnull(sku.totalsalesvolume, $5) as totalsalesvolume, ifnull(sku.totalquantity, $6) as totalquantity, ifnull(number, $7) as skunumber, gs.topping from goods.goods gs left join ( select id, goods_id from goods.goods_up_app gu where gu.tenant_app_id = $8 ) t on gs.id = t.goods_id left join ( select goods_id, min(price) as minprice, max(market_price) as marketprice, sum(sales_volume) as totalsalesvolume, sum(quantity) as totalquantity, count(*) as number from goods.goods_sku where activity_id = $9 group by tenant_id, goods_id ) sku on sku.goods_id = gs.id where gs.tenant_id = $10 and gs.status < $11 order by gs.topping desc, sku.totalsalesvolume asc, gs.id desc ) tmp_count|1|1|1||0|0|62444|62444|1|1|
|mysql|delete from wx_gateway.wx_template_msg where create_time < date_sub(now(), interval $0 day)|1|32|32||0|0|913289|913289|0|0|
||select wx_app_id, count(*) as c from user_service.wx_user where wx_app_id in ($0, $1) group by wx_app_id|1|20|20||0|0|48476|48476|2|2|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_id in ($2, $3, $4, $5, $6, $7, $8)|1|1|1||0|0|44332|44332|7|7|
|order|select id, tenant_id, tenant_wechatapp_id, order_id, user_id, user_name, shop_id, shop_name, operator_type, src_status, dst_status, full_message, remark, create_time, update_time, src_child_status, dst_child_status from order_operator_log where tenant_wechatapp_id = $0 and order_id = $1 and dst_status = $2 order by create_time desc|1|1|1||0|0|867965|867965|1|1|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_id in ($2, $3, $4, $5)|1|1|1||0|0|20572|20572|4|4|
|order|select count(0) from order_info od left join order_detail dt on od.id = dt.order_id left join order_address ad on od.id = ad.order_id where od.tenant_id = $0 and od.tenant_wechatapp_id = $1 and (od.mobile_no = $2 or ad.mobile_no = $3) and od.status = $4 and od.finish_type = $5|1|1|1||0|0|14626|14626|1|1|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_id in ($2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16)|1|1|1||0|0|427428|427428|15|15|
||update v4_user.member_import set birthday = null where birthday = $0 and tenant_id = $1|1|1|1||0|0|309500|309500|0|0|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|1|1|1||0|0|43286|43286|23|23|
|v4_employee|select count(*) as total_count, count(finish_time) as finish_count from task_task t join task_invite_task_template t2 on t.task_template_id = t2.id and t2.tenant_id = $0 and t2.tenant_app_id = $1 where t2.invite_time < $2 and t.end_time > $3 and t2.status in ($4, $5, $6) and t.task_type = $7 and t.status = $8 and t.shop_id = $9 and t.tenant_id = $10 and t.tenant_app_id = $11|1|1|1||0|0|53466|53466|1|1|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_id in ($2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23)|1|1|1||0|0|76198|76198|22|22|
|v4_coupon|select tenant_id, tenant_app_id, member_id, count(1) as total from v4_coupon.coupon where datediff(date_format(end_time, '%y-%m-%d'), date_format(now(), '%y-%m-%d')) = $0 and coupon_status in ($1) group by tenant_id, tenant_app_id, member_id|1|1|1||0|0|93722|93722|11|11|
|v4_user|select t1.id as memberid, t2.id as potentialcustomerid, t2.checkin_time as checkintime from member t1 join potential_customer t2 on t1.tenant_app_id = t2.tenant_app_id and (t1.id = t2.member_id or (t2.external_user_id != $0 and t1.external_user_id = t2.external_user_id)) and t2.tenant_id = $1 and t2.tenant_app_id = $2 where t2.maintain_shop_id = $3 and t2.id in ($4, $5) and t1.tenant_id = $6 and t1.tenant_app_id = $7|1|1|1||0|0|133862|133862|2|2|
|coupon_service|select * from coupon_service.coupon where datediff(date_format(end_time, '%y-%m-%d'), date_format(now(), '%y-%m-%d')) = $0 and coupon_state in ($1)|1|172|172||0|0|9549244|9549244|1213|1213|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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)|1|2|2||0|0|334337|334337|70|70|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id as 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 = $0 and tu.tenant_app_id = $1 and mb.erp_member_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, $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)|1|4|4||0|0|928140|928140|152|152|
