|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|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_822257848045047808 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|4|4||0|0|308926|308926|1|1|
|statistic|select max ( statistic_date ) enddate from result_shop_status where tenant_id = :1 group by tenant_id|1|2|2||0|0|140063|140063|1|1|
|account|/* applicationname = intellij idea 2019.1 */ select * from erp_sync.sync_record where tenant_app_id = :1 and user_id = :2|1|16|16||0|0|115433|115433|4|4|
|tag_service|insert into tag_service.label_vip_match_830220893509701632_830221803765940224 ( 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_830220893509701632_830221803765940224 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|143281|143281|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|16|16||0|0|23514290|23514290|1|1|
|statistic|select tenant_id , tenant_app_id , activity_id , employee_shop_id , employee_user_id , employee_name , date_format ( update_time , '%y-%m-%d' ) statistic_date , count ( 1 ) use_amount from statistic.coupon_user where tenant_app_id = :1 and coupon_state = :2 and activity_id > :3 and employee_user_id > :4 and update_time >= :5 and update_time <= :6 group by tenant_id , tenant_app_id , activity_id , employee_shop_id , employee_user_id , employee_name , statistic_date|1|3|3||0|0|385299|385299|0|0|
|statistic|select es.id , es.tenant_id , es.tenant_wechatapp_id tenant_app_id , es.sales_erp_id , es.sales_no , es.sales_date , es.member_erp_id , es.amount , es.create_time , es.update_time , es.dept_erp_id , es.employee_erp_id , es.employee_name , is_sales has_sale , '2019-06-2323:59:59.0' collect_time , es.sales_status , '_821229068421742592' tableindex from tenant.erp_sales es where es.tenant_wechatapp_id = :1 and es.create_time >= :2 and es.create_time <= :3 limit :4 offset :5|1|4|4||0|0|174000|174000|483|483|
|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_830220893509701632 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|83284|83284|48|48|
|statistic|select id , user_name , mobile_no , status , scene , begin_time , expire_time , create_time , shop_name , member_user_name , member_mobile_no , content from backlog where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and scene = :4 and user_name > :5 and shop_name > :6 order by create_time desc limit :7 , :8|1|1|1||0|0|1239923|1239923|20|20|
|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|1|7|7||0|0|525460|525460|115|115|
|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|2|2||0|0|106388|106388|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|50371|50371|28|28|
|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 )|1|2|2||0|0|70400|70400|0|0|
|statistic|select es.id , es.tenant_id , es.tenant_wechatapp_id tenant_app_id , es.sales_erp_id , es.sales_no , es.sales_date , es.member_erp_id , es.amount , es.create_time , es.update_time , es.dept_erp_id , es.employee_erp_id , es.employee_name , is_sales has_sale , '2019-06-2323:59:59.0' collect_time , es.sales_status , '_885278795660111872' tableindex from tenant.erp_sales es where es.tenant_wechatapp_id = :1 and es.create_time >= :2 and es.create_time <= :3 limit :4 offset :5|1|9|9||0|0|704145|704145|417|417|
|tenant|select count ( 0 ) from ( select es.id , es.sales_no , es.sales_date , es.sales_erp_id , es.amount , ifnull ( shop.shop_name , ed.dept_name ) dept_name , es.employee_name from tenant.erp_sales es join tenant.erp_department ed on ed.dept_erp_id = es.dept_erp_id and ed.tenant_id = :1 left join tenant.tenant_wechatapp_shop shop on shop.dept_erp_id = ed.dept_erp_id and shop.tenant_wechatapp_id = :2 where es.member_erp_id = :3 and es.tenant_id = :4 and es.tenant_wechatapp_id = :5 and es.sales_status = :6 ) table_count|1|1|1||0|0|13101|13101|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_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|1374331|1374331|103|103|
|message_push|delete from message_log where to_days ( create_time ) -to_days ( now ( ) ) < :1|1|15|15||0|0|349238|349238|0|0|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_823709122435256320' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|1|1||0|0|1400|1400|9|9|
|statistic|select es.id , es.tenant_id , es.tenant_wechatapp_id tenant_app_id , es.sales_erp_id , es.sales_no , es.sales_date , es.member_erp_id , es.amount , es.create_time , es.update_time , es.dept_erp_id , es.employee_erp_id , es.employee_name , is_sales has_sale , '2019-06-2323:59:59.0' collect_time , es.sales_status , '_867265598260879360' tableindex from tenant.erp_sales es where es.tenant_wechatapp_id = :1 and es.create_time >= :2 and es.create_time <= :3 limit :4 offset :5|1|1|1||0|0|63215|63215|33|33|
|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.create_time >= :5 and mb.create_time <= :6 and mb.register_flag = :7 ) tmp_count|1|5|5||0|0|8120195|8120195|1|1|
|account|select id , tenant_id , tenant_app_id , account_type , owner_type , owner_id , balance , cumulation , status from account where owner_type = :1 and balance < :2 and account_type = :3|1|15|15||0|0|4450212|4450212|46|46|
|statistic|select sd.id , sd.sales_no salesno , os.shop_id shopid , ifnull ( os.shop_name , '未知' ) shopname , oe.employee_user_id userid , ifnull ( oe.employee_user_name , '未知' ) username , sd.product_name productname , sd.amount_pay amountpay , sd.value_add_no valueaddno , sd.value_add_amount valueaddamount , sd.value_add_state valueaddstate , sd.value_add_date valueadddate , if ( length ( sd.value_add_coupon ) = 18 , sd.value_add_coupon , null ) valueaddcoupon , sd.user_name memberusername , sd.mobile_no 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_id = :1 and os.shop_id != :2 and oe.employee_user_id != :3 and sd.value_add_no is not null and sd.tenant_app_id = :4 and os.shop_id = :5 and oe.employee_user_id = :6 order by sd.sales_date desc , sd.sales_erp_id desc limit :7 , :8|1|2|2||0|0|935845|935845|13|13|
|platform|select getuid , count ( id ) as qty from ( select * from coupondetail where couponstate = :1 and vendorid = :2 and month ( expirytime ) = month ( date_sub ( curdate ( ) , interval :3 day ) ) and day ( expirytime ) = day ( date_sub ( curdate ( ) , interval :4 day ) ) ) as t group by getuid|1|5|5||0|0|318769|318769|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_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|3|3||0|0|132803|132803|36|36|
|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|157924|157924|0|0|
|statistic|select max ( statistic_date ) enddate from result_shop_grade where tenant_id = :1 group by tenant_id|1|6|6||0|0|475145|475145|1|1|
|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|2|2||0|0|125885|125885|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_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|285065|285065|0|0|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_476787156229165056' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|25|25||0|0|479911|479911|150|150|
|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|4|4||0|0|120774|120774|0|0|
|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|1|1||0|0|181961|181961|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 ) and ( user.nick_name like concat ( :61 , :62 , :63 ) or user.mobile_no = :64 ) )|1|3|3||0|0|12413|12413|1|1|
|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|4|4||0|0|318769|318769|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|72997|72997|10|10|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_836363095600320512' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|2|2||0|0|11634|11634|246|246|
|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|2|2||0|0|16672|16672|297|297|
|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|12|12||0|0|360698|360698|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_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|911896|911896|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 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|12|12||0|0|489499|489499|0|0|
|statistic|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.register_flag = :4 limit :5 , :6|1|20|20||0|0|18301517|18301517|10|10|
||/* applicationname = datagrip 2018.2.2 */ select * from statistic.backlog where tenant_app_id = :1 and scene = :2 order by create_time desc|1|14|14||0|0|1240385|1240385|502|502|
|value_added|select id , template_name as templatename , added_percent_per_day as addedpercentperday , add_days as adddays , keeping_days as keepingdays , devalue_percent_per_day as devaluepercentperday , exchange_days as exchangedays , is_disable as isdisable , effective_days as effectivedays , ifnull ( usenumber , 0 ) as usenumber , generator_method as generatormethod , remark as remark from value_added_template left join ( select template_id , count ( * ) usenumber from value_added_user where tenant_wechatapp_id = :1 group by template_id ) value_added_user on value_added_template.id = value_added_user.template_id where tenant_wechatapp_id = :2 and id = :3|1|1|1||0|0|39802|39802|1|1|
|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|7|7||0|0|2678466|2678466|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.warranty_date warrantydate , es.warranty_id warrantyid from statistic.erp_sales_480726380749918208 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.warranty_date > :6 ) table_count|1|1|1||0|0|141893|141893|1|1|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_827516559562940416' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|16|16||0|0|479911|479911|23|23|
|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|1|3|3||0|0|308818|308818|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|2|2||0|0|28984|28984|0|0|
|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|286816|286816|137|137|
|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|2|2||0|0|132767|132767|8|8|
|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|1373682|1373682|20|20|
|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|7|7||0|0|666552|666552|23|23|
|statistic|select max ( statistic_date ) enddate from result_shop_status where tenant_id = :1 and tenant_app_id = :2 group by tenant_id|1|2|2||0|0|140063|140063|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|524650|524650|0|0|
|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|44361|44361|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|488259|488259|0|0|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_814020764498956288' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|1|1||0|0|10708|10708|3|3|
|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|2|2||0|0|3405|3405|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_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|31|31||0|0|2678466|2678466|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|3|3||0|0|4045|4045|1|1|
|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.create_time >= :6 and mb.create_time <= :7 and mb.register_flag = :8 ) tmp_count|1|2|2||0|0|60163|60163|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_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|2|2||0|0|798598|798598|276|276|
|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|2|2||0|0|63016|63016|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_830220893509701632_830221803765940224 where vip_id = :1|1|2|2||0|0|143193|143193|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_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|1373542|1373542|0|0|
|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|28342|28342|0|0|
|statistic|select es.id , es.tenant_id , es.tenant_wechatapp_id tenant_app_id , es.sales_erp_id , es.sales_no , es.sales_date , es.member_erp_id , es.amount , es.create_time , es.update_time , es.dept_erp_id , es.employee_erp_id , es.employee_name , is_sales has_sale , '2019-06-2323:59:59.0' collect_time , es.sales_status , '_823688108565368832' tableindex from tenant.erp_sales es where es.tenant_wechatapp_id = :1 and es.create_time >= :2 and es.create_time <= :3 limit :4 offset :5|1|8|8||0|0|488259|488259|1205|1205|
|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 ) and ( user.nick_name like concat ( :22 , :23 , :24 ) or user.mobile_no = :25 ) )|1|1|1||0|0|8864|8864|1|1|
|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.source_type = :4 and mb.create_time >= :5 and mb.create_time <= :6 and mb.register_flag = :7 ) tmp_count|1|2|2||0|0|318616|318616|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|4|4||0|0|165662|165662|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|283081|283081|7|7|
|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.price desc limit :8|1|3|3||0|0|7839|7839|6|6|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_821229068421742592' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|2|2||0|0|3866|3866|43|43|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_816096827580399616' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|2|2||0|0|1730|1730|0|0|
|user_service|select * from user_service.user where plat_unionid = :1|1|12|12||0|0|2098477|2098477|1|1|
|statistic|select es.id , es.tenant_id , es.tenant_wechatapp_id tenant_app_id , es.sales_erp_id , es.sales_no , es.sales_date , es.member_erp_id , es.amount , es.create_time , es.update_time , es.dept_erp_id , es.employee_erp_id , es.employee_name , is_sales has_sale , '2019-06-2323:59:59.0' collect_time , es.sales_status , '_488003299602206720' tableindex from tenant.erp_sales es where es.tenant_wechatapp_id = :1 and es.create_time >= :2 and es.create_time <= :3 limit :4 offset :5|1|1|1||0|0|129877|129877|103|103|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_480726380749918208' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|4|4||0|0|14859|14859|25|25|
|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|2|2||0|0|488294|488294|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|3|3||0|0|622677|622677|0|0|
|tag_service|delete from tag_service.label_vip_match_889699715132813312_889999611513671680 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_889699715132813312_889999611513671680 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|86891|86891|0|0|
|user_service|select count ( 0 ) from tenant_user tu join user u on u.id = tu.user_id where tu.tenant_id = :1 and ( tu.user_name like concat ( :2 , :3 , :4 ) or tu.mobile_no = :5 or u.nick_name like concat ( :6 , :7 , :8 ) ) and tenant_app_id = :9|1|6|6||0|0|100908|100908|1|1|
|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_480726380749918208 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|132825|132825|1|1|
|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|125823|125823|3|3|
|statistic|select max ( statistic_date ) enddate from result_shop_source where tenant_id = :1 group by tenant_id|1|5|5||0|0|393768|393768|1|1|
|statistic|select ue.tenant_wechatapp_id , ue.user_id , ifnull ( eu.user_id , ue.employee_erp_id ) employee_user_id , '2019-06-2323: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|1|3|3||0|0|14935|14935|22|22|
|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|488259|488259|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|1|1||0|0|56942|56942|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_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|525245|525245|85|85|
|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|1|4|4||0|0|528092|528092|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_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|3|3||0|0|1374331|1374331|103|103|
|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|130169|130169|38|38|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_816099123538214912' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|3|3||0|0|3635|3635|17|17|
|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|3|3||0|0|216524|216524|344|344|
|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_826954007829331968_826973052054052864 where vip_id = :1|1|5|5||0|0|268089|268089|1|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 )|1|2|2||0|0|37098|37098|0|0|
|statistic|select count ( 0 ) from ( select id , src_type , business_name , user_name , mobile_no , head_img , push_time , pull_time , if ( pull_status = 1 , '已领完' , '未领取' ) pull_status from statistic.gift_pack where tenant_id = :1 and tenant_app_id = :2 and page_id = :3 and src_type = :4 order by push_time desc ) tmp_count|1|4|4||0|0|529317|529317|1|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_480726380749918208_480728003618410496 where vip_id = :1|1|2|2||0|0|183652|183652|1|1|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_818707624273952768' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|2|2||0|0|16002|16002|61|61|
|tenant|select *from tenant.erp_sales where tenant_wechatapp_id = :1 and to_days ( sales_date ) -to_days ( now ( ) ) = :2 and is_sales = true|1|4|4||0|0|704150|704150|179|179|
|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|1|1|1||0|0|131408|131408|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|489499|489499|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|1|1||0|0|128577|128577|65|65|
|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|5|5||0|0|175342|175342|191|191|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_819000302970638336' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|5|5||0|0|7446|7446|72|72|
|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|7|7||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_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|68579|68579|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 , :244 , :245 , :246 , :247 , :248 , :249 , :250 , :251 , :252 , :253 , :254 , :255 , :256 , :257 , :258 , :259 , :260 , :261 , :262 , :263 , :264 , :265 , :266 , :267 , :268 , :269 , :270 , :271 , :272 , :273 , :274 , :275 , :276 , :277 , :278 , :279 , :280 , :281 , :282 , :283 , :284 , :285 , :286 , :287 , :288 , :289 , :290 , :291 , :292 , :293 , :294 , :295 , :296 , :297 , :298 , :299 , :300 , :301 , :302 , :303 , :304 , :305 , :306 , :307 , :308 , :309 , :310 , :311 , :312 , :313 , :314 , :315 , :316 , :317 , :318 , :319 , :320 , :321 , :322 , :323 , :324 , :325 , :326 , :327 , :328 , :329 , :330 , :331 , :332 , :333 , :334 , :335 , :336 , :337 , :338 , :339 , :340 , :341 , :342 , :343 , :344 , :345 , :346 ) and ( user.nick_name like concat ( :347 , :348 , :349 ) or user.mobile_no = :350 ) )|1|11|11||0|0|137109|137109|1|1|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_830220893509701632' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|3|3||0|0|10613|10613|108|108|
|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|1|1||0|0|525460|525460|115|115|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_823844580729339904' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|5|5||0|0|25788|25788|267|267|
|statistic|delete from statistic.batch_step_execution where step_execution_id <= :1|1|1|1||0|0|22687|22687|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|1|4|4||0|0|19329|19329|5000|5000|
|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|386956|386956|740|740|
|statistic|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|1|10|10||0|0|9662586|9662586|19189|19189|
|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_821229068421742592 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_821229068421742592 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|174997|174997|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|33|33||0|0|1065390|1065390|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_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|4|4||0|0|90520|90520|20|20|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_821174502091165696' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|1|1||0|0|2856|2856|3|3|
|activity_service|select count ( 0 ) from activity_service.user_trace t1 join activity_service.activity t2 on t1.activity_id = t2.id join activity_service.cutdown_price_activity_apply t3 on t1.user_apply_id = t3.id where t1.status = :1 and t2.tenant_wechatapp_id = :2 and t2.activity_type = :3 and t1.step = :4|1|2|2||0|0|658444|658444|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_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|613776|613776|607|607|
|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|1|2|2||0|0|474294|474294|27|27|
|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|1|1||0|0|645533|645533|2|2|
|statistic|select tenant_wechatapp_id , sales_erp_id , product_barcode , id , amount_added , date_format ( create_time , '%y-%m-%d' ) value_add_date , coupon_user_id , state , '_823844580729339904' tableindex from value_added.value_added_user where tenant_wechatapp_id = :1 and update_time >= :2 and update_time <= date_add ( :3 , interval :4 hour ) order by id limit :5 offset :6|1|1|1||0|0|44660|44660|5000|5000|
|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|97500|97500|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|524664|524664|2|2|
|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|4375|4375|0|0|
|tag_service|delete from tag_service.batch_job_execution_params where job_execution_id <= :1|1|2|2||0|0|265800|265800|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_822257848045047808 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_822257848045047808 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|29133|29133|0|0|
|statistic|select es.id , es.tenant_id , es.tenant_wechatapp_id tenant_app_id , es.sales_erp_id , es.sales_no , es.sales_date , es.member_erp_id , es.amount , es.create_time , es.update_time , es.dept_erp_id , es.employee_erp_id , es.employee_name , is_sales has_sale , '2019-06-2323:59:59.0' collect_time , es.sales_status , '_816096827580399616' tableindex from tenant.erp_sales es where es.tenant_wechatapp_id = :1 and es.create_time >= :2 and es.create_time <= :3 limit :4 offset :5|1|5|5||0|0|90365|90365|52|52|
|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|1|1||0|0|7394|7394|0|0|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_814640285408600064' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|1|3|3||0|0|10190|10190|11|11|
|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|414604|414604|78|78|
|statistic|select bl.id , bl.tenant_id , bl.tenant_app_id , bl.data , bl.status , bl.update_time from employee.backlog bl where bl.tenant_app_id = :1 and bl.update_time >= :2 and bl.update_time <= :3 order by bl.id limit :4 offset :5|1|17|17||0|0|741158|741158|1344|1344|
|statistic|select es.id , es.tenant_id , es.tenant_wechatapp_id tenant_app_id , es.sales_erp_id , es.sales_no , es.sales_date , es.member_erp_id , es.amount , es.create_time , es.update_time , es.dept_erp_id , es.employee_erp_id , es.employee_name , is_sales has_sale , '2019-06-2323:59:59.0' collect_time , es.sales_status , '_827516559562940416' tableindex from tenant.erp_sales es where es.tenant_wechatapp_id = :1 and es.create_time >= :2 and es.create_time <= :3 limit :4 offset :5|1|1|1||0|0|414033|414033|242|242|
|statistic|select es.id , es.tenant_id , es.tenant_wechatapp_id tenant_app_id , es.sales_erp_id , es.sales_no , es.sales_date , es.member_erp_id , es.amount , es.create_time , es.update_time , es.dept_erp_id , es.employee_erp_id , es.employee_name , is_sales has_sale , '2019-06-2323:59:59.0' collect_time , es.sales_status , '_486900027235635200' tableindex from tenant.erp_sales es where es.tenant_wechatapp_id = :1 and es.create_time >= :2 and es.create_time <= :3 limit :4 offset :5|1|1|1||0|0|67114|67114|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.price asc limit :8|1|1|1||0|0|7839|7839|6|6|
|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.shop_id = :5 and ec.sales_date between :6 and :7 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|897026|897026|1|1|
|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 )|1|1|1||0|0|94901|94901|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|2|2||0|0|66068|66068|1|1|
|statistic|select es.id , es.tenant_id , es.tenant_wechatapp_id tenant_app_id , es.sales_erp_id , es.sales_no , es.sales_date , es.member_erp_id , es.amount , es.create_time , es.update_time , es.dept_erp_id , es.employee_erp_id , es.employee_name , is_sales has_sale , '2019-06-2323:59:59.0' collect_time , es.sales_status , '_826254702915141632' tableindex from tenant.erp_sales es where es.tenant_wechatapp_id = :1 and es.create_time >= :2 and es.create_time <= :3 limit :4 offset :5|1|1|1||0|0|25761|25761|28|28|
|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|1373598|1373598|8|8|
|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|6|6||0|0|580984|580984|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.price asc limit :8 , :9|1|1|1||0|0|7845|7845|6|6|
|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|2|1||0|0|233120|116562|0|0|
|statistic|select sd.id , sd.sales_no salesno , os.shop_id shopid , ifnull ( os.shop_name , '未知' ) shopname , oe.employee_user_id userid , ifnull ( oe.employee_user_name , '未知' ) username , sd.product_name productname , sd.amount_pay amountpay , sd.value_add_no valueaddno , sd.value_add_amount valueaddamount , sd.value_add_state valueaddstate , sd.value_add_date valueadddate , if ( length ( sd.value_add_coupon ) = 18 , sd.value_add_coupon , null ) valueaddcoupon , sd.user_name memberusername , sd.mobile_no 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_id = :1 and os.shop_id != :2 and oe.employee_user_id != :3 and sd.value_add_no is not null and sd.tenant_app_id = :4 and os.shop_id = :5 order by sd.sales_date desc , sd.sales_erp_id desc limit :6|2|4|2||0|0|1824788|912691|120|100|
|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|2|1||0|0|272188|136100|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|5|4||0|0|141038|121713|0|0|
|statistic|select count ( 0 ) from backlog where tenant_id = :1 and tenant_app_id = :2 and shop_id = :3 and scene = :4 and user_name > :5 and shop_name > :6|2|15|13||0|0|2479766|1239883|2|1|
|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|12|6||0|0|1085179|542621|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|2|1||0|0|225851|112947|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|665355|333826|0|0|
|statistic|select es.id , es.tenant_id , es.tenant_wechatapp_id tenant_app_id , es.sales_erp_id , es.sales_no , es.sales_date , es.member_erp_id , es.amount , es.create_time , es.update_time , es.dept_erp_id , es.employee_erp_id , es.employee_name , is_sales has_sale , '2019-06-2323:59:59.0' collect_time , es.sales_status , '_476787156229165056' tableindex from tenant.erp_sales es where es.tenant_wechatapp_id = :1 and es.create_time >= :2 and es.create_time <= :3 limit :4 offset :5|2|4|2||0|0|526662|465845|252|234|
|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|8|4||0|0|734488|367254|0|0|
|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|3|2||0|0|589461|295446|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|2|4|3||0|0|54710|46349|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_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|15|12||0|0|1006607|912042|73|73|
|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|4|2||0|0|421734|210872|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|2|1||0|0|224468|112234|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|4|2||0|0|556820|278410|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|11|6||0|0|1176078|588048|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|2|1||0|0|93378|64070|0|0|
|statistic|select id , user_name , mobile_no , status , scene , begin_time , expire_time , create_time , shop_name , member_user_name , member_mobile_no , content from backlog where tenant_id = :1 and tenant_app_id = :2 and expire_time between :3 and :4 and shop_id = :5 and user_id = :6 and user_name > :7 and shop_name > :8 order by create_time desc limit :9|2|2|1||0|0|2479768|1239884|2|1|
|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|12|6||0|0|1072331|536167|0|0|
|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|4|2||0|0|690596|345584|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 and ( tu.user_name like concat ( concat ( :6 , :7 , :8 ) ) or tu.mobile_no = :9 )|2|2|1||0|0|4329|2178|2|1|
|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|4|2||0|0|660419|330370|0|0|
|statistic|select sd.id , sd.sales_no salesno , os.shop_id shopid , ifnull ( os.shop_name , '未知' ) shopname , oe.employee_user_id userid , ifnull ( oe.employee_user_name , '未知' ) username , sd.product_name productname , sd.amount_pay amountpay , sd.value_add_no valueaddno , sd.value_add_amount valueaddamount , sd.value_add_state valueaddstate , sd.value_add_date valueadddate , if ( length ( sd.value_add_coupon ) = 18 , sd.value_add_coupon , null ) valueaddcoupon , sd.user_name memberusername , sd.mobile_no 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_id = :1 and os.shop_id != :2 and oe.employee_user_id != :3 and sd.value_add_no is not null and sd.tenant_app_id = :4 and os.shop_id = :5 and oe.employee_user_id = :6 order by sd.sales_date desc , sd.sales_erp_id desc limit :7|2|4|2||0|0|1853084|926542|40|20|
|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|2|10|7||0|0|362950|181475|2|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_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|2|3|2||0|0|301766|150883|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|4|2||0|0|324559|162281|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|16|8||0|0|1380058|690034|0|0|
|statistic|select id , tenant_id , tenant_wechatapp_id tenant_app_id , src_type , page_id , tenant_app_open_id , user_id , user_name , mobile_no , head_img , create_time push_time , 0 pull_status from customize_page.award_qualified where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 limit :4 offset :5|2|4|2||0|0|212847|183994|839|688|
|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|6|3||0|0|572626|286316|0|0|
|statistic|select od.id , od.tenant_id , od.tenant_wechatapp_id tenant_app_id , od.order_no , od.source , od.type , od.activity_id , od.activity_type , od.user_id , od.user_name , od.mobile_no , od.take_type , td.shop_id , td.shop_name , od.coupon_id , dt.product_id goods_id , dt.product_name goods_name , dt.art_no style_no , dt.sku_id , dt.spec , gs.barcode , od.product_fee , od.freight_fee , od.discount_fee , od.total_fee , od.payment_fee , od.status , od.finish_type , od.take_shop_id , od.take_shop_name , od.take_employee_user_id , od.take_employee_user_name , od.manager_shop_id , od.manager_shop_name , od.manager_user_id , od.manager_user_name , od.manager_mobile_no , od.manager_brokerage , od.create_time , od.update_time , '2019-06-2323:59:59.0' collect_time , dt.quantity from `order`.order_info od left join order.order_detail dt on od.id = dt.order_id left join deliver.trade_deliver td on od.id = td.trade_id left join goods.goods_sku gs on dt.sku_id = gs.id where od.tenant_wechatapp_id = :1 and od.update_time >= :2 and od.create_time <= :3 and od.update_time <= :4 limit :5 offset :6|2|5|4||0|0|71461|36098|291|268|
|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|4|2||0|0|391572|195786|0|0|
|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|5|3||0|0|40468|24380|2|1|
|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|3|2||0|0|512460|256458|0|0|
|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|14|7||0|0|1320229|660131|0|0|
|statistic|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.create_time >= :5 and mb.create_time <= :6 and mb.register_flag = :7|2|22|11||0|0|16240390|8120195|32102|16051|
|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|2|1||0|0|266129|133069|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|10|5||0|0|1024020|512016|0|0|
|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|8|4||0|0|725013|362515|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|2|1||0|0|536191|268109|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|4|2||0|0|453383|226697|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 ) 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|2|11|6||0|0|771087|386125|4|4|
|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|543155|271876|0|0|
|tenant|select count ( 0 ) from ( select shop.* , dept.dept_name , count ( emp.id ) as employeescount from tenant_wechatapp_shop shop left join erp_department dept on shop.dept_erp_id = dept.dept_erp_id and shop.tenant_id = dept.tenant_id left join erp_employee emp on emp.tenant_id = shop.tenant_id and emp.dept_erp_id = shop.dept_erp_id and emp.is_disable = :1 where shop.tenant_wechatapp_id = :2 and shop.status in ( :3 , :4 ) group by shop.id ) table_count|2|2|1||0|0|19612|9806|2|1|
|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|2|1||0|0|243357|121679|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|2|1||0|0|207184|103594|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|14|7||0|0|1326330|663272|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|43028|21514|44|22|
|statistic|select tu.tenant_id , tu.tenant_wechatapp_id , tt.activity_name , tu.activity_id , tu.user_id , date_format ( tu.create_time , '%y-%m-%d' ) statistic_date from activity_service.assist_task_user tu inner join activity_service.activity tt on tu.activity_id = tt.id where tu.tenant_wechatapp_id = :1 and tu.create_time >= :2 and tu.create_time <= :3 limit :4 offset :5|3|4|2||0|0|1059204|353068|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_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|3|6|2||0|0|54843|25823|36|17|
|statistic|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.register_flag = :4|3|69|32||0|0|40666676|18301517|106247|41010|
|statistic|select sd.id , sd.sales_no salesno , os.shop_id shopid , ifnull ( os.shop_name , '未知' ) shopname , oe.employee_user_id userid , ifnull ( oe.employee_user_name , '未知' ) username , sd.product_name productname , sd.amount_pay amountpay , sd.value_add_no valueaddno , sd.value_add_amount valueaddamount , sd.value_add_state valueaddstate , sd.value_add_date valueadddate , if ( length ( sd.value_add_coupon ) = 18 , sd.value_add_coupon , null ) valueaddcoupon , sd.user_name memberusername , sd.mobile_no 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_id = :1 and os.shop_id != :2 and oe.employee_user_id != :3 and sd.value_add_no is not null and sd.tenant_app_id = :4 and os.shop_id = :5 order by sd.sales_date desc , sd.sales_erp_id desc limit :6 , :7|3|6|2||0|0|2837339|945794|120|100|
|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|3|7|4||0|0|129345|54497|78|26|
|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|4|2||0|0|85981|44141|0|0|
|tenant|select shop.* , dept.dept_name , count ( emp.id ) as employeescount from tenant_wechatapp_shop shop left join erp_department dept on shop.dept_erp_id = dept.dept_erp_id and shop.tenant_id = dept.tenant_id left join erp_employee emp on emp.tenant_id = shop.tenant_id and emp.dept_erp_id = shop.dept_erp_id and emp.is_disable = :1 where shop.tenant_wechatapp_id = :2 and shop.status in ( :3 , :4 ) group by shop.id order by shop.create_time desc limit :5|3|4|1||0|0|29280|9760|60|20|
|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|3|7|4||0|0|129113|54417|20|7|
|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|17646|9496|1323|854|
|statistic|select count ( 0 ) from ( select sd.id , sd.sales_no salesno , os.shop_id shopid , ifnull ( os.shop_name , '未知' ) shopname , oe.employee_user_id userid , ifnull ( oe.employee_user_name , '未知' ) username , sd.product_name productname , sd.amount_pay amountpay , sd.value_add_no valueaddno , sd.value_add_amount valueaddamount , sd.value_add_state valueaddstate , sd.value_add_date valueadddate , if ( length ( sd.value_add_coupon ) = 18 , sd.value_add_coupon , null ) valueaddcoupon , sd.user_name memberusername , sd.mobile_no 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_id = :1 and os.shop_id != :2 and oe.employee_user_id != :3 and sd.value_add_no is not null and sd.tenant_app_id = :4 and os.shop_id = :5 and oe.employee_user_id = :6 order by sd.sales_date desc , sd.sales_erp_id desc ) tmp_count|3|17|13||0|0|2737824|912608|3|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_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|3|7|4||0|0|58212|36002|0|0|
|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|3|4|2||0|0|47353|22343|407|394|
|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.source_type = :4 and mb.subscribe_flag = :5 and mb.bind_flag = :6 and mb.full_flag = :7 and mb.register_flag = :8 ) tmp_count|3|11|7||0|0|25251409|20696789|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|8|4||0|0|88506|62517|21|19|
|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|12|10||0|0|2691063|897025|12|5|
|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_822257848045047808_822262919524818944 where vip_id = :1|3|16|5||0|0|1035588|345196|3|1|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_469175049962786816' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|3|3|1||0|0|13921|5148|51|30|
|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|3|13|5||0|0|990402|330134|2|1|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_822257848045047808' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|3|17|15||0|0|491720|479911|145|79|
|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|3|3|1||0|0|3702225|1234472|56|48|
|account|/* applicationname = intellij idea 2019.1 */ select * from user_service.erp_member where mobile_no = :1|3|51|18||0|0|11988138|3996466|6|2|
|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|3|5|2||0|0|17048|7359|672|629|
|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|3|9|5||0|0|164789|76445|4|4|
|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|3|8|4||0|0|23425|7845|11|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_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|252291|106514|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_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|5|2||0|0|174665|53733|0|0|
|statistic|select tenant_wechatapp_id , erp_sales_id , id , date_format ( create_time , '%y-%m-%d' ) warranty_date , '_817517269994225664' tableindex from warranty_service.warranty where tenant_wechatapp_id = :1 and create_time >= :2 and create_time <= :3 order by id limit :4 offset :5|4|13|4||0|0|58618|23107|172|57|
|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|380127|309089|57|41|
|statistic|select count ( 0 ) from backlog where tenant_id = :1 and tenant_app_id = :2 and expire_time between :3 and :4 and shop_id = :5 and user_id = :6 and user_name > :7 and shop_name > :8|4|39|12||0|0|4959532|1239883|4|1|
|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|19|9||0|0|3588412|897113|98|27|
|user_service|select id , plat_unionid , plat_openid , user_name , mobile_no , nick_name , sex , head_img_url , country , province , city , status , create_time , update_time , is_subscribe , subscribe_time from `user` where user_name like concat ( :1 , :2 , :3 ) or mobile_no = :4 or nick_name like concat ( :5 , :6 , :7 ) limit :8|4|10|3||0|0|8385635|2096422|4|1|
|bespoke|select count ( * ) from bespoke.bespoke_trade where user_id = :1 and tenant_app_id = :2 and status <> :3|4|5|2||0|0|101076|25269|4|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|4|8|3||0|0|31253|7839|24|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_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|4|6|2||0|0|99671|33526|0|0|
|statistic|select max ( statistic_date ) enddate from result_shop_user where tenant_id = :1 group by tenant_id|4|35|15||0|0|8811160|2202790|4|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_488003299602206720_488032253511864320 where vip_id = :1|4|11|6||0|0|421820|105455|4|1|
|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|5|10|4||0|0|10148971|9662586|5|1|
|platform|select count ( 1 ) from coupondetail cd where getuid = :1 and ( couponstate = :2 or couponstate = :3 ) and date_format ( expirytime , :4 ) >= curdate ( )|5|11|3||0|0|1593845|318769|5|1|
|statistic|select count ( 0 ) from ( select sd.id , sd.sales_no salesno , os.shop_id shopid , ifnull ( os.shop_name , '未知' ) shopname , oe.employee_user_id userid , ifnull ( oe.employee_user_name , '未知' ) username , sd.product_name productname , sd.amount_pay amountpay , sd.value_add_no valueaddno , sd.value_add_amount valueaddamount , sd.value_add_state valueaddstate , sd.value_add_date valueadddate , if ( length ( sd.value_add_coupon ) = 18 , sd.value_add_coupon , null ) valueaddcoupon , sd.user_name memberusername , sd.mobile_no 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_id = :1 and os.shop_id != :2 and oe.employee_user_id != :3 and sd.value_add_no is not null and sd.tenant_app_id = :4 and os.shop_id = :5 order by sd.sales_date desc , sd.sales_erp_id desc ) tmp_count|5|9|2||0|0|4612990|922598|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|43|17||0|0|1338263|1000377|5|5|
|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|5|21|11||0|0|191649|72623|0|0|
|gift_mail|select count ( 0 ) from ( select p.* , sp.take_type , ifnull ( pp.integral_price , ifnull ( ( select min ( inventory.price ) from inventory where inventory.product_id = p.id ) , :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 where ( p.tenant_id = :4 )|5|10|2||0|0|29468|5920|5|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 where ( p.tenant_id = :4 ) order by p.id desc limit :5|5|12|3||0|0|29559|5940|91|20|
|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|5|19|4||0|0|4485178|897068|5|1|
|user_service|select count ( 0 ) from `user` where user_name like concat ( :1 , :2 , :3 ) or mobile_no = :4 or nick_name like concat ( :5 , :6 , :7 )|5|31|12||0|0|10482030|2096421|5|1|
|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|5|27|8||0|0|4485305|897117|70|28|
|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|12|5||0|0|1339|1302|0|0|
|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|6|18|12||0|0|7416467|1239732|59|44|
|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|6|12|4||0|0|1044882|174294|6|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|6|27|6||0|0|1628616|271436|4|1|
|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|6|21|5||0|0|2322088|387372|0|0|
|statistic|select max ( statistic_date ) enddate from result_shop_user where tenant_id = :1 and tenant_app_id = :2 group by tenant_id|6|26|13||0|0|13216740|2202790|6|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|6|16|4||0|0|2300522|387369|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_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|6|12|3||0|0|372197|110732|0|0|
|activity_service|select count ( distinct ( user_id ) ) from user_trace where tenant_app_id = :1 and activity_id = :2 and status != :3|7|8|2||0|0|110641|64341|7|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|7|9|2||0|0|1789376|344191|1682|539|
|statistic|select ut.tenant_id , ut.tenant_app_id , tt.activity_name , ut.activity_id , ut.user_id , date_format ( ut.create_time , '%y-%m-%d' ) statistic_date from activity_service.user_trace ut inner join activity_service.activity tt on ut.activity_id = tt.id where ut.tenant_app_id = :1 and ut.activity_type = :2 and ut.step = :3 and ut.create_time >= :4 and ut.create_time <= :5 limit :6 offset :7|7|11|3||0|0|289804|148841|140|121|
|platform|select `noteid` , `vendorid` , `detailindex` , `productname` , `productbarcode` , `category` , `salestype` , `quantity` , `amount` , `integral` , `productdesc` , `slid` , `paidamount` , `id` from `salesdetaillog` where `noteid` = :1 and `vendorid` = :2|7|11|2||0|0|286799|101288|13|3|
|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|8|9|2||0|0|209679|68991|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|8|12|3||0|0|4338339|663230|183|45|
|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|8|12|2||0|0|4394303|676039|650|108|
|statistic|select cu.id , cu.tenant_id , cu.tenant_wechatapp_id , cu.coupon_name , cu.coupon_type , cu.coupon_no , cu.create_channel , cu.coupon_state , cu.user_name , cu.creator_name , cu.face_value , cu.begin_time , cu.end_time , cu.remark , cu.create_time , cu.update_time , cu.mobile_no , cu.creator_mobile_no , if ( cu.coupon_type = 4 , vu.template_id , cu.coupon_template_id ) coupon_template_id from coupon_service.coupon_user cu left join value_added.value_added_user vu on cu.tenant_wechatapp_id = vu.tenant_wechatapp_id and cu.id = vu.coupon_user_id where cu.tenant_wechatapp_id = :1 and cu.create_time >= :2 and cu.create_time <= :3 limit :4 offset :5|9|31|8||0|0|262658|81662|1015|309|
|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|9|21|5||0|0|191920|40690|1767|627|
|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|9|25|6||0|0|15039344|3218344|6754|1354|
|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 )|9|80|12||0|0|985282|154734|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|42|4||0|0|3321520|332152|8|1|
|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|10|22|8||0|0|176204|17783|200|20|
|platform|select `typefullname` , `methodname` , `arguments` , `partition` , `offset` , `createtime` , `updatetime` , `retried` , `errormsg` , `id` from `pushlog` where `typefullname` = :1 and `methodname` = :2 and `arguments` = :3|10|18|6||0|0|2091236|237799|1|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|10|12|1||0|0|107300|10730|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|11|153|38||0|0|4533468|743114|3151|652|
|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|11|30|8||0|0|359888|91463|11|1|
|value_added|select id , tenant_wechatapp_id as tenantwechatappid , user_id as userid , template_id as templateid , sales_erp_id as saleserpid , product_name as productname , shop_name as shopname , product_barcode as productbarcode , amount_total as amounttotal , amount_pay as amountpay , amount_added as amountadded , state as state , add_days as adddays , 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 from value_added_user where sales_erp_id = :1 and sales_index = :2 and tenant_wechatapp_id = :3 and state != :4|12|17|2||0|0|477540|39797|3|1|
|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 )|12|16|2||0|0|7473077|622757|13|9|
|statistic|select max ( statistic_date ) enddate from result_shop_source where tenant_id = :1 and tenant_app_id = :2 group by tenant_id|13|35|6||0|0|5118984|393768|13|1|
|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.register_flag = :4 ) tmp_count|13|280|51||0|0|733197956|102816365|13|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_id = :1 and tu.tenant_app_id = :2 and ( u.mobile_no = :3 or u.nick_name like concat ( :4 , :5 , :6 ) or tu.user_name like concat ( :7 , :8 , :9 ) )|13|42|10||0|0|1975564|263134|436|168|
|statistic|select max ( statistic_date ) enddate from result_shop_grade where tenant_id = :1 and tenant_app_id = :2 group by tenant_id|13|35|6||0|0|6176885|475145|13|1|
|order|select tenant_wechatapp_id from order_info where status = :1 and child_status is null group by tenant_wechatapp_id|13|30|4||0|0|446797|34369|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|14|31|4||0|0|5222440|743590|815|137|
|platform|select count ( 1 ) from `integrallog` where `vendorid` = :1 and `changefrom` = :2 and `changeid` = :3|15|24|3||0|0|396490|36067|15|1|
|erp_sync|select * from erp_sync.retry_data where ( need_erp_member_id = :1 or ( need_erp_member_id = :2 and erp_member_id is not null ) ) and retry_times > :3 order by id asc|17|69|6||0|0|747898|43995|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|18|75|7||0|0|1003830|56061|18|1|
|erp_sync|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|20|50|3||0|0|110365|5542|110365|5542|
|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 ) )|20|39|5||0|0|144250|7773|20|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 )|22|88|12||0|0|48462598|2202979|22|1|
|platform|select count ( 1 ) from `salesdetaillog` where `vendorid` = :1 and `noteid` = :2|24|55|4||0|0|1319530|101312|24|1|
|statistic|select id , timestampdiff ( year , solar_birthday , '2019-06-2223:59:59.001' ) age from member where tenant_app_id = :1 and birthday_month_day = :2 limit :3 offset :4|25|57|6||0|0|3304805|345196|2458|668|
|order|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|30|68|3||0|0|165538|5541|165538|5541|
|statistic|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.source_type = :4 and mb.subscribe_flag = :5 and mb.bind_flag = :6 and mb.full_flag = :7 and mb.register_flag = :8|31|14187|506||0|0|84951243|10878554|168145|21730|
|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|35|81|7||0|0|6785|522|0|0|
|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|44|132|11||0|0|7383444|978259|4166|599|
|payment|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|47|91|5||0|0|1333698|28381|1333698|28381|
|facepass_sync|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|51|161|4||0|0|280959|5676|280959|5676|
|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|71|188|15||0|0|8286226|141197|70|1|
|account|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|97|247|4||0|0|536469|5672|536469|5672|
|customize_page|select q.page_id as id , page.title , page.valid_days , q.create_time , q.id as qualifiedid from customize_page.award_qualified q inner join customize_page.customize_page page on q.page_id = page.id inner join ( select aq.page_id from customize_page.award_qualified aq inner join customize_page.award_detail ad on aq.page_id = ad.page_id left join customize_page.award_receive_detail ard on aq.id = ard.qualified_id and ad.id = ard.award_id and aq.user_id = ard.user_id where ( aq.user_id = :1 or aq.tenant_app_open_id = :2 ) and ard.id is null and ( ( ad.put_quantity >= ad.get_quantity and ad.type = :3 ) or ad.type not in ( :4 ) ) group by aq.page_id ) as d on d.page_id = q.page_id where q.tenant_wechatapp_id = :5 and ( user_id = :6 or tenant_app_open_id = :7 ) and if ( page.valid_days = :8 , true , to_days ( now ( ) ) < ( to_days ( q.create_time ) :9 page.valid_days ) ) order by q.create_time desc|614|895|14||0|0|401041566|762898|1250|38|
