|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|tag_service|insert into tag_service.label_vip_match_480726380749918208_480728003618410496 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_480726380749918208_480728003618410496 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|4|4||0|0|184928|184928|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_487569764496052224 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|45308|45308|48|48|
|statistic|select tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.employee_user_id , tmp.employee_user_name , sum ( tmp.amount ) amount from ( select t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) employee_user_id , if ( oe.employee_user_id = '-1' or oe.employee_user_id is null , :1 , oe.employee_user_name ) employee_user_name , t.amount from ( select tenant_id , tenant_app_id , shop_id , employee_user_id , count ( * ) amount from statistic.member where tenant_app_id = :2 and create_time between :3 and :4 and register_flag = :5 group by tenant_id , tenant_app_id , shop_id , employee_user_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and ( t.shop_id = os.dept_erp_id or t.shop_id = os.shop_id ) left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and ( t.employee_user_id = oe.employee_erp_id or t.employee_user_id = oe.employee_user_id ) ) tmp group by tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.employee_user_id , tmp.employee_user_name|1|1|1||0|0|283312|283312|109|109|
|platform|select count ( 1 ) from coupondetail where vendorid = :1 and coupontype = :2 and couponstate = :3 and to_days ( :4 ) :5 to_days ( createtime ) = :6|1|2|2||0|0|318771|318771|1|1|
|user_service|select count ( 0 ) from tenant_user tenantuser join user user on tenantuser.user_id = user.id where ( tenantuser.tenant_app_id = :1 and tenantuser.user_id not 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 ) and ( user.nick_name like concat ( :213 , :214 , :215 ) or tenantuser.mobile_no = :216 ) )|1|11|11||0|0|225378|225378|1|1|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_832396582723833856 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|1|1||0|0|21214|21214|0|0|
|platform|select * from ( select c.* from coupon c join couponput cp on c.`id` = cp.couponid and cp.appid = :1 join ( select couponid , count ( 1 ) as cangetnum from coupondetail where couponstate = :2 /*已投放*/ group by couponid ) cd on c.id = cd.couponid left join ( select couponid , count ( 1 ) as num from coupondetail where getuid = :3 group by couponid ) cdm on c.id = cdm.couponid where now ( ) < c.expirydate /*礼券档案未过期*/ and cd.cangetnum > :4 /*可领数量大于0*/ and ( c.`perget` = :5 or c.`perget` > ifnull ( cdm.num , :6 ) ) /*未限每人领数量，或者当前用户领的数小于限制数*/ and c.`disabled` = :7 /*未停用*/ and ( c.vendorid = :8 or c.vendorid = :9 ) order by c.`facevalue` desc ) as tv limit :10 , :11|1|1|1||0|0|320169|320169|0|0|
|statistic|select bl.id , bl.tenant_id , bl.tenant_app_id , bl.user_id , ee.employee_name user_name , ee.mobile_no , bl.status , bl.scene , bl.data , bl.begin_time , bl.expire_time , bl.create_time , bl.update_time , ifnull ( ws.id , -1 ) shop_id , ws.shop_name from employee.backlog bl left join tenant.employee_user eu on bl.tenant_app_id = eu.tenant_wechatapp_id and bl.user_id = eu.user_id left join tenant.erp_employee ee on eu.tenant_id = ee.tenant_id and eu.employee_erp_id = ee.employee_erp_id left join tenant.tenant_wechatapp_shop ws on eu.shop_id = ws.id and ws.status = :1 where bl.tenant_app_id = :2 and bl.create_time >= :3 and bl.create_time <= :4 order by bl.id limit :5 offset :6|1|1|1||0|0|4220|4220|844|844|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.redpack_amount ) redpack_amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.redpack_amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , sum ( ifnull ( redpack_amount , 0 ) ) redpack_amount from statistic.erp_sales_823688108565368832 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and redpack_date = date_format ( :6 , :7 ) group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|501276|501276|0|0|
|user_service|select ue.user_id as id , tu.user_name as username , u.head_img_url as headimgurl , u.nick_name as nickname , tu.mobile_no as mobile , tu.sex from user_employee ue join tenant_user tu on ue.user_id = tu.user_id and tu.tenant_id = :1 and tu.tenant_app_id = :2 join user u on tu.user_id = u.id where ue.employee_user_id = :3 and ue.tenant_id = :4 and tenant_app_id = :5 order by tu.bind_time desc|1|1|1||0|0|49645|49645|9929|9929|
|statistic|select t.source_type , t.amount from ( select source_type , sum ( amount ) amount from statistic.result_add_shop_source where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and statistic_date between :4 and :5 group by source_type ) t order by t.amount desc|1|1|1||0|0|148931|148931|2|2|
|tag_service|delete from tag_service.label_vip_match_817878088380628992_817882720653852672 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_817878088380628992_817882720653852672 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|79818|79818|0|0|
|tag_service|insert into tag_service.label_vip_match_817878088380628992_817882720653852672 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_817878088380628992_817882720653852672 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|1|1||0|0|40023|40023|0|0|
|message_push|delete from message_log where create_time < :1|1|16|16||0|0|173638|173638|0|0|
|tag_service|insert into tag_service.label_vip_match_828766757295529984_828828072282198016 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_828766757295529984_828828072282198016 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|1|1||0|0|59831|59831|0|0|
|gift_mail|select t.* , tt.can_take_date , tt.shop_name , tt.take_shop_name , tt.take_employee_name , ta.recipients , ta.user_tel , concat ( ta.area , ta.address ) address , if ( t.trade_type = 3 , pl.id , it.barcode ) as barcode , if ( t.trade_type = 3 , pl.default_image_url , p.default_image_url ) as defaultimageurl from trade t left outer join trade_take tt on tt.trade_id = t.id left outer join trade_addr ta on ta.trade_id = t.id left outer join product p on p.id = t.product_id left outer join platform_product pl on pl.id = t.product_id left outer join inventory it on it.product_id = t.product_id and it.specification = t.specification where ( t.tenant_wechatapp_id = :1 ) order by create_time desc|1|5|5||0|0|16404|16404|1204|1204|
|value_added|-- 根据添加时间得出当前增值金额 update value_added_user set amount_added = if ( :1 > ( ( ( added_percent_per_day / :2 ) * if ( :3 >= timestampdiff ( day , date_format ( create_time , :4 ) , now ( ) ) :5 :6 :7 add_days , timestampdiff ( day , date_format ( create_time , :8 ) , now ( ) ) :9 :10 , add_days ) ) :11 ( ( devalue_percent_per_day / :12 ) * if ( :13 >= timestampdiff ( day , date_format ( create_time , :14 ) , now ( ) ) :15 :16 :17 add_days :18 keeping_days , :19 , timestampdiff ( day , date_format ( create_time , :20 ) , now ( ) ) :21 :22 :23 add_days :24 keeping_days ) ) ) * amount_pay , :25 , ( ( ( added_percent_per_day / :26 ) * if ( :27 >= timestampdiff ( day , date_format ( create_time , :28 ) , now ( ) ) :29 :30 :31 add_days , timestampdiff ( day , date_format ( create_time , :32 ) , now ( ) ) :33 :34 , add_days ) ) :35 ( ( devalue_percent_per_day / :36 ) * if ( :37 >= timestampdiff ( day , date_format ( create_time , :38 ) , now ( ) ) :39 :40 :41 add_days :42 keeping_days , :43 , timestampdiff ( day , date_format ( create_time , :44 ) , now ( ) ) :45 :46 :47 add_days :48 keeping_days ) ) ) * amount_pay ) , update_time = now ( ) where state = :49 and update_time <= curdate ( ) and ( create_time >= date_add ( curdate ( ) , interval :50 ( add_days :51 keeping_days :52 :53 ) day ) or ( amount_added > :54 and create_time < date_add ( curdate ( ) , interval :55 ( add_days :56 keeping_days :57 :58 ) day ) ) ) -- 判断条件 在增值时间内 增值金大于0 状态正常|1|3|3||0|0|143230|143230|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_476787156229165056 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and warranty_date = date_format ( :6 , :7 ) group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|530157|530157|53|53|
|tag_service|select count ( 0 ) from statistic.member t1 join statistic.member_extra t2 on t1.id = t2.id join tag_service.label_vip_match_885278795660111872_885279553956712448 lvm on t1.id = lvm.id where :1 = :2 and t2.tenant_id = :3 and t2.tenant_app_id = :4 and t2.shop_id = :5 and t2.employee_user_id = :6 and lvm.vip_source = :7 and lvm.bind_state in ( :8 ) and lvm.subscribe_state in ( :9 ) and lvm.member_identity in ( :10 , :11 , :12 , :13 )|1|1|1||0|0|2128|2128|1|1|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) dept_erp_id , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , 0 value_add_amount from value_added.value_added_template vt inner join value_added.value_added_category vc on vt.id = vc.template_id and vt.is_disable = :1 inner join statistic.erp_sales_detail_885278795660111872 sd on vc.tenant_wechatapp_id = sd.tenant_app_id and vc.erp_product_category_id = sd.category_erp_id left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where vt.tenant_wechatapp_id = :2 and sd.sales_status = :3 and sd.sales_type = :4 and sd.create_time >= :5 and sd.create_time <= :6 and sd.value_add_no is null and os.shop_id != :7 and oe.employee_user_id != :8 limit :9 offset :10|1|7|7||0|0|2703553|2703553|205|205|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) dept_erp_id , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , 0 value_add_amount from value_added.value_added_template vt inner join value_added.value_added_category vc on vt.id = vc.template_id and vt.is_disable = :1 inner join statistic.erp_sales_detail_827516559562940416 sd on vc.tenant_wechatapp_id = sd.tenant_app_id and vc.erp_product_category_id = sd.category_erp_id left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where vt.tenant_wechatapp_id = :2 and sd.sales_status = :3 and sd.sales_type = :4 and sd.create_time >= :5 and sd.create_time <= :6 and sd.value_add_no is null and os.shop_id != :7 and oe.employee_user_id != :8 limit :9 offset :10|1|1|1||0|0|632476|632476|147|147|
|statistic|select max ( job_execution_id ) jobid from statistic.batch_job_execution where create_time < :1|1|1|1||0|0|150283|150283|1|1|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_907400816212623360 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|2|2||0|0|191241|191241|38|38|
|tag_service|insert into tag_service.label_vip_match_817517269994225664_817536856118829056 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_817517269994225664_817536856118829056 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|1|1||0|0|52628|52628|0|0|
|tag_service|select id , tenant_app_id , shop_id , vip_id , vip_source , member_grade , sex , new_or_old , lifecycle , animal_born , constellation , month_birth , age_group , months_initiation , month_lately_consume , frequency_total_consume , amount_total_consume , total_integral , usable_integral , member_identity , member_source , year_initiation , lately_month_birth , subscribe_state , bind_state , perfect_data_state , memorial_day , member_anniversary , member_shop , last_product_category , last_sale_balance , last_stone_weight , last_gold_weight , customer_type , customer_character , shape , skin_color , face_type , affective_state , preference , accepted_info_type , estimated_consumption_capacity , maintain_level , buy_purpose , intent_product , price_area , enter_shop_need from tag_service.label_vip_match_834615931371048960_836444994523926528 where vip_id = :1|1|1|1||0|0|59187|59187|0|0|
|tag_service|delete from tag_service.label_vip_match_488003299602206720_885391961685602304 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_488003299602206720_885391961685602304 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|1|1||0|0|61415|61415|0|0|
|statistic|select sd.product_barcode , ifnull ( es.amount , 0 ) amount , sd.tenant_app_id , es.sales_date , es.dept_erp_id , sd.tenant_id , ifnull ( sd.statistic_date , es.sales_date ) statistic_date from ( select tenant_id , tenant_app_id , sales_erp_id , product_barcode , date_format ( create_time , '%y-%m-%d' ) statistic_date from statistic.erp_sales_detail_823688108565368832 where tenant_app_id = :1 and create_time >= :2 and create_time <= :3 and sales_type = :4 and sales_status = :5 ) sd inner join ( select tenant_id , tenant_app_id , sales_erp_id , amount , sales_date , dept_erp_id from statistic.erp_sales_823688108565368832 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|1|1|1||0|0|502157|502157|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_488003299602206720 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|5|5||0|0|590808|590808|0|0|
|statistic|update erp_sales_476787156229165056 set user_id = :1 , user_name = :2 , mobile_no = :3 where tenant_app_id = :4 and member_erp_id = :5 and user_name is null|1|1|1||0|0|4470|4470|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_490810080325931008 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|2|2||0|0|154329|154329|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_830220893509701632 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|2|2||0|0|165261|165261|0|0|
|user_service|select count ( 0 ) from tenant_user tenantuser join user user on tenantuser.user_id = user.id where ( tenantuser.tenant_app_id = :1 and tenantuser.user_id not 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 , :233 , :234 , :235 , :236 , :237 , :238 , :239 , :240 , :241 , :242 , :243 ) and ( user.nick_name like concat ( :244 , :245 , :246 ) or tenantuser.mobile_no = :247 ) )|1|9|9||0|0|288372|288372|1|1|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount , sum ( tmp.score ) score from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount , t.score from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount , sum ( ifnull ( score , 0 ) ) score from statistic.erp_sales_823688108565368832 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and comment_date = date_format ( :6 , :7 ) group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|501286|501286|0|0|
|tag_service|insert into tag_service.label_vip_match_487569764496052224_487577238854832128 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_487569764496052224_487577238854832128 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|2|2||0|0|127719|127719|0|0|
|statistic|select sd.product_barcode , ifnull ( es.amount , 0 ) amount , sd.tenant_app_id , es.sales_date , es.dept_erp_id , sd.tenant_id , ifnull ( sd.statistic_date , es.sales_date ) statistic_date from ( select tenant_id , tenant_app_id , sales_erp_id , product_barcode , date_format ( create_time , '%y-%m-%d' ) statistic_date from statistic.erp_sales_detail_885278795660111872 where tenant_app_id = :1 and create_time >= :2 and create_time <= :3 and sales_type = :4 and sales_status = :5 ) sd inner join ( select tenant_id , tenant_app_id , sales_erp_id , amount , sales_date , dept_erp_id from statistic.erp_sales_885278795660111872 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|1|6|6||0|0|2702697|2702697|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_826254702915141632 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|1|1||0|0|24220|24220|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) dept_erp_id , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , 0 value_add_amount from value_added.value_added_template vt inner join value_added.value_added_category vc on vt.id = vc.template_id and vt.is_disable = :1 inner join statistic.erp_sales_detail_476787156229165056 sd on vc.tenant_wechatapp_id = sd.tenant_app_id and vc.erp_product_category_id = sd.category_erp_id left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where vt.tenant_wechatapp_id = :2 and sd.sales_status = :3 and sd.sales_type = :4 and sd.create_time >= :5 and sd.create_time <= :6 and sd.value_add_no is null and os.shop_id != :7 and oe.employee_user_id != :8 limit :9 offset :10|1|3|3||0|0|806810|806810|146|146|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_885278795660111872 where tenant_app_id = :3 and has_sale = :4 and sales_status = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|4|4||0|0|1383554|1383554|69|69|
|statistic|select count ( 0 ) from backlog where tenant_id = :1 and tenant_app_id = :2 and expire_time between :3 and :4 and user_name > :5 and shop_name > :6|1|15|15||0|0|1435345|1435345|1|1|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_827516559562940416 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|13|13||0|0|688216|688216|11|11|
|tag_service|delete from tag_service.label_vip_match_469175049962786816_469517846737719296 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_469175049962786816_469517846737719296 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|29130|29130|0|0|
|statistic|select tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.source_type , sum ( tmp.amount ) amount from ( select t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , t.source_type , t.amount from ( select mb.tenant_id , mb.tenant_app_id , mb.shop_id , mb.source_type , count ( 1 ) amount from statistic.member mb where mb.tenant_app_id = :1 and mb.create_time between :2 and :3 and mb.register_flag = :4 group by mb.tenant_id , mb.tenant_app_id , mb.shop_id , mb.source_type ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and ( t.shop_id = os.dept_erp_id or t.shop_id = os.shop_id ) ) tmp group by tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.source_type|1|1|1||0|0|211739|211739|41|41|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_821229068421742592 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|6|6||0|0|382437|382437|0|0|
|statistic|select tu.id , tu.tenant_id tenantid , tu.tenant_wechatapp_id tenantappid , tu.member_erp_id memberuserid , tu.user_name username , tu.mobile_no mobileno , tu.create_time tempcreatetime , '2019-07-2223:59:59.0' updatetime , tu.dept_erp_id shopid , ifnull ( tu.consumption_integral , 0 ) consumptionintegral , tu.grade_erp_id gradeerpid , tu.employee_erp_id employeeuserid from user_service.erp_member tu where tu.tenant_wechatapp_id = :1 and tu.update_time >= :2 and tu.create_time <= :3 and tu.update_time <= :4 limit :5 offset :6|1|2|2||0|0|2611|2611|2544|2544|
|mysql|update coupon_service.coupon_grant_limit set get_quantity = ( select count ( * ) from coupon_service.coupon_user where coupon_user.coupon_template_id = coupon_grant_limit.coupon_template_id ) where get_quantity = :1|1|72|72||0|0|345033325|345033325|0|0|
|coupon_service|select * from coupon_user where datediff ( date_format ( end_time , :1 ) , date_format ( now ( ) , :2 ) ) = :3 and coupon_state in ( :4 )|1|1|1||0|0|435591|435591|962|962|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_885278795660111872 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|22|22||0|0|1383554|1383554|69|69|
|statistic|select sd.product_barcode , ifnull ( es.amount , 0 ) amount , sd.tenant_app_id , es.sales_date , es.dept_erp_id , sd.tenant_id , ifnull ( sd.statistic_date , es.sales_date ) statistic_date from ( select tenant_id , tenant_app_id , sales_erp_id , product_barcode , date_format ( create_time , '%y-%m-%d' ) statistic_date from statistic.erp_sales_detail_823844580729339904 where tenant_app_id = :1 and create_time >= :2 and create_time <= :3 and sales_type = :4 and sales_status = :5 ) sd inner join ( select tenant_id , tenant_app_id , sales_erp_id , amount , sales_date , dept_erp_id from statistic.erp_sales_823844580729339904 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|1|1|1||0|0|93336|93336|12|12|
|statistic|select t.tenant_id , t.tenant_app_id , t.coupon_id , if ( t.coupon_type = 4 , vt.template_name , ct.coupon_name ) coupon_name , t.statistic_date , t.create_channel , count ( 1 ) get_amount from ( select tenant_id , tenant_app_id , coupon_template_id coupon_id , create_channel , date_format ( create_time , '%y-%m-%d' ) statistic_date , coupon_type from statistic.coupon_user where tenant_app_id = :1 and create_time >= :2 and create_time <= :3 ) t left join coupon_service.coupon_template ct on t.coupon_id = ct.id left join value_added.value_added_template vt on t.tenant_app_id = vt.tenant_wechatapp_id and t.coupon_id = vt.id group by t.tenant_id , t.tenant_app_id , t.coupon_id , ct.coupon_name , t.statistic_date , t.create_channel , t.coupon_type|1|6|6||0|0|433654|433654|0|0|
|statistic|select t.user_id id , t.user_name name , t.score from ( select ec.user_id , ec.user_name , round ( ec.score/ec.amount ) score from ( select ec.user_id , ec.user_name , sum ( ec.score ) score , sum ( ec.amount ) amount from result_employee_comment ec where ec.tenant_id = :1 and ec.tenant_app_id = :2 and ec.shop_id = :3 and ec.statistic_date between :4 and :5 and ec.score > :6 and ec.user_id != :7 group by ec.user_id , ec.user_name ) ec ) t order by t.score desc|1|2|2||0|0|104852|104852|1|1|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_486900027235635200 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|63016|63016|0|0|
|statistic|update erp_sales_823688108565368832 set user_id = null , user_name = :1 , mobile_no = :2 where tenant_app_id = :3 and member_erp_id = :4 and user_name is null|1|1|1||0|0|3519|3519|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_823709122435256320 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|1|1||0|0|38403|38403|0|0|
|statistic|select count ( 0 ) from backlog where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and user_id = :4 and user_name > :5 and shop_name > :6|1|14|14||0|0|1435345|1435345|1|1|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_480726380749918208 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|135315|135315|34|34|
|user_service|select t1.erp_member_id as membererpid , t2.head_img_url as headimgurl , t2.nick_name as nickname , t1.mobile_no as mobileno , date_format ( t1.bind_time , '%y-%m-%d%h:%i:%s' ) as registertime from tenant_user t1 join `user` t2 on t1.user_id = t2.id left join user_employee t3 on t1.user_id = t3.user_id and t1.tenant_id = t3.tenant_id and t1.tenant_app_id = t3.tenant_wechatapp_id where t3.id is null and t1.mobile_no is not null and t1.mobile_no != :1 and t1.erp_member_id is not null and t1.shop_id = :2 and t1.tenant_id = :3 and t1.tenant_app_id = :4 -- and t1.bind_time < current_date order by t1.bind_time asc limit :5|1|1|1||0|0|56757|56757|8|8|
|tag_service|insert into tag_service.label_vip_match_818707624273952768_818711793240154112 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_818707624273952768_818711793240154112 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|1|1||0|0|39910|39910|0|0|
|statistic|delete from statistic.batch_step_execution where step_execution_id <= :1|1|1|1||0|0|23986|23986|0|0|
|user_service|select * from user_employee where employee_erp_id = :1 and tenant_id = :2 and date_format ( update_time , :3 ) = date_format ( now ( ) , :4 )|1|2|2||0|0|723715|723715|100|100|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_823844580729339904 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|4|4||0|0|183860|183860|178|178|
|tag_service|delete from tag_service.label_vip_match_469175049962786816_470281572487139328 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_469175049962786816_470281572487139328 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|1|1||0|0|48098|48098|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_823688108565368832 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and warranty_date = date_format ( :6 , :7 ) group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|501276|501276|0|0|
|tag_service|select id , tenant_app_id , shop_id , vip_id , vip_source , member_grade , sex , new_or_old , lifecycle , animal_born , constellation , month_birth , age_group , months_initiation , month_lately_consume , frequency_total_consume , amount_total_consume , total_integral , usable_integral , member_identity , member_source , year_initiation , lately_month_birth , subscribe_state , bind_state , perfect_data_state , memorial_day , member_anniversary , member_shop , last_product_category , last_sale_balance , last_stone_weight , last_gold_weight , customer_type , customer_character , shape , skin_color , face_type , affective_state , preference , accepted_info_type , estimated_consumption_capacity , maintain_level , buy_purpose , intent_product , price_area , enter_shop_need from tag_service.label_vip_match_836363095600320512_836442940199964672 where vip_id = :1 and vip_source = :2|1|1|1||0|0|317900|317900|1|1|
|tag_service|delete from tag_service.batch_job_execution_params where job_execution_id <= :1|1|2|2||0|0|284278|284278|0|0|
|user_service|select tenantuser.user_id , user.nick_name , tenantuser.head_img_url , user.sex , user.mobile_no as mobile , user.country , user.province , user.city from tenant_user tenantuser join user user on tenantuser.user_id = user.id where ( tenantuser.tenant_app_id = :1 and tenantuser.user_id not 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 , :233 , :234 , :235 , :236 , :237 , :238 , :239 , :240 , :241 , :242 , :243 ) and ( user.nick_name like concat ( :244 , :245 , :246 ) or tenantuser.mobile_no = :247 ) ) order by tenantuser.create_time desc limit :248|1|1|1||0|0|288372|288372|1|1|
|tag_service|delete from tag_service.label_vip_match_817517269994225664_817533420308570112 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_817517269994225664_817533420308570112 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|1|1||0|0|34106|34106|0|0|
|tag_service|insert into tag_service.label_vip_match_907400816212623360_907482231063232512 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_907400816212623360_907482231063232512 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|1|1||0|0|143815|143815|0|0|
|statistic|select sd.product_barcode , ifnull ( es.amount , 0 ) amount , sd.tenant_app_id , es.sales_date , es.dept_erp_id , sd.tenant_id , ifnull ( sd.statistic_date , es.sales_date ) statistic_date from ( select tenant_id , tenant_app_id , sales_erp_id , product_barcode , date_format ( create_time , '%y-%m-%d' ) statistic_date from statistic.erp_sales_detail_471320523331211264 where tenant_app_id = :1 and create_time >= :2 and create_time <= :3 and sales_type = :4 and sales_status = :5 ) sd inner join ( select tenant_id , tenant_app_id , sales_erp_id , amount , sales_date , dept_erp_id from statistic.erp_sales_471320523331211264 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|1|1|1||0|0|25682|25682|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_828766757295529984 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|6|6||0|0|226439|226439|129|129|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_816096827580399616 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|91630|91630|12|12|
|platform|select count ( 1 ) from `taskassignment` ta where ta.tasktype = :1 and ( ta.taskstatus = :2 or ta.taskstatus = :3 ) and vendorid = :4 and uid = :5|1|1|1||0|0|626646|626646|1|1|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_827516559562940416 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|6|6||0|0|423280|423280|63|63|
|tag_service|select count ( * ) from tag_service.label_vip_match_885278795660111872_885279553956712448 lvm where :1 = :2 and lvm.member_identity in ( :3 , :4 , :5 , :6 , :7 ) and lvm.new_or_old in ( :8 )|1|1|1||0|0|345994|345994|1|1|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_823688108565368832 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|6|6||0|0|502071|502071|0|0|
|statistic|select t.user_id id , t.user_name name , t.amount from ( select user_id , user_name , sum ( amount ) amount from statistic.result_add_shop_user where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and statistic_date between :4 and :5 and user_name > :6 group by user_id , user_name ) t order by t.amount desc|1|2|2||0|0|334027|334027|6|6|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_885278795660111872 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and warranty_date = date_format ( :6 , :7 ) group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|3|3||0|0|1383065|1383065|2|2|
|statistic|select bm.id , group_concat ( distinct sd.category_erp_id ) categoryid , group_concat ( distinct sd.category_name ) categoryname , min ( es.sales_date ) firstsalestime , max ( es.sales_date ) lastsalestime from base_user_member bu inner join member_extra bm on bu.tenant_app_id = bm.tenant_app_id and bu.user_id = bm.user_id inner join tenant.erp_sales es on bm.tenant_app_id = es.tenant_wechatapp_id and bm.member_erp_id = es.member_erp_id inner join tenant.erp_sales_detail sd on es.tenant_wechatapp_id = sd.tenant_wechatapp_id and es.sales_erp_id = sd.sales_erp_id where bu.tenant_app_id = :1 and sd.sales_type = :2 and es.sales_status = :3 group by bm.id order by bm.id limit :4 offset :5|1|7|7||0|0|153039|153039|49|49|
|coupon_service|select * from coupon_user where create_channel = :1 and tenant_wechatapp_id = :2 and channel_id = :3 limit :4|1|9|9||0|0|61659|61659|0|0|
|tag_service|delete from tag_service.label_vip_match_477416547359526912_477418729651703808 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_477416547359526912_477418729651703808 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|1|1||0|0|35767|35767|0|0|
|activity_service|select assist_task_activity_id as id , count ( distinct user_id ) as partakenum , sum ( if ( partake_type = 'appoint' and status = :1 , :2 , :3 ) ) as appointnum , sum ( if ( partake_type = :4 , :5 , :6 ) ) as applynum , sum ( if ( partake_type = :7 and status >= :8 , :9 , :10 ) ) as finishnum from assist_task_user where assist_task_activity_id in ( :11 , :12 , :13 , :14 ) group by assist_task_activity_id|1|2|2||0|0|363653|363653|4|4|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_907400816212623360 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|3|3||0|0|312950|312950|0|0|
|statistic|select count ( 0 ) from ( select tmp.shop_id shopid , tmp.shop_name shopname , tmp.user_id userid , tmp.user_name username , tmp.sale_amount saleamount , tmp.war_amount waramount , tmp.warrate from ( select t.shop_id , t.shop_name , t.user_id , t.user_name , t.sale_amount , t.war_amount , if ( sale_amount = 0 , 0 , round ( t.war_amount*100/t.sale_amount , 2 ) ) warrate from ( select ec.shop_id , ec.shop_name , ec.user_id , ec.user_name , sum ( ifnull ( ec.sale_amount , 0 ) ) sale_amount , sum ( ifnull ( ec.war_amount , 0 ) ) war_amount from statistic.result_employee_warranty ec where ec.tenant_id = :1 and ec.shop_id != :2 and ec.user_name != :3 and ec.tenant_app_id = :4 and ec.sales_date between :5 and :6 group by ec.shop_id , ec.shop_name , ec.user_id , ec.user_name ) t ) tmp order by tmp.shop_name ) tmp_count|1|1|1||0|0|964665|964665|1|1|
|statistic|select count ( 0 ) from ( select tmp.shop_id shopid , tmp.shop_name shopname , tmp.user_id userid , tmp.user_name username , tmp.sale_amount saleamount , tmp.war_amount waramount , tmp.warrate from ( select t.shop_id , t.shop_name , t.user_id , t.user_name , t.sale_amount , t.war_amount , if ( sale_amount = 0 , 0 , round ( t.war_amount*100/t.sale_amount , 2 ) ) warrate from ( select ec.shop_id , ec.shop_name , ec.user_id , ec.user_name , sum ( ifnull ( ec.sale_amount , 0 ) ) sale_amount , sum ( ifnull ( ec.war_amount , 0 ) ) war_amount from statistic.result_employee_warranty ec where ec.tenant_id = :1 and ec.shop_id != :2 and ec.user_name != :3 and ec.tenant_app_id = :4 group by ec.shop_id , ec.shop_name , ec.user_id , ec.user_name ) t ) tmp order by tmp.shop_name ) tmp_count|1|4|4||0|0|965673|965673|1|1|
|statistic|select ambassador_put_date statistic_date , tenant_id , tenant_app_id , coupon_template_id coupon_id , coupon_name , ambassador_id , ambassador_user_name , count ( * ) use_amount from statistic.coupon_user where tenant_app_id = :1 and create_channel = :2 and coupon_state = :3 and update_time >= :4 and update_time <= :5 group by ambassador_put_date , tenant_id , tenant_app_id , coupon_template_id , coupon_name , ambassador_id , ambassador_user_name|1|1|1||0|0|434631|434631|0|0|
|platform|select `tasktype` , `tasktime` , `taskstatus` , `bid` , `vendorid` , `uid` , `completetime` , `remark` , `createtime` , `id` from `taskassignment` where `bid` = :1 and `tasktype` = :2 and `tasktime` = :3 and `vendorid` = :4 and `uid` = :5|1|2|2||0|0|626521|626521|0|0|
|tag_service|delete from tag_service.label_vip_match_816440425157005312_816442247884083200 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_816440425157005312_816442247884083200 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|1|1||0|0|46960|46960|0|0|
|tag_service|delete from tag_service.label_vip_match_822257848045047808_822264540166144000 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_822257848045047808_822264540166144000 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|74048|74048|0|0|
|tag_service|delete from tag_service.label_vip_match_819000302970638336_819053378054164480 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_819000302970638336_819053378054164480 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|3|3||0|0|100393|100393|0|0|
|platform|select ifnull ( eid , 0 ) as eid , ifnull ( shopid , 0 ) as sid , vendorid , count ( 1 ) as quantity from productcerts where vendorid = :1 and to_days ( :2 ) :3 to_days ( createtime ) = :4 group by eid , shopid , vendorid|1|1|1||0|0|28984|28984|0|0|
|tag_service|delete from tag_service.label_vip_match_822257848045047808_822282586666606592 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_822257848045047808_822282586666606592 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|1|1||0|0|70482|70482|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_476787156229165056 where tenant_app_id = :3 and has_sale = :4 and sales_status = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|2|2||0|0|530262|530262|68|68|
|tag_service|delete from tag_service.label_vip_match_817878088380628992_817882952124895232 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_817878088380628992_817882952124895232 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|71748|71748|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.redpack_amount ) redpack_amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.redpack_amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , sum ( ifnull ( redpack_amount , 0 ) ) redpack_amount from statistic.erp_sales_885278795660111872 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and redpack_date = date_format ( :6 , :7 ) group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|3|3||0|0|1383051|1383051|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_823844580729339904 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|3|3||0|0|93611|93611|78|78|
|tag_service|insert into tag_service.label_vip_match_819000302970638336_819053378054164480 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_819000302970638336_819053378054164480 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|1|1||0|0|50303|50303|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_823688108565368832 where tenant_app_id = :3 and has_sale = :4 and sales_status = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|502071|502071|0|0|
|customize_page|select id , tenant_id , tenant_wechatapp_id , page_id , user_id , tenant_app_open_id , create_time , update_time , business_id , src_type , user_name , mobile_no , head_img from award_qualified where tenant_wechatapp_id = :1 and page_id = :2 and ( user_id = :3 or tenant_app_open_id = :4 )|1|1|1||0|0|66188|66188|1|1|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_839295151019966464 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|3|3||0|0|11820|11820|6|6|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_834615931371048960 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|1|1||0|0|72752|72752|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount , sum ( tmp.score ) score from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount , t.score from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount , sum ( ifnull ( score , 0 ) ) score from statistic.erp_sales_885278795660111872 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and comment_date = date_format ( :6 , :7 ) group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|3|3||0|0|1383058|1383058|1|1|
|statistic|select count ( 0 ) from ( select cu.id , cu.coupon_name couponname , cu.coupon_type coupontype , cu.coupon_no couponno , cu.create_channel couponchannel , cu.coupon_state couponstate , cu.user_name username , cu.creator_name creatorname , cu.face_value facevalue , cu.begin_time begintime , cu.end_time endtime , cu.remark , cu.mobile_no mobileno , cu.creator_mobile_no creatormobileno , eu.employee_user_id writeoffuserid , cu.writeoff_time writeofftime , eu.employee_user_name writeoffusername , cu.create_time createtime , ws.shop_name , ws.shop_id , cu.reservation_shop_name reservationshopname , date_format ( cu.reservation_time , '%y-%m-%d' ) reservationdate from coupon_user cu left join statistic.off_employee eu on cu.tenant_app_id = eu.tenant_app_id and ( cu.writeoff_user_id = eu.employee_erp_id or cu.writeoff_user_id = eu.employee_user_id ) left join statistic.off_shop ws on cu.tenant_app_id = ws.tenant_app_id and ( cu.writeoff_shop_id = ws.dept_erp_id or cu.writeoff_shop_id = ws.shop_id ) left join activity tt on cu.activity_id = tt.id where cu.tenant_id = :1 and cu.tenant_app_id = :2 and cu.create_channel = :3 and cu.coupon_template_id = :4 ) table_count|1|4|4||0|0|286981|286981|1|1|
|statistic|select t.tenant_id , t.tenant_app_id , t.coupon_template_id , if ( t.coupon_type = 4 , vt.template_name , ct.coupon_name ) coupon_name , t.statistic_date , t.create_channel , count ( 1 ) use_amount from ( select tenant_id , tenant_app_id , coupon_template_id , coupon_name , create_channel , date_format ( update_time , '%y-%m-%d' ) statistic_date , coupon_type from coupon_user where tenant_app_id = :1 and coupon_state = :2 and update_time >= :3 and update_time <= :4 ) t left join coupon_service.coupon_template ct on t.coupon_template_id = ct.id left join value_added.value_added_template vt on t.tenant_app_id = vt.tenant_wechatapp_id and t.coupon_template_id = vt.id group by t.tenant_id , t.tenant_app_id , t.coupon_template_id , ct.coupon_name , t.statistic_date , t.create_channel , t.coupon_type|1|1|1||0|0|435033|435033|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_817161814168092672 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|4|4||0|0|28998|28998|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_828766757295529984 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|3|3||0|0|134501|134501|50|50|
|statistic|select tu.id , tu.user_id userid , tu.tenant_id tenantid , tu.tenant_app_id tenantappid , tu.shop_id shopid , tu.erp_member_id memberuserid , tu.user_name username , tu.mobile_no mobileno , ifnull ( tu.sex , 0 ) sex , tu.birthday , tu.birthday_is_lunar birthdayislunar , tu.memorial_name memorialname , tu.memorial_day memorialday , tu.memorial_day_is_lunar memorialdayislunar , tu.create_time createtime , '2019-07-2223:59:59.0' updatetime , if ( tu.bind_time is null , 0 , 1 ) bindflag , if ( tu.mobile_no is null , 0 , 1 ) fullflag , ifnull ( em.consumption_integral , 0 ) consumptionintegral , em.grade_erp_id gradeerpid , tu.bind_time bindtime , if ( ifnull ( tu.is_subscribe , 0 ) = 0 , 1 , 0 ) cancelflag , if ( ifnull ( tu.is_subscribe , 0 ) = 1 , 1 , 0 ) subscribeflag , if ( tu.is_subscribe = 1 , null , tu.subscribe_time ) canceltime , tu.subscribe_time from user_service.tenant_user tu left join user_service.erp_member em on tu.tenant_app_id = em.tenant_wechatapp_id and tu.erp_member_id = em.member_erp_id where tu.tenant_app_id = :1 and tu.update_time >= :2 and tu.create_time <= :3 and tu.update_time <= :4 union all select tu.id , tu.user_id userid , tu.tenant_id tenantid , tu.tenant_app_id tenantappid , tu.shop_id shopid , tu.erp_member_id memberuserid , tu.user_name username , tu.mobile_no mobileno , ifnull ( tu.sex , 0 ) sex , tu.birthday , tu.birthday_is_lunar birthdayislunar , tu.memorial_name memorialname , tu.memorial_day memorialday , tu.memorial_day_is_lunar memorialdayislunar , tu.create_time createtime , '2019-07-2223:59:59.0' updatetime , if ( tu.bind_time is null , 0 , 1 ) bindflag , if ( tu.mobile_no is null , 0 , 1 ) fullflag , ifnull ( em.consumption_integral , 0 ) consumptionintegral , em.grade_erp_id gradeerpid , tu.bind_time bindtime , if ( ifnull ( tu.is_subscribe , 0 ) = 0 , 1 , 0 ) cancelflag , if ( ifnull ( tu.is_subscribe , 0 ) = 1 , 1 , 0 ) subscribeflag , if ( tu.is_subscribe = 1 , null , tu.subscribe_time ) canceltime , tu.subscribe_time from user_service.tenant_user tu left join user_service.erp_member em on tu.tenant_app_id = em.tenant_wechatapp_id and tu.erp_member_id = em.member_erp_id where tu.tenant_app_id = :5 and em.update_time >= :6 and tu.create_time <= :7 and em.update_time <= :8 limit :9 offset :10|1|1|1||0|0|10537|10537|5000|5000|
|statistic|select sd.product_barcode , ifnull ( es.amount , 0 ) amount , sd.tenant_app_id , es.sales_date , es.dept_erp_id , sd.tenant_id , ifnull ( sd.statistic_date , es.sales_date ) statistic_date from ( select tenant_id , tenant_app_id , sales_erp_id , product_barcode , date_format ( create_time , '%y-%m-%d' ) statistic_date from statistic.erp_sales_detail_476787156229165056 where tenant_app_id = :1 and create_time >= :2 and create_time <= :3 and sales_type = :4 and sales_status = :5 ) sd inner join ( select tenant_id , tenant_app_id , sales_erp_id , amount , sales_date , dept_erp_id from statistic.erp_sales_476787156229165056 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|1|2|2||0|0|921878|921878|3|3|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_814020764498956288 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|2|2||0|0|26769|26769|10|10|
|tag_service|insert into tag_service.label_vip_match_821229068421742592_821504909596737536 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_821229068421742592_821504909596737536 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|2|2||0|0|201633|201633|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount , sum ( tmp.score ) score from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount , t.score from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount , sum ( ifnull ( score , 0 ) ) score from statistic.erp_sales_476787156229165056 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and comment_date = date_format ( :6 , :7 ) group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|529786|529786|0|0|
|tag_service|insert into tag_service.label_vip_match_490810080325931008_490828878219186176 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_490810080325931008_490828878219186176 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|1|1||0|0|141177|141177|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_817878088380628992 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|50715|50715|14|14|
|statistic|select sd.product_barcode , ifnull ( es.amount , 0 ) amount , sd.tenant_app_id , es.sales_date , es.dept_erp_id , sd.tenant_id , ifnull ( sd.statistic_date , es.sales_date ) statistic_date from ( select tenant_id , tenant_app_id , sales_erp_id , product_barcode , date_format ( create_time , '%y-%m-%d' ) statistic_date from statistic.erp_sales_detail_827516559562940416 where tenant_app_id = :1 and create_time >= :2 and create_time <= :3 and sales_type = :4 and sales_status = :5 ) sd inner join ( select tenant_id , tenant_app_id , sales_erp_id , amount , sales_date , dept_erp_id from statistic.erp_sales_827516559562940416 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|1|2|2||0|0|688194|688194|0|0|
|activity_service|select * from activity_service.user_trace where activity_id = :1 order by id desc limit :2|1|2|2||0|0|676896|676896|0|0|
|statistic|select count ( 0 ) from ( select es.id , es.sales_no salesno , es.dept_erp_id shopid , ifnull ( os.shop_name , '未知' ) shopname , es.erp_employee_id employeeuserid , ifnull ( oe.employee_user_name , '未知' ) employeeusername , es.user_name username , es.mobile_no mobileno , es.sales_date salesdate , es.score , es.comment_date commentdate , round ( es.redpack_amount / 100 , 2 ) redpackamount , es.redpack_busi_id busiid , es.content from statistic.erp_sales_817878088380628992 es left join statistic.off_shop os on es.tenant_app_id = os.tenant_app_id and es.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on es.tenant_app_id = oe.tenant_app_id and es.erp_employee_id = oe.employee_erp_id where es.tenant_id = :1 and os.shop_id != :2 and oe.employee_user_id != :3 and es.tenant_app_id = :4 and os.shop_id = :5 and es.comment_date > :6 ) table_count|1|1|1||0|0|125835|125835|1|1|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_885278795660111872 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|44|44||0|0|2702697|2702697|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_821229068421742592 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|3|3||0|0|185692|185692|152|152|
|tag_service|select id , tenant_app_id , shop_id , vip_id , vip_source , member_grade , sex , new_or_old , lifecycle , animal_born , constellation , month_birth , age_group , months_initiation , month_lately_consume , frequency_total_consume , amount_total_consume , total_integral , usable_integral , member_identity , member_source , year_initiation , lately_month_birth , subscribe_state , bind_state , perfect_data_state , memorial_day , member_anniversary , member_shop , last_product_category , last_sale_balance , last_stone_weight , last_gold_weight , customer_type , customer_character , shape , skin_color , face_type , affective_state , preference , accepted_info_type , estimated_consumption_capacity , maintain_level , buy_purpose , intent_product , price_area , enter_shop_need from tag_service.label_vip_match_907400816212623360_907482231063232512 where vip_id = :1|1|2|2||0|0|131905|131905|0|0|
|statistic|select count ( 0 ) from ( select mb.member_user_id memberuserid , mb.user_name username , mb.mobile_no mobileno , mb.age , mb.sex sex , mb.status status , mb.birthday birthday , mb.memorial_name memorialname , mb.memorial_day memorialday , mb.source_type sourcetype , mb.identity , if ( mt.grade_erp_id is null , '无' , gd.grade_name ) gradename , mt.sales_balance salesbalance , mt.sales_amount salesamount , mt.consumption_integral consumptionintegral , mt.cumulation cumulation , mt.balance balance , mt.service_amount serviceamount , mt.registe_time registetime , mt.first_shop_time firstshoptime , mt.last_shop_time lastshoptime , mt.first_sales_time firstsalestime , mt.last_sales_time lastsalestime , mt.last_login_time lastlogintime , mt.follow_time followtime , mt.cancel_follow_time cancelfollowtime , mt.bind_time bindtime , mt.last_service_time lastservicetime , mt.category_name categoryname , tw.brand_name tenantappname , mb.cancel_flag cancelflag , mb.subscribe_flag subscribeflag , mb.bind_flag bindflag , mb.full_flag fullflag , ifnull ( os.shop_name , '未知' ) shop_name , if ( oe.employee_user_id = '-1' or oe.employee_user_id is null , :1 , oe.employee_user_name ) employee_user_name from statistic.member mb left join statistic.member_extra mt on mb.id = mt.id left join statistic.tenant_wechatapp tw on mb.tenant_app_id = tw.id left join statistic.grade gd on mt.tenant_id = gd.tenant_id and mt.grade_erp_id = gd.grade_erp_id left join statistic.off_shop os on mt.tenant_app_id = os.tenant_app_id and ( mt.shop_id = os.shop_id or mt.shop_id = os.dept_erp_id ) left join statistic.off_employee oe on mt.tenant_app_id = oe.tenant_app_id and ( mt.employee_user_id = oe.employee_erp_id or mt.employee_user_id = oe.employee_user_id ) where mb.tenant_id = :2 and mb.tenant_app_id = :3 and mb.subscribe_flag = :4 and mb.bind_flag = :5 and mb.register_flag = :6 ) tmp_count|1|4|4||0|0|503626|503626|1|1|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_480726380749918208 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|4|4||0|0|290460|290460|0|0|
|user_service|select count ( 0 ) from tenant_user tenantuser join user user on tenantuser.user_id = user.id where ( tenantuser.tenant_app_id = :1 and tenantuser.user_id not 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 ) and ( user.nick_name like concat ( :89 , :90 , :91 ) or tenantuser.mobile_no = :92 ) )|1|2|2||0|0|10123|10123|1|1|
|tag_service|insert into tag_service.member_statistic_fe2ea558e092dd0b6fb1ae3b548e4b40 select t1.id , t1.tenant_id , t1.tenant_app_id , t2.shop_id , ifnull ( t2.employee_user_id , ifnull ( t1.employee_user_id , 0 ) ) as employee_user_id , t2.grade_erp_id , t1.user_id as userid , t1.member_user_id as memberuserid , '' as shopname , '' as employeeusername , t1.user_name as username , t1.mobile_no as mobileno , t1.age , t1.sex , date_format ( t1.birthday , '%y-%m-%d' ) as birthday , t1.birthday_is_lunar as birthdayislunar , t1.memorial_name as memorialname , date_format ( t1.memorial_day , '%y-%m-%d' ) as memorialday , t1.memorial_day_is_lunar as memorialdayislunar , t1.source_type as sourcetype , t1.identity , t1.subscribe_flag as subscribeflag , t1.bind_flag as bindflag , t1.full_flag as fullflag , t1.cancel_flag as cancelflag , '' as gradename , t2.sales_balance as salesbalance , t2.sales_amount as salesamount , t2.consumption_integral as consumptionintegral , t2.cumulation , t2.balance , t2.service_amount as serviceamount , t2.last_service_time as lastservicetime , ifnull ( t2.registe_time , if ( t1.user_id is null and t1.member_user_id is not null , t1.create_time , null ) ) as registetime , t2.first_shop_time as firstshoptime , t2.last_shop_time as lastshoptime , t2.first_sales_time as firstsalestime , t2.last_sales_time as lastsalestime , t2.last_login_time as lastlogintime , t2.last_score_time as lastscoretime , t2.follow_time as followtime , t2.cancel_follow_time as cancelfollowtime , t2.bind_time as bindtime , t2.category_name as categoryname from statistic.member t1 join statistic.member_extra t2 on t1.id = t2.id join tag_service.label_vip_match_914339923195113472_914647604141285376 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and t2.tenant_id = :3 and t2.tenant_app_id = :4 and lvm.member_identity in ( :5 , :6 , :7 , :8 , :9 ) and lvm.new_or_old in ( :10 )|1|2|2||0|0|148206|148206|0|0|
|tag_service|select id , tenant_app_id , shop_id , vip_id , vip_source , member_grade , sex , new_or_old , lifecycle , animal_born , constellation , month_birth , age_group , months_initiation , month_lately_consume , frequency_total_consume , amount_total_consume , total_integral , usable_integral , member_identity , member_source , year_initiation , lately_month_birth , subscribe_state , bind_state , perfect_data_state , memorial_day , member_anniversary , member_shop , last_product_category , last_sale_balance , last_stone_weight , last_gold_weight , customer_type , customer_character , shape , skin_color , face_type , affective_state , preference , accepted_info_type , estimated_consumption_capacity , maintain_level , buy_purpose , intent_product , price_area , enter_shop_need from tag_service.label_vip_match_814640285408600064_814650677526577152 where vip_id = :1|1|1|1||0|0|61574|61574|1|1|
|gift_mail|select * from ( select p.* , sp.take_type , ifnull ( pp.integral_price , ifnull ( ( select min ( inventory.price ) from inventory where inventory.product_id = p.id ) , :1 ) ) as price , ifnull ( t.quantity , :2 ) quantity , pt.partner_name vendorname , 0.0 distance , c.categroy_name categroy_name , pp.partner_id partner_id from product p inner join category c on c.id = p.category_id left outer join self_product sp on p.id = sp.product_id left outer join partner_product pp on p.id = pp.product_id left outer join partner pt on pt.id = pp.partner_id left outer join ( select product_id , sum ( quantity ) quantity from gift_mail.inventory group by product_id ) t on p.id = t.product_id where ( ( p.is_disable is null or p.is_disable = :3 ) ) ) as p left outer join product_status ps on p.id = ps.product_id where ( p.product_status = :4 and p.tenant_id = :5 and ( ps.tenant_wechatapp_id = :6 or p.product_type = :7 ) ) order by p.volume desc , p.id desc limit :8 , :9|1|1|1||0|0|8308|8308|3|3|
|statistic|select tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , sum ( tmp.cancel_amount ) cancel_amount , sum ( tmp.full_amount ) full_amount , sum ( tmp.bind_amount ) bind_amount , sum ( tmp.subscribe_amount ) subscribe_amount from ( select t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , t.cancel_amount , t.full_amount , t.bind_amount , t.subscribe_amount from ( select mb.tenant_id , mb.tenant_app_id , mb.shop_id , sum ( if ( mb.subscribe_flag = 0 , 1 , 0 ) ) cancel_amount , sum ( if ( mb.subscribe_flag = 1 , 1 , 0 ) ) subscribe_amount , sum ( if ( mb.bind_flag = 1 , 1 , 0 ) ) bind_amount , sum ( if ( mb.full_flag = 1 , 1 , 0 ) ) full_amount from statistic.member mb where mb.tenant_app_id = :1 and mb.create_time between :2 and :3 and mb.register_flag = :4 group by mb.tenant_id , mb.tenant_app_id , mb.shop_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and ( t.shop_id = os.dept_erp_id or t.shop_id = os.shop_id ) ) tmp group by tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name|1|2|2||0|0|207127|207127|21|21|
|tag_service|delete from tag_service.label_vip_match_817878088380628992_836466365488484352 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_817878088380628992_836466365488484352 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|68488|68488|0|0|
|user_service|select count ( 0 ) from tenant_user tenantuser join user user on tenantuser.user_id = user.id where ( tenantuser.tenant_app_id = :1 and tenantuser.user_id not 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 ) and ( user.nick_name like concat ( :107 , :108 , :109 ) or tenantuser.mobile_no = :110 ) )|1|2|2||0|0|99693|99693|1|1|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.redpack_amount ) redpack_amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.redpack_amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , sum ( ifnull ( redpack_amount , 0 ) ) redpack_amount from statistic.erp_sales_476787156229165056 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and redpack_date = date_format ( :6 , :7 ) group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|529786|529786|0|0|
|tag_service|delete from tag_service.label_vip_match_818707624273952768_818711793240154112 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_818707624273952768_818711793240154112 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|1|1||0|0|72787|72787|0|0|
|tag_service|delete from tag_service.label_vip_match_816450513213112320_816469819577647104 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_816450513213112320_816469819577647104 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|1|1||0|0|24992|24992|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_488003299602206720 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|134385|134385|28|28|
|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 , create_time as createtime , date_add ( create_time , interval add_days day ) , date_add ( create_time , interval add_days + keeping_days day ) from value_added_user where keeping_days > :1 and state = :2 and create_time >= date_add ( curdate ( ) , interval :3 * ( add_days-1 ) day ) and create_time < date_add ( curdate ( ) , interval ( :4 * ( add_days-1 ) :5 :6 ) day )|1|1|1||0|0|143242|143242|583|583|
|employee|select * from backlog where tenant_app_id = :1 and user_id = :2 and status in ( :3 , :4 ) and scene = :5 and expire_time >= :6 order by create_time desc limit :7 , :8|1|3|3||0|0|90593|90593|7|7|
|tag_service|delete from tag_service.label_vip_match_482207042405273600_482480185988485120 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_482207042405273600_482480185988485120 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|1|1||0|0|53040|53040|0|0|
|tag_service|insert into tag_service.member_statistic_07f5eb822862aa6f70831ad6c533cdaa select t1.id , t1.tenant_id , t1.tenant_app_id , t2.shop_id , ifnull ( t2.employee_user_id , ifnull ( t1.employee_user_id , 0 ) ) as employee_user_id , t2.grade_erp_id , t1.user_id as userid , t1.member_user_id as memberuserid , '' as shopname , '' as employeeusername , t1.user_name as username , t1.mobile_no as mobileno , t1.age , t1.sex , date_format ( t1.birthday , '%y-%m-%d' ) as birthday , t1.birthday_is_lunar as birthdayislunar , t1.memorial_name as memorialname , date_format ( t1.memorial_day , '%y-%m-%d' ) as memorialday , t1.memorial_day_is_lunar as memorialdayislunar , t1.source_type as sourcetype , t1.identity , t1.subscribe_flag as subscribeflag , t1.bind_flag as bindflag , t1.full_flag as fullflag , t1.cancel_flag as cancelflag , '' as gradename , t2.sales_balance as salesbalance , t2.sales_amount as salesamount , t2.consumption_integral as consumptionintegral , t2.cumulation , t2.balance , t2.service_amount as serviceamount , t2.last_service_time as lastservicetime , ifnull ( t2.registe_time , if ( t1.user_id is null and t1.member_user_id is not null , t1.create_time , null ) ) as registetime , t2.first_shop_time as firstshoptime , t2.last_shop_time as lastshoptime , t2.first_sales_time as firstsalestime , t2.last_sales_time as lastsalestime , t2.last_login_time as lastlogintime , t2.last_score_time as lastscoretime , t2.follow_time as followtime , t2.cancel_follow_time as cancelfollowtime , t2.bind_time as bindtime , t2.category_name as categoryname from statistic.member t1 join statistic.member_extra t2 on t1.id = t2.id join tag_service.label_vip_match_885278795660111872_885279553956712448 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and t2.tenant_id = :3 and t2.tenant_app_id = :4 and lvm.member_identity in ( :5 , :6 , :7 , :8 , :9 ) and lvm.new_or_old in ( :10 )|1|3|3||0|0|366390|366390|0|0|
|tag_service|select id , tenant_app_id , shop_id , vip_id , vip_source , member_grade , sex , new_or_old , lifecycle , animal_born , constellation , month_birth , age_group , months_initiation , month_lately_consume , frequency_total_consume , amount_total_consume , total_integral , usable_integral , member_identity , member_source , year_initiation , lately_month_birth , subscribe_state , bind_state , perfect_data_state , memorial_day , member_anniversary , member_shop , last_product_category , last_sale_balance , last_stone_weight , last_gold_weight , customer_type , customer_character , shape , skin_color , face_type , affective_state , preference , accepted_info_type , estimated_consumption_capacity , maintain_level , buy_purpose , intent_product , price_area , enter_shop_need from tag_service.label_vip_match_476787156229165056_476788488201703424 where vip_id = :1|1|4|4||0|0|332517|332517|1|1|
|tag_service|insert into tag_service.label_vip_match_486900027235635200_486927024615723008 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_486900027235635200_486927024615723008 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|2|2||0|0|99066|99066|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_885418658174709760 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|1|1||0|0|99556|99556|0|0|
|tag_service|delete from tag_service.label_vip_match_816869802005020672_816875333662851072 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_816869802005020672_816875333662851072 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|1|1||0|0|50378|50378|0|0|
|tag_service|delete from tag_service.label_vip_match_821174502091165696_821180732360658944 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_821174502091165696_821180732360658944 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|63952|63952|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_487569764496052224 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|4|4||0|0|114375|114375|0|0|
|tag_service|delete from tag_service.label_vip_match_476787156229165056_864729529476812800 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_476787156229165056_864729529476812800 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|79001|79001|0|0|
|statistic|select sd.product_barcode , ifnull ( es.amount , 0 ) amount , sd.tenant_app_id , es.sales_date , es.dept_erp_id , sd.tenant_id , ifnull ( sd.statistic_date , es.sales_date ) statistic_date from ( select tenant_id , tenant_app_id , sales_erp_id , product_barcode , date_format ( create_time , '%y-%m-%d' ) statistic_date from statistic.erp_sales_detail_839295151019966464 where tenant_app_id = :1 and create_time >= :2 and create_time <= :3 and sales_type = :4 and sales_status = :5 ) sd inner join ( select tenant_id , tenant_app_id , sales_erp_id , amount , sales_date , dept_erp_id from statistic.erp_sales_839295151019966464 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|1|1|1||0|0|9386|9386|0|0|
|tag_service|delete from tag_service.label_vip_match_817878088380628992_817882331640545280 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_817878088380628992_817882331640545280 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|70738|70738|0|0|
|sms|select sum ( ifnull ( send_count , 1 ) ) amount from sms_send where code like :1 and date_format ( create_time , :2 ) = :3 and tenant_id = :4 and tenant_app_id = :5|1|2|2||0|0|3814|3814|1|1|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_490810080325931008 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|74150|74150|13|13|
|tag_service|delete from tag_service.label_vip_match_876595466006016000_876596932347273216 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_876595466006016000_876596932347273216 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|78721|78721|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_823688108565368832 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|17|17||0|0|1096116|1096116|0|0|
|statistic|select count ( 0 ) from backlog where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and user_name > :4 and shop_name > :5|1|1|1||0|0|1435345|1435345|1|1|
|platform|select s.* , ifnull ( pc.certsquantity , 0 ) as certsquantity , ifnull ( va.addvaluequantity , 0 ) as addvaluequantity from ( /*昨天的销售记录*/ select eid , vendorid , sid , count ( 1 ) as salesquantity from saleslog sl where vendorid = :1 and to_days ( :2 ) :3 to_days ( salesdate ) = :4 group by eid , vendorid , sid ) s left join ( /*昨天质保单*/ select eid , count ( 1 ) as certsquantity from productcerts where vendorid = :5 and to_days ( :6 ) :7 to_days ( createtime ) = :8 group by eid ) pc on s.eid = pc.eid left join ( /*昨天的增值计划*/ select empid , count ( 1 ) as addvaluequantity from valueaddedlog where vendorid = :9 and to_days ( :10 ) :11 to_days ( createtime ) = :12 group by empid ) va on va.empid = s.eid|1|2|2||0|0|45585|45585|0|0|
|platform|select count ( 1 ) from `smssent` where vendorid = :1 and success = true and date_sub ( date ( :2 ) , interval :3 day ) = date_format ( senttime , :4 )|1|3|3||0|0|66068|66068|1|1|
|tag_service|insert into tag_service.label_vip_match_818623050667823104_818630542999207936 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_818623050667823104_818630542999207936 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|1|1||0|0|81681|81681|0|0|
|activity_service|select count ( distinct ( user_id ) ) from user_trace where tenant_app_id = :1 and activity_id = :2 and status != :3|1|1|1||0|0|8985|8985|1|1|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_816096827580399616 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|2|2||0|0|168323|168323|0|0|
|tag_service|insert into tag_service.label_vip_match_471320523331211264_471366425118904320 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_471320523331211264_471366425118904320 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|1|1||0|0|54245|54245|0|0|
|platform|select `vendorid` , `memberid` , `salesdate` , `noteid` , `noteno` , `empid` , `empname` , `amounttotal` , `quantitytotal` , `integraltotal` , `salesstoreid` , `staffattitude` , `professionallevel` , `appearance` , `storeimage` , `productdisplay` , `salescomment` , `commenttime` , `replycontent` , `replytime` , `replyuser` , `tipfee` , `tipmorderid` , `tippayno` , `tippaytime` , `status` , `aftersalesremark` , `uid` , `eid` , `sid` , `id` from `saleslog` where vendorid = :1 and tipfee > :2 and tippayno is not null and date_sub ( date ( :3 ) , interval :4 day ) = date_format ( tippaytime , :5 )|1|6|6||0|0|120774|120774|0|0|
|platform|select `vendorid` , `memberid` , `salesdate` , `noteid` , `noteno` , `empid` , `empname` , `amounttotal` , `quantitytotal` , `integraltotal` , `salesstoreid` , `staffattitude` , `professionallevel` , `appearance` , `storeimage` , `productdisplay` , `salescomment` , `commenttime` , `replycontent` , `replytime` , `replyuser` , `tipfee` , `tipmorderid` , `tippayno` , `tippaytime` , `status` , `aftersalesremark` , `uid` , `eid` , `sid` , `id` from `saleslog` where vendorid = :1 and status = :2 and date_sub ( curdate ( ) , interval :3 day ) = date_format ( salesdate , :4 )|1|6|6||0|0|120774|120774|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_836363095600320512 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|1|1||0|0|128178|128178|2|2|
|gift_mail|select count ( 0 ) from ( select p.* , sp.take_type , ifnull ( pp.integral_price , ifnull ( ( select min ( inventory.price ) from inventory where inventory.product_id = p.id ) , :1 ) ) as price , ifnull ( t.quantity , :2 ) quantity , pt.partner_name vendorname , 0.0 distance , c.categroy_name categroy_name , pp.partner_id partner_id from product p inner join category c on c.id = p.category_id left outer join self_product sp on p.id = sp.product_id left outer join partner_product pp on p.id = pp.product_id left outer join partner pt on pt.id = pp.partner_id left outer join ( select product_id , sum ( quantity ) quantity from gift_mail.inventory group by product_id ) t on p.id = t.product_id where ( ( p.is_disable is null or p.is_disable = :3 ) ) ) as p left outer join product_status ps on p.id = ps.product_id where ( p.product_status = :4 and p.tenant_id = :5 and ( ps.tenant_wechatapp_id = :6 or p.product_type = :7 ) )|2|2|1||0|0|15386|8290|2|1|
|tag_service|delete from tag_service.label_vip_match_476787156229165056_476788488201703424 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_476787156229165056_476788488201703424 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|27|19||0|0|1329860|664940|0|0|
|tag_service|delete from tag_service.label_vip_match_822257848045047808_822262919524818944 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_822257848045047808_822262919524818944 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|25|17||0|0|1392449|696229|0|0|
|tag_service|delete from tag_service.label_vip_match_471320523331211264_471366425118904320 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_471320523331211264_471366425118904320 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|5|3||0|0|216664|108334|0|0|
|statistic|select eu.tenant_id , eu.tenant_wechatapp_id , eu.employee_erp_id , eu.user_id , ifnull ( ee.employee_name , tu.user_name ) user_name from tenant.employee_user eu left join tenant.erp_employee ee on eu.tenant_id = ee.tenant_id and eu.employee_erp_id = ee.employee_erp_id left join user_service.tenant_user tu on eu.tenant_wechatapp_id = tu.tenant_app_id and eu.user_id = tu.user_id limit :1 offset :2|2|5|4||0|0|47208|27542|6967|5000|
|tag_service|delete from tag_service.label_vip_match_836363095600320512_836442940199964672 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_836363095600320512_836442940199964672 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|17|10||0|0|1270428|635276|0|0|
|coupon_service|select id , tenant_id , tenant_wechatapp_id , coupon_template_id , coupon_no , coupon_state , owner_id , creator_id , creator_mobile_no , creator_name , user_name , mobile_no , create_channel , coupon_name , face_value , coupon_type , use_threshold , begin_time , end_time , remark , create_time , update_time , product_name , exchange_shop , channel_id , writeoff_user_id , off_type from coupon_user where coupon_template_id = :1 and owner_id = :2|2|6|5||0|0|871202|435738|184|184|
|gift_mail|select t.* , tt.can_take_date , tt.shop_name , tt.take_shop_name , tt.take_employee_name , ta.recipients , ta.user_tel , concat ( ta.area , ta.address ) address , if ( t.trade_type = 3 , pl.id , it.barcode ) as barcode , if ( t.trade_type = 3 , pl.default_image_url , p.default_image_url ) as defaultimageurl from trade t left outer join trade_take tt on tt.trade_id = t.id left outer join trade_addr ta on ta.trade_id = t.id left outer join product p on p.id = t.product_id left outer join platform_product pl on pl.id = t.product_id left outer join inventory it on it.product_id = t.product_id and it.specification = t.specification where ( t.tenant_wechatapp_id = :1 ) order by create_time desc limit :2|2|7|4||0|0|30920|15700|40|20|
|tag_service|insert into tag_service.label_vip_match_822257848045047808_822262919524818944 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_822257848045047808_822262919524818944 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|6|4||0|0|696499|348389|0|0|
|tag_service|delete from tag_service.label_vip_match_823688108565368832_823695523771879424 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_823688108565368832_823695523771879424 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|20|14||0|0|1194663|597335|0|0|
|tag_service|insert into tag_service.label_vip_match_885278795660111872_885279553956712448 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_885278795660111872_885279553956712448 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|5|3||0|0|692482|346886|0|0|
|activity_service|select ut.id , ut.user_name , ut.mobile_no , ut.data userheadimg , at.activity_name , ut.create_time from activity_service.user_trace ut left join activity_service.activity at on ut.activity_id = at.id where ut.step = :1 and ut.activity_id = :2 order by ut.create_time desc limit :3|2|8|4||0|0|1353590|676827|2|1|
|statistic|select t.statistic_date , t.tenant_id , t.tenant_app_id , t.src_type , t.page_id , t.business_name , count ( * ) push_amount from ( select date_format ( push_time , '%y-%m-%d' ) statistic_date , tenant_id , tenant_app_id , src_type , page_id , business_name from statistic.gift_pack where tenant_app_id = :1 and push_time >= :2 and push_time <= :3 ) t group by t.statistic_date , t.tenant_id , t.tenant_app_id , t.src_type , t.page_id , t.business_name limit :4 offset :5|2|7|6||0|0|1309668|655065|0|0|
|tag_service|delete from tag_service.label_vip_match_814019237554196480_814024519298617344 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_814019237554196480_814024519298617344 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|5|4||0|0|191013|95507|0|0|
|tag_service|delete from tag_service.label_vip_match_817517269994225664_817536856118829056 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_817517269994225664_817536856118829056 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|4|3||0|0|210258|105130|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_817517269994225664 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|2|3|2||0|0|48687|41150|31|24|
|statistic|select count ( 0 ) from ( select mb.member_user_id memberuserid , mb.user_name username , mb.mobile_no mobileno , mb.age , mb.sex sex , mb.status status , mb.birthday birthday , mb.memorial_name memorialname , mb.memorial_day memorialday , mb.source_type sourcetype , mb.identity , if ( mt.grade_erp_id is null , '无' , gd.grade_name ) gradename , mt.sales_balance salesbalance , mt.sales_amount salesamount , mt.consumption_integral consumptionintegral , mt.cumulation cumulation , mt.balance balance , mt.service_amount serviceamount , mt.registe_time registetime , mt.first_shop_time firstshoptime , mt.last_shop_time lastshoptime , mt.first_sales_time firstsalestime , mt.last_sales_time lastsalestime , mt.last_login_time lastlogintime , mt.follow_time followtime , mt.cancel_follow_time cancelfollowtime , mt.bind_time bindtime , mt.last_service_time lastservicetime , mt.category_name categoryname , tw.brand_name tenantappname , mb.cancel_flag cancelflag , mb.subscribe_flag subscribeflag , mb.bind_flag bindflag , mb.full_flag fullflag , ifnull ( os.shop_name , '未知' ) shop_name , if ( oe.employee_user_id = '-1' or oe.employee_user_id is null , :1 , oe.employee_user_name ) employee_user_name from statistic.member mb left join statistic.member_extra mt on mb.id = mt.id left join statistic.tenant_wechatapp tw on mb.tenant_app_id = tw.id left join statistic.grade gd on mt.tenant_id = gd.tenant_id and mt.grade_erp_id = gd.grade_erp_id left join statistic.off_shop os on mt.tenant_app_id = os.tenant_app_id and ( mt.shop_id = os.shop_id or mt.shop_id = os.dept_erp_id ) left join statistic.off_employee oe on mt.tenant_app_id = oe.tenant_app_id and ( mt.employee_user_id = oe.employee_erp_id or mt.employee_user_id = oe.employee_user_id ) where mb.tenant_id = :2 and mb.tenant_app_id = :3 and mb.create_time >= :4 and mb.create_time <= :5 and mb.register_flag = :6 ) tmp_count|2|10|5||0|0|439840|219920|2|1|
|tag_service|delete from tag_service.label_vip_match_834615931371048960_836444994523926528 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_834615931371048960_836444994523926528 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|4|3||0|0|236690|118346|0|0|
|user_service|select count ( 0 ) from user_employee ue join tenant_user tu on ue.user_id = tu.user_id and tu.tenant_id = :1 and tu.tenant_app_id = :2 join user u on tu.user_id = u.id where ue.employee_user_id = :3 and ue.tenant_id = :4 and tenant_app_id = :5|2|3|2||0|0|53097|29787|2|1|
|tag_service|delete from tag_service.label_vip_match_914339923195113472_914647604141285376 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_914339923195113472_914647604141285376 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|2|1||0|0|197565|98783|0|0|
|tag_service|delete from tag_service.label_vip_match_818623050667823104_818630542999207936 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_818623050667823104_818630542999207936 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|5|3||0|0|326435|163221|0|0|
|tag_service|select count ( * ) from tag_service.label_vip_match_885278795660111872_885279553956712448 lvm where :1 = :2 and lvm.member_identity in ( :3 , :4 , :5 , :6 , :7 ) and lvm.lifecycle in ( :8 )|2|8|5||0|0|345994|311559|2|1|
|tag_service|insert into tag_service.label_vip_match_823688108565368832_823695523771879424 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_823688108565368832_823695523771879424 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|5|3||0|0|597729|299065|0|0|
|tag_service|delete from tag_service.label_vip_match_882402759662481408_882404155665268736 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_882402759662481408_882404155665268736 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|3|2||0|0|279382|139692|0|0|
|statistic|select t.shop_id id , t.shop_name name , t.totalamount , t.finishamount , t.finish_rate finishrate from ( select ec.shop_id , ec.shop_name , ec.totalamount , ec.finishamount , if ( ec.totalamount = 0 , 100 , round ( ec.finishamount*100/ec.totalamount , 2 ) ) finish_rate from ( select shop_id , shop_name , sum ( total_amount ) totalamount , sum ( finish_amount ) finishamount from result_employee_task where tenant_id = :1 and tenant_app_id = :2 and expire_date between :3 and :4 and shop_id != :5 and user_id != :6 group by shop_id , shop_name ) ec ) t order by t.finish_rate desc|2|2|1||0|0|32976|19987|10|7|
|tag_service|delete from tag_service.label_vip_match_830220893509701632_830221803765940224 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_830220893509701632_830221803765940224 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|9|6||0|0|575732|287868|0|0|
|tag_service|delete from tag_service.label_vip_match_899878776672923648_902701957964152832 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_899878776672923648_902701957964152832 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|2|1||0|0|187433|93719|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_476787156229165056 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|2|10|8||0|0|591801|530262|76|68|
|tag_service|delete from tag_service.label_vip_match_814640285408600064_814650677526577152 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_814640285408600064_814650677526577152 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|3|2||0|0|246225|123113|0|0|
|tag_service|select count ( * ) from tag_service.label_vip_match_885278795660111872_885279553956712448 lvm where :1 = :2 and lvm.frequency_total_consume in ( :3 , :4 , :5 , :6 , :7 ) and lvm.member_identity in ( :8 )|2|5|4||0|0|300537|261927|2|1|
|tag_service|select id , tenant_app_id , shop_id , vip_id , vip_source , member_grade , sex , new_or_old , lifecycle , animal_born , constellation , month_birth , age_group , months_initiation , month_lately_consume , frequency_total_consume , amount_total_consume , total_integral , usable_integral , member_identity , member_source , year_initiation , lately_month_birth , subscribe_state , bind_state , perfect_data_state , memorial_day , member_anniversary , member_shop , last_product_category , last_sale_balance , last_stone_weight , last_gold_weight , customer_type , customer_character , shape , skin_color , face_type , affective_state , preference , accepted_info_type , estimated_consumption_capacity , maintain_level , buy_purpose , intent_product , price_area , enter_shop_need from tag_service.label_vip_match_891434732540272640_891435946115981312 where vip_id = :1|2|2|1||0|0|145030|72515|2|1|
|gift_mail|select count ( 0 ) from ( select t.* , tt.can_take_date , tt.shop_name , tt.take_shop_name , tt.take_employee_name , ta.recipients , ta.user_tel , concat ( ta.area , ta.address ) address , if ( t.trade_type = 3 , pl.id , it.barcode ) as barcode , if ( t.trade_type = 3 , pl.default_image_url , p.default_image_url ) as defaultimageurl from trade t left outer join trade_take tt on tt.trade_id = t.id left outer join trade_addr ta on ta.trade_id = t.id left outer join product p on p.id = t.product_id left outer join platform_product pl on pl.id = t.product_id left outer join inventory it on it.product_id = t.product_id and it.specification = t.specification where ( t.tenant_wechatapp_id = :1 ) order by create_time desc ) tmp_count|2|4|2||0|0|28379|14383|2|1|
|statistic|select bu.tenant_app_id , bu.user_id , count ( 1 ) order_amount from statistic.base_order_user bu left join statistic.order_info od on bu.tenant_app_id = od.tenant_app_id and bu.user_id = od.user_id where bu.tenant_app_id = :1 and od.status in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 ) group by bu.tenant_app_id , bu.user_id|2|2|1||0|0|77680|38843|4|3|
|tag_service|delete from tag_service.label_vip_match_823844580729339904_823856782299402240 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_823844580729339904_823856782299402240 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|16|10||0|0|1117447|558735|0|0|
|tag_service|delete from tag_service.label_vip_match_480726380749918208_480728003618410496 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_480726380749918208_480728003618410496 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|15|12||0|0|738546|369292|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_486900027235635200 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|2|4|2||0|0|141038|121713|0|0|
|statistic|select max ( statistic_date ) enddate from result_shop_status where tenant_id = :1 and tenant_app_id = :2 group by tenant_id|2|5|3||0|0|328438|164219|2|1|
|tag_service|delete from tag_service.label_vip_match_486900027235635200_486927024615723008 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_486900027235635200_486927024615723008 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|6|4||0|0|395808|197904|0|0|
|tag_service|delete from tag_service.label_vip_match_828766757295529984_828828072282198016 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_828766757295529984_828828072282198016 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|4|3||0|0|238115|119071|0|0|
|tag_service|delete from tag_service.label_vip_match_487569764496052224_487577238854832128 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_487569764496052224_487577238854832128 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|9|7||0|0|501332|250674|0|0|
|statistic|select sd.product_barcode , ifnull ( es.amount , 0 ) amount , sd.tenant_app_id , es.sales_date , es.dept_erp_id , sd.tenant_id , ifnull ( sd.statistic_date , es.sales_date ) statistic_date from ( select tenant_id , tenant_app_id , sales_erp_id , product_barcode , date_format ( create_time , '%y-%m-%d' ) statistic_date from statistic.erp_sales_detail_817517269994225664 where tenant_app_id = :1 and create_time >= :2 and create_time <= :3 and sales_type = :4 and sales_status = :5 ) sd inner join ( select tenant_id , tenant_app_id , sales_erp_id , amount , sales_date , dept_erp_id from statistic.erp_sales_817517269994225664 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|2|4|3||0|0|54147|41190|0|0|
|activity_service|select id , tenant_id , tenant_wechatapp_id , activity_id , acitivity_type , user_id , qualified_id , page_id , scene_type , scene_biz_id , create_time , update_time from activity_gift_grant where activity_id = :1 and acitivity_type = :2 and user_id = :3 and scene_type = :4|2|3|2||0|0|277280|138640|0|0|
|tag_service|delete from tag_service.label_vip_match_827516559562940416_827519836937560064 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_827516559562940416_827519836937560064 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|17|12||0|0|1044322|522162|0|0|
|gift_mail|select * from ( select p.* , sp.take_type , ifnull ( pp.integral_price , ifnull ( ( select min ( inventory.price ) from inventory where inventory.product_id = p.id ) , :1 ) ) as price , ifnull ( t.quantity , :2 ) quantity , pt.partner_name vendorname , 0.0 distance , c.categroy_name categroy_name , pp.partner_id partner_id from product p inner join category c on c.id = p.category_id left outer join self_product sp on p.id = sp.product_id left outer join partner_product pp on p.id = pp.product_id left outer join partner pt on pt.id = pp.partner_id left outer join ( select product_id , sum ( quantity ) quantity from gift_mail.inventory group by product_id ) t on p.id = t.product_id where ( ( p.is_disable is null or p.is_disable = :3 ) ) ) as p left outer join product_status ps on p.id = ps.product_id where ( p.product_status = :4 and p.tenant_id = :5 and ( ps.tenant_wechatapp_id = :6 or p.product_type = :7 ) ) order by p.volume desc , p.id desc limit :8|2|2|1||0|0|16725|8387|12|6|
|tag_service|delete from tag_service.label_vip_match_907400816212623360_907482231063232512 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_907400816212623360_907482231063232512 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|5|3||0|0|503850|251930|0|0|
|tag_service|insert into tag_service.label_vip_match_488003299602206720_488032253511864320 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_488003299602206720_488032253511864320 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|4|3||0|0|405742|202926|0|0|
|tag_service|insert into tag_service.label_vip_match_826954007829331968_826973052054052864 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_826954007829331968_826973052054052864 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|3|2||0|0|536478|268245|0|0|
|tag_service|insert into tag_service.label_vip_match_476787156229165056_476788488201703424 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_476787156229165056_476788488201703424 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|6|4||0|0|665131|332671|0|0|
|tag_service|delete from tag_service.label_vip_match_816096827580399616_816103866541051904 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_816096827580399616_816103866541051904 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|3|2||0|0|225140|112570|0|0|
|tag_service|delete from tag_service.label_vip_match_885278795660111872_885279553956712448 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_885278795660111872_885279553956712448 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|15|8||0|0|1382432|691240|0|0|
|tag_service|insert into tag_service.label_vip_match_823844580729339904_823856782299402240 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_823844580729339904_823856782299402240 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|3|2||0|0|559085|279729|0|0|
|tag_service|insert into tag_service.label_vip_match_827516559562940416_827519836937560064 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_827516559562940416_827519836937560064 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|4|3||0|0|522569|261489|0|0|
|tag_service|delete from tag_service.label_vip_match_490810080325931008_490828878219186176 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_490810080325931008_490828878219186176 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|6|4||0|0|564123|282063|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_816440425157005312 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|2|3|1||0|0|98081|67354|0|0|
|statistic|select t.tenant_id , t.tenant_app_id , t.coupon_id , if ( t.coupon_type = 4 , vt.template_name , ct.coupon_name ) coupon_name , t.statistic_date , t.create_channel , count ( 1 ) reservation_amount from ( select tenant_id , tenant_app_id , coupon_template_id coupon_id , create_channel , date_format ( create_time , '%y-%m-%d' ) statistic_date , coupon_type from statistic.coupon_user where tenant_app_id = :1 and collect_time >= :2 and collect_time <= :3 and reservation_shop_id > :4 ) t left join coupon_service.coupon_template ct on t.coupon_id = ct.id left join value_added.value_added_template vt on t.tenant_app_id = vt.tenant_wechatapp_id and t.coupon_id = vt.id group by t.tenant_id , t.tenant_app_id , t.coupon_id , ct.coupon_name , t.statistic_date , t.create_channel , t.coupon_type|2|3|1||0|0|870250|435217|0|0|
|statistic|select tmp.shopid id , tmp.shopname name , tmp.amount saleamount , tmp.addamount valueamount , tmp.addrate finishrate from ( select t.shop_id shopid , t.shop_name shopname , t.amount , t.addamount , if ( t.amount = 0 , 100 , round ( t.addamount*100/t.amount ) ) addrate , t.valueaddamount from ( select sd.shop_id , os.shop_name , sum ( finish_amount ) addamount , sum ( un_finish_amount ) +sum ( finish_amount ) amount , sum ( ifnull ( sd.value_add_amount , 0 ) ) valueaddamount from statistic.result_employee_value sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.shop_id = os.shop_id left join ( select ep.* from statistic.off_employee ep inner join ( select tenant_app_id , employee_user_id , max ( employee_erp_id ) employee_erp_id from statistic.off_employee group by tenant_app_id , employee_user_id ) dep on ep.tenant_app_id = dep.tenant_app_id and ep.employee_erp_id = dep.employee_erp_id and ep.employee_user_id = dep.employee_user_id ) oe on sd.tenant_app_id = oe.tenant_app_id and sd.user_id = oe.employee_user_id where sd.tenant_id = :1 and sd.shop_id != :2 and sd.user_id != :3 and sd.sales_date between :4 and :5 group by sd.shop_id , os.shop_name ) t ) tmp order by tmp.addrate desc|2|2|1||0|0|93252|46626|48|24|
|tag_service|delete from tag_service.label_vip_match_821229068421742592_821504909596737536 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_821229068421742592_821504909596737536 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|16|12||0|0|804307|402165|0|0|
|activity_service|select count ( 0 ) from activity_service.user_trace t1 join activity_service.activity t2 on t1.activity_id = t2.id where t1.status = :1 and t2.tenant_wechatapp_id = :2 and t2.activity_type = :3 and t1.step = :4|2|8|5||0|0|1362284|681146|2|1|
|tag_service|delete from tag_service.label_vip_match_469175049962786816_469178094259933184 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_469175049962786816_469178094259933184 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|6|3||0|0|75692|37846|0|0|
|tag_service|delete from tag_service.label_vip_match_826954007829331968_826973052054052864 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_826954007829331968_826973052054052864 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|16|10||0|0|1072932|536466|0|0|
|tag_service|delete from tag_service.label_vip_match_891434732540272640_891435946115981312 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_891434732540272640_891435946115981312 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|6|4||0|0|289943|144977|0|0|
|statistic|select tmp.tenant_id , tmp.tenant_app_id , tmp.grade_erp_id , tmp.grade_name , tmp.shop_id , tmp.shop_name , sum ( tmp.amount ) amount from ( select t.tenant_id , t.tenant_app_id , ifnull ( t.grade_erp_id , -1 ) grade_erp_id , if ( t.grade_erp_id is null , '无' , ifnull ( gd.grade_name , '' ) ) grade_name , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , t.amount from ( select mb.tenant_id , mb.tenant_app_id , mb.shop_id , mt.grade_erp_id , count ( * ) amount from statistic.member mb left join statistic.member_extra mt on mb.id = mt.id where mb.tenant_app_id = :1 and mb.create_time between :2 and :3 and mb.register_flag = :4 group by mb.tenant_id , mb.tenant_app_id , mb.shop_id , mt.grade_erp_id ) t left join statistic.grade gd on t.tenant_id = gd.tenant_id and t.grade_erp_id = gd.grade_erp_id left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and ( t.shop_id = os.dept_erp_id or t.shop_id = os.shop_id ) ) tmp group by tmp.tenant_id , tmp.tenant_app_id , tmp.grade_erp_id , tmp.grade_name , tmp.shop_id , tmp.shop_name|2|3|2||0|0|702059|354669|46|26|
|tag_service|insert into tag_service.label_vip_match_836363095600320512_836442940199964672 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_836363095600320512_836442940199964672 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|5|3||0|0|636372|318796|0|0|
|tag_service|delete from tag_service.label_vip_match_488003299602206720_488032253511864320 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_488003299602206720_488032253511864320 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|13|9||0|0|811277|405645|0|0|
|statistic|select ec.scene , ec.totalamount , ec.finishamount , if ( ec.totalamount = 0 , 100 , round ( ec.finishamount*100/ec.totalamount , 2 ) ) finishrate from ( select scene , sum ( total_amount ) totalamount , sum ( finish_amount ) finishamount from result_employee_task where tenant_id = :1 and tenant_app_id = :2 and expire_date between :3 and :4 and user_id != :5 and shop_name != :6 group by scene ) ec order by ec.scene|2|2|1||0|0|32976|19975|10|6|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_476787156229165056 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|2|29|26||0|0|1017594|921933|29|29|
|statistic|select es.tenant_wechatapp_id tenant_app_id , es.member_erp_id , ifnull ( sum ( es.amount ) , 0 ) salesbalance , count ( 1 ) salesamount from base_erp_member bm inner join tenant.erp_sales es on bm.tenant_app_id = es.tenant_wechatapp_id and bm.member_erp_id = es.member_erp_id where bm.tenant_app_id = :1 and es.sales_status = :2 group by es.tenant_wechatapp_id , es.member_erp_id limit :3 offset :4|3|5|2||0|0|16314|8626|568|260|
|statistic|select t.shop_id id , t.shop_name name , t.saleamount , t.waramount , t.finish_rate finishrate from ( select ec.shop_id , ec.shop_name , ec.saleamount , ec.waramount , if ( ec.saleamount = 0 , 100 , round ( ec.waramount*100/ec.saleamount , 2 ) ) finish_rate from ( select ec.shop_id , ec.shop_name , sum ( ec.sale_amount ) saleamount , sum ( ec.war_amount ) waramount from result_employee_warranty ec where ec.tenant_id = :1 and ec.shop_id != :2 and ec.tenant_app_id = :3 and ec.sales_date between :4 and :5 group by ec.shop_id , ec.shop_name ) ec ) t order by t.finish_rate desc|3|17|8||0|0|2893687|964565|4|2|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_835720547919761408 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|3|12|8||0|0|91643|45379|0|0|
|activity_service|select count ( 0 ) from ( select t2.user_name as username , t2.data as userheadimg , ifnull ( t1.finished_time , t1.update_time ) as time , t1.cutdown_amount as cutdownamount , t2.partake_data as partakedata from activity_service.cutdown_price_activity_apply t1 join activity_service.user_trace t2 on t1.id = t2.user_apply_id and t2.step = :1 where t1.activity_id = :2 ) table_count|3|3|1||0|0|113617|68991|3|1|
|platform|select vm.* from vendormember vm join member m on vm.id = m.vendormemberid and vm.vendorid = m.vendorid where m.employeeid = :1 and vm.vendorid = :2 and ( ( birthdaytype = :3 and month ( birthday ) = month ( date_sub ( curdate ( ) , interval :4 day ) ) and day ( birthday ) = day ( date_sub ( curdate ( ) , interval :5 day ) ) ) or ( birthdaytype = :6 and month ( birthday ) = month ( date_sub ( :7 , interval :8 day ) ) and day ( birthday ) = day ( date_sub ( :9 , interval :10 day ) ) ) )|3|6|3||0|0|89538|62521|32|26|
|statistic|select t.user_id id , t.user_name name , t.saleamount , t.waramount , t.finish_rate finishrate from ( select ec.user_id , ec.user_name , ec.saleamount , ec.waramount , if ( ec.saleamount = 0 , 100 , round ( ec.waramount*100/ec.saleamount , 2 ) ) finish_rate from ( select ec.user_id , ec.user_name , sum ( ec.sale_amount ) saleamount , sum ( ec.war_amount ) waramount from statistic.result_employee_warranty ec where ec.tenant_id = :1 and ec.shop_id = :2 and ec.user_id != :3 and ec.tenant_app_id = :4 and ec.sales_date between :5 and :6 group by ec.user_id , ec.user_name ) ec ) t order by t.finish_rate desc|3|18|9||0|0|2893707|964585|9|7|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_817878088380628992 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|3|9|3||0|0|261141|109444|0|0|
|activity_service|select count ( 0 ) from activity_service.user_trace ut left join activity_service.activity at on ut.activity_id = at.id where ut.step = :1 and ut.activity_id = :2|3|4|1||0|0|2030402|676826|3|1|
|statistic|select ue.tenant_wechatapp_id , ue.user_id , ifnull ( eu.user_id , ue.employee_erp_id ) employee_user_id , '2019-07-2223:59:59.0' update_time from user_service.user_employee ue left join tenant.employee_user eu on ue.tenant_wechatapp_id = eu.tenant_wechatapp_id and ue.employee_user_id = eu.id where ue.tenant_wechatapp_id = :1 and ue.update_time >= :2 and ue.update_time <= :3 limit :4 offset :5|3|4|1||0|0|107838|76235|554|530|
|statistic|select t.shop_id id , t.shop_name name , t.totalamount , t.finishamount , t.finish_rate finishrate from ( select ec.shop_id , ec.shop_name , ec.totalamount , ec.finishamount , if ( ec.totalamount = 0 , 100 , round ( ec.finishamount*100/ec.totalamount , 2 ) ) finish_rate from ( select shop_id , shop_name , sum ( total_amount ) totalamount , sum ( finish_amount ) finishamount from result_employee_task where tenant_id = :1 and expire_date between :2 and :3 and shop_id != :4 and user_id != :5 group by shop_id , shop_name ) ec ) t order by t.finish_rate desc|4|11|3||0|0|175675|44695|92|26|
|statistic|select t.shop_id id , t.shop_name name , t.saleamount , t.waramount , t.finish_rate finishrate from ( select ec.shop_id , ec.shop_name , ec.saleamount , ec.waramount , if ( ec.saleamount = 0 , 100 , round ( ec.waramount*100/ec.saleamount , 2 ) ) finish_rate from ( select ec.shop_id , ec.shop_name , sum ( ec.sale_amount ) saleamount , sum ( ec.war_amount ) waramount from result_employee_warranty ec where ec.tenant_id = :1 and ec.shop_id != :2 and ec.sales_date between :3 and :4 group by ec.shop_id , ec.shop_name ) ec ) t order by t.finish_rate desc|4|35|12||0|0|3858572|964653|86|24|
|tag_service|select id , tenant_app_id , shop_id , vip_id , vip_source , member_grade , sex , new_or_old , lifecycle , animal_born , constellation , month_birth , age_group , months_initiation , month_lately_consume , frequency_total_consume , amount_total_consume , total_integral , usable_integral , member_identity , member_source , year_initiation , lately_month_birth , subscribe_state , bind_state , perfect_data_state , memorial_day , member_anniversary , member_shop , last_product_category , last_sale_balance , last_stone_weight , last_gold_weight , customer_type , customer_character , shape , skin_color , face_type , affective_state , preference , accepted_info_type , estimated_consumption_capacity , maintain_level , buy_purpose , intent_product , price_area , enter_shop_need from tag_service.label_vip_match_480726380749918208_480728003618410496 where vip_id = :1|4|10|3||0|0|738808|184702|4|1|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_817517269994225664 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|4|10|5||0|0|173540|83045|4|3|
|statistic|select ec.scene , ec.totalamount , ec.finishamount , if ( ec.totalamount = 0 , 100 , round ( ec.finishamount*100/ec.totalamount , 2 ) ) finishrate from ( select scene , sum ( total_amount ) totalamount , sum ( finish_amount ) finishamount from result_employee_task where tenant_id = :1 and expire_date between :2 and :3 and user_id != :4 and shop_name != :5 group by scene ) ec order by ec.scene|4|11|3||0|0|175399|44615|23|6|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_822257848045047808 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|4|10|4||0|0|383976|312359|51|34|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_816450513213112320 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|4|6|2||0|0|145772|54797|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_814020764498956288 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|4|11|4||0|0|166843|76527|0|0|
|statistic|select max ( statistic_date ) enddate from result_shop_status where tenant_id = :1 group by tenant_id|4|11|3||0|0|656876|164219|4|1|
|tenant|select id , sales_no , sales_date , member_erp_id , sales_erp_id , is_sales from erp_sales where sales_no like concat ( :1 , :2 , :3 ) and sales_status = :4 and tenant_id = :5 and tenant_wechatapp_id = :6 order by sales_date desc limit :7|4|7|4||0|0|1548216|471046|0|0|
|activity_service|select t1.id , t1.tenant_app_id as tenantappid , t1.user_id as userid , t1.user_name as username , t1.mobile_no as mobileno , t1.user_apply_id as userapplyid , t1.step , t1.data , t1.partake_data as partakedata , t2.id as activityid , t2.activity_name as activityname , t2.activity_type as activitytype , t1.create_time as time from activity_service.user_trace t1 join activity_service.activity t2 on t1.activity_id = t2.id where t1.status = :1 and t2.tenant_wechatapp_id = :2 and t2.activity_type = :3 and t1.step = :4 order by t1.create_time desc limit :5|4|7|2||0|0|6815778|1703950|80|20|
|statistic|select el.tenant_wechatapp_id tenant_app_id , el.member_erp_id , ifnull ( sum ( if ( el.integral > 0 , el.integral , 0 ) ) , 0 ) cumulation , ifnull ( sum ( el.integral ) , 0 ) balance , max ( el.update_time ) lastscoretime from base_erp_member em inner join user_service.erp_integral_log el on em.tenant_app_id = el.tenant_wechatapp_id and em.member_erp_id = el.member_erp_id where em.tenant_app_id = :1 group by el.tenant_wechatapp_id , el.member_erp_id limit :2 offset :3|4|7|2||0|0|20173|6883|606|261|
|user_service|select count ( 0 ) from ( select t1.erp_member_id as membererpid , t2.head_img_url as headimgurl , t2.nick_name as nickname , t1.mobile_no as mobileno , date_format ( t1.bind_time , '%y-%m-%d%h:%i:%s' ) as registertime from tenant_user t1 join `user` t2 on t1.user_id = t2.id left join user_employee t3 on t1.user_id = t3.user_id and t1.tenant_id = t3.tenant_id and t1.tenant_app_id = t3.tenant_wechatapp_id where t3.id is null and t1.mobile_no is not null and t1.mobile_no != :1 and t1.erp_member_id is not null and t1.shop_id = :2 and t1.tenant_id = :3 and t1.tenant_app_id = :4 ) table_count|5|16|5||0|0|190836|58509|5|1|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_822257848045047808 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|5|48|21||0|0|1362656|1011409|5|5|
|statistic|select max ( statistic_date ) enddate from result_shop_grade where tenant_id = :1 group by tenant_id|5|29|8||0|0|2815265|563053|5|1|
|statistic|select max ( statistic_date ) enddate from result_shop_source where tenant_id = :1 group by tenant_id|5|27|7||0|0|2339610|467922|5|1|
|statistic|select max ( statistic_date ) enddate from result_shop_user where tenant_id = :1 and tenant_app_id = :2 group by tenant_id|5|52|14||0|0|13212900|2642580|5|1|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_469175049962786816 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|5|7|2||0|0|117694|35669|0|0|
|tag_service|select id , tenant_app_id , shop_id , vip_id , vip_source , member_grade , sex , new_or_old , lifecycle , animal_born , constellation , month_birth , age_group , months_initiation , month_lately_consume , frequency_total_consume , amount_total_consume , total_integral , usable_integral , member_identity , member_source , year_initiation , lately_month_birth , subscribe_state , bind_state , perfect_data_state , memorial_day , member_anniversary , member_shop , last_product_category , last_sale_balance , last_stone_weight , last_gold_weight , customer_type , customer_character , shape , skin_color , face_type , affective_state , preference , accepted_info_type , estimated_consumption_capacity , maintain_level , buy_purpose , intent_product , price_area , enter_shop_need from tag_service.label_vip_match_487569764496052224_487577238854832128 where vip_id = :1|6|11|2||0|0|756690|126115|5|1|
|platform|update vendormember vm inner join ( select sum ( integral ) as integral , sum ( if ( integral > 0 , integral , 0 ) ) as hisintegral from integrallog where vendorid = :1 and memberid = :2 and isdeleted = :3 ) s on :4 = :5 set vm.integral = ifnull ( s.integral , :6 ) , vm.hisintegral = ifnull ( s.hisintegral , :7 ) , vm.updatetime = now ( ) where vendorid = :8 and memberid = :9|6|10|3||0|0|1358|1293|0|0|
|user_service|select count ( * ) from tenant_user where tenant_app_id = :1 and shop_id = :2 and mobile_no is not null and mobile_no != :3|7|22|7||0|0|604222|144292|7|1|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_839295151019966464 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|7|19|6||0|0|400022|110732|0|0|
|bespoke|select count ( * ) from bespoke.bespoke_trade where user_id = :1 and tenant_app_id = :2 and status <> :3|7|11|3||0|0|197225|28175|7|1|
|statistic|select es.tenant_wechatapp_id tenant_app_id , es.member_erp_id , group_concat ( distinct sd.category_erp_id ) categoryid , group_concat ( distinct sd.category_name ) categoryname , min ( es.sales_date ) firstsalestime , max ( es.sales_date ) lastsalestime from base_erp_member bm inner join tenant.erp_sales es on bm.tenant_app_id = es.tenant_wechatapp_id and bm.member_erp_id = es.member_erp_id inner join tenant.erp_sales_detail sd on es.tenant_wechatapp_id = sd.tenant_wechatapp_id and es.sales_erp_id = sd.sales_erp_id where bm.tenant_app_id = :1 and sd.sales_type = :2 and es.sales_status = :3 group by es.tenant_wechatapp_id , es.member_erp_id limit :4 offset :5|7|24|9||0|0|176041|45483|854|259|
|account|select id , tenant_id , tenant_wechatapp_id , account_type , user_id , mch_billno , send_name , mch_id , sub_mch_id , wxappid , msgappid , re_openid , total_amount , total_num , wishing , client_ip , act_name , remark , scene_id , risk_info , consume_mch_id , send_time , order_status , failure_reason , biz_id , biz_type , biz_tag , send_listid , need_callback , create_time , update_time , user_name , mobile_no , receive_time , refund_amount , refund_time from wx_redpacket_send_order where order_status in ( :1 , :2 ) order by id desc|8|11|3||0|0|146141|18298|58|19|
|statistic|select count ( 0 ) from ( select tmp.shop_id shopid , tmp.shop_name shopname , tmp.sale_amount saleamount , tmp.war_amount waramount , tmp.warrate from ( select t.shop_id , t.shop_name , t.sale_amount , t.war_amount , if ( sale_amount = 0 , 0 , round ( t.war_amount*100/t.sale_amount , 2 ) ) warrate from ( select ec.shop_id , ec.shop_name , sum ( ifnull ( ec.sale_amount , 0 ) ) sale_amount , sum ( ifnull ( ec.war_amount , 0 ) ) war_amount from statistic.result_employee_warranty ec where ec.tenant_id = :1 and ec.shop_id != :2 and ec.user_name != :3 and ec.tenant_app_id = :4 group by ec.shop_id , ec.shop_name ) t ) tmp order by tmp.shop_name ) tmp_count|8|30|4||0|0|7716642|964605|8|1|
|statistic|select tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , sum ( tmp.cancel_amount ) cancel_amount , sum ( tmp.full_amount ) full_amount , sum ( tmp.bind_amount ) bind_amount , sum ( tmp.subscribe_amount ) subscribe_amount from ( select t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , t.cancel_amount , t.full_amount , t.bind_amount , t.subscribe_amount from ( select mb.tenant_id , mb.tenant_app_id , mt.shop_id , sum ( if ( mb.subscribe_flag = 0 , 1 , 0 ) ) cancel_amount , sum ( if ( mb.subscribe_flag = 1 , 1 , 0 ) ) subscribe_amount , sum ( if ( mb.bind_flag = 1 , 1 , 0 ) ) bind_amount , sum ( if ( mb.full_flag = 1 , 1 , 0 ) ) full_amount from statistic.member mb inner join statistic.member_extra mt on mb.id = mt.id where mb.tenant_app_id = :1 and mb.create_time <= :2 and mb.register_flag = :3 group by mb.tenant_id , mb.tenant_app_id , mt.shop_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and ( t.shop_id = os.dept_erp_id or t.shop_id = os.shop_id ) ) tmp group by tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name|9|18|4||0|0|5034511|668669|220|46|
|statistic|select tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.source_type , sum ( tmp.amount ) amount from ( select t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , t.source_type , t.amount from ( select mb.tenant_id , mb.tenant_app_id , mt.shop_id , mb.source_type , count ( * ) amount from statistic.member mb inner join statistic.member_extra mt on mb.id = mt.id where mb.tenant_app_id = :1 and mb.create_time <= :2 and mb.register_flag = :3 group by mb.tenant_id , mb.tenant_app_id , mt.shop_id , mb.source_type ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and ( t.shop_id = os.dept_erp_id or t.shop_id = os.shop_id ) ) tmp group by tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.source_type|9|16|4||0|0|5094452|681744|772|114|
|statistic|select max ( statistic_date ) enddate from result_shop_user where tenant_id = :1 group by tenant_id|10|84|20||0|0|26425800|2642580|10|1|
|tag_service|select id , tenant_app_id , shop_id , vip_id , vip_source , member_grade , sex , new_or_old , lifecycle , animal_born , constellation , month_birth , age_group , months_initiation , month_lately_consume , frequency_total_consume , amount_total_consume , total_integral , usable_integral , member_identity , member_source , year_initiation , lately_month_birth , subscribe_state , bind_state , perfect_data_state , memorial_day , member_anniversary , member_shop , last_product_category , last_sale_balance , last_stone_weight , last_gold_weight , customer_type , customer_character , shape , skin_color , face_type , affective_state , preference , accepted_info_type , estimated_consumption_capacity , maintain_level , buy_purpose , intent_product , price_area , enter_shop_need from tag_service.label_vip_match_821229068421742592_821504909596737536 where vip_id = :1|10|32|5||0|0|2012430|201243|7|1|
|tag_service|select id , tenant_app_id , shop_id , vip_id , vip_source , member_grade , sex , new_or_old , lifecycle , animal_born , constellation , month_birth , age_group , months_initiation , month_lately_consume , frequency_total_consume , amount_total_consume , total_integral , usable_integral , member_identity , member_source , year_initiation , lately_month_birth , subscribe_state , bind_state , perfect_data_state , memorial_day , member_anniversary , member_shop , last_product_category , last_sale_balance , last_stone_weight , last_gold_weight , customer_type , customer_character , shape , skin_color , face_type , affective_state , preference , accepted_info_type , estimated_consumption_capacity , maintain_level , buy_purpose , intent_product , price_area , enter_shop_need from tag_service.label_vip_match_823844580729339904_823856782299402240 where vip_id = :1|10|45|6||0|0|2794650|279465|9|1|
|tag_service|select id , tenant_app_id , shop_id , vip_id , vip_source , member_grade , sex , new_or_old , lifecycle , animal_born , constellation , month_birth , age_group , months_initiation , month_lately_consume , frequency_total_consume , amount_total_consume , total_integral , usable_integral , member_identity , member_source , year_initiation , lately_month_birth , subscribe_state , bind_state , perfect_data_state , memorial_day , member_anniversary , member_shop , last_product_category , last_sale_balance , last_stone_weight , last_gold_weight , customer_type , customer_character , shape , skin_color , face_type , affective_state , preference , accepted_info_type , estimated_consumption_capacity , maintain_level , buy_purpose , intent_product , price_area , enter_shop_need from tag_service.label_vip_match_885278795660111872_885279553956712448 where vip_id = :1|10|44|10||0|0|3459940|345994|8|1|
|coupon_service|select id as usercouponid , coupon_no as couponno , end_time as endtime , begin_time as begintime , face_value as facevalue , coupon_name as couponname , coupon_type as coupontype , remark , exchange_shop , off_type from coupon_user where owner_id = :1 and coupon_template_id = :2 and coupon_state = :3 and end_time > now ( ) limit :4|10|29|6||0|0|4294096|436454|6|1|
|statistic|select sum ( amount ) amount from result_shop_user where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and statistic_date = ( select max ( statistic_date ) from result_shop_user where tenant_id = :4 and tenant_app_id = :5 and shop_id = :6 and user_name > :7 group by shop_id )|11|64|15||0|0|29068768|2642674|11|1|
|tag_service|select id , tenant_app_id , shop_id , vip_id , vip_source , member_grade , sex , new_or_old , lifecycle , animal_born , constellation , month_birth , age_group , months_initiation , month_lately_consume , frequency_total_consume , amount_total_consume , total_integral , usable_integral , member_identity , member_source , year_initiation , lately_month_birth , subscribe_state , bind_state , perfect_data_state , memorial_day , member_anniversary , member_shop , last_product_category , last_sale_balance , last_stone_weight , last_gold_weight , customer_type , customer_character , shape , skin_color , face_type , affective_state , preference , accepted_info_type , estimated_consumption_capacity , maintain_level , buy_purpose , intent_product , price_area , enter_shop_need from tag_service.label_vip_match_836363095600320512_836442940199964672 where vip_id = :1|11|48|5||0|0|3496900|317900|11|1|
|statistic|select bg.id , bd.content , bd.create_time from employee.backlog bg left join employee.backlog_detail bd on bg.id = bd.backlog_id where bg.tenant_app_id = :1 and bd.create_time >= :2 and bd.create_time <= :3 limit :4 offset :5|12|21|4||0|0|1319132|453014|2072|417|
|statistic|select tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.employee_user_id , tmp.employee_user_name , sum ( tmp.amount ) amount from ( select t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) employee_user_id , if ( oe.employee_user_id = '-1' or oe.employee_user_id is null , :1 , oe.employee_user_name ) employee_user_name , t.amount from ( select mt.tenant_id , mt.tenant_app_id , mt.shop_id , mt.employee_user_id , count ( * ) amount from statistic.member mb left join statistic.member_extra mt on mb.id = mt.id where mb.tenant_app_id = :2 and mb.create_time <= :3 and mb.register_flag = :4 group by mt.tenant_id , mt.tenant_app_id , mt.shop_id , mt.employee_user_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and ( t.shop_id = os.dept_erp_id or t.shop_id = os.shop_id ) left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and ( t.employee_user_id = oe.employee_erp_id or t.employee_user_id = oe.employee_user_id ) ) tmp group by tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.employee_user_id , tmp.employee_user_name|12|38|10||0|0|17508866|3321972|7867|1350|
|platform|select `noteid` , `vendorid` , `detailindex` , `productname` , `productbarcode` , `category` , `salestype` , `quantity` , `amount` , `integral` , `productdesc` , `slid` , `paidamount` , `id` from `salesdetaillog` where `noteid` = :1 and `vendorid` = :2|12|26|5||0|0|476605|104769|28|7|
|qrcode_service|select *from qrcode_service.qrcode_scan_log where open_id = :1 and tenant_app_id = :2 order by create_time desc limit :3|14|23|4||0|0|12023840|860247|10|1|
|user_service|select tu.user_id as userid , tu.mobile_no as mobileno , tu.user_name as username , u.nick_name as nickname , u.head_img_url as headimgurl from tenant_user tu join `user` u on tu.user_id = u.id where tu.tenant_app_id = :1 and ( tu.mobile_no = :2 or u.nick_name like concat ( :3 , :4 ) or tu.user_name like concat ( :5 , :6 ) )|17|81|9||0|0|1643930|117202|44|10|
|employee|select * from backlog where tenant_app_id = :1 and user_id = :2 and status in ( :3 , :4 ) and scene = :5 and expire_time >= :6 order by create_time desc limit :7|17|47|4||0|0|1540085|90595|42|9|
|erp_sync|select * from erp_sync.retry_data where ( need_erp_member_id = :1 or ( need_erp_member_id = :2 and erp_member_id is not null ) ) and retry_times > :3 order by id asc|17|91|8||0|0|838069|49323|0|0|
|tenant|select count ( 0 ) from erp_sales where tenant_id = :1 and tenant_wechatapp_id = :2 and sales_date >= :3 and employee_erp_id = :4 and sales_status = :5|17|29|3||0|0|3141221|184954|17|1|
|customer|select count ( 0 ) from customer_face_pass t where :1 = :2 and t.is_checkin = :3 and t.shop_id = :4 and t.person_type not in ( :5 )|18|122|11||0|0|1719780|152895|18|1|
|platform|select `typefullname` , `methodname` , `arguments` , `partition` , `offset` , `createtime` , `updatetime` , `retried` , `errormsg` , `id` from `pushlog` where `typefullname` = :1 and `methodname` = :2 and `arguments` = :3|18|26|3||0|0|4191173|240829|1|1|
|platform|select count ( 1 ) from coupondetail cd where getuid = :1 and ( couponstate = :2 or couponstate = :3 ) and date_format ( expirytime , :4 ) >= curdate ( )|19|47|5||0|0|6056649|318771|19|1|
|facepass_sync|select id , tenant_id , tenant_wechatapp_id , shop_id , status , retries , success_time , send_fail_msg , create_time , update_time , send_data from customer_face_register_message where status in ( :1 , :2 ) and retries < :3 limit :4|19|26|2||0|0|235906|12418|0|0|
|platform|select `tasktype` , `tasktime` , `taskstatus` , `bid` , `vendorid` , `uid` , `completetime` , `remark` , `createtime` , `id` from `taskassignment` where tasktype = :1 and vendorid = :2 and date_format ( tasktime , :3 ) >= curdate ( ) and ( taskstatus = :4 or taskstatus = :5 )|21|36|3||0|0|13159566|626646|6|3|
|order|select tenant_wechatapp_id from order_info where status = :1 and child_status is null group by tenant_wechatapp_id|21|64|4||0|0|816649|38889|0|0|
|statistic|select tmp.tenant_id , tmp.tenant_app_id , tmp.grade_erp_id , tmp.grade_name , tmp.shop_id , tmp.shop_name , sum ( tmp.amount ) amount from ( select t.tenant_id , t.tenant_app_id , ifnull ( t.grade_erp_id , -1 ) grade_erp_id , if ( t.grade_erp_id is null , '无' , gd.grade_name ) grade_name , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , t.amount from ( select mt.tenant_id , mt.tenant_app_id , mt.shop_id , mt.grade_erp_id , count ( * ) amount from statistic.member mb left join statistic.member_extra mt on mb.id = mt.id where mb.tenant_app_id = :1 and mb.create_time <= :2 and mb.register_flag = :3 group by mt.tenant_id , mt.tenant_app_id , mt.shop_id , mt.grade_erp_id ) t left join statistic.grade gd on t.tenant_id = gd.tenant_id and t.grade_erp_id = gd.grade_erp_id left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and ( t.shop_id = os.dept_erp_id or t.shop_id = os.shop_id ) ) tmp group by tmp.tenant_id , tmp.tenant_app_id , tmp.grade_erp_id , tmp.grade_name , tmp.shop_id , tmp.shop_name|21|72|16||0|0|6617407|749304|1257|142|
|statistic|select t.tenant_id , t.tenant_app_id , ifnull ( t.shop_id , -1 ) shop_id , t.shop_name , ifnull ( t.user_id , -1 ) user_id , t.user_name , t.scene , t.expire_date , t.statistic_date , count ( * ) total_amount from ( select bg.id , bg.tenant_id , bg.tenant_app_id , bg.shop_id , bg.shop_name , bg.user_id , bg.user_name , bg.status , bg.scene , date_format ( bg.expire_time , '%y-%m-%d' ) expire_date , date_format ( bg.create_time , '%y-%m-%d' ) statistic_date from statistic.backlog bg where bg.tenant_app_id = :1 and bg.shop_id != :2 and bg.user_id != :3 and bg.create_time >= :4 and bg.create_time <= :5 ) t group by t.tenant_id , t.tenant_app_id , t.shop_id , t.shop_name , t.user_id , t.user_name , t.scene , t.expire_date , t.statistic_date limit :6 offset :7|23|98|21||0|0|32936892|1435073|492|187|
|activity_service|select id , tenant_id , tenant_app_id , activity_id , user_id , tenant_app_open_id , customize_page_id , qualitied_id , status , remark , create_time , update_time from intelligent_marketing_activity_gift where `status` = :1 limit :2 , :3|23|41|5||0|0|2649416|115192|0|0|
|facepass_sync|select id , tenant_id , tenant_wechatapp_id , shop_id , status , create_time , update_time , receive_data , response_data from customer_face_sync_message where status = :1 and create_time < date_add ( now ( ) , interval :2 minute ) order by id asc limit :3|24|105|7||0|0|905783|39954|24|1|
|platform|select count ( 1 ) from `integrallog` where `vendorid` = :1 and `changefrom` = :2 and `changeid` = :3|25|40|3||0|0|438168|37050|25|1|
|statistic|select id , timestampdiff ( year , solar_birthday , '2019-07-2123:59:59.001' ) age from member where tenant_app_id = :1 and birthday_month_day = :2 limit :3 offset :4|26|58|6||0|0|3747081|348197|2542|645|
|statistic|select t.tenant_id , t.tenant_app_id , ifnull ( t.shop_id , -1 ) shop_id , t.shop_name , ifnull ( t.user_id , -1 ) user_id , t.user_name , t.scene , t.expire_date , t.statistic_date , count ( 1 ) finish_amount from ( select bg.id , bg.tenant_id , bg.tenant_app_id , bg.shop_id , bg.shop_name , bg.user_id , bg.user_name , bg.status , bg.scene , date_format ( bg.expire_time , '%y-%m-%d' ) expire_date , date_format ( bg.update_time , '%y-%m-%d' ) statistic_date from statistic.backlog bg where bg.tenant_app_id = :1 and bg.status = :2 and bg.shop_id != :3 and bg.user_id != :4 and bg.update_time >= :5 and bg.update_time <= :6 ) t group by t.tenant_id , t.tenant_app_id , t.shop_id , t.shop_name , t.user_id , t.user_name , t.scene , t.expire_date , t.statistic_date limit :7 offset :8|26|37|2||0|0|37241791|1435073|123|53|
|statistic|select max ( statistic_date ) enddate from result_shop_source where tenant_id = :1 and tenant_app_id = :2 group by tenant_id|35|116|7||0|0|16377270|467922|35|1|
|statistic|select max ( statistic_date ) enddate from result_shop_grade where tenant_id = :1 and tenant_app_id = :2 group by tenant_id|36|125|7||0|0|20269908|563053|36|1|
|statistic|select mt.id , es.sales_erp_id lastsaleerpid , sd.category_erp_id lastcategoryid , sd.category_name lastcategoryname , sd.stone_weight laststoneweight , sd.gold_weight lastgoldweight , round ( sd.amount_pay/if ( sd.quantity = 0 , 1 , sd.quantity ) , 2 ) price , es.amount salesbalance from statistic.member_extra mt inner join tenant.erp_sales es on mt.tenant_app_id = es.tenant_wechatapp_id and mt.member_erp_id = es.member_erp_id and mt.last_sales_time = es.sales_date inner join tenant.erp_sales_detail sd on es.tenant_wechatapp_id = sd.tenant_wechatapp_id and es.sales_erp_id = sd.sales_erp_id where mt.tenant_app_id = :1 and mt.create_time <= :2 and sd.sales_type = :3 and mt.create_time >= :4 order by mt.id , es.sales_erp_id desc , price desc limit :5 offset :6|40|170|20||0|0|8904719|1427887|2273|258|
|platform|select count ( 1 ) from `salesdetaillog` where `vendorid` = :1 and `noteid` = :2|46|97|5||0|0|1593799|104800|46|1|
|erp_sync|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|61|227|6||0|0|849575|13985|849575|13985|
|authorization_service|update user_login_token set status = :1 where user_id = :2 and tenant_id = :3 and tenant_wx_app_id = :4 and login_way = :5|64|201|15||0|0|9476|649|0|0|
|payment|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|137|183|8||0|0|8905020|70244|8905020|70244|
|facepass_sync|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|143|659|9||0|0|1988798|14046|1988798|14046|
|account|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|151|745|9||0|0|2049386|14044|2049386|14044|
