|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|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|167|236|3||0|0|857608|46176|167|1|
|v4_sales|select * from v4_sales.erp_sales_detail where sales_erp_id = $0 and product_barcode = $1|154|178|2||0|0|158952986|1032592|156|2|
|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|114|162|4||0|0|253318|5476|253318|5476|
|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)|105|236|22||0|0|11233303|213278|58|2|
|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|92|182|4||0|0|1214643|27559|92|1|
|v4_sales|select * from v4_sales.erp_sales_detail where sales_erp_id = $0 and sales_type = $1 order by sales_index|77|607|20||0|0|79466684|1032598|243|11|
|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|61|169|11||0|0|21267809|1086983|16|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)|60|85|7||0|0|81101310|1352749|51|2|
|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|59|70|2||0|0|487170|8264|354|6|
|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)|54|80|4||0|0|21307788|394749|54|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)|54|66|2||0|0|72988987|1352749|91|4|
|comment_service|select * from comment_service.comment_reward where comment_id = $0 limit $1|53|82|3||0|0|20098079|389747|15|1|
|user_service|select count(0) from user_service.tenant_member t1 join user_service.tenant_member_info t2 on t1.tenant_id = t2.tenant_id and t1.id = t2.id 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|50|81|11||0|0|1163779|287845|50|1|
|v4_sales|select * from erp_sales where sales_erp_id = $0 limit $1|50|245|17||0|0|26594786|535970|50|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|46|62|4||0|0|8547042|208596|34|1|
|coupon_service|select count(*) from employee_give_coupon_log where tenant_app_id = $0 and coupon_push_id = $1|42|57|2||0|0|982340|32412|42|1|
|v4_user|select count(*) as total from member_source where source_id = $0 and tenant_id = $1 and tenant_app_id = $2|37|53|3||0|0|7716603|208598|37|1|
|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|30|285|25||0|0|2864311|274738|30|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)|27|38|6||0|0|36497174|1352685|92|6|
|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|26|41|3||0|0|67097|4836|26|1|
|coupon_service|select ifnull(sum(quantity), $0) from coupon_service.coupon_market_order where market_id = $1 and user_id = $2 and order_state = $3|23|53|5||0|0|11824026|514385|23|1|
|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|21|29|2||0|0|72224|5860|21|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, $15, $16, $17, $18, $19, $20)|21|25|2||0|0|28396143|1352407|379|25|
|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)|21|23|1||0|0|28378401|1352601|53|3|
|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|20|36|5||0|0|1684813|84320|20|1|
|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')|19|115|23||0|0|3929625|269022|3127|2232|
|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|19|35|3||0|0|100755|14072|19|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|19|35|3||0|0|100867|14086|19|1|
|corpwx|update external_user set un_assign_flag = $0 where tenant_id = $1 and un_assign_flag = $2|18|44|7||0|0|468356|57322|0|0|
|tenant|select id, tenant_id, tenant_app_id, sneak_guest_maintain_id, sneak_guest_id, url, create_time, update_time from sneak_guest_maintain_file where tenant_app_id = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6)|18|22|2||0|0|24332698|1352501|94|7|
|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|17|34|4||0|0|1783319|104924|17|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, $40, $41, $42wm2wxudqaan9b4dzv7wj0orgrkxsbh8w$43wm2wxudqaa6zerbernww8v7twe5nk-_w$44wm2wxudqaacqca69ck4mpxafdnoarbfw$45wm2wxudqaagyg-l9fgneyhk9dvqh_dqq$46wm2wxudqaarde0r_i6f_ujnjyvbxjsuq$47wm2wxudqaaj1rwylaaw6zokr4vvitrbw$48wm2wxudqaaa3mxnpb3wa7putbkh2glka$49wm2wxudqaaglz6o4hzna9x_mzqivbfuw$50wm2wxudqaazm8nuiwwljbqo1wtbxfxkw$51wm2wxudqaax_btk2uszua_m2bmm750mq$52wm2wxudqaah-c5psn9syx_rtp3rzmizg$53wm2wxudqaajgibxjzhz_pym6gmnitsda$54wm2wxudqaa2nrwsegro2xqw19bk9qrbg$55wm2wxudqaaldnbzgnz4nygc_7lqqyw_a$56wm2wxudqaaamhwxastzf4va_bmewfpja$57wm2wxudqaalz7tbk6dxhfl34j2anafoa$58wm2wxudqaadpzy_rzbip-itm6sxxgrwa$59wm2wxudqaa9vdw-ciagpssn0q5ckgoog$60wm2wxudqaa6tndgcigdhxj6glefhngtg$61wm2wxudqaasuhp8otiv_w_del88_loga$62wm2wxudqaa4ppfpzckrdb8c13bu_ar_g$63wm2wxudqaafhabltzs1h4ajiq1d1oija$64wm2wxudqaard2bzd9eoi6sivkxu3bo6a$65wm2wxudqaaqeur3y7xjj8ranstgqycgg$66wm2wxudqaadyzkmd6gw66_en2nihmwgw$67wm2wxudqaakjhm50prvtfjbsbswoftqg$68wm2wxudqaa78nkjslbcnawo1u9j_1saq$69wm2wxudqaaxhekp3ogszjafu8qyul9sq$70wm2wxudqaa5niob0rwgztzq3sbqlcycg$71wm2wxudqaaobbclckuw-nlkln8cpm0bg$72wm2wxudqaaq3fmttz_bebbnu0erbpr7g$73wm2wxudqaas-uoyoqzxachmy6cl_t7ig$74wm2wxudqaa5psbvgglnlcu8t0ytk335q$75wm2wxudqaajnbikikqekrj02ffe7zdsa$76wm2wxudqaafi4jrkpkezhyfydymkql-q$77wm2wxudqaaq_nxjupo3nfypmo2juikdw$78wm2wxudqaa7s2o9kuanysfuyl5cudwza$79wm2wxudqaagmkxu87zy4_y3v4kprit-a$80wm2wxudqaaxyuwsraqwbz2usks5eisjq$81wm2wxudqaaibxnrwluji28hwmgjljgaa$82wm2wxudqaaiz93sbb5ii0jeiycnwqaua$83wm2wxudqaaixkifziyfi5wblaw4yfxug$84wm2wxudqaaxhjqbfg4hfpwiqfwpu00xa$85wm2wxudqaa_jscttzdrwbxidof2w8spg$86wm2wxudqaaduartv4kgoho9opn4b_4eg$87wm2wxudqaakob6ocqmx4-kg3pxi6rkeq$88wm2wxudqaaqzerwcdxr1tjbawva2cgwg$89wm2wxudqaan2w9yjlb0nfmf8ypsxp74q$90wm2wxudqaapsvuzyf_39z_ssilb0yh0q$91wm2wxudqaas0cv4shoi043ewsiiemz_g$92wm2wxudqaawsylanhqt5omhkyg_i1p1g$93wm2wxudqaakl8wrcbb6-6-lubtna42vg$94wm2wxudqaagu7in_ahsusyphqxc-7nta$95wm2wxudqaa37hmydwwfot4ffbo8wjcoq$96wm2wxudqaansw9vhirzqg2rr7aeppmxg$97wm2wxudqaad_zc5ff3suetd-m7bm2f9a$98wm2wxudqaaefwyj7qk_zy91fcb_opfyg$99wm2wxudqaa6xuobcvjguq8ms5amiwbeq$100wm2wxudqaatrjn_-ijawmfsfbygj8bbw$101wm2wxudqaarurvfnz5pssmqyu6icsxca$102wm2wxudqaavuotnaq2hhy1pffrr1e4wg$103wm2wxudqaae_lak-p5bhgahfb7pypu0q$104wm2wxudqaarfrsdre64ociy9pqfkuxta$105wm2wxudqaailuvzjbd-kl0pjn_eiglka$106wm2wxudqaa5kmb2w_brrxkolmxvceuaa$107wm2wxudqaajobhofwhi-32z0czphnwyw$108wm2wxudqaa0a0illhc49qjbcp2nyp8ww$109wm2wxudqaab03we3lwm8bom7h3zh_zig$110wm2wxudqaakf7tsxsvk7dtco6nf4d3iw$111wm2wxudqaamcp8h67ktsr_njcx1gyosq$112wm2wxudqaan1vt5tg68onyex1zyr9apg$113wm2wxudqaat3i7goktqeqkpnz1fnuh0w$114wm2wxudqaanezjyfr3nsptnbvx9tcxra$115wm2wxudqaavgaaqekjxo9f8_85zcjlqw$116wm2wxudqaa5fzu2vw5oicfaplfb57gow$117wm2wxudqaaizfknf_1sf_p08rzdpum-a$118wm2wxudqaaae6x9dypqtu7uz9vzuvv8q$119wm2wxudqaa73swr4t7ah1xtcxornmumw$120wm2wxudqaa-irek-r4fot4f_cflggiiw$121wm2wxudqaasj2is4fsbnzj-8xhf9c-7a$122wm2wxudqaaytqvoamezkdfnmnegf-vca$123wm2wxudqaaa-myut-wpbotj_z1uuxtja$124wm2wxudqaak8nqkp6-69yzie-ra0b5aw$125wm2wxudqaajun...|17|23|2||0|0|26435|1563|13039|771|
|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|17|23|2||0|0|164887|20568|17|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)|16|20|2||0|0|21624099|1352340|99|11|
|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)|15|19|2||0|0|20274560|1352268|74|6|
|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|14|18|2||0|0|584250|273862|14|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)|14|31|4||0|0|7196482|514219|0|0|
|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|12|16|2||0|0|423804|295326|120|10|
|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)|12|17|2||0|0|5041480|451788|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|15|3||0|0|691136|65828|12|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, $40, $41, $42wm2wxudqaan9b4dzv7wj0orgrkxsbh8w$43wm2wxudqaa6zerbernww8v7twe5nk-_w$44wm2wxudqaacqca69ck4mpxafdnoarbfw$45wm2wxudqaagyg-l9fgneyhk9dvqh_dqq$46wm2wxudqaarde0r_i6f_ujnjyvbxjsuq$47wm2wxudqaaj1rwylaaw6zokr4vvitrbw$48wm2wxudqaaa3mxnpb3wa7putbkh2glka$49wm2wxudqaaglz6o4hzna9x_mzqivbfuw$50wm2wxudqaazm8nuiwwljbqo1wtbxfxkw$51wm2wxudqaax_btk2uszua_m2bmm750mq$52wm2wxudqaah-c5psn9syx_rtp3rzmizg$53wm2wxudqaajgibxjzhz_pym6gmnitsda$54wm2wxudqaa2nrwsegro2xqw19bk9qrbg$55wm2wxudqaaldnbzgnz4nygc_7lqqyw_a$56wm2wxudqaaamhwxastzf4va_bmewfpja$57wm2wxudqaalz7tbk6dxhfl34j2anafoa$58wm2wxudqaadpzy_rzbip-itm6sxxgrwa$59wm2wxudqaa9vdw-ciagpssn0q5ckgoog$60wm2wxudqaa6tndgcigdhxj6glefhngtg$61wm2wxudqaasuhp8otiv_w_del88_loga$62wm2wxudqaa4ppfpzckrdb8c13bu_ar_g$63wm2wxudqaafhabltzs1h4ajiq1d1oija$64wm2wxudqaaqeur3y7xjj8ranstgqycgg$65wm2wxudqaadyzkmd6gw66_en2nihmwgw$66wm2wxudqaakjhm50prvtfjbsbswoftqg$67wm2wxudqaa78nkjslbcnawo1u9j_1saq$68wm2wxudqaaxhekp3ogszjafu8qyul9sq$69wm2wxudqaa5niob0rwgztzq3sbqlcycg$70wm2wxudqaaobbclckuw-nlkln8cpm0bg$71wm2wxudqaaq3fmttz_bebbnu0erbpr7g$72wm2wxudqaas-uoyoqzxachmy6cl_t7ig$73wm2wxudqaa5psbvgglnlcu8t0ytk335q$74wm2wxudqaajnbikikqekrj02ffe7zdsa$75wm2wxudqaafi4jrkpkezhyfydymkql-q$76wm2wxudqaaq_nxjupo3nfypmo2juikdw$77wm2wxudqaa7s2o9kuanysfuyl5cudwza$78wm2wxudqaagmkxu87zy4_y3v4kprit-a$79wm2wxudqaaxyuwsraqwbz2usks5eisjq$80wm2wxudqaaibxnrwluji28hwmgjljgaa$81wm2wxudqaaiz93sbb5ii0jeiycnwqaua$82wm2wxudqaaixkifziyfi5wblaw4yfxug$83wm2wxudqaaxhjqbfg4hfpwiqfwpu00xa$84wm2wxudqaa_jscttzdrwbxidof2w8spg$85wm2wxudqaaduartv4kgoho9opn4b_4eg$86wm2wxudqaakob6ocqmx4-kg3pxi6rkeq$87wm2wxudqaaqzerwcdxr1tjbawva2cgwg$88wm2wxudqaan2w9yjlb0nfmf8ypsxp74q$89wm2wxudqaapsvuzyf_39z_ssilb0yh0q$90wm2wxudqaas0cv4shoi043ewsiiemz_g$91wm2wxudqaawsylanhqt5omhkyg_i1p1g$92wm2wxudqaakl8wrcbb6-6-lubtna42vg$93wm2wxudqaagu7in_ahsusyphqxc-7nta$94wm2wxudqaa37hmydwwfot4ffbo8wjcoq$95wm2wxudqaansw9vhirzqg2rr7aeppmxg$96wm2wxudqaad_zc5ff3suetd-m7bm2f9a$97wm2wxudqaaefwyj7qk_zy91fcb_opfyg$98wm2wxudqaa6xuobcvjguq8ms5amiwbeq$99wm2wxudqaatrjn_-ijawmfsfbygj8bbw$100wm2wxudqaarurvfnz5pssmqyu6icsxca$101wm2wxudqaavuotnaq2hhy1pffrr1e4wg$102wm2wxudqaae_lak-p5bhgahfb7pypu0q$103wm2wxudqaarfrsdre64ociy9pqfkuxta$104wm2wxudqaailuvzjbd-kl0pjn_eiglka$105wm2wxudqaa5kmb2w_brrxkolmxvceuaa$106wm2wxudqaajobhofwhi-32z0czphnwyw$107wm2wxudqaa0a0illhc49qjbcp2nyp8ww$108wm2wxudqaab03we3lwm8bom7h3zh_zig$109wm2wxudqaakf7tsxsvk7dtco6nf4d3iw$110wm2wxudqaamcp8h67ktsr_njcx1gyosq$111wm2wxudqaan1vt5tg68onyex1zyr9apg$112wm2wxudqaat3i7goktqeqkpnz1fnuh0w$113wm2wxudqaanezjyfr3nsptnbvx9tcxra$114wm2wxudqaavgaaqekjxo9f8_85zcjlqw$115wm2wxudqaa5fzu2vw5oicfaplfb57gow$116wm2wxudqaaizfknf_1sf_p08rzdpum-a$117wm2wxudqaaae6x9dypqtu7uz9vzuvv8q$118wm2wxudqaa73swr4t7ah1xtcxornmumw$119wm2wxudqaa-irek-r4fot4f_cflggiiw$120wm2wxudqaasj2is4fsbnzj-8xhf9c-7a$121wm2wxudqaaytqvoamezkdfnmnegf-vca$122wm2wxudqaaa-myut-wpbotj_z1uuxtja$123wm2wxudqaak8nqkp6-69yzie-ra0b5aw$124wm2wxudqaajunul-gsgjmzt8iirtkk-a$125wm2wxudqaa_jc...|11|14|1||0|0|16861|1533|8315|756|
|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|10|15|2||0|0|6058558|606368|38|9|
|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|10|27|5||0|0|500154|124954|10|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|9|11|1||0|0|2078198|231293|22|4|
|warranty_service|select count(*) from warranty where user_id = $0 and tenant_wechatapp_id = $1 and is_disable = $2|9|44|8||0|0|52321|10140|9|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, $5|8|9|1||0|0|4673971|606567|46|10|
|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|8|9|1||0|0|58096|7262|8|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|8|18|6||0|0|3456163|476890|415|244|
|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)|7|8|1||0|0|9464467|1353165|117|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)|7|8|1||0|0|9462702|1352501|47|8|
|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|7|1||0|0|9460408|1352412|62|11|
|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|7|9|1||0|0|1616767|231260|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|7|15|4||0|0|1812213|820482|7|1|
|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.create_time between $4 and $5 and s.event_type in ($6, $7, $8) group by s.sneak_guest_id ) a|6|7|1||0|0|1649880|274991|6|1|
|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|6|6|1||0|0|18574|3692|721|279|
|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 order by i.volume asc, p.id desc limit $1|6|15|2||0|0|75360|12560|60|10|
|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|6|148|36||0|0|350724370|70048610|6|1|
|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|6|6|1||0|0|16546|3103|45|8|
|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)|6|8|1||0|0|8113186|1352892|49|9|
|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|6|7|1||0|0|8106|2110|6|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|6|27|8||0|0|134592|30777|25565|5816|
|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, $88wm2wxudqaar08hwkjwxdy4pyaogjtb-q$89wm2wxudqaaidtakzk2xcmu4q7hm1kaqq$90wm2wxudqaab7lptydkp4tzwb2-wl5dba$91wm2wxudqaag-zdgx8jcifzyk9u_q9vaq$92wm2wxudqaajbtt5tl6i_df_ahqebr2ga$93wm2wxudqaaidqtpyx-tn6ybc-uuyqqna$94wm2wxudqaa_fedeqyt3mkaznqpf3penw$95wm2wxudqaanfddlaa1cljq677njn5s5q$96wm2wxudqaaflkpdsmlxoruzix37twkba$97wm2wxudqaai1n6oovixdhocwyf_cncog$98wm2wxudqaax6l73xfkcbu9numd9gij8a$99wm2wxudqaavwe-k5tbqlgpfjrfhy4zvq$100wm2wxudqaasu-xzka8jfyq_oqammnqpa$101wm2wxudqaa_sq3yufkhdpl7wfic70m5a$102wm2wxudqaax4pf7fveolzlksbhojtbfa$103wm2wxudqaaqbhhpr0gjzpaxp6a3yxvhg$104wm2wxudqaa26hqug2cbo69nhihltcbvg$105wm2wxudqaabay0jsquyrqjeqozrgn6iq$106wm2wxudqaaukmrt6j3eyosj6gftlr1jw$107wm2wxudqaalaemyofci4dxvappgys1fq$108wm2wxudqaanno_pkwvasbmpbjia9aojq$109wm2wxudqaah2k3b4uastvqkogzvccfrw$110wm2wxudqaawhy0ynxdnjnykv5ktveqcq$111wm2wxudqaao6kh1bj1co8odi5oethl4q$112wm2wxudqaahscw88camzupaikamrwojw$113wm2wxudqaajni-mfs2q3oyymr8_nw-nq$114wm2wxudqaazmfyj5n75vn0karlravwpw$115wm2wxudqaahviuwhfg_uwwcioroxbisa$116wm2wxudqaaqqbpvsz_mfs_5svfzjj-3w$117wm2wxudqaabrr-kbo2v7uf8vdyux0zxw$118wm2wxudqaacj4x2jyrh3b_x7uvi2a8ka$119wm2wxudqaauzmmjnnzszxoiivim6549g$120wm2wxudqaadf7xq0oq69ej8yl8mwohng$121wm2wxudqaax-duhebqwgst4tuh95kjsq$122wm2wxudqaao3sr-imnvp0gxpotupwclw$123wm2wxudqaaknq97pxqszxfmsz38s9vvg$124wm2wxudqaa5sfhruunyn8qbxwjqs3-ow$125wm2wxudqaaovz...|6|8|1||0|0|3916|656|1796|301|
|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|5|6|1||0|0|31490|7382|5|1|
|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|5|110|42||0|0|10627587|2589485|34|7|
|tenant|select id, tenant_id, tenant_app_id, sneak_guest_maintain_id, sneak_guest_id, url, create_time, update_time from sneak_guest_maintain_file where tenant_app_id = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)|5|6|1||0|0|6758966|1352398|61|19|
|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 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 order by tm.id desc limit $6|5|6|2||0|0|37614|8394|60|12|
|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|5|7|1||0|0|1269244|254026|5|1|
|goods|select * from goods_take_shop where tenant_id = $0 and goods_id = $1 and activity_id = $2 order by create_time desc|5|6|2||0|0|506922|101417|179|68|
|v4_employee|select sum(ifnull(member_age <= $0, $1)) as `age|25岁以下`, sum(ifnull(member_age between $2 and $3, $4)) as `age|26-35岁`, sum(ifnull(member_age between $5 and $6, $7)) as `age|36-40岁`, sum(ifnull(member_age between $8 and $9, $10)) as `age|41-55岁`, sum(ifnull(member_age >= $11, $12)) as `age|56岁以上`, sum(ifnull(shop_id = $13, $14)) as `shop|北票萃华金店`, sum(ifnull(shop_id = $15, $16)) as `shop|海城萃华珠宝`, sum(ifnull(shop_id = $17, $18)) as `shop|建平萃华金店`, sum(ifnull(shop_id = $19, $20)) as `shop|建平萃华通胜店`, sum(ifnull(shop_id = $21, $22)) as `shop|喀左萃华一店`, sum(ifnull(shop_id = $23, $24)) as `shop|喀左萃华二店`, sum(ifnull(shop_id = $25, $26)) as `shop|海城潮宏基珠宝二店`, sum(ifnull(shop_id = $27, $28)) as `shop|苏区萃华专卖店`, sum(ifnull(shop_id = $29, $30)) as `shop|苏区萃华形象店`, sum(ifnull(shop_id = $31, $32)) as `shop|苏区萃华旗舰店`, sum(ifnull(shop_id = $33, $34)) as `shop|苏区六福珠宝`, sum(ifnull(shop_id = $35, $36)) as `shop|凌源南街周大福`, sum(ifnull(shop_id = $37, $38)) as `shop|凌源北街周大福`, sum(ifnull(shop_id = $39, $40)) as `shop|建平周大福`, sum(ifnull(shop_id = $41, $42)) as `shop|建平潮宏基珠宝`, sum(ifnull(shop_id = $43, $44)) as `shop|大和周大福店`, sum(ifnull(shop_id = $45, $46)) as `shop|海城站前街周大福`, sum(ifnull(shop_id = $47, $48)) as `shop|北票周大福珠宝`, sum(ifnull(shop_id = $49, $50)) as `shop|鞍山青年街`, sum(ifnull(shop_id = $51, $52)) as `shop|鞍山周大福景子街店`, sum(ifnull(shop_id = $53, $54)) as `shop|海城潮宏基一店`, sum(ifnull(member_sex = $55, $56)) as `sex|男`, sum(ifnull(member_sex = $57, $58)) as `sex|女`, sum(ifnull(member_sex = $59, $60)) as `sex|其他`, sum(ifnull(member_integral_total = $61, $62)) as `integral_total|等于0分`, sum(ifnull(member_integral_total between $63 and $64, $65)) as `integral_total|1-4999分`, sum(ifnull(member_integral_total between $66 and $67, $68)) as `integral_total|5000-19999分`, sum(ifnull(member_integral_total between $69 and $70, $71)) as `integral_total|20000-49999分`, sum(ifnull(member_integral_total >= $72, $73)) as `integral_total|大于等于50000分`, sum(ifnull(member_sales_amount = $74, $75)) as `amount_total_consume|等于0元`, sum(ifnull(member_sales_amount between $76 and $77, $78)) as `amount_total_consume|1-2000元`, sum(ifnull(member_sales_amount between $79 and $80, $81)) as `amount_total_consume|2001-10000元`, sum(ifnull(member_sales_amount between $82 and $83, $84)) as `amount_total_consume|10001-50000元`, sum(ifnull(member_sales_amount >= $85, $86)) as `amount_total_consume|大于等于50001元`, sum(ifnull(member_sales_count = $87, $88)) as `consume_num|0次`, sum(ifnull(member_sales_count = $89, $90)) as `consume_num|1次`, sum(ifnull(member_sales_count = $91, $92)) as `consume_num|2次`, sum(ifnull(member_sales_count between $93 and $94, $95)) as `consume_num|3-5次`, sum(ifnull(member_sales_count >= $96, $97)) as `consume_num|6次以上`, sum(ifnull(member_level_id = $98, $99)) as `member_level|粉丝会员`, sum(ifnull(member_level_id = $100, $101)) as `member_level|白银会员`, sum(ifnull(member_level_id = $102, $103)) as `member_level|黄金会员`, sum(ifnull(member_level_id = $104, $105)) as `member_level|铂金会员`, sum(ifnull(member_level_id = $106, $107)) as `member_level|钻石会员`, sum(ifnull(member_integral_balance = $108, $109)) as `integral_balance|等于0分`, sum(ifnull(member_integral_balance between $110 and $111, $112)) as `integral_balance|1-1999分`, sum(ifnull(member_integral_balance between $113 and $114, $115)) as `integral_balance|2000-4999分`, sum(ifnull(member_integral_balance between $116 and $117, $118)) as `integral_balance|5000-19999分`, sum(ifnull(member_integral_balance >= $119, $120)) as `integral_balance|大于等于20000分` from task_task where task_template_id = $121|5|13|6||0|0|1846340|369268|5|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|5|6|1||0|0|421047|84297|5|1|
|tenant|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 ) order by es.sales_date desc limit $8|5|148|36||0|0|350120760|70024152|50|10|
|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|4|16|5||0|0|94071|27554|4|1|
|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|4|5|1||0|0|19592|6164|8|2|
|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|4|12|4||0|0|95063|34790|4|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, $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')|4|12|4||0|0|95303|34850|120|30|
|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|4|11|7||0|0|814767|412511|331|174|
|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, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23)|4|11|3||0|0|407324|103022|80|20|
|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|4|21|8||0|0|315222|78824|4|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 order by i.volume asc, p.tag_price desc, p.id desc limit $1|4|8|2||0|0|50240|12560|40|10|
|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 order by i.volume asc, p.id desc ) tmp_count|4|6|1||0|0|29048|7262|4|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|4|6|2||0|0|174361|66211|2458|1533|
|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|4|15|7||0|0|93292|23323|4|1|
|wx_gateway|select media_id from wx_gateway.wx_image where tenant_app_id = $0 and state = $1|4|10|3||0|0|851596|212899|2076|519|
|order|select max(create_time) from `order`.order_operator_log where tenant_wechatapp_id = $0 and order_id = $1|4|14|4||0|0|3357319|839486|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.next_maintain_date >= $3 and sg.next_maintain_date <= $4 and sg.status = $5 order by sg.id desc limit $6, $7|3|4|2||0|0|1817394|606141|19|9|
|v4_employee|select s.id, s.name from shop s join ( select distinct shop_id from task_task where status = $0 and task_template_id = $1 and tenant_id = $2 and tenant_app_id = $3 ) t on s.id = t.shop_id where s.tenant_id = $4 and s.tenant_app_id = $5|3|7|4||0|0|417198|139066|36|12|
|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|3|3|1||0|0|43800|19198|3|1|
|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|3|3|1||0|0|13330|4444|3|1|
|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|1||0|0|99626|34954|24|10|
|tenant|select count(*) from sneak_guest where tenant_app_id = $0 and status = $1 and create_shop_id = $2 and maintain_employee_id = $3|3|4|1||0|0|18186|6567|3|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|3|3|1||0|0|1816615|605743|19|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 p.tag_price desc, p.id desc limit $2, $3|3|3|1||0|0|25206|8456|18|6|
|v4_sales|select id, sales_erp_id, sales_no, sales_date, member_erp_id, employee_erp_id, employee_name, assist_employee_erp_id, assist_employee_name, dept_erp_id, amount, sales_remark, receipts, sales_status, is_sales, busi_date, erp_create_time, recommend_id, post_time, tenant_id, tenant_app_id, create_time, update_time from erp_sales where sales_no = $0|3|12|6||0|0|1817099|605704|16|6|
|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|3|7|3||0|0|598681|199569|30|10|
|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)|3|4|1||0|0|244327|99460|18|6|
|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|3|8|5||0|0|49700|22195|3|1|
|employee|update backlog_system set status = $0, finish_time = now() where tenant_app_id = $1 and scene = $2|3|7|2||0|0|3327366|1109122|0|0|
|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|3|3|1||0|0|217204|79043|3|1|
|v4_employee|select count(*) as total_count, count(finish_time) as finish_count, 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, ifnull(sum(trade_amount), $0) as trade_amount, ifnull(sum(trade_num), $1) as trade_num from task_task where task_type = $2 and `status` = $3 and task_template_id = $4 and tenant_id = $5 and tenant_app_id = $6|3|7|4||0|0|417063|139021|3|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|3|4|1||0|0|243612|81264|0|0|
|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) and t.scene = $11 and t.begin_time >= $12 and t.expire_time < $13 group by date_format(t.create_time, '%d')|3|3|1||0|0|28088|13804|86|30|
|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) and t.scene = $11 and t.begin_time >= $12 and t.expire_time < $13|3|3|1||0|0|27916|13744|3|1|
|tenant|select id, tenant_id, tenant_app_id, sneak_guest_maintain_id, sneak_guest_id, url, create_time, update_time from sneak_guest_maintain_file where tenant_app_id = $0 and sneak_guest_maintain_id in ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)|3|4|1||0|0|4056278|1352398|31|12|
|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 order by i.volume asc, p.tag_price desc, p.id desc ) tmp_count|3|4|1||0|0|21786|7262|3|1|
|tenant|select id, tenant_id, tenant_app_id, sneak_guest_maintain_id, sneak_guest_id, url, create_time, update_time from sneak_guest_maintain_file where tenant_app_id = $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)|3|3|1||0|0|4054466|1352267|51|19|
|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|3|4|1||0|0|18186|6567|3|1|
|user_service|select tm.user_id as id, tm.user_name as username, tm.head_img_url as headimgurl, tm.user_name as nickname, tm.mobile_no as mobile, tm.sex 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|2|3|2||0|0|813930|451698|3|2|
|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)|2|2|1||0|0|2704249|1352502|21|13|
|employee|select ifnull(sum(task_amount), $0) as shouldaddnum, ifnull(sum(finish_amount), $1) as addednum from backlog t where t.tenant_id = $2 and t.tenant_app_id = $3 and t.shop_id = $4 and t.employee_id = $5 and t.scene = $6 and t.begin_time >= $7 and t.expire_time < $8|2|2|1||0|0|2072|1378|2|1|
|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)|2|2|1||0|0|5992|2996|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|87162|74277|2|1|
|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|2|3|2||0|0|10793|8730|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_id = $1 and sneak_guest_maintain_id = $2|2|3|1||0|0|2705032|1352524|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|2|2|1||0|0|87162|74277|2|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)|2|4|2||0|0|1772798|953439|248|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)|2|2|1||0|0|2704564|1352323|28|14|
|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|2|3|1||0|0|43926|32755|2|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)|2|4|3||0|0|1591833|820564|138|69|
|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|2|2|1||0|0|148449|74229|8|5|
|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)|2|3|1||0|0|148449|74229|2|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|2|3|2||0|0|2284|1194|0|0|
|v4_employee|select count(*) as total from task_task where task_template_id = $0 and tenant_id = $1 and tenant_app_id = $2|2|3|1||0|0|278042|139021|2|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|2|2|1||0|0|10750|5376|2|1|
|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|2|7|3||0|0|1678539|839548|0|0|
|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|2|2|1||0|0|168484|84340|2|1|
|v4_employee|select sum(ifnull(member_sales_count = $0, $1)) as `consume_num|0次`, sum(ifnull(member_sales_count = $2, $3)) as `consume_num|1次`, sum(ifnull(member_sales_count = $4, $5)) as `consume_num|2次`, sum(ifnull(member_sales_count between $6 and $7, $8)) as `consume_num|3-5次`, sum(ifnull(member_sales_count >= $9, $10)) as `consume_num|6次以上`, sum(ifnull(member_age <= $11, $12)) as `age|25岁以下`, sum(ifnull(member_age between $13 and $14, $15)) as `age|26-35岁`, sum(ifnull(member_age between $16 and $17, $18)) as `age|36-40岁`, sum(ifnull(member_age between $19 and $20, $21)) as `age|41-55岁`, sum(ifnull(member_age >= $22, $23)) as `age|56岁以上`, sum(ifnull(shop_id = $24, $25)) as `shop|北票萃华金店`, sum(ifnull(shop_id = $26, $27)) as `shop|海城萃华珠宝`, sum(ifnull(shop_id = $28, $29)) as `shop|建平萃华金店`, sum(ifnull(shop_id = $30, $31)) as `shop|建平萃华通胜店`, sum(ifnull(shop_id = $32, $33)) as `shop|喀左萃华一店`, sum(ifnull(shop_id = $34, $35)) as `shop|喀左萃华二店`, sum(ifnull(shop_id = $36, $37)) as `shop|海城潮宏基珠宝二店`, sum(ifnull(shop_id = $38, $39)) as `shop|苏区萃华专卖店`, sum(ifnull(shop_id = $40, $41)) as `shop|苏区萃华形象店`, sum(ifnull(shop_id = $42, $43)) as `shop|苏区萃华旗舰店`, sum(ifnull(shop_id = $44, $45)) as `shop|苏区六福珠宝`, sum(ifnull(shop_id = $46, $47)) as `shop|凌源南街周大福`, sum(ifnull(shop_id = $48, $49)) as `shop|凌源北街周大福`, sum(ifnull(shop_id = $50, $51)) as `shop|建平周大福`, sum(ifnull(shop_id = $52, $53)) as `shop|建平潮宏基珠宝`, sum(ifnull(shop_id = $54, $55)) as `shop|大和周大福店`, sum(ifnull(shop_id = $56, $57)) as `shop|海城站前街周大福`, sum(ifnull(shop_id = $58, $59)) as `shop|北票周大福珠宝`, sum(ifnull(shop_id = $60, $61)) as `shop|鞍山青年街`, sum(ifnull(shop_id = $62, $63)) as `shop|鞍山周大福景子街店`, sum(ifnull(shop_id = $64, $65)) as `shop|海城潮宏基一店`, sum(ifnull(member_sales_amount = $66, $67)) as `amount_total_consume|等于0元`, sum(ifnull(member_sales_amount between $68 and $69, $70)) as `amount_total_consume|1-2000元`, sum(ifnull(member_sales_amount between $71 and $72, $73)) as `amount_total_consume|2001-10000元`, sum(ifnull(member_sales_amount between $74 and $75, $76)) as `amount_total_consume|10001-50000元`, sum(ifnull(member_sales_amount >= $77, $78)) as `amount_total_consume|大于等于50001元`, sum(ifnull(member_sex = $79, $80)) as `sex|男`, sum(ifnull(member_sex = $81, $82)) as `sex|女`, sum(ifnull(member_sex = $83, $84)) as `sex|其他`, sum(ifnull(member_level_id = $85, $86)) as `member_level|粉丝会员`, sum(ifnull(member_level_id = $87, $88)) as `member_level|白银会员`, sum(ifnull(member_level_id = $89, $90)) as `member_level|黄金会员`, sum(ifnull(member_level_id = $91, $92)) as `member_level|铂金会员`, sum(ifnull(member_level_id = $93, $94)) as `member_level|钻石会员`, sum(ifnull(member_integral_balance = $95, $96)) as `integral_balance|等于0分`, sum(ifnull(member_integral_balance between $97 and $98, $99)) as `integral_balance|1-1999分`, sum(ifnull(member_integral_balance between $100 and $101, $102)) as `integral_balance|2000-4999分`, sum(ifnull(member_integral_balance between $103 and $104, $105)) as `integral_balance|5000-19999分`, sum(ifnull(member_integral_balance >= $106, $107)) as `integral_balance|大于等于20000分`, sum(ifnull(member_integral_total = $108, $109)) as `integral_total|等于0分`, sum(ifnull(member_integral_total between $110 and $111, $112)) as `integral_total|1-4999分`, sum(ifnull(member_integral_total between $113 and $114, $115)) as `integral_total|5000-19999分`, sum(ifnull(member_integral_total between $116 and $117, $118)) as `integral_total|20000-49999分`, sum(ifnull(member_integral_total >= $119, $120)) as `integral_total|大于等于50000分` from task_task where task_template_id = $121|2|2|1||0|0|738536|369268|2|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)|2|2|1||0|0|352328|312901|26|13|
|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|5959|3134|5959|3134|
|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|2|4|3||0|0|812617|406419|24|14|
|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)|2|3|1||0|0|725520|374630|123|63|
|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|2|3|1||0|0|16192|8096|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)|2|2|1||0|0|498730|454542|8|4|
|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)|2|3|2||0|0|1782442|921308|196|98|
|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|3|2||0|0|417123|208565|2|1|
|tenant|select sp.id as shopid, sp.shop_name as shopname, ifnull(sum(tt.maintaincount), $0) as maintaincount, ifnull(sum(tt.maintainnum), $1) as maintainnum, ifnull(sum(tt.successnum), $2) as successnum, ifnull(sum(tt.failnum), $3) as failnum, ifnull(sum(tt.salemoney), $4) as salemoney from tenant.tenant_wechatapp_shop sp left join ( select g.create_shop_id as shop_id, count(1) as maintaincount, count(distinct t.sneak_guest_id) as maintainnum, $5 as successnum, $6 as failnum, $7 as salemoney from tenant.sneak_guest g join tenant.sneak_guest_maintain t on t.sneak_guest_id = g.id where g.tenant_app_id = $8 and (g.fail_type is null or g.fail_type = $9) and t.event_type in ($10, $11, $12) and t.create_time >= $13 and t.create_time < $14 group by g.create_shop_id union all select g.create_shop_id as shop_id, $15 as maintaincount, $16 as maintainnum, count(distinct t.sneak_guest_id) as successnum, $17 as failnum, sum(sgs.`amount`) as salemoney from tenant.sneak_guest g join tenant.sneak_guest_maintain t on t.sneak_guest_id = g.id join tenant.sneak_guest_sales sgs on g.id = sgs.sneak_guest_id where g.tenant_app_id = $18 and t.event_type in ($19) and t.create_time >= $20 and t.create_time < $21 group by g.create_shop_id union all select g.create_shop_id as shop_id, $22 as maintaincount, $23 as maintainnum, $24 as successnum, count(distinct t.sneak_guest_id) as failnum, $25 as salemoney from tenant.sneak_guest g join tenant.sneak_guest_maintain t on t.sneak_guest_id = g.id where g.tenant_app_id = $26 and g.fail_type = $27 and t.event_type in ($28) and t.create_time >= $29 and t.create_time < $30 group by g.create_shop_id ) tt on sp.id = tt.shop_id where sp.status = $31 and sp.tenant_wechatapp_id = $32 group by sp.id, sp.shop_name order by sp.id|2|2|1||0|0|1965383|982742|48|24|
|tenant|select count(0) from ( select sg.id, sg.sneak_guest_no, sg.user_id, sg.user_type, ey.employee_name as maintainemployeename, sg.last_maintain_date, ws.shop_name as createshopname, sg.status, sg.create_time, t1.employee_name as createemployeename, sg.finish_date, sg.fail_type, gs.sales_id, gs.sales_no, w1.shop_name as salesshopname, gs.sales_date, gs.product_name, gs.product_quantity, gs.amount as salesamount, if(sg.status = $0, case when sg.fail_type = $1 then $2 when sg.fail_type = $3 then $4 else ifnull(emp.employee_name, $5) end, $6) as operfailemployeename from sneak_guest sg left join employee ey on sg.maintain_employee_id = ey.id left join tenant_wechatapp_shop ws on sg.create_shop_id = ws.id left join employee t1 on sg.create_employee_id = t1.id left join sneak_guest_sales gs on sg.tenant_app_id = gs.tenant_app_id and sg.id = gs.sneak_guest_id left join tenant_wechatapp_shop w1 on gs.shop_id = w1.id left join tenant.sneak_guest_maintain gm on gm.sneak_guest_id = sg.id and gm.event_type = $7 left join employee emp on gm.employee_id = emp.id where sg.tenant_app_id = $8 order by sg.id desc ) tmp_count|2|7|5||0|0|966071|679701|2|1|
|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|2|2|1||0|0|4414|2451|0|0|
|gift_mail|select count(0) from ( select p.*, sp.take_type, ifnull(pp.integral_price, ifnull(( select min(inventory.price) from inventory where inventory.product_id = p.id ), $0)) as price, ifnull(t.quantity, $1) as quantity, pt.partner_name as vendorname, $2 as distance, c.categroy_name as categroy_name, pp.partner_id from product p inner join category c on c.id = p.category_id left join self_product sp on p.id = sp.product_id left join partner_product pp on p.id = pp.product_id left join partner pt on pt.id = pp.partner_id left join ( select product_id, sum(quantity) as quantity from gift_mail.inventory group by product_id ) t on p.id = t.product_id where p.is_disable is null or p.is_disable = $3 ) p left join product_status ps on p.id = ps.product_id and ps.tenant_wechatapp_id = $4 where p.tenant_id = $5 and p.product_name like $6 and p.product_type = $7 and (ps.id is not null or p.tenant_wechatapp_id = $8)|1|1|1||0|0|50596|50596|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)|1|2|2||0|0|68988|68988|7|7|
|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|3|3||0|0|953369|953369|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)|1|1|1||0|0|274582|274582|52|52|
|corpwx|select date_format(t.create_time, '%d') as monthday, count(*) as addednum from external_user t where t.tenant_id = $0 and t.corp_user_id in ($1, $2, $3, $4, $5, $6, $7) and t.create_time >= $8 and t.create_time < $9 group by date_format(t.create_time, '%d')|1|1|1||0|0|2435|2435|30|30|
|employee|update backlog set leave_flag = $0 where tenant_app_id = $1 and employee_id = $2|1|2|2||0|0|2333|2333|0|0|
|value_added|select id, tenant_wechatapp_id as tenantwechatappid, user_id as userid, template_id as templateid, sales_erp_id as saleserpid, product_name as productname, shop_name as shopname, product_barcode as productbarcode, amount_total as amounttotal, amount_pay as amountpay, amount_added as amountadded, state as state, add_days, added_percent_per_day as addedpercentperday, devalue_percent_per_day as devaluepercentperday, keeping_days as keepingdays, exchange_days as exchangedays, coupon_user_id as couponuserid, sales_index as salesindex, start_add_time as createtime, date_add(start_add_time, interval add_days - $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|1829427|1829427|978|978|
|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|118820|118820|23|23|
|coupon_service|select * from coupon_service.coupon_can_give where coupon_id = $0 limit $1|1|1|1||0|0|242336|242336|1|1|
|value_added|select count(0) from ( select t1.id, t2.sales_no as salesno, date_format(t2.sales_date, '%y-%m-%d') as salesdate, date_format(t1.start_add_time, '%y-%m-%d') as valueadddate, t2.dept_erp_id as shopid, t1.shop_name as shopname, t2.employee_erp_id as userid, t2.employee_name as username, t1.product_name as productname, t1.amount_pay as amountpay, t1.id as valueaddno, t1.amount_added as valueaddamount, t1.state, if(t1.state = $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|37384|37384|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)|1|1|1||0|0|32693|32693|4|4|
|v4_employee|select sum(ifnull(member_age <= $0, $1)) as `age|25岁以下`, sum(ifnull(member_age between $2 and $3, $4)) as `age|26-35岁`, sum(ifnull(member_age between $5 and $6, $7)) as `age|36-40岁`, sum(ifnull(member_age between $8 and $9, $10)) as `age|41-55岁`, sum(ifnull(member_age >= $11, $12)) as `age|56岁以上`, sum(ifnull(shop_id = $13, $14)) as `shop|北票萃华金店`, sum(ifnull(shop_id = $15, $16)) as `shop|海城萃华珠宝`, sum(ifnull(shop_id = $17, $18)) as `shop|建平萃华金店`, sum(ifnull(shop_id = $19, $20)) as `shop|建平萃华通胜店`, sum(ifnull(shop_id = $21, $22)) as `shop|喀左萃华一店`, sum(ifnull(shop_id = $23, $24)) as `shop|喀左萃华二店`, sum(ifnull(shop_id = $25, $26)) as `shop|海城潮宏基珠宝二店`, sum(ifnull(shop_id = $27, $28)) as `shop|苏区萃华专卖店`, sum(ifnull(shop_id = $29, $30)) as `shop|苏区萃华形象店`, sum(ifnull(shop_id = $31, $32)) as `shop|苏区萃华旗舰店`, sum(ifnull(shop_id = $33, $34)) as `shop|苏区六福珠宝`, sum(ifnull(shop_id = $35, $36)) as `shop|凌源南街周大福`, sum(ifnull(shop_id = $37, $38)) as `shop|凌源北街周大福`, sum(ifnull(shop_id = $39, $40)) as `shop|建平周大福`, sum(ifnull(shop_id = $41, $42)) as `shop|建平潮宏基珠宝`, sum(ifnull(shop_id = $43, $44)) as `shop|大和周大福店`, sum(ifnull(shop_id = $45, $46)) as `shop|海城站前街周大福`, sum(ifnull(shop_id = $47, $48)) as `shop|北票周大福珠宝`, sum(ifnull(shop_id = $49, $50)) as `shop|鞍山青年街`, sum(ifnull(shop_id = $51, $52)) as `shop|鞍山周大福景子街店`, sum(ifnull(shop_id = $53, $54)) as `shop|海城潮宏基一店`, sum(ifnull(member_sex = $55, $56)) as `sex|男`, sum(ifnull(member_sex = $57, $58)) as `sex|女`, sum(ifnull(member_sex = $59, $60)) as `sex|其他`, sum(ifnull(member_integral_total = $61, $62)) as `integral_total|等于0分`, sum(ifnull(member_integral_total between $63 and $64, $65)) as `integral_total|1-4999分`, sum(ifnull(member_integral_total between $66 and $67, $68)) as `integral_total|5000-19999分`, sum(ifnull(member_integral_total between $69 and $70, $71)) as `integral_total|20000-49999分`, sum(ifnull(member_integral_total >= $72, $73)) as `integral_total|大于等于50000分`, sum(ifnull(member_sales_amount = $74, $75)) as `amount_total_consume|等于0元`, sum(ifnull(member_sales_amount between $76 and $77, $78)) as `amount_total_consume|1-2000元`, sum(ifnull(member_sales_amount between $79 and $80, $81)) as `amount_total_consume|2001-10000元`, sum(ifnull(member_sales_amount between $82 and $83, $84)) as `amount_total_consume|10001-50000元`, sum(ifnull(member_sales_amount >= $85, $86)) as `amount_total_consume|大于等于50001元`, sum(ifnull(member_sales_count = $87, $88)) as `consume_num|0次`, sum(ifnull(member_sales_count = $89, $90)) as `consume_num|1次`, sum(ifnull(member_sales_count = $91, $92)) as `consume_num|2次`, sum(ifnull(member_sales_count between $93 and $94, $95)) as `consume_num|3-5次`, sum(ifnull(member_sales_count >= $96, $97)) as `consume_num|6次以上`, sum(ifnull(member_level_id = $98, $99)) as `member_level|粉丝会员`, sum(ifnull(member_level_id = $100, $101)) as `member_level|白银会员`, sum(ifnull(member_level_id = $102, $103)) as `member_level|黄金会员`, sum(ifnull(member_level_id = $104, $105)) as `member_level|铂金会员`, sum(ifnull(member_level_id = $106, $107)) as `member_level|钻石会员`, sum(ifnull(member_integral_balance = $108, $109)) as `integral_balance|等于0分`, sum(ifnull(member_integral_balance between $110 and $111, $112)) as `integral_balance|1-1999分`, sum(ifnull(member_integral_balance between $113 and $114, $115)) as `integral_balance|2000-4999分`, sum(ifnull(member_integral_balance between $116 and $117, $118)) as `integral_balance|5000-19999分`, sum(ifnull(member_integral_balance >= $119, $120)) as `integral_balance|大于等于20000分` from task_task where task_template_id = $121 and finish_time is null|1|1|1||0|0|207464|207464|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, $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)|1|5|5||0|0|1224864|1224864|169|169|
|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)|1|1|1||0|0|1224877|1224877|182|182|
|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)|1|1|1||0|0|315743|315743|53|53|
|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 status = $3 and expire_time > now()|1|1|1||0|0|65828|65828|1|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 in ($4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) and t.scene = $15 and t.begin_time >= $16 and t.expire_time < $17|1|1|1||0|0|24903|24903|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|3|3||0|0|807206|807206|234|234|
|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|4748|4748|1|1|
|user_service|insert into wx_user (id, wx_app_id, open_id, union_id, nick_name, user_name, mobile_no, head_img_url, is_subscribe, subscribe_time, unsubscribe_time, wx_card_code, wx_card_no, sex, country, province, city, plat_open_id, create_time, update_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|1|1|1||0|0|0|0|0|0|
|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|21|21||0|0|1829424|1829424|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)|1|1|1||0|0|42516|42516|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)|1|1|1||0|0|251242|251242|39|39|
|employee|update backlog set finish_amount = $0, finish_time = now(), status = $1 where tenant_id = $2 and tenant_app_id = $3 and scene = $4 and begin_time <= $5 and expire_time >= $6 and user_id = $7 and user_type = $8 and finish_amount = $9|1|1|1||0|0|31708|31708|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)|1|2|2||0|0|332943|332943|42|42|
|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)|1|1|1||0|0|44010|44010|18|18|
|v4_employee|select sum(ifnull(member_sales_count = $0, $1)) as `consume_num|0次`, sum(ifnull(member_sales_count = $2, $3)) as `consume_num|1次`, sum(ifnull(member_sales_count = $4, $5)) as `consume_num|2次`, sum(ifnull(member_sales_count between $6 and $7, $8)) as `consume_num|3-5次`, sum(ifnull(member_sales_count >= $9, $10)) as `consume_num|6次以上`, sum(ifnull(member_age <= $11, $12)) as `age|25岁以下`, sum(ifnull(member_age between $13 and $14, $15)) as `age|26-35岁`, sum(ifnull(member_age between $16 and $17, $18)) as `age|36-40岁`, sum(ifnull(member_age between $19 and $20, $21)) as `age|41-55岁`, sum(ifnull(member_age >= $22, $23)) as `age|56岁以上`, sum(ifnull(shop_id = $24, $25)) as `shop|长沙1店`, sum(ifnull(member_sales_amount <= $26, $27)) as `amount_total_consume|2000元以下`, sum(ifnull(member_sales_amount between $28 and $29, $30)) as `amount_total_consume|2001-10000元`, sum(ifnull(member_sales_amount between $31 and $32, $33)) as `amount_total_consume|10001-50000元`, sum(ifnull(member_sales_amount between $34 and $35, $36)) as `amount_total_consume|50001-99999元`, sum(ifnull(member_sales_amount >= $37, $38)) as `amount_total_consume|100000元以上`, sum(ifnull(member_sex = $39, $40)) as `sex|男`, sum(ifnull(member_sex = $41, $42)) as `sex|女`, sum(ifnull(member_sex = $43, $44)) as `sex|其他`, sum(ifnull(member_level_id = $45, $46)) as `member_level|粉丝会员`, sum(ifnull(member_level_id = $47, $48)) as `member_level|银卡`, sum(ifnull(member_level_id = $49, $50)) as `member_level|金卡`, sum(ifnull(member_level_id = $51, $52)) as `member_level|收到的`, sum(ifnull(member_level_id = $53, $54)) as `member_level|11`, sum(ifnull(member_integral_balance <= $55, $56)) as `integral_balance|2000分以下`, sum(ifnull(member_integral_balance between $57 and $58, $59)) as `integral_balance|2001-10000分`, sum(ifnull(member_integral_balance between $60 and $61, $62)) as `integral_balance|10001-30000分`, sum(ifnull(member_integral_balance between $63 and $64, $65)) as `integral_balance|30001-50000分`, sum(ifnull(member_integral_balance >= $66, $67)) as `integral_balance|50001分以上`, sum(ifnull(member_integral_total <= $68, $69)) as `integral_total|2000分以下`, sum(ifnull(member_integral_total between $70 and $71, $72)) as `integral_total|2001-10000分`, sum(ifnull(member_integral_total between $73 and $74, $75)) as `integral_total|10001-50000分`, sum(ifnull(member_integral_total between $76 and $77, $78)) as `integral_total|50001-99999分`, sum(ifnull(member_integral_total >= $79, $80)) as `integral_total|100000分以上` from task_task where task_template_id = $81|1|1|1||0|0|369268|369268|1|1|
|corpwx|select date_format(t.create_time, '%d') as monthday, count(*) as addednum from external_user t where t.tenant_id = $0 and t.corp_user_id in ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) and t.create_time >= $11 and t.create_time < $12 group by date_format(t.create_time, '%d')|1|1|1||0|0|4482|4482|30|30|
|coupon_service|select market_id as id, count(market_id) as quantity from ( select market_id from coupon_service.coupon_market_order where market_id in ($0) and order_state = $1 group by user_id, market_id ) number group by market_id|1|1|1||0|0|518025|518025|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)|1|2|2||0|0|771250|771250|50|50|
|tenant|select count(0) from ( select shop.*, dept.dept_name, count(es.id) as employeescount from tenant_wechatapp_shop shop left join erp_department dept on shop.dept_erp_id = dept.dept_erp_id and shop.tenant_id = dept.tenant_id left join employee_shop es on shop.id = es.shop_id and es.status in ($0, $1) where shop.tenant_wechatapp_id = $2 and shop.status in ($3, $4) and shop.status = $5 group by shop.id ) table_count|1|1|1||0|0|82203|82203|1|1|
|v4_employee|select sum(ifnull(member_sales_count = $0, $1)) as `consume_num|0次`, sum(ifnull(member_sales_count = $2, $3)) as `consume_num|1次`, sum(ifnull(member_sales_count = $4, $5)) as `consume_num|2次`, sum(ifnull(member_sales_count between $6 and $7, $8)) as `consume_num|3-5次`, sum(ifnull(member_sales_count >= $9, $10)) as `consume_num|6次以上`, sum(ifnull(member_age <= $11, $12)) as `age|25岁以下`, sum(ifnull(member_age between $13 and $14, $15)) as `age|26-35岁`, sum(ifnull(member_age between $16 and $17, $18)) as `age|36-40岁`, sum(ifnull(member_age between $19 and $20, $21)) as `age|41-55岁`, sum(ifnull(member_age >= $22, $23)) as `age|56岁以上`, sum(ifnull(shop_id = $24, $25)) as `shop|北票萃华金店`, sum(ifnull(shop_id = $26, $27)) as `shop|海城萃华珠宝`, sum(ifnull(shop_id = $28, $29)) as `shop|建平萃华金店`, sum(ifnull(shop_id = $30, $31)) as `shop|建平萃华通胜店`, sum(ifnull(shop_id = $32, $33)) as `shop|喀左萃华一店`, sum(ifnull(shop_id = $34, $35)) as `shop|喀左萃华二店`, sum(ifnull(shop_id = $36, $37)) as `shop|海城潮宏基珠宝二店`, sum(ifnull(shop_id = $38, $39)) as `shop|苏区萃华专卖店`, sum(ifnull(shop_id = $40, $41)) as `shop|苏区萃华形象店`, sum(ifnull(shop_id = $42, $43)) as `shop|苏区萃华旗舰店`, sum(ifnull(shop_id = $44, $45)) as `shop|苏区六福珠宝`, sum(ifnull(shop_id = $46, $47)) as `shop|凌源南街周大福`, sum(ifnull(shop_id = $48, $49)) as `shop|凌源北街周大福`, sum(ifnull(shop_id = $50, $51)) as `shop|建平周大福`, sum(ifnull(shop_id = $52, $53)) as `shop|建平潮宏基珠宝`, sum(ifnull(shop_id = $54, $55)) as `shop|大和周大福店`, sum(ifnull(shop_id = $56, $57)) as `shop|海城站前街周大福`, sum(ifnull(shop_id = $58, $59)) as `shop|北票周大福珠宝`, sum(ifnull(shop_id = $60, $61)) as `shop|鞍山青年街`, sum(ifnull(shop_id = $62, $63)) as `shop|鞍山周大福景子街店`, sum(ifnull(shop_id = $64, $65)) as `shop|海城潮宏基一店`, sum(ifnull(member_sales_amount = $66, $67)) as `amount_total_consume|等于0元`, sum(ifnull(member_sales_amount between $68 and $69, $70)) as `amount_total_consume|1-2000元`, sum(ifnull(member_sales_amount between $71 and $72, $73)) as `amount_total_consume|2001-10000元`, sum(ifnull(member_sales_amount between $74 and $75, $76)) as `amount_total_consume|10001-50000元`, sum(ifnull(member_sales_amount >= $77, $78)) as `amount_total_consume|大于等于50001元`, sum(ifnull(member_sex = $79, $80)) as `sex|男`, sum(ifnull(member_sex = $81, $82)) as `sex|女`, sum(ifnull(member_sex = $83, $84)) as `sex|其他`, sum(ifnull(member_level_id = $85, $86)) as `member_level|粉丝会员`, sum(ifnull(member_level_id = $87, $88)) as `member_level|白银会员`, sum(ifnull(member_level_id = $89, $90)) as `member_level|黄金会员`, sum(ifnull(member_level_id = $91, $92)) as `member_level|铂金会员`, sum(ifnull(member_level_id = $93, $94)) as `member_level|钻石会员`, sum(ifnull(member_integral_balance = $95, $96)) as `integral_balance|等于0分`, sum(ifnull(member_integral_balance between $97 and $98, $99)) as `integral_balance|1-1999分`, sum(ifnull(member_integral_balance between $100 and $101, $102)) as `integral_balance|2000-4999分`, sum(ifnull(member_integral_balance between $103 and $104, $105)) as `integral_balance|5000-19999分`, sum(ifnull(member_integral_balance >= $106, $107)) as `integral_balance|大于等于20000分`, sum(ifnull(member_integral_total = $108, $109)) as `integral_total|等于0分`, sum(ifnull(member_integral_total between $110 and $111, $112)) as `integral_total|1-4999分`, sum(ifnull(member_integral_total between $113 and $114, $115)) as `integral_total|5000-19999分`, sum(ifnull(member_integral_total between $116 and $117, $118)) as `integral_total|20000-49999分`, sum(ifnull(member_integral_total >= $119, $120)) as `integral_total|大于等于50000分` from task_task where task_template_id = $121 and finish_time is null|1|1|1||0|0|207465|207465|1|1|
|tenant|select count(0) from ( select sg.id, sneak_guest_no, sg.status, user_id, smg.time, if(sg.status = $0, e.employee_name, $1) as maintainemployeename, smg._count as maintainnum, sg.update_employee_id from tenant.sneak_guest sg join tenant.employee e on e.id = sg.maintain_employee_id join ( select sneak_guest_id, count(*) as _count, min(create_time) as time from tenant.sneak_guest_maintain where tenant_id = $2 and tenant_app_id = $3 and shop_id = $4 and employee_id = $5 and event_type in ($6, $7, $8) and create_time between $9 and $10 group by sneak_guest_id ) smg on smg.sneak_guest_id = sg.id where sg.tenant_id = $11 and sg.tenant_app_id = $12 and (sg.fail_type is null or sg.fail_type = $13) ) tmp_count|1|6|6||0|0|82326|82326|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, 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|204346|204346|110|110|
|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 ) table_count|1|3|3||0|0|32544|32544|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)|1|2|2||0|0|312901|312901|31|31|
|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)|1|1|1||0|0|953364|953364|49|49|
|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)|1|1|1||0|0|861212|861212|137|137|
|user_service|select count(0) from user_service.user_source us left join user_service.tenant_member m on m.user_id = us.user_id left join user_service.user_employee ue on ue.user_id = m.user_id where m.tenant_id = $0 and m.tenant_app_id = $1 and us.tenant_id = $2 and us.tenant_wechatapp_id = $3 and ue.tenant_id = $4 and ue.tenant_wechatapp_id = $5 and us.shop_id = $6 and us.from_id = $7 and us.create_time >= $8 and us.create_time < $9 and us.source_type = $10 and us.from_id is not null and us.shop_id is not null|1|1|1||0|0|1818|1818|1|1|
|value_added|update value_added_user set state = $0 where state = $1 and tenant_id = $2 and tenant_wechatapp_id = $3 and user_id = $4 and product_barcode = $5|1|2|2||0|0|145|145|0|0|
||delete from tenant.sjfx_dct_erp_sales_detail_extend where create_time < $0|1|1|1||0|0|154541|154541|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)|1|1|1||0|0|107471|107471|26|26|
|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)|1|1|1||0|0|85390|85390|10|10|
|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)|1|3|3||0|0|861166|861166|114|114|
|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 p.tag_price desc, p.id desc ) tmp_count|1|1|1||0|0|7262|7262|1|1|
|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|43275|43275|1|1|
|mysql|delete from wx_gateway.wx_template_msg where create_time < date_sub(now(), interval $0 day)|1|33|33||0|0|977551|977551|0|0|
|user_service|select tu.user_id, tm.shop_id, mb.erp_member_id membererpid, tu.mobile_no, tu.user_name, ue.employee_id, tm.grade_id from user_service.tenant_member tu inner join user_service.tenant_member_info tm on tu.tenant_id = tm.tenant_id and tu.id = tm.id inner join user_service.tenant_member_bind mb on tu.tenant_id = mb.tenant_id and tu.id = mb.id left join user_service.user_employee ue on tu.tenant_app_id = ue.tenant_wechatapp_id and tu.user_id = ue.user_id where tu.tenant_id = $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|1315663|1315663|311|311|
|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|362286|362286|22|22|
|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, $87wm2wxudqaar08hwkjwxdy4pyaogjtb-q$88wm2wxudqaaidtakzk2xcmu4q7hm1kaqq$89wm2wxudqaab7lptydkp4tzwb2-wl5dba$90wm2wxudqaag-zdgx8jcifzyk9u_q9vaq$91wm2wxudqaajbtt5tl6i_df_ahqebr2ga$92wm2wxudqaaidqtpyx-tn6ybc-uuyqqna$93wm2wxudqaa_fedeqyt3mkaznqpf3penw$94wm2wxudqaanfddlaa1cljq677njn5s5q$95wm2wxudqaaflkpdsmlxoruzix37twkba$96wm2wxudqaai1n6oovixdhocwyf_cncog$97wm2wxudqaax6l73xfkcbu9numd9gij8a$98wm2wxudqaavwe-k5tbqlgpfjrfhy4zvq$99wm2wxudqaasu-xzka8jfyq_oqammnqpa$100wm2wxudqaa_sq3yufkhdpl7wfic70m5a$101wm2wxudqaax4pf7fveolzlksbhojtbfa$102wm2wxudqaaqbhhpr0gjzpaxp6a3yxvhg$103wm2wxudqaa26hqug2cbo69nhihltcbvg$104wm2wxudqaabay0jsquyrqjeqozrgn6iq$105wm2wxudqaaukmrt6j3eyosj6gftlr1jw$106wm2wxudqaalaemyofci4dxvappgys1fq$107wm2wxudqaanno_pkwvasbmpbjia9aojq$108wm2wxudqaah2k3b4uastvqkogzvccfrw$109wm2wxudqaawhy0ynxdnjnykv5ktveqcq$110wm2wxudqaao6kh1bj1co8odi5oethl4q$111wm2wxudqaahscw88camzupaikamrwojw$112wm2wxudqaajni-mfs2q3oyymr8_nw-nq$113wm2wxudqaazmfyj5n75vn0karlravwpw$114wm2wxudqaahviuwhfg_uwwcioroxbisa$115wm2wxudqaaqqbpvsz_mfs_5svfzjj-3w$116wm2wxudqaabrr-kbo2v7uf8vdyux0zxw$117wm2wxudqaacj4x2jyrh3b_x7uvi2a8ka$118wm2wxudqaauzmmjnnzszxoiivim6549g$119wm2wxudqaadf7xq0oq69ej8yl8mwohng$120wm2wxudqaax-duhebqwgst4tuh95kjsq$121wm2wxudqaao3sr-imnvp0gxpotupwclw$122wm2wxudqaaknq97pxqszxfmsz38s9vvg$123wm2wxudqaa5sfhruunyn8qbxwjqs3-ow$124wm2wxudqaaovznutugrtn4kwwfugp9vg$125wm2wxudqaa-r6...|1|1|1||0|0|650|650|298|298|
|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)|1|1|1||0|0|1352501|1352501|16|16|
|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, $13) and t.scene = $14 and t.begin_time >= $15 and t.expire_time < $16 group by date_format(t.create_time, '%d')|1|1|1||0|0|51343|51343|30|30|
|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, $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)|1|1|1||0|0|820872|820872|223|223|
|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)|1|1|1||0|0|288240|288240|47|47|
|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|1|1|1||0|0|117950|117950|0|0|
|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|1|1|1||0|0|21715|21715|1|1|
|employee|select bg.id, bg.employee_id, bg.shop_id, bg.scene, bg.status, bg.create_time, bg.begin_time, bg.expire_time, bg.member_user_name, bg.mobile_no as member_mobile_no from employee.backlog bg where bg.tenant_app_id = $0 and bg.scene not in ($1, $2) and bg.expire_time between $3 and $4 and bg.shop_id = $5 and bg.status in ($6) and bg.scene = $7 and bg.leave_flag = $8 order by id desc limit $9|1|1|1||0|0|172595|172595|10|10|
|tenant|select id, tenant_id, tenant_app_id, sneak_guest_maintain_id, sneak_guest_id, url, create_time, update_time from sneak_guest_maintain_file where tenant_app_id = $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|1352268|1352268|17|17|
|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, $13) and t.scene = $14 and t.begin_time >= $15 and t.expire_time < $16|1|1|1||0|0|51283|51283|1|1|
|tenant|select count(0) from ( select sg.employee_id as employeeid, sg._actual as actualnum, sg._maintain as continuenum, sg._failure as failnum, sg._success as dealnum, e.employee_name, e.head_img_url from ( select sgm.employee_id, count(distinct sneak_guest_id) as _actual, sum(_maintain) as _maintain, sum(_success) as _success, sum(_failure) as _failure, max(sgm.create_time) as create_time from ( select sgm.employee_id, sneak_guest_id, if(event_type = $0, $1, $2) as _maintain, if(event_type = $3, $4, $5) as _success, if(event_type = $6, $7, $8) as _failure, sgm.create_time as create_time from tenant.sneak_guest_maintain sgm join tenant.sneak_guest sg on sgm.sneak_guest_id = sg.id where sgm.tenant_id = $9 and sgm.tenant_app_id = $10 and sgm.shop_id = $11 and sgm.create_time between $12 and $13 and sgm.event_type in ($14, $15, $16) and (sg.fail_type is null or sg.fail_type = $17) ) sgm where 1 = 1 group by sgm.employee_id ) sg join tenant.employee e on e.id = sg.employee_id order by sg.create_time desc ) tmp_count|1|1|1||0|0|5349|5349|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, $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)|1|3|3||0|0|780386|780386|151|151|
|export|select od.coupon_id, case o.pay_type when $0 then $1 when $2 then $3 when $4 then $5 when $6 then $7 else $8 end paytypetext from coupon_service.coupon_market_order_detail od join coupon_service.coupon_market_order o on o.tenant_id = $9 and o.tenant_app_id = $10 and o.id = od.order_id where od.tenant_id = $11 and od.tenant_app_id = $12 and od.coupon_id in ( $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|1|1|1||0|0|103022|103022|1340|1340|
|user_service|select ue.user_id as id, tm.user_name as username, tm.head_img_url as headimgurl, tm.user_name as nickname, tm.mobile_no as mobile, tm.sex from user_service.user_employee ue join user_service.tenant_member tm on tm.tenant_id = ue.tenant_id and tm.tenant_app_id = ue.tenant_wechatapp_id and tm.user_id = ue.user_id where ue.employee_id = $0 and ue.tenant_id = $1 and ue.tenant_wechatapp_id = $2 and ue.shop_id = $3 order by tm.id desc limit $4|1|1|1||0|0|4287|4287|10|10|
|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, $13, $14) and t.scene = $15 and t.begin_time >= $16 and t.expire_time < $17 group by date_format(t.create_time, '%d')|1|1|1||0|0|24963|24963|30|30|
|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)|1|1|1||0|0|12159|12159|1|1|
||delete from tenant.sjfx_dct_erp_sales_detail where create_time < $0|1|2|2||0|0|276542|276542|0|0|
|mysql|delete from message_push.message_log where create_time < date_sub(now(), interval $0 day)|1|72|72||0|0|2708974|2708974|0|0|
|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|132|132||0|0|9371837|9371837|1498|1498|
|order|select count(*) as amount from order_detail where tenant_wechatapp_id = $0 and sku_id = $1|1|7|7||0|0|204323|204323|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, ...|1|1|1||0|0|1315607|1315607|255|255|
|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)|1|4|4||0|0|921308|921308|77|77|
|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)|1|2|2||0|0|539513|539513|123|123|
|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)|1|1|1||0|0|819350|819350|115|115|
|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|2|2||0|0|921308|921308|144|144|
|coupon_service|select count(0) from coupon_service.coupon cu join coupon_service.coupon_extend ce on ce.tenant_id = $0 and ce.tenant_app_id = $1 and ce.id = cu.id where cu.tenant_id = $2 and cu.tenant_app_id = $3 and cu.create_time >= $4 and cu.create_time <= $5|1|1|1||0|0|21612|21612|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, $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)|1|1|1||0|0|819443|819443|208|208|
|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)|1|1|1||0|0|275090|275090|17|17|
|coupon_service|select count(0) from coupon_service.coupon cu join coupon_service.coupon_extend ce on ce.tenant_id = $0 and ce.tenant_app_id = $1 and ce.id = cu.id join ( select coupon_id from coupon_service.coupon_write_off_log wol where wol.tenant_id = $2 and wol.tenant_app_id = $3 and wol.state = $4 and wol.create_time >= $5 and wol.create_time <= $6 group by coupon_id ) w on w.coupon_id = cu.id where cu.tenant_id = $7 and cu.tenant_app_id = $8 and (cu.coupon_state = $9 or (cu.coupon_state = $10 and ce.writeoff_time is not null)) and cu.create_time >= $11 and cu.create_time <= $12 and cu.template_id = $13|1|1|1||0|0|15880|15880|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)|1|1|1||0|0|20534|20534|5|5|
|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|1829427|1829427|1239|1239|
|tenant|select sum(tt.maintaincount) as maintaincount, sum(tt.maintainnum) as maintainnum, sum(tt.successnum) as successnum, sum(tt.failnum) as failnum, sum(tt.salemoney) as salemoney from ( select count(1) as maintaincount, count(distinct t.sneak_guest_id) as maintainnum, $0 as successnum, $1 as failnum, $2 as salemoney from tenant.sneak_guest g join tenant.sneak_guest_maintain t on t.sneak_guest_id = g.id where g.tenant_app_id = $3 and (g.fail_type is null or g.fail_type = $4) and t.event_type in ($5, $6, $7) and t.create_time >= $8 and t.create_time < $9 union all select $10 as maintaincount, $11 as maintainnum, count(distinct t.sneak_guest_id) as successnum, $12 as failnum, sum(sgs.`amount`) as salemoney from tenant.sneak_guest g join tenant.sneak_guest_maintain t on t.sneak_guest_id = g.id join tenant.sneak_guest_sales sgs on g.id = sgs.sneak_guest_id where g.tenant_app_id = $13 and t.event_type in ($14) and t.create_time >= $15 and t.create_time < $16 union all select $17 as maintaincount, $18 as maintainnum, $19 as successnum, count(distinct t.sneak_guest_id) as failnum, $20 as salemoney from tenant.sneak_guest g join tenant.sneak_guest_maintain t on t.sneak_guest_id = g.id where g.tenant_app_id = $21 and g.fail_type = $22 and t.event_type in ($23) and t.create_time >= $24 and t.create_time < $25 ) tt|1|1|1||0|0|792315|792315|1|1|
|message_push|insert into message_log (id, tenant_id, tenant_app_id, user_id, scene_type, msg_id, post_data, create_time, update_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?)|1|1|1||0|0|0|0|0|0|
|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|37915|37915|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)|1|1|1||0|0|427211|427211|11|11|
|v4_employee|select id, batch_no, task_type, system_task_type, task_frequency, task_name, task_template_id, business_id, shop_id, employee_id, member_id, start_time, end_time, finish_time, send_coupons, recv_coupons, recv_coupon_time, accept_time, plan_arrival_shop_time, arrival_shop_time, trade_nos, trade_num, trade_amount, trade_time, member_name, member_mobile_no, member_latest_birthday, member_sex, member_age, member_level_id, member_level, member_sales_amount, member_sales_count, member_integral_balance, member_integral_total, status, tenant_id, tenant_app_id, create_time, update_time from task_task where member_id = $0 and task_template_id in ($1) and tenant_id = $2 and tenant_app_id = $3|1|1|1||0|0|1|1|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|7|7||0|0|205740|205740|12|12|
|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)|1|1|1||0|0|74220|74220|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, $127, $128, $129, $130, $131, $132, $133, $134, $135, $136, $137, $138, $139, $140, $141, $142, $143, $144, $145, $146, $147, $148, $149, $150)|1|3|3||0|0|777598|777598|149|149|
|gift_mail|select count(0) from ( select p.id, p.default_image_url, p.product_name, p.product_type, p.tag_price, ifnull(pp.integral_price, ifnull(( select min(inventory.price) from gift_mail.inventory where inventory.product_id = p.id ), $0)) as price, p.volume, p.category_id, p.product_status, $1 as quantity, pp.partner_id as partner_id, p.topping from gift_mail.product p left join gift_mail.partner_product pp on p.id = pp.product_id left join gift_mail.product_status ps on ps.product_id = p.id where p.tenant_id = $2 and product_status = $3 and (p.is_disable is null or p.is_disable = $4) and (ps.tenant_wechatapp_id = $5 or p.product_type = $6) ) p where p.topping = $7|1|1|1||0|0|16517|16517|1|1|
||select * from user_service.wx_user where mobile_no = $0|1|4|4||0|0|491512|491512|0|0|
|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|204240|204240|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)|1|1|1||0|0|216231|216231|35|35|
|user_service|select * from user_employee where tenant_wechatapp_id = $0 and employee_id = $1|1|1|1||0|0|3391|3391|3391|3391|
|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)|1|1|1||0|0|1224787|1224787|92|92|
|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)|1|1|1||0|0|771291|771291|91|91|
|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|1|1|1||0|0|8270|8270|6|6|
|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)|1|1|1||0|0|82642|82642|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)|1|8|8||0|0|348364|348364|58|58|
|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|1|1||0|0|1351620|1351620|16|16|
|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|412031|412031|90|90|
|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)|1|3|3||0|0|69944|69944|28|28|
|v4_sales|select member_erp_id from v4_sales.erp_sales where sales_status = $0 and sales_date < $1 and member_erp_id in ($2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20) and tenant_id = $21 and tenant_app_id = $22 group by member_erp_id|1|3|3||0|0|8959|8959|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, $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)|1|5|5||0|0|1315578|1315578|226|226|
