|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 46.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 46.00 , user_name = :16 , create_time = create_time|1|17|17||0|0|0|0|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 ) and ( user.nick_name like concat ( :122 , :123 , :124 ) or tenantuser.mobile_no = :125 ) )|1|6|6||0|0|177884|177884|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_839295151019966464 where tenant_app_id = :1 and create_time >= :2 and create_time <= :3 and sales_type = :4 and sales_status = :5 ) sd inner join ( select tenant_id , tenant_app_id , sales_erp_id , amount , sales_date , dept_erp_id from statistic.erp_sales_839295151019966464 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|1|2|2||0|0|20809|20809|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_828766757295529984 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|7|7||0|0|233871|233871|448|448|
|tag_service|insert into tag_service.label_vip_match_916119427764772864_918632942668926976 ( 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_916119427764772864_918632942668926976 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|40320|40320|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_816440425157005312 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|19835|19835|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_885418658174709760 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|1|1||0|0|100547|100547|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_908917637281533952 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|24914|24914|0|0|
|tag_service|insert into tag_service.label_vip_match_817517269994225664_817536856118829056 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_817517269994225664_817536856118829056 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|1|1||0|0|79405|79405|0|0|
|tag_service|delete from tag_service.label_vip_match_469175049962786816_470281572487139328 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_469175049962786816_470281572487139328 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|48426|48426|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.redpack_amount ) redpack_amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.redpack_amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , sum ( ifnull ( redpack_amount , 0 ) ) redpack_amount from statistic.erp_sales_885278795660111872 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and redpack_date = date_format ( :6 , :7 ) group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|4|4||0|0|1386980|1386980|0|0|
|statistic|select tu.id , tu.user_id userid , tu.tenant_id tenantid , tu.tenant_app_id tenantappid , tu.shop_id shopid , tu.erp_member_id memberuserid , tu.user_name username , tu.mobile_no mobileno , ifnull ( tu.sex , 0 ) sex , tu.birthday , tu.birthday_is_lunar birthdayislunar , tu.memorial_name memorialname , tu.memorial_day memorialday , tu.memorial_day_is_lunar memorialdayislunar , tu.create_time createtime , '2019-08-0623:59:59.0' updatetime , if ( tu.bind_time is null , 0 , 1 ) bindflag , if ( tu.mobile_no is null , 0 , 1 ) fullflag , ifnull ( em.consumption_integral , 0 ) consumptionintegral , em.grade_erp_id gradeerpid , tu.bind_time bindtime , if ( ifnull ( tu.is_subscribe , 0 ) = 0 , 1 , 0 ) cancelflag , if ( ifnull ( tu.is_subscribe , 0 ) = 1 , 1 , 0 ) subscribeflag , if ( tu.is_subscribe = 1 , null , tu.subscribe_time ) canceltime , tu.subscribe_time from user_service.tenant_user tu left join user_service.erp_member em on tu.tenant_app_id = em.tenant_wechatapp_id and tu.erp_member_id = em.member_erp_id where tu.tenant_app_id = :1 and tu.update_time >= :2 and tu.create_time <= :3 and tu.update_time <= :4 union all select tu.id , tu.user_id userid , tu.tenant_id tenantid , tu.tenant_app_id tenantappid , tu.shop_id shopid , tu.erp_member_id memberuserid , tu.user_name username , tu.mobile_no mobileno , ifnull ( tu.sex , 0 ) sex , tu.birthday , tu.birthday_is_lunar birthdayislunar , tu.memorial_name memorialname , tu.memorial_day memorialday , tu.memorial_day_is_lunar memorialdayislunar , tu.create_time createtime , '2019-08-0623:59:59.0' updatetime , if ( tu.bind_time is null , 0 , 1 ) bindflag , if ( tu.mobile_no is null , 0 , 1 ) fullflag , ifnull ( em.consumption_integral , 0 ) consumptionintegral , em.grade_erp_id gradeerpid , tu.bind_time bindtime , if ( ifnull ( tu.is_subscribe , 0 ) = 0 , 1 , 0 ) cancelflag , if ( ifnull ( tu.is_subscribe , 0 ) = 1 , 1 , 0 ) subscribeflag , if ( tu.is_subscribe = 1 , null , tu.subscribe_time ) canceltime , tu.subscribe_time from user_service.tenant_user tu left join user_service.erp_member em on tu.tenant_app_id = em.tenant_wechatapp_id and tu.erp_member_id = em.member_erp_id where tu.tenant_app_id = :5 and em.update_time >= :6 and tu.create_time <= :7 and em.update_time <= :8 limit :9 offset :10|1|6|6||0|0|46562|46562|5000|5000|
|tag_service|delete from tag_service.batch_job_execution_params where job_execution_id <= :1|1|2|2||0|0|298268|298268|0|0|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 382.00 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|23|23||0|0|0|0|0|0|
|tag_service|insert into tag_service.label_vip_match_471320523331211264_471366425118904320 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_471320523331211264_471366425118904320 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|1|1||0|0|57847|57847|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|2|2||0|0|508299|508299|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|6|6||0|0|138506|138506|67|67|
|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|3|3||0|0|144911|144911|8|8|
|tag_service|delete from tag_service.label_vip_match_822257848045047808_822264540166144000 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_822257848045047808_822264540166144000 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|74537|74537|0|0|
|tag_service|insert into tag_service.label_vip_match_816096827580399616_816103866541051904 ( 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_816096827580399616_816103866541051904 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|56370|56370|0|0|
|facepass_sync|insert into `job_execution_log` ( `id` , `job_name` , `task_id` , `hostname` , `ip` , `sharding_item` , `execution_source` , `is_success` , `start_time` ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 )|1|25|25||0|0|0|0|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_907400816212623360 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|2|2||0|0|194310|194310|46|46|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 83.00 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|26|26||0|0|0|0|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|61|61||0|0|2710385|2710385|0|0|
|tenant|insert into erp_sales_detail ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_index , sales_type , product_barcode , product_name , cert_no , hand_size , category_erp_id , category_name , stone_weight , gold_weight , total_weight , quantity , amount_total , amount_pay , integral , remark ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , 1235.00 , 1235.00 , 124.00 , :16 ) on duplicate key update sales_type = :17 , product_barcode = :18 , product_name = :19 , cert_no = :20 , hand_size = :21 , category_erp_id = :22 , category_name = :23 , stone_weight = :24 , gold_weight = :25 , total_weight = :26 , quantity = :27 , amount_total = 1235.00 , amount_pay = 1235.00 , integral = 124.00 , remark = :28|1|8|8||0|0|0|0|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_488003299602206720 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|2|2||0|0|136610|136610|56|56|
|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|3|3||0|0|171672|171672|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 ) and ( user.nick_name like concat ( :29 , :30 , :31 ) or tenantuser.mobile_no = :32 ) )|1|3|3||0|0|33647|33647|1|1|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 355.00 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|18|18||0|0|0|0|0|0|
|tag_service|delete from tag_service.label_vip_match_829922417672491008_829968320848510976 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_829922417672491008_829968320848510976 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|28340|28340|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_822257848045047808 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|313537|313537|19|19|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , -1062.33 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|26|26||0|0|0|0|0|0|
|tag_service|delete from tag_service.label_vip_match_916119427764772864_918632942668926976 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_916119427764772864_918632942668926976 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|4|4||0|0|78729|78729|0|0|
|tag_service|insert into tag_service.label_vip_match_814019237554196480_814024519298617344 ( 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_814019237554196480_814024519298617344 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|48024|48024|0|0|
|tag_service|delete from tag_service.label_vip_match_818707624273952768_818711793240154112 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_818707624273952768_818711793240154112 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|83715|83715|0|0|
|tag_service|delete from tag_service.label_vip_match_822257848045047808_822267157453774848 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_822257848045047808_822267157453774848 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|72791|72791|0|0|
|tag_service|delete from tag_service.label_vip_match_816440425157005312_816442247884083200 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_816440425157005312_816442247884083200 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|1|1||0|0|57917|57917|0|0|
|statistic|select tmp.tenant_id , tmp.tenant_app_id , tmp.grade_erp_id , tmp.grade_name , tmp.shop_id , tmp.shop_name , sum ( tmp.amount ) amount from ( select t.tenant_id , t.tenant_app_id , ifnull ( t.grade_erp_id , -1 ) grade_erp_id , if ( t.grade_erp_id is null , '无' , ifnull ( gd.grade_name , '' ) ) grade_name , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , t.amount from ( select mb.tenant_id , mb.tenant_app_id , mb.shop_id , mt.grade_erp_id , count ( * ) amount from statistic.member mb left join statistic.member_extra mt on mb.id = mt.id where mb.tenant_app_id = :1 and mb.create_time between :2 and :3 and mb.register_flag = :4 group by mb.tenant_id , mb.tenant_app_id , mb.shop_id , mt.grade_erp_id ) t left join statistic.grade gd on t.tenant_id = gd.tenant_id and t.grade_erp_id = gd.grade_erp_id left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and ( t.shop_id = os.dept_erp_id or t.shop_id = os.shop_id ) ) tmp group by tmp.tenant_id , tmp.tenant_app_id , tmp.grade_erp_id , tmp.grade_name , tmp.shop_id , tmp.shop_name|1|1|1||0|0|362581|362581|29|29|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 183.00 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|26|26||0|0|0|0|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_476787156229165056 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|7|7||0|0|533303|533303|132|132|
||update value_added.`value_added_user_extend` t0 join value_added.`value_added_user` t1 on t0.id = t1.id join tenant.erp_sales t2 on t1.tenant_wechatapp_id = t2.tenant_wechatapp_id and t1.sales_erp_id = t2.sales_erp_id join tenant.erp_sales_detail t3 on t1.tenant_wechatapp_id = t3.tenant_wechatapp_id and t1.sales_erp_id = t3.sales_erp_id and t1.sales_index = t3.sales_index set t0.sales_no = t2.sales_no , t0.dept_erp_id = t2.dept_erp_id , t0.employee_erp_id = t2.employee_erp_id , t0.employee_name = t2.employee_name , t0.sales_date = t2.sales_date , t0.category_erp_id = t3.category_erp_id|1|37|37||0|0|607984|607984|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|75399|75399|0|0|
|platform|select `tasktype` , `tasktime` , `taskstatus` , `bid` , `vendorid` , `uid` , `completetime` , `remark` , `createtime` , `id` from `taskassignment` where `bid` = :1 and `tasktype` = :2 and `tasktime` = :3 and `vendorid` = :4 and `uid` = :5|1|2|2||0|0|628594|628594|0|0|
|platform|select `vendorid` , `memberid` , `salesdate` , `noteid` , `noteno` , `empid` , `empname` , `amounttotal` , `quantitytotal` , `integraltotal` , `salesstoreid` , `staffattitude` , `professionallevel` , `appearance` , `storeimage` , `productdisplay` , `salescomment` , `commenttime` , `replycontent` , `replytime` , `replyuser` , `tipfee` , `tipmorderid` , `tippayno` , `tippaytime` , `status` , `aftersalesremark` , `uid` , `eid` , `sid` , `id` from `saleslog` where vendorid = :1 and status = :2 and date_sub ( curdate ( ) , interval :3 day ) = date_format ( salesdate , :4 )|1|4|4||0|0|120774|120774|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_836363095600320512 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|1|1||0|0|157341|157341|5|5|
|authorization_service|update user_login_token set login_code = :1 where id = :2|1|28|28||0|0|1|1|0|0|
|tag_service|delete from tag_service.label_vip_match_822257848045047808_822282586666606592 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_822257848045047808_822282586666606592 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|70512|70512|0|0|
|tag_service|delete from tag_service.label_vip_match_817878088380628992_836466365488484352 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_817878088380628992_836466365488484352 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|1|1||0|0|68512|68512|0|0|
|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|313717|313717|0|0|
|tenant|insert into erp_sales ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_no , sales_date , member_erp_id , employee_erp_id , employee_name , dept_erp_id , amount , sales_remark , receipts , sales_status , is_sales , busi_date ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , 2399.04 , :10 , :11 , :12 , :13 , :14 ) on duplicate key update sales_date = :15 , member_erp_id = :16 , employee_erp_id = :17 , employee_name = :18 , dept_erp_id = :19 , amount = 2399.04 , sales_remark = :20 , receipts = :21 , sales_status = :22 , is_sales = :23 , busi_date = :24|1|17|17||0|0|0|0|0|0|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 844.00 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|20|20||0|0|0|0|0|0|
|tag_service|delete from tag_service.label_vip_match_839295151019966464_839642460417216512 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_839295151019966464_839642460417216512 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|34344|34344|0|0|
|tag_service|delete from tag_service.label_vip_match_814020764498956288_823708811058520064 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_814020764498956288_823708811058520064 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|33962|33962|0|0|
|platform|update `component` set `verifyticket` = :1 , `ticketovertime` = :2 , `token` = :3 , `tokenovertime` = :4 , `preauthcode` = :5 , `preauthcodeovertime` = :6 , `updatetime` = :7 , `createtime` = :8 where `id` = :9|1|26|26||0|0|1|1|0|0|
|message_push|insert into message_log ( id , tenant_id , tenant_app_id , user_id , scene_type , post_data , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , ... , \\"tenant_wechatapp_id\\":\\"818734782652387328\\"}"}' , :6 , :7 )|1|10|10||0|0|0|0|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 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|4|4||0|0|1387015|1387015|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_816869802005020672 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|67766|67766|0|0|
|customize_page|select id , tenant_id , tenant_wechatapp_id , page_id , user_id , tenant_app_open_id , create_time , update_time , business_id , src_type , user_name , mobile_no , head_img from award_qualified where tenant_wechatapp_id = :1 and page_id = :2 and ( user_id = :3 or tenant_app_open_id = :4 )|1|1|1||0|0|14921|14921|0|0|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 59.00 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|9|9||0|0|0|0|0|0|
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 3715870.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 3715870.00 , user_name = :16 , create_time = create_time|1|12|12||0|0|0|0|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_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|6|6||0|0|697818|697818|44|44|
|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_489024659472388096 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|7200|7200|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_469175049962786816 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|7995|7995|8|8|
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 576.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 576.00 , user_name = :16 , create_time = create_time|1|26|26||0|0|0|0|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_835720547919761408 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_835720547919761408 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|1|1|1||0|0|5049|5049|0|0|
|warranty_service|insert into warranty ( id , tenant_wechatapp_id , user_id , erp_sales_id , update_user_id , warranty_no , is_disable , warranty_data , employee_erp_id , dept_erp_id , sales_no , sales_date ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , ... 抹零：2.00 现金：13498.00","userid":"923146617614282752","amount":13500,"detail":[{"id":"477929656573008601","saleserpid":"8665","salestype":"销售","productbarcode":"1907130079","productname":"足金手镯","certno":"","categoryname":"足金（g）","totalweight":"","stoneweight":"0.000","goldweight":"","remark":"","quantity":1,"amounttotal":3661,"imgurls":["https://api.weixin.qq.com/cgi-bin/media/get?access_token = 24_gkpi1z_g31kq-n6w7tnous22qb6dqtdrg729n1o8secuol6hgqt_3rymqeftdnyb18rfvm7es2x1bwhg9o5v9ii4hmg7qvkjia1sr1_ueterl3_40anqgsyfwaxzwu2fzhngfrmh_div2lhkwlrbamdapv&media_id = _o7whdbvcattrgz3rbylr9agrqasmcqd8h96k0diz5xchvfpsjw5c7_xujvejeuj"],"serverids":["_o7whdbvcattrgz3rbylr9agrqasmcqd8h96k0diz5xchvfpsjw5c7_xujvejeuj"]},{"id":"477929656573008602","saleserpid":"8665","salestype":"销售","productbarcode":"1907130094","productname":"足金手镯","certno":"","categoryname":"足金（g）","totalweight":"","stoneweight":"0.000","goldweight":"","remark":"","quantity":1,"amounttotal":3661,"imgurls":["https://api.weixin.qq.com/cgi-bin/media/get?access_token = 24_gkpi1z_g31kq-n6w7tnous22qb6dqtdrg729n1o8secuol6hgqt_3rymqeftdnyb18rfvm7es2x1bwhg9o5v9ii4hmg7qvkjia1sr1_ueterl3_40anqgsyfwaxzwu2fzhngfrmh_div2lhkwlrbamdapv&media_id = bcpolut5yyjizlkgzgp8jcvc0tyaiv0eb1tl188ek3qlqa4j7ptg9oxtrb4qdqmf"],"serverids":["bcpolut5yyjizlkgzgp8jcvc0tyaiv0eb1tl188ek3qlqa4j7ptg9oxtrb4qdqmf"]},{"id":"477929656573008603","saleserpid":"8665","salestype":"销售","productbarcode":"286889","productname":"足金手镯","certno":"","categoryname":"足金（g）","totalweight":"","stoneweight":"0.000","goldweight":"","remark":"","quantity":1,"amounttotal":3091,"imgurls":["https://api.weixin.qq.com/cgi-bin/media/get?access_token = 24_gkpi1z_g31kq-n6w7tnous22qb6dqtdrg729n1o8secuol6hgqt_3rymqeftdnyb18rfvm7es2x1bwhg9o5v9ii4hmg7qvkjia1sr1_ueterl3_40anqgsyfwaxzwu2fzhngfrmh_div2lhkwlrbamdapv&media_id = 1fn1qipbinotylwqfga0wb7bwszrgm8x-lz0kmhvwncxnkmzopgdcmrzx_3tzu89"],"serverids":["1fn1qipbinotylwqfga0wb7bwszrgm8x-lz0kmhvwncxnkmzopgdcmrzx_3tzu89"]},{"id":"477929656573008604","saleserpid":"8665","salestype":"销售","productbarcode":"286894","productname":"足金手镯","certno":"","categoryname":"足金（g）","totalweight":"","stoneweight":"0.000","goldweight":"","remark":"","quantity":1,"amounttotal":3087,"imgurls":["https://api.weixin.qq.com/cgi-bin/media/get?access_token = 24_gkpi1z_g31kq-n6w7tnous22qb6dqtdrg729n1o8secuol6hgqt_3rymqeftdnyb18rfvm7es2x1bwhg9o5v9ii4hmg7qvkjia1sr1_ueterl3_40anqgsyfwaxzwu2fzhngfrmh_div2lhkwlrbamdapv&media_id = msq766tmytgbqt6ow-sodpewzhtb8eig3aivuqggbna5vk5icwm1w6tzusfkrjoo"],"serverids":["msq766tmytgbqt6ow-sodpewzhtb8eig3aivuqggbna5vk5icwm1w6tzusfkrjoo"]}]}' , :8 , :9 , :10 , :11 )|1|13|13||0|0|0|0|0|0|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 830.00 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|20|20||0|0|0|0|0|0|
|tag_service|delete from tag_service.label_vip_match_490540971604447232_491197539744354304 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_490540971604447232_491197539744354304 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|34396|34396|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_816450513213112320 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|20549|20549|4|4|
|activity_service|select count ( 0 ) from activity_service.user_trace t1 join activity_service.activity t2 on t1.activity_id = t2.id where t1.status = :1 and t2.tenant_wechatapp_id = :2 and t2.activity_type = :3 and t2.id = :4 and t1.step = :5|1|5|5||0|0|877091|877091|1|1|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 1333.00 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|23|23||0|0|0|0|0|0|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 7411.33 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|18|18||0|0|0|0|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|3|3||0|0|92276|92276|26|26|
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 82.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 82.00 , user_name = :16 , create_time = create_time|1|28|28||0|0|0|0|0|0|
|platform|insert into `wetplsend` ( `vendorid` , `uid` , `templateid` , `data` , `sendtime` , `linkurl` ) values ( :1 , :2 , :3 , ... , 您有新的待办事项。\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"线下销售第三次回访\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"2019-08-07\",\"color\":\"#173177\"},\"remark\":{\"value\":\"请点击详情进行处理！\",\"color\":\"#173177\"}}' , :4 , :5 )|1|9|9||0|0|0|0|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_490810080325931008 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|2|2||0|0|157376|157376|0|0|
|tag_service|delete from tag_service.label_vip_match_839295151019966464_839654427978682368 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_839295151019966464_839654427978682368 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|37500|37500|0|0|
|warranty_service|insert into warranty ( id , tenant_wechatapp_id , user_id , erp_sales_id , update_user_id , warranty_no , is_disable , warranty_data , employee_erp_id , dept_erp_id , sales_no , sales_date ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , ... 二维码--微信：61.00","userid":"836823480828727296","amount":61,"detail":[{"id":"477929656572999753","saleserpid":"163261","salestype":"销售","productbarcode":"9241137674416","productname":"足金耳钉","certno":"1218004579651","categoryname":"黄金 ( g ) ... = 24_b8au-t-qpb6pwyyfzdjhjerpwxs1lcxkra1jj7nydef40hrmvdyox4rqde0p2ac92gqgtjdnlmykvdqsqgrfsqg2fd14wddndwhbk7woej5v2-h_od_hwqj_bx1udznmgqho4b4nf26vzrnegfsdahdwvi&media_id = owqhaqokppc0oem5hnc7btxsi8i0mxabcb8iptqmaorvbhk2myoqjtyinu6wg689"],"serverids":["owqhaqokppc0oem5hnc7btxsi8i0mxabcb8iptqmaorvbhk2myoqjtyinu6wg689"]},{"id":"477929656572999754","saleserpid":"163261","salestype":"以旧换新","productbarcode":"bmw","productname":"梦金园足金9999旧料","certno":"","categoryname":"旧料","totalweight":"0.00g","stoneweight":"0.000","goldweight":"0.00g","remark":"","quantity":0,"amounttotal":-620,"imgurls":[],"serverids":null}]}' , :8 , :9 , :10 , :11 )|1|19|19||0|0|0|0|0|0|
|account|select sales_date , tenant_id , tenant_wechatapp_id tenant_app_id , dept_erp_id shop_id , employee_erp_id user_id , count ( * ) amount from tenant.erp_sales where tenant_wechatapp_id = :1 and sales_status = :2 and is_sales = :3 and create_time <= :4 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , employee_erp_id|1|1|1||0|0|301129|301129|55042|55042|
|tenant|insert into erp_sales ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_no , sales_date , member_erp_id , employee_erp_id , employee_name , dept_erp_id , amount , sales_remark , receipts , sales_status , is_sales , busi_date ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , 2005.00 , :10 , :11 , :12 , :13 , :14 ) on duplicate key update sales_date = :15 , member_erp_id = :16 , employee_erp_id = :17 , employee_name = :18 , dept_erp_id = :19 , amount = 2005.00 , sales_remark = :20 , receipts = :21 , sales_status = :22 , is_sales = :23 , busi_date = :24|1|18|18||0|0|0|0|0|0|
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 1.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 1.00 , user_name = :16 , create_time = create_time|1|14|14||0|0|0|0|0|0|
|message_push|delete from message_log where create_time < :1|1|17|17||0|0|200791|200791|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_487569764496052224 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|3|3||0|0|119418|119418|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|532397|532397|4|4|
|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|811752|811752|610|610|
|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|5|5||0|0|294394|294394|0|0|
|activity_service|select t1.id , t1.tenant_app_id as tenantappid , t1.user_id as userid , t1.user_name as username , t1.mobile_no as mobileno , t1.user_apply_id as userapplyid , t1.step , t1.data , t1.partake_data as partakedata , t2.id as activityid , t2.activity_name as activityname , t2.activity_type as activitytype , t1.create_time as time from activity_service.user_trace t1 join activity_service.activity t2 on t1.activity_id = t2.id where t1.status = :1 and t2.tenant_wechatapp_id = :2 and t2.activity_type = :3 and t1.step = :4 order by t1.create_time desc limit :5|1|1|1||0|0|1290765|1290765|20|20|
|tag_service|insert into tag_service.label_vip_match_819000302970638336_819053378054164480 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_819000302970638336_819053378054164480 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|2|2||0|0|51351|51351|0|0|
|tag_service|insert into tag_service.label_vip_match_882402759662481408_882404155665268736 ( 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_882402759662481408_882404155665268736 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|70367|70367|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|5|5||0|0|1387717|1387717|101|101|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_816096827580399616 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|2|2||0|0|169478|169478|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_821229068421742592 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|3|3||0|0|192259|192259|206|206|
|message_push|insert into message_log ( id , tenant_id , tenant_app_id , user_id , scene_type , post_data , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , ... = 823710703591407616#/member/shopping_record","data":{"keyword5":{"value":"qtxsd-0013-00008190","color":"#000066"},"keyword3":{"value":"560.00","color":"#000066"},"keyword4":{"value":"2019-08-07","color":"#000066"},"keyword1":{"value":"岳化周六福","color":"#000066"},"keyword2":{"value":"金au750项链 , 金au750项链","color":"#000066"},"remark":{"value":"点击“详情”查看消费明细","color":"#ff3399"},"first":{"value":"感谢惠顾！","color":"#000000"}},"appid":null,"pagepath":null}' , :6 , :7 )|1|21|21||0|0|0|0|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_469175049962786816 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_469175049962786816 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|19110|19110|0|0|
|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.warrate desc ) tmp_count|1|4|4||0|0|1000510|1000510|1|1|
|tenant|select id , tenant_id as tenantid , tenant_wechatapp_id as tenantwechatappid , sales_erp_id as saleserpid , sales_index as salesindex , sales_type as salestype , product_barcode as productbarcode , product_name as productname , cert_no as certno , hand_size as handsize , category_erp_id as categoryerpid , category_name as categoryname , stone_weight as stoneweight , gold_weight as goldweight , total_weight as totalweight , quantity , amount_total as amounttotal , amount_pay as amountpay , integral , remark from erp_sales_detail where tenant_id = :1 and tenant_wechatapp_id = :2 and sales_erp_id = :3 order by sales_index|1|8|8||0|0|2|2|2|2|
|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|5|5||0|0|318771|318771|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_922378989354409984_922381553475047424 where vip_id = :1|1|1|1||0|0|99192|99192|1|1|
|tag_service|delete from tag_service.label_vip_match_490540971604447232_490549485626331136 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_490540971604447232_490549485626331136 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|24406|24406|0|0|
|tag_service|delete from tag_service.label_vip_match_817517269994225664_817533420308570112 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_817517269994225664_817533420308570112 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|1|1||0|0|34930|34930|0|0|
|tag_service|insert into tag_service.label_vip_match_889699715132813312_889999611513671680 ( 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_889699715132813312_889999611513671680 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|44745|44745|0|0|
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 32.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 32.00 , user_name = :16 , create_time = create_time|1|18|18||0|0|0|0|0|0|
|tag_service|insert into tag_service.label_vip_match_818623050667823104_818630542999207936 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_818623050667823104_818630542999207936 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|1|1||0|0|81951|81951|0|0|
|tag_service|delete from tag_service.label_vip_match_477416547359526912_477418729651703808 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_477416547359526912_477418729651703808 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|3|3||0|0|35933|35933|0|0|
|tenant|insert into erp_sales ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_no , sales_date , member_erp_id , employee_erp_id , employee_name , dept_erp_id , amount , sales_remark , receipts , sales_status , is_sales , busi_date ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , 59.00 , :10 , :11 , :12 , :13 , :14 ) on duplicate key update sales_date = :15 , member_erp_id = :16 , employee_erp_id = :17 , employee_name = :18 , dept_erp_id = :19 , amount = 59.00 , sales_remark = :20 , receipts = :21 , sales_status = :22 , is_sales = :23 , busi_date = :24|1|9|9||0|0|0|0|0|0|
|statistic|select tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , sum ( tmp.cancel_amount ) cancel_amount , sum ( tmp.full_amount ) full_amount , sum ( tmp.bind_amount ) bind_amount , sum ( tmp.subscribe_amount ) subscribe_amount from ( select t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , t.cancel_amount , t.full_amount , t.bind_amount , t.subscribe_amount from ( select mb.tenant_id , mb.tenant_app_id , mb.shop_id , sum ( if ( mb.subscribe_flag = 0 , 1 , 0 ) ) cancel_amount , sum ( if ( mb.subscribe_flag = 1 , 1 , 0 ) ) subscribe_amount , sum ( if ( mb.bind_flag = 1 , 1 , 0 ) ) bind_amount , sum ( if ( mb.full_flag = 1 , 1 , 0 ) ) full_amount from statistic.member mb where mb.tenant_app_id = :1 and mb.create_time between :2 and :3 and mb.register_flag = :4 group by mb.tenant_id , mb.tenant_app_id , mb.shop_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and ( t.shop_id = os.dept_erp_id or t.shop_id = os.shop_id ) ) tmp group by tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name|1|1|1||0|0|362008|362008|22|22|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_832396582723833856 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|1|1||0|0|19923|19923|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|25|25||0|0|1111734|1111734|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_480726380749918208 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_480726380749918208 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|137936|137936|12|12|
|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|533303|533303|132|132|
|value_added|-- 根据添加时间得出当前增值金额 update value_added_user set amount_added = if ( :1 > ( ( ( added_percent_per_day / :2 ) * if ( :3 >= timestampdiff ( day , date_format ( start_add_time , :4 ) , now ( ) ) :5 :6 :7 add_days , timestampdiff ( day , date_format ( start_add_time , :8 ) , now ( ) ) :9 :10 , add_days ) ) :11 ( ( devalue_percent_per_day / :12 ) * if ( :13 >= timestampdiff ( day , date_format ( start_add_time , :14 ) , now ( ) ) :15 :16 :17 add_days :18 keeping_days , :19 , timestampdiff ( day , date_format ( start_add_time , :20 ) , now ( ) ) :21 :22 :23 add_days :24 keeping_days ) ) ) * amount_pay , :25 , ( ( ( added_percent_per_day / :26 ) * if ( :27 >= timestampdiff ( day , date_format ( start_add_time , :28 ) , now ( ) ) :29 :30 :31 add_days , timestampdiff ( day , date_format ( start_add_time , :32 ) , now ( ) ) :33 :34 , add_days ) ) :35 ( ( devalue_percent_per_day / :36 ) * if ( :37 >= timestampdiff ( day , date_format ( start_add_time , :38 ) , now ( ) ) :39 :40 :41 add_days :42 keeping_days , :43 , timestampdiff ( day , date_format ( start_add_time , :44 ) , now ( ) ) :45 :46 :47 add_days :48 keeping_days ) ) ) * amount_pay ) , update_time = now ( ) where state = :49 and update_time <= curdate ( ) and ( start_add_time >= date_add ( curdate ( ) , interval :50 ( add_days :51 keeping_days :52 :53 ) day ) or ( amount_added > :54 and start_add_time < date_add ( curdate ( ) , interval :55 ( add_days :56 keeping_days :57 :58 ) day ) ) ) -- 判断条件 在增值时间内 增值金大于0 状态正常|1|2|2||0|0|153092|153092|0|0|
|statistic|delete from statistic.batch_step_execution where step_execution_id <= :1|1|1|1||0|0|24847|24847|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_882402759662481408_882404155665268736 where vip_id = :1|1|2|2||0|0|70295|70295|1|1|
|platform|select s.* , ifnull ( pc.certsquantity , 0 ) as certsquantity , ifnull ( va.addvaluequantity , 0 ) as addvaluequantity from ( /*昨天的销售记录*/ select eid , vendorid , sid , count ( 1 ) as salesquantity from saleslog sl where vendorid = :1 and to_days ( :2 ) :3 to_days ( salesdate ) = :4 group by eid , vendorid , sid ) s left join ( /*昨天质保单*/ select eid , count ( 1 ) as certsquantity from productcerts where vendorid = :5 and to_days ( :6 ) :7 to_days ( createtime ) = :8 group by eid ) pc on s.eid = pc.eid left join ( /*昨天的增值计划*/ select empid , count ( 1 ) as addvaluequantity from valueaddedlog where vendorid = :9 and to_days ( :10 ) :11 to_days ( createtime ) = :12 group by empid ) va on va.empid = s.eid|1|2|2||0|0|46241|46241|0|0|
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 2743.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 2743.00 , user_name = :16 , create_time = create_time|1|29|29||0|0|0|0|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_816096827580399616 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_816096827580399616 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|3|3||0|0|92329|92329|0|0|
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 59799.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 59799.00 , user_name = :16 , create_time = create_time|1|25|25||0|0|0|0|0|0|
|activity_service|select id , tenant_id , tenant_wechatapp_id , activity_id , acitivity_type , user_id , qualified_id , page_id , scene_type , scene_biz_id , create_time , update_time from activity_gift_grant where activity_id = :1 and acitivity_type = :2 and user_id = :3 and scene_type = :4 and scene_biz_id = :5|1|2|2||0|0|161973|161973|1|1|
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 1030.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 1030.00 , user_name = :16 , create_time = create_time|1|19|19||0|0|0|0|0|0|
|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|146305|146305|0|0|
|account|select id , tenant_id , tenant_wechatapp_id , account_type , user_id , mch_billno , send_name , mch_id , sub_mch_id , wxappid , msgappid , re_openid , total_amount , total_num , wishing , client_ip , act_name , remark , scene_id , risk_info , consume_mch_id , send_time , order_status , failure_reason , biz_id , biz_type , biz_tag , send_listid , need_callback , create_time , update_time , user_name , mobile_no , receive_time , refund_amount , refund_time from wx_redpacket_send_order where order_status in ( :1 , :2 ) order by id desc|1|2|2||0|0|19271|19271|5|5|
|tag_service|delete from tag_service.label_vip_match_816450513213112320_816523343191642112 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_816450513213112320_816523343191642112 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|36638|36638|0|0|
|statistic|delete from base_erp_member where tenant_app_id = :1|1|1|1||0|0|99081|99081|0|0|
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 10940.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 10940.00 , user_name = :16 , create_time = create_time|1|17|17||0|0|0|0|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|1|1||0|0|533225|533225|1|1|
|tenant|insert into erp_sales ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_no , sales_date , member_erp_id , employee_erp_id , employee_name , dept_erp_id , amount , sales_remark , receipts , sales_status , is_sales , busi_date ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , 800.00 , :10 , :11 , :12 , :13 , :14 ) on duplicate key update sales_date = :15 , member_erp_id = :16 , employee_erp_id = :17 , employee_name = :18 , dept_erp_id = :19 , amount = 800.00 , sales_remark = :20 , receipts = :21 , sales_status = :22 , is_sales = :23 , busi_date = :24|1|17|17||0|0|0|0|0|0|
|message_push|insert into message_log ( id , tenant_id , tenant_app_id , user_id , scene_type , post_data , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , ... , \\"tenant_wechatapp_id\\":\\"823695523771879424\\"}"}' , :6 , :7 )|1|22|22||0|0|0|0|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_476787156229165056 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and warranty_date = date_format ( :6 , :7 ) group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|532985|532985|88|88|
||update employee.backlog set status = :1 where status in ( :2 , :3 ) and expire_time < date_add ( now ( ) , interval :4 day )|1|2|2||0|0|1061565|1061565|0|0|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 3982.50 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|23|23||0|0|0|0|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.redpack_amount ) redpack_amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.redpack_amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , sum ( ifnull ( redpack_amount , 0 ) ) redpack_amount from statistic.erp_sales_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|532369|532369|0|0|
|platform|commit|1|30|30||0|0|0|0|0|0|
|user_service|update tenant_user set user_id = :1 , tenant_id = :2 , tenant_app_id = :3 , tenant_app_open_id = :4 , is_subscribe = :5 , subscribe_time = :6 , is_update_info = :7 , shop_id = :8 , erp_member_id = :9 , mobile_no = :10 , user_name = :11 , head_img_url = :12 , sex = :13 , birthday = :14 , birthday_is_lunar = :15 , memorial_name = :16 , memorial_day_is_lunar = :17 , wx_card_code = :18 , wx_card_no = :19 , status = :20 , bind_time = :21 , create_time = create_time where id = :22|1|9|9||0|0|1|1|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.redpack_amount ) redpack_amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.redpack_amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , sum ( ifnull ( redpack_amount , 0 ) ) redpack_amount from statistic.erp_sales_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|508299|508299|0|0|
|activity_service|select id , tenant_id , tenant_wechatapp_id , activity_id , acitivity_type , user_id , qualified_id , page_id , scene_type , scene_biz_id , create_time , update_time from activity_gift_grant where activity_id = :1 and acitivity_type = :2 and user_id = :3 and scene_type = :4|1|2|2||0|0|161980|161980|0|0|
|statistic|select sd.product_barcode , ifnull ( es.amount , 0 ) amount , sd.tenant_app_id , es.sales_date , es.dept_erp_id , sd.tenant_id , ifnull ( sd.statistic_date , es.sales_date ) statistic_date from ( select tenant_id , tenant_app_id , sales_erp_id , product_barcode , date_format ( create_time , '%y-%m-%d' ) statistic_date from statistic.erp_sales_detail_823688108565368832 where tenant_app_id = :1 and create_time >= :2 and create_time <= :3 and sales_type = :4 and sales_status = :5 ) sd inner join ( select tenant_id , tenant_app_id , sales_erp_id , amount , sales_date , dept_erp_id from statistic.erp_sales_823688108565368832 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|1|2|2||0|0|511000|511000|0|0|
|message_push|insert into message_log ( id , tenant_id , tenant_app_id , user_id , scene_type , post_data , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , ... , \\"tenant_wechatapp_id\\":\\"823856782299402240\\"}"}' , :6 , :7 )|1|11|11||0|0|0|0|0|0|
|tag_service|delete from tag_service.label_vip_match_816869802005020672_816875333662851072 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_816869802005020672_816875333662851072 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|50648|50648|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|2|2||0|0|394203|394203|41|41|
|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|1|9|9||0|0|349420|349420|1|1|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 312.66 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|20|20||0|0|0|0|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_907400816212623360 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|3|3||0|0|318594|318594|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|2|2||0|0|89142|89142|0|0|
|statistic|update erp_sales_476787156229165056 set user_id = :1 , user_name = :2 , mobile_no = :3 where tenant_app_id = :4 and member_erp_id = :5 and user_name is null|1|2|2||0|0|4517|4517|0|0|
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 10999.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 10999.00 , user_name = :16 , create_time = create_time|1|17|17||0|0|0|0|0|0|
|tag_service|delete from tag_service.label_vip_match_817878088380628992_817882952124895232 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_817878088380628992_817882952124895232 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|112296|112296|0|0|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 30.00 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|26|26||0|0|0|0|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|1|6|6||0|0|462937|462937|0|0|
|timer|update task_info set next_time = :1 where id = :2|1|21|21||0|0|1|1|0|0|
|platform|select ifnull ( eid , 0 ) as eid , ifnull ( shopid , 0 ) as sid , vendorid , count ( 1 ) as quantity from productcerts where vendorid = :1 and to_days ( :2 ) :3 to_days ( createtime ) = :4 group by eid , shopid , vendorid|1|1|1||0|0|28984|28984|0|0|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 1009.00 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|18|18||0|0|0|0|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|7|7||0|0|509598|509598|0|0|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 82.00 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|29|29||0|0|0|0|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_822257848045047808 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|313544|313544|20|20|
|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_907400816212623360 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_907400816212623360 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|4|4||0|0|318594|318594|0|0|
|warranty_service|insert into warranty ( id , tenant_wechatapp_id , user_id , erp_sales_id , update_user_id , warranty_no , is_disable , warranty_data , employee_erp_id , dept_erp_id , sales_no , sales_date ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , ... 现金：5200.00","userid":"923331813185736704","amount":5200,"detail":[{"id":"477929656573013223","saleserpid":"103319","salestype":"销售","productbarcode":"18014066","productname":"翡翠手镯","certno":"jj1102011","categoryname":"翡翠","totalweight":"46.18g","stoneweight":"0.000","goldweight":"0.00g","remark":"","quantity":1,"amounttotal":5200,"imgurls":["https://api.weixin.qq.com/cgi-bin/media/get?access_token = 24_fqt6nmkhhloi64pxlexlgsdfl00xzmr2ivgpmb35ntpyc-lvjs8wqmqmonkk2gushj0-kizugvibwq9mj4eqnn3lhk3hc-lgxycwiwbs3rbaod9fpkiuqtbudaxixlffjctjqz1brmbfq68lffvhaddaaq&media_id = mtgg5wegcgfvukr6eoyh3kp7phh1klxhrfqlt5xwzlmf8znzwduajhka7ct_5v87"],"serverids":["mtgg5wegcgfvukr6eoyh3kp7phh1klxhrfqlt5xwzlmf8znzwduajhka7ct_5v87"]}]}' , :8 , :9 , :10 , :11 )|1|25|25||0|0|0|0|0|0|
|message_push|insert into message_log ( id , tenant_id , tenant_app_id , user_id , scene_type , post_data , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , ... , \\"tenant_wechatapp_id\\":\\"841822506628247552\\"}"}' , :6 , :7 )|1|28|28||0|0|0|0|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_823844580729339904 where tenant_app_id = :1 and create_time >= :2 and create_time <= :3 and sales_type = :4 and sales_status = :5 ) sd inner join ( select tenant_id , tenant_app_id , sales_erp_id , amount , sales_date , dept_erp_id from statistic.erp_sales_823844580729339904 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|1|2|2||0|0|97324|97324|2|2|
|tenant|insert into erp_sales ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_no , sales_date , member_erp_id , employee_erp_id , employee_name , dept_erp_id , amount , sales_remark , receipts , sales_status , is_sales , busi_date ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , 2320.00 , :10 , :11 , :12 , :13 , :14 ) on duplicate key update sales_date = :15 , member_erp_id = :16 , employee_erp_id = :17 , employee_name = :18 , dept_erp_id = :19 , amount = 2320.00 , sales_remark = :20 , receipts = :21 , sales_status = :22 , is_sales = :23 , busi_date = :24|1|17|17||0|0|0|0|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_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|5|5||0|0|395196|395196|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 )|1|1|1||0|0|1302|1302|1|1|
|tag_service|delete from tag_service.label_vip_match_469175049962786816_470281367440199680 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_469175049962786816_470281367440199680 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|22428|22428|0|0|
|platform|select count ( 1 ) from `smssent` where vendorid = :1 and success = true and date_sub ( date ( :2 ) , interval :3 day ) = date_format ( senttime , :4 )|1|3|3||0|0|66068|66068|1|1|
|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 id in ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 , :31 , :32 , :33 , :34 , :35 , :36 , :37 , :38 , :39 , :40 , :41 , :42 , :43 , :44 , :45 , :46 , :47 , :48 , :49 , :50 , :51 , :52 , :53 , :54 , :55 , :56 , :57 , :58 , :59 , :60 , :61 , :62 , :63 , :64 , :65 , :66 , :67 , :68 , :69 , :70 , :71 , :72 , :73 , :74 , :75 , :76 , :77 , :78 , :79 , :80 , :81 , :82 , :83 , :84 , :85 , :86 , :87 , :88 , :89 , :90 , :91 , :92 , :93 , :94 , :95 , :96 , :97 , :98 , :99 , :100 , :101 , :102 , :103 , :104 , :105 , :106 , :107 , :108 , :109 , :110 , :111 , :112 , :113 , :114 , :115 , :116 , :117 , :118 , :119 , :120 , :121 , :122 , :123 , :124 , :125 , :126 , :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 , :347 , :348 , :349 , :350 , :351 , :352 , :353 , :354 , :355 , :356 , :357 , :358 , :359 , :360 , :361 , :362 , :363 , :364 , :365 , :366 , :367 , :368 , :369 , :370 , :371 , :372 , :373 , :374 , :375 , :376 , :377 , :378 , :379 , :380 , :381 , :382 , :383 , :384 , :385 , :386 , :387 , :388 , :389 , :390 , :391 , :392 , :393 , :394 , :395 , :396 , :397 , :398 , :399 , :400 , :401 , :402 , :403 , :404 , :405 , :406 , :407 , :408 , :409 , :410 , :411 , :412 , :413 , :414 , :415 , :416 , :417 , :418 , :419 , :420 , :421 , :422 , :423 , :424 , :425 , :426 , :427 , :428 , :429 , :430 , :431 , :432 , :433 , :434 , :435 , :436 , :437 , :438 , :439 , :440 , :441 , :442 , :443 , :444 , :445 , :446 , :447 , :448 , :449 , :450 , :451 , :452 , :453 , :454 , :455 , :456 , :457 , :458 , :459 , :460 , :461 , :462 , :463 , :464 , :465 , :466 , :467 , :468 , :469 , :470 , :471 , :472 , :473 , :474 , :475 , :476 , :477 , :478 , :479 , :480 , :481 , :482 , :483 , :484 , :485 , :486 , :487 , :488 , :489 , :490 , :491 , :492 , :493 , :494 , :495 , :496 , :497 , :498 , :499 , :500 , :501 , :502 , :503 , :504 , :505 , :506 , :507 , :508 , :509 , :510 , :511 , :512 , :513 , :514 , :515 , :516 , :517 , :518 , :519 , :520 , :521 , :522 , :523 , :524 , :525 , :526 , :527 , :528 , :529 , :530 , :531 , :532 , :533 , :534 , :535 , :536 , :537 , :538 , :539 , :540 , :541 , :542 , :543 , :544 , :545 , :546 , :547 , :548 , :549 , :550 , :551 , :552 , :553 , :554 , :555 , :556 , :557 , :558 , :559 , :560 , :561 , :562 , :563 , :564 , :565 , :566 , :567 , :568 , :569 , :570 , :571 , :572 , :573 , :574 , :575 , :576 , :577 , :578 , :579 , :580 , :581 , :582 , :583 , :584 , :585 , :586 , :587 , :588 , :589 , :590 , :591 , :592 , :593 , :594 , :595 , :596 , :597 , :598 , :599 , :600 , :601 , :602 , :603 , :604 , :605 , :606 , :607 , :608 , :609 , :610 , :611 , :612 , :613 , :614 , :615 , :616 , :617 , :618 , :619 , :620 , :621 , :622 , :623 , :624 , :625 , :626 , :627 , :628 , :629 , :630 , :631 , :632 , :633 , :634 , :635 , :636 , :637 , :638 , :639 , :640 , :641 , :642 , :643 , :644 , :645 , :646 , :647 , :648 , :649 , :650 , :651 , :652 , :653 , :654 , :655 , :656 , :657 , :658 , :659 , :660 , :661 , :662 , :663 , :664 , :665 , :666 , :667 , :668 , :669 , :670 , :671 , :672 , :673 , :674 , :675 , :676 , :677 , :678 , :679 , :680 , :681 , :682 , :683 , :684 , :685 , :686 , :687 , :688 , :689 , :690 , :691 , :692 , :693 , :694 , :695 , :696 , :697 , :698 , :699 , :700 , :701 , :702 , :703 , :704 , :705 , :706 , :707 , :708 , :709 , :710 , :711 , :712 , :713 , :714 , :715 , :716 , :717 , :718 , :719 , :720 , :721 , :722 , :723 , :724 , :725 , :726 , :727 , :728 , :729 , :730 , :731 , :732 , :733 , :734 , :735 , :736 , :737 , :738 , :739 , :740 , :741 , :742 , :743 , :744 , :745 , :746 , :747 , :748 , :749 , :750 , :751 , :752 , :753 , :754 , :755 , :756 , :757 , :758 , :759 , :760 , :761 , :762 , :763 , :764 , :765 , :766 , :767 , :768 , :769 , :770 , :771 , :772 , :773 , :774 , :775 , :776 , :777 , :778 , :779 , :780 , :781 , :782 , :783 , :784 , :785 , :786 , :787 , :788 , :789 , :790 , :791 , :792 , :793 , :794 , :795 , :796 , :797 , :798 , :799 , :800 , :801 , :802 , :803 , :804 , :805 , :806 , :807 , :808 , :809 , :810 , :811 , :812 , :813 , :814 , :815 , :816 , :817 , :818 , :819 , :820 , :821 , :822 , :823 , :824 , :825 , :826 , :827 , :828 , :829 , :830 , :831 , :832 , :833 , :834 , :835 , :836 , :837 , :838 , :839 , :840 , :841 , :842 , :843 , :844 , :845 , :846 , :847 , :848 , :849 , :850 , :851 , :852 , :853 , :854 , :855 , :856 , :857 , :858 , :859 , :860 , :861 , :862 , :863 , :864 , :865 , :866 , :867 , :868 , :869 , :870 , :871 , :872 , :873 , :874 , :875 , :876 , :877 , :878 , :879 , :880 , :881 , :882 , :883 , :884 , :885 , :886 , :887 , :888 , :889 , :890 , :891 , :892 , :893 , :894 , :895 , :896 , :897 , :898 , :899 , :900 , :901 , :902 , :903 , :904 , :905 , :906 , :907 , :908 , :909 , :910 , :911 , :912 , :913 , :914 , :915 , :916 , :917 , :918 , :919 , :920 , :921 , :922 , :923 , :924 , :925 , :926 , :927 , :928 , :929 , :930 , :931 , :932 , :933 , :934 , :935 , :936 , :937 , :938 , :939 , :940 , :941 , :942 , :943 , :944 , :945 , :946 , :947 , :948 , :949 , :950 , :951 , :952 , :953 , :954 , :955 , :956 , :957 , :958 , :959 , :960 , :961 , :962 , :963 , :964 , :965 , :966 , :967 , :968 , :969 , :970 , :971 , :972 , :973 , :974 , :975 , :976 , :977 , :978 , :979 , :980 , :981 , :982 , :983 , :984 , :985 , :986 , :987 , :988 , :989 , :990 , :991 , :992 , :993 , :994 , :995 , :996 , :997 , :998 , :999 , :1000 , :1001 , :1002 , :1003 , :1004 , :1005 , :1006 , :1007 , :1008 , :1009 , :1010 , :1011 , :1012 , :1013 , :1014 , :1015 , :1016 , :1017 , :1018 , :1019 , :1020 , :1021 , :1022 , :1023 , :1024 , :1025 , :1026 , :1027 , :1028 , :1029 , :1030 , :1031 , :1032 , :1033 , :1034 , :1035 , :1036 , :1037 , :1038 , :1039 , :1040 , :1041 , :1042 , :1043 , :1044 , :1045 , :1046 , :1047 , :1048 , :1049 , :1050 , :1051 , :1052 , :1053 , :1054 , :1055 , :1056 , :1057 , :1058 , :1059 , :1060 , :1061 , :1062 , :1063 , :1064 , :1065 , :1066 , :1067 , :1068 , :1069 , :1070 , :1071 , :1072 , :1073 , :1074 , :1075 , :1076 , :1077 , :1078 , :1079 , :1080 , :1081 , :1082 , :1083 , :1084 , :1085 , :1086 , :1087 , :1088 , :1089 , :1090 , :1091 , :1092 , :1093 , :1094 , :1095 , :1096 , :1097 , :1098 , :1099 , :1100 , :1101 , :1102 , :1103 , :1104 , :1105 , :1106 , :1107 , :1108 , :1109 , :1110 , :1111 , :1112 , :1113 , :1114 , :1115 , :1116 , :1117 , :1118 , :1119 , :1120 , :1121 , :1122 , :1123 , :1124 , :1125 , :1126 , :1127 , :1128 , :1129 , :1130 , :1131 , :1132 , :1133 , :1134 , :1135 , :1136 , :1137 , :1138 , :1139 , :1140 , :1141 , :1142 , :1143 , :1144 , :1145 , :1146 , :1147 , :1148 , :1149 , :1150 , :1151 , :1152 , :1153 , :1154 , :1155 , :1156 , :1157 , :1158 , :1159 , :1160 , :1161 , :1162 , :1163 , :1164 , :1165 , :1166 , :1167 , :1168 , :1169 , :1170 , :1171 , :1172 , :1173 , :1174 , :1175 , :1176 , :1177 , :1178 , :1179 , :1180 , :1181 , :1182 , :1183 , :1184 , :1185 , :1186 , :1187 , :1188 , :1189 , :1190 , :1191 , :1192 , :1193 , :1194 , :1195 , :1196 , :1197 , :1198 , :1199 , :1200 , :1201 , :1202 , :1203 , :1204 , :1205 , :1206 , :1207 , :1208 , :1209 , :1210 , :1211 , :1212 , :1213 , :1214 , :1215 , :1216 , :1217 , :1218 , :1219 , :1220 , :1221 , :1222 , :1223 , :1224 , :1225 , :1226 , :1227 , :1228 , :1229 , :1230 , :1231 , :1232 , :1233 , :1234 , :1235 , :1236 , :1237 , :1238 , :1239 , :1240 , :1241 , :1242 , :1243 , :1244 , :1245 , :1246 , :1247 , :1248 , :1249 , :1250 , :1251 , :1252 , :1253 , :1254 , :1255 , :1256 , :1257 , :1258 , :1259 , :1260 , :1261 , :1262 , :1263 , :1264 , :1265 , :1266 , :1267 , :1268 , :1269 , :1270 , :1271 , :1272 , :1273 , :1274 , :1275 , :1276 , :1277 , :1278 , :1279 , :1280|1|1|1||0|0|1401|1401|1401|1401|
|message_push|insert into message_log ( id , tenant_id , tenant_app_id , user_id , scene_type , post_data , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , ... , \\"tenant_wechatapp_id\\":\\"914401072561307648\\"}"}' , :6 , :7 )|1|13|13||0|0|0|0|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|4|4||0|0|29135|29135|0|0|
|tag_service|insert into tag_service.label_vip_match_487569764496052224_487577238854832128 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_487569764496052224_487577238854832128 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|3|3||0|0|130352|130352|0|0|
|coupon_service|select count ( 0 ) from coupon_service.coupon_user cu left join coupon_service.write_off_log wol on wol.coupon_user_id = cu.id left join coupon_service.reservation r on r.coupon_user_id = cu.id and state = :1 left join coupon_service.grant_info gi on gi.coupon_user_id = cu.id where cu.tenant_wechatapp_id = :2|1|15|15||0|0|70441|70441|0|0|
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 19.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 19.00 , user_name = :16 , create_time = create_time|1|20|20||0|0|0|0|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_828766757295529984 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_828766757295529984 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|138872|138872|0|0|
|account|insert into `job_execution_log` ( `id` , `job_name` , `task_id` , `hostname` , `ip` , `sharding_item` , `execution_source` , `is_success` , `start_time` ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 )|1|25|25||0|0|0|0|0|0|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 1467.33 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|20|20||0|0|0|0|0|0|
|tag_service|delete from tag_service.label_vip_match_839295151019966464_839652414381412352 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_839295151019966464_839652414381412352 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|29313|29313|0|0|
|coupon_service|select cu.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.mobile_no , cu.creator_mobile_no , cu.create_time , wol.create_time as writeofftime , r.create_time as reservationdate , r.shop_name as reservationshopname , wol.writeoff_user_name , wol.writeoff_shop_id as shopid , wol.dept_erp_id as erpdeptid from coupon_service.coupon_user cu left join coupon_service.write_off_log wol on wol.coupon_user_id = cu.id left join coupon_service.reservation r on r.coupon_user_id = cu.id and state = :1 left join coupon_service.grant_info gi on gi.coupon_user_id = cu.id where cu.tenant_wechatapp_id = :2 and cu.coupon_state = :3 limit :4|1|15|15||0|0|38694|38694|0|0|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 231.50 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|26|26||0|0|0|0|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 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|19|19||0|0|1387717|1387717|101|101|
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 20.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 20.00 , user_name = :16 , create_time = create_time|1|18|18||0|0|0|0|0|0|
|tag_service|delete from tag_service.label_vip_match_912227360709853184_912228262623625216 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_912227360709853184_912228262623625216 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|74901|74901|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|4|4||0|0|210644|210644|1|1|
|tag_service|delete from tag_service.label_vip_match_828778547559579648_828780274153209856 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_828778547559579648_828780274153209856 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|39792|39792|0|0|
|erp_sync|insert into `job_execution_log` ( `id` , `job_name` , `task_id` , `hostname` , `ip` , `sharding_item` , `execution_source` , `is_success` , `start_time` ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 )|1|25|25||0|0|0|0|0|0|
|message_push|insert into message_log ( id , tenant_id , tenant_app_id , user_id , scene_type , post_data , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , ... = 470281572487139328#/member/shopping_record","data":{"keyword5":{"value":"qtxsd-0013-00005887","color":"#000066"},"keyword3":{"value":"2496.00","color":"#000066"},"keyword4":{"value":"2019-08-07","color":"#000066"},"keyword1":{"value":"昌邑全福元老鳯祥","color":"#000066"},"keyword2":{"value":"硬金挂坠 , 硬金挂坠 , 本厂足金旧料 , 金18k精品耳钉","color":"#000066"},"remark":{"value":"点击“详情”查看消费明细","color":"#ff3399"},"first":{"value":"感谢惠顾！","color":"#000000"}},"appid":null,"pagepath":null}' , :6 , :7 )|1|21|21||0|0|0|0|0|0|
|tag_service|delete from tag_service.label_vip_match_817878088380628992_817882720653852672 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_817878088380628992_817882720653852672 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|96855|96855|0|0|
|activity_service|select t1.user_id as userid , 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|1|1|1||0|0|68991|68991|4650|4650|
|tag_service|insert into tag_service.label_vip_match_817878088380628992_817882952124895232 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_817878088380628992_817882952124895232 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|57996|57996|0|0|
|tag_service|insert into tag_service.label_vip_match_834615931371048960_836444994523926528 ( 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_834615931371048960_836444994523926528 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|114422|114422|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_821174502091165696 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|42189|42189|0|0|
|tenant|insert into erp_sales ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_no , sales_date , member_erp_id , employee_erp_id , employee_name , dept_erp_id , amount , sales_remark , receipts , sales_status , is_sales , busi_date ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , 125.00 , :10 , :11 , :12 , :13 , :14 ) on duplicate key update sales_date = :15 , member_erp_id = :16 , employee_erp_id = :17 , employee_name = :18 , dept_erp_id = :19 , amount = 125.00 , sales_remark = :20 , receipts = :21 , sales_status = :22 , is_sales = :23 , busi_date = :24|1|27|27||0|0|0|0|0|0|
|tenant|insert into erp_sales ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_no , sales_date , member_erp_id , employee_erp_id , employee_name , dept_erp_id , amount , sales_remark , receipts , sales_status , is_sales , busi_date ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , 1690.00 , :10 , :11 , :12 , :13 , :14 ) on duplicate key update sales_date = :15 , member_erp_id = :16 , employee_erp_id = :17 , employee_name = :18 , dept_erp_id = :19 , amount = 1690.00 , sales_remark = :20 , receipts = :21 , sales_status = :22 , is_sales = :23 , busi_date = :24|1|20|20||0|0|0|0|0|0|
|warranty_service|insert into warranty ( id , tenant_wechatapp_id , user_id , erp_sales_id , update_user_id , warranty_no , is_disable , warranty_data , employee_erp_id , dept_erp_id , sales_no , sales_date ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , ... 现金：2550.00","userid":"923330577547976704","amount":2550,"detail":[{"id":"477929656573013133","saleserpid":"6314759","salestype":"销售","productbarcode":"14014604","productname":"18k金项链","certno":"","categoryname":"k金","totalweight":"","stoneweight":"0.000","goldweight":"","remark":"","quantity":1,"amounttotal":1224,"imgurls":["https://api.weixin.qq.com/cgi-bin/media/get?access_token = 24_c-v6gb8h3clys_mfd2lzjj2x9crkt4qzhpwqlbn4ya7yjjurxulwxw93else5lvizlxhqvj6jpoy2bmo3jjzmi1otdrkh1bc1ppxq4l5h0uzuewqlxuhytswl8pngc_8_udfpntfhmtnkn3poubjahdgmt&media_id = yjoixb6e2lyydul4wn0zarekul14111boexr_0v00pa-lpmdtzhfvydpav9s_647"],"serverids":["yjoixb6e2lyydul4wn0zarekul14111boexr_0v00pa-lpmdtzhfvydpav9s_647"]},{"id":"477929656573013134","saleserpid":"6314759","salestype":"销售","productbarcode":"12099030","productname":"18k金吊坠","certno":"","categoryname":"k金","totalweight":"","stoneweight":"0.000","goldweight":"","remark":"","quantity":1,"amounttotal":1326,"imgurls":["https://api.weixin.qq.com/cgi-bin/media/get?access_token = 24_c-v6gb8h3clys_mfd2lzjj2x9crkt4qzhpwqlbn4ya7yjjurxulwxw93else5lvizlxhqvj6jpoy2bmo3jjzmi1otdrkh1bc1ppxq4l5h0uzuewqlxuhytswl8pngc_8_udfpntfhmtnkn3poubjahdgmt&media_id = yjoixb6e2lyydul4wn0zarekul14111boexr_0v00pa-lpmdtzhfvydpav9s_647"],"serverids":["yjoixb6e2lyydul4wn0zarekul14111boexr_0v00pa-lpmdtzhfvydpav9s_647"]}]}' , :8 , :9 , :10 , :11 )|1|3|3||0|0|0|0|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 ) and ( user.nick_name like concat ( :25 , :26 , :27 ) or tenantuser.mobile_no = :28 ) )|1|1|1||0|0|5735|5735|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_823844580729339904 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|3|3||0|0|97617|97617|148|148|
|tenant|insert into erp_sales ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_no , sales_date , member_erp_id , employee_erp_id , employee_name , dept_erp_id , amount , sales_remark , receipts , sales_status , is_sales , busi_date ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , 501.00 , :10 , :11 , :12 , :13 , :14 ) on duplicate key update sales_date = :15 , member_erp_id = :16 , employee_erp_id = :17 , employee_name = :18 , dept_erp_id = :19 , amount = 501.00 , sales_remark = :20 , receipts = :21 , sales_status = :22 , is_sales = :23 , busi_date = :24|1|26|26||0|0|0|0|0|0|
|tenant|select id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_index , sales_type , product_barcode , product_name , cert_no , hand_size , category_erp_id , category_name , stone_weight , gold_weight , total_weight , quantity , amount_total , amount_pay , integral , remark , create_time , update_time from erp_sales_detail where sales_erp_id = :1 and tenant_wechatapp_id = :2|1|8|8||0|0|1|1|1|1|
|tag_service|delete from tag_service.label_vip_match_849916675989012480_850153199259193344 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_849916675989012480_850153199259193344 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|46038|46038|0|0|
||insert into comment_service.`comment_reward` ( id , tenant_id , tenant_app_id , comment_id , give_type , give_prize , busi_id ) select t2.id+3 as id , t1.tenant_id , t1.tenant_wechatapp_id , t1.id as comment_id , 'point' , t2.amount , t2.id as busi_id from comment_service.`comment` t1 join account.account_flow t2 on t1.tenant_wechatapp_id = t2.dst_tenant_app_id and t1.primary_key_id = t2.busi_id and t2.busi_type = :1 where :2 = :3 and t2.dst_account_type = :4|1|24|24||0|0|3025703|3025703|0|0|
|tag_service|delete from tag_service.label_vip_match_476787156229165056_864729529476812800 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_476787156229165056_864729529476812800 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|79281|79281|0|0|
|statistic|select max ( job_execution_id ) jobid from statistic.batch_job_execution where create_time < :1|1|1|1||0|0|156100|156100|1|1|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 0.33 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|20|20||0|0|0|0|0|0|
|message_push|insert into message_log ( id , tenant_id , tenant_app_id , user_id , scene_type , post_data , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , ... = 885279553956712448#/member/shopping_record","data":{"keyword5":{"value":"qtxsd-0077-00001660","color":"#000066"},"keyword3":{"value":"14000.00","color":"#000066"},"keyword4":{"value":"2019-08-07","color":"#000066"},"keyword1":{"value":"东方福珠宝荣成步行街店","color":"#000066"},"keyword2":{"value":"18k金钻石戒指 , 钻石手镯","color":"#000066"},"remark":{"value":"点击“详情”查看消费明细","color":"#ff3399"},"first":{"value":"感谢惠顾！","color":"#000000"}},"appid":null,"pagepath":null}' , :6 , :7 )|1|27|27||0|0|0|0|0|0|
|account|select ut.tenant_wx_app_id tenant_app_id , ut.user_id , ut.create_time lastlogintime from authorization_service.user_login_token ut where ut.tenant_wx_app_id = :1 and ut.create_time <= :2 limit :3 offset :4|1|2|2||0|0|5008|5008|5000|5000|
|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_899878776672923648_902701957964152832 where vip_id = :1|1|1|1||0|0|49362|49362|0|0|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount , sum ( tmp.score ) score from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount , t.score from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount , sum ( ifnull ( score , 0 ) ) score from statistic.erp_sales_885278795660111872 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and comment_date = date_format ( :6 , :7 ) group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|4|4||0|0|1387022|1387022|6|6|
|tag_service|insert into tag_service.label_vip_match_841816981308002304_841822506628247552 ( 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_841816981308002304_841822506628247552 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|35528|35528|0|0|
|statistic|select sd.product_barcode , ifnull ( es.amount , 0 ) amount , sd.tenant_app_id , es.sales_date , es.dept_erp_id , sd.tenant_id , ifnull ( sd.statistic_date , es.sales_date ) statistic_date from ( select tenant_id , tenant_app_id , sales_erp_id , product_barcode , date_format ( create_time , '%y-%m-%d' ) statistic_date from statistic.erp_sales_detail_885278795660111872 where tenant_app_id = :1 and create_time >= :2 and create_time <= :3 and sales_type = :4 and sales_status = :5 ) sd inner join ( select tenant_id , tenant_app_id , sales_erp_id , amount , sales_date , dept_erp_id from statistic.erp_sales_885278795660111872 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|1|42|42||0|0|2710385|2710385|0|0|
|tag_service|select count ( * ) from statistic.member t where t.tenant_id = :1 and t.tenant_app_id = :2|1|2|2||0|0|333531|333531|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_814020764498956288 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_814020764498956288 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|1|1|1||0|0|27540|27540|0|0|
|warranty_service|insert into warranty ( id , tenant_wechatapp_id , user_id , erp_sales_id , update_user_id , warranty_no , is_disable , warranty_data , employee_erp_id , dept_erp_id , sales_no , sales_date ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , ... 刷卡4415：1143.80","userid":"922759654348468224","amount":1143.8,"detail":[{"id":"477929656573012880","saleserpid":"566941","salestype":"销售","productbarcode":"01s1v3107190058","productname":"足金耳饰","certno":"","categoryname":"黄金 ( 克 ) ... = 24_14otimidk6ax6n-i0jefnnqg3qvdknclrlfed_mzmdvzq_wfd60kwq3um-a9nwgu4zxs59cojndtsm00mg5pll1tgwj5fdjuqrdx9nurm4kg52opdaj47ulengesctkvbzumtu6yqwxsh_koouqdakdflh&media_id = 7gcvdybqzkfo5zjkkdxx9zmvdndctgm99ch4qyvx5taygjtk-xbpnuhtijteuwnb"],"serverids":["7gcvdybqzkfo5zjkkdxx9zmvdndctgm99ch4qyvx5taygjtk-xbpnuhtijteuwnb"]}]}' , :8 , :9 , :10 , :11 )|1|2|2||0|0|0|0|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) dept_erp_id , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , 0 value_add_amount from value_added.value_added_template vt inner join value_added.value_added_category vc on vt.id = vc.template_id and vt.is_disable = :1 inner join statistic.erp_sales_detail_885278795660111872 sd on vc.tenant_wechatapp_id = sd.tenant_app_id and vc.erp_product_category_id = sd.category_erp_id left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where vt.tenant_wechatapp_id = :2 and sd.sales_status = :3 and sd.sales_type = :4 and sd.create_time >= :5 and sd.create_time <= :6 and sd.value_add_no is null and os.shop_id != :7 and oe.employee_user_id != :8 limit :9 offset :10|1|4|4||0|0|2712903|2712903|616|616|
|tag_service|insert into tag_service.label_vip_match_817878088380628992_817882331640545280 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_817878088380628992_817882331640545280 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|59578|59578|0|0|
|platform|select `no` , `salesid` , `noteno` , `barcode` , `productname` , `customername` , `customertel` , `quantity` , `amount` , `productdesc` , `remark` , `salername` , `productimageid` , `productimageurl` , `shopid` , `vendorid` , `vendormemberid` , `salesdetailid` , `createtime` , `certimageurl` , `certimageid` , `aftersalesremark` , `eid` , `id` from `productcerts` where `vendormemberid` = :1 and `vendorid` = :2|1|1|1||0|0|2513|2513|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_823844580729339904 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|1|2|2||0|0|190442|190442|286|286|
|tag_service|delete from tag_service.label_vip_match_817161814168092672_817175909835513856 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_817161814168092672_817175909835513856 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|46600|46600|0|0|
||insert into value_added.`value_added_user_extend` ( id , tenant_id , tenant_wechatapp_id ) select id , tenant_id , tenant_wechatapp_id from value_added.value_added_user|1|3|3||0|0|153193|153193|0|0|
|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|52949|52949|5000|5000|
|tag_service|delete from tag_service.label_vip_match_821174502091165696_821180732360658944 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_821174502091165696_821180732360658944 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|66510|66510|0|0|
|tag_service|insert into tag_service.label_vip_match_907400816212623360_907482231063232512 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_907400816212623360_907482231063232512 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|2|2||0|0|150830|150830|0|0|
|tag_service|insert into tag_service.label_vip_match_486900027235635200_486927024615723008 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_486900027235635200_486927024615723008 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|1|1||0|0|99730|99730|0|0|
|tag_service|insert into tag_service.label_vip_match_814640285408600064_814650677526577152 ( 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_814640285408600064_814650677526577152 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|74511|74511|0|0|
|mysql|update employee.backlog set status = :1 where status in ( :2 , :3 ) and expire_time < date_add ( now ( ) , interval :4 day )|1|29|29||0|0|1061564|1061564|0|0|
|gift_mail|select * from ( select p.* , sp.take_type , ifnull ( pp.integral_price , ifnull ( ( select min ( inventory.price ) from inventory where inventory.product_id = p.id ) , :1 ) ) as price , ifnull ( t.quantity , :2 ) quantity , pt.partner_name vendorname , 0.0 distance , c.categroy_name categroy_name , pp.partner_id partner_id from product p inner join category c on c.id = p.category_id left outer join self_product sp on p.id = sp.product_id left outer join partner_product pp on p.id = pp.product_id left outer join partner pt on pt.id = pp.partner_id left outer join ( select product_id , sum ( quantity ) quantity from gift_mail.inventory group by product_id ) t on p.id = t.product_id where ( ( p.is_disable is null or p.is_disable = :3 ) ) ) as p left outer join product_status ps on p.id = ps.product_id where ( p.product_status = :4 and p.tenant_id = :5 and ( ps.tenant_wechatapp_id = :6 or p.product_type = :7 ) ) order by p.volume desc , p.id desc limit :8 , :9|1|1|1||0|0|8596|8596|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_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|7|7||0|0|596263|596263|0|0|
|tenant|insert into erp_sales ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_no , sales_date , member_erp_id , employee_erp_id , employee_name , dept_erp_id , amount , sales_remark , receipts , sales_status , is_sales , busi_date ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , 4110.00 , :10 , :11 , :12 , :13 , :14 ) on duplicate key update sales_date = :15 , member_erp_id = :16 , employee_erp_id = :17 , employee_name = :18 , dept_erp_id = :19 , amount = 4110.00 , sales_remark = :20 , receipts = :21 , sales_status = :22 , is_sales = :23 , busi_date = :24|1|29|29||0|0|0|0|0|0|
|statistic|select sd.id , sd.tenant_id , sd.tenant_wechatapp_id tenant_app_id , es.member_erp_id , sd.sales_erp_id , sd.sales_type , sd.product_barcode , sd.product_name , sd.category_name , sd.quantity , sd.amount_total/if ( sd.quantity = 0 , 1 , sd.quantity ) price , sd.amount_pay , sd.integral , sd.create_time , sd.update_time , sd.stone_weight , sd.gold_weight , es.sales_no , es.sales_date , es.dept_erp_id , es.erp_employee_id , sd.category_erp_id , es.sales_status , es.user_id , es.user_name , es.mobile_no , '_885278795660111872' tableindex from statistic.base_erp_sales be inner join tenant.erp_sales_detail sd on be.tenant_app_id = sd.tenant_wechatapp_id and be.sales_erp_id = sd.sales_erp_id inner join statistic.erp_sales_885278795660111872 es on be.tenant_app_id = es.tenant_app_id and be.sales_erp_id = es.sales_erp_id where be.tenant_app_id = :1 order by sd.id limit :2 offset :3|1|2|2||0|0|15856|15856|4063|4063|
|platform|select `vendorid` , `memberid` , `salesdate` , `noteid` , `noteno` , `empid` , `empname` , `amounttotal` , `quantitytotal` , `integraltotal` , `salesstoreid` , `staffattitude` , `professionallevel` , `appearance` , `storeimage` , `productdisplay` , `salescomment` , `commenttime` , `replycontent` , `replytime` , `replyuser` , `tipfee` , `tipmorderid` , `tippayno` , `tippaytime` , `status` , `aftersalesremark` , `uid` , `eid` , `sid` , `id` from `saleslog` where vendorid = :1 and tipfee > :2 and tippayno is not null and date_sub ( date ( :3 ) , interval :4 day ) = date_format ( tippaytime , :5 )|1|6|6||0|0|120774|120774|0|0|
|user_service|insert into erp_member_info ( id , tenant_id , tenant_wechatapp_id , erp_member_id , mobile_no , user_name , sex , birthday , birthday_is_lunar , home_address , memorialday , memorialday_name , memorialday_is_lunar , interested , amount , create_time , update_time ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , 3005024.00 , :14 , :15 ) on duplicate key update erp_member_id = :16 , mobile_no = :17 , user_name = :18 , sex = :19 , birthday = :20 , birthday_is_lunar = :21 , home_address = :22 , memorialday = :23 , memorialday_name = :24 , memorialday_is_lunar = :25 , interested = :26 , amount = 3005024.00 , update_time = :27|1|27|27||0|0|0|0|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|2|2||0|0|509598|509598|0|0|
|account|select distinct tenant_wechatapp_id tenant_app_id , date_format ( create_time , '%y-%m-%d%h' ) statistic_date from tenant.erp_sales where tenant_wechatapp_id = :1 and update_time >= :2 and update_time <= :3 and sales_status = :4|1|2|2||0|0|191701|191701|25|25|
|tenant|select * from erp_sales where member_erp_id = :1 and tenant_wechatapp_id = :2 and sales_status = :3|1|10|10||0|0|0|0|0|0|
|account|select sales_date , tenant_id , tenant_wechatapp_id tenant_app_id , dept_erp_id shop_id , employee_erp_id user_id , count ( * ) amount from tenant.erp_sales where tenant_wechatapp_id = :1 and sales_status in ( :2 , :3 ) and is_sales = :4 and create_time <= :5 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , employee_erp_id|1|2|2||0|0|301129|301129|55042|55042|
|erp_sync|insert into retry_data ( id , tenant_id , tenant_app_id , business_type , operation_type , data_id , user_id , erp_member_id , need_erp_member_id , retry_times , msg , send_time , create_time , data ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 )|1|22|22||0|0|0|0|0|0|
|timer|update task_info set name = :1 , params = :2 , cron = :3 , delay = null , next_time = :4 , status = :5 , create_time = :6 , update_time = :7 where id = :8|1|30|30||0|0|1|1|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_471320523331211264 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|43724|43724|69|69|
|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|1|4|4||0|0|1000510|1000510|1|1|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount from statistic.erp_sales_480726380749918208 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and create_time >= :6 and create_time <= :7 group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|2|2||0|0|137912|137912|80|80|
|statistic|select tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name , sum ( tmp.amount ) amount , sum ( tmp.score ) score from ( select t.sales_date , t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) user_id , if ( oe.employee_user_id is null or oe.employee_user_id = :1 , :2 , oe.employee_user_name ) user_name , t.amount , t.score from ( select sales_date , tenant_id , tenant_app_id , dept_erp_id shop_id , erp_employee_id user_id , count ( * ) amount , sum ( ifnull ( score , 0 ) ) score from statistic.erp_sales_823688108565368832 where tenant_app_id = :3 and sales_status = :4 and has_sale = :5 and comment_date = date_format ( :6 , :7 ) group by tenant_id , tenant_app_id , sales_date , dept_erp_id , erp_employee_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and t.shop_id = os.dept_erp_id left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and t.user_id = oe.employee_erp_id ) tmp where tmp.shop_id != :8 and tmp.user_id != :9 group by tmp.sales_date , tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.user_id , tmp.user_name|1|1|1||0|0|508324|508324|0|0|
|tag_service|insert into tag_service.label_vip_match_828766757295529984_828828072282198016 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_828766757295529984_828828072282198016 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|1|2|2||0|0|61592|61592|0|0|
|tag_service|delete from tag_service.label_vip_match_488003299602206720_885391961685602304 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_488003299602206720_885391961685602304 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|1|2|2||0|0|63190|63190|0|0|
|statistic|update erp_sales_823688108565368832 set user_id = null , user_name = :1 , mobile_no = :2 where tenant_app_id = :3 and member_erp_id = :4 and user_name is null|1|1|1||0|0|3578|3578|0|0|
|erp_sync|select * from retry_data where tenant_app_id = :1 and user_id = :2|1|2|2||0|0|1461|1461|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|75395|75395|24|24|
|user_service|insert into erp_integral_log ( tenant_id , tenant_wechatapp_id , integral_erp_id , member_erp_id , note_erp_id , remark , integral , erp_create_time , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , 74.00 , :7 , :8 , :9 ) on duplicate key update update_time = now ( )|1|25|25||0|0|0|0|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) dept_erp_id , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , 0 value_add_amount from value_added.value_added_template vt inner join value_added.value_added_category vc on vt.id = vc.template_id and vt.is_disable = :1 inner join statistic.erp_sales_detail_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|641015|641015|757|757|
||update customize_page.award_qualified aq inner join ( select tenant_wechatapp_id , qualified_id , min ( create_time ) create_time from customize_page.award_receive_detail group by tenant_wechatapp_id , qualified_id ) ar on aq.tenant_wechatapp_id = ar.tenant_wechatapp_id and aq.id = ar.qualified_id set aq.receive_status = :1 , aq.receive_time = ar.create_time where aq.receive_status = :2|1|2|2||0|0|173280|173280|0|0|
||update warranty_service.warranty w join tenant.erp_sales es on es.sales_erp_id = w.erp_sales_id and es.tenant_wechatapp_id = w.tenant_wechatapp_id set w.employee_erp_id = es.employee_erp_id , w.sales_no = es.sales_no , w.dept_erp_id = es.dept_erp_id , w.sales_date = es.sales_date where w.erp_sales_id is not null|1|38|38||0|0|1147224|1147224|0|0|
|tag_service|delete from tag_service.label_vip_match_841816981308002304_841822506628247552 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_841816981308002304_841822506628247552 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|70396|70396|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_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|1|1||0|0|89621|89621|59|59|
|tenant|insert into erp_sales ( id , tenant_id , tenant_wechatapp_id , sales_erp_id , sales_no , sales_date , member_erp_id , employee_erp_id , employee_name , dept_erp_id , amount , sales_remark , receipts , sales_status , is_sales , busi_date ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , 1556.92 , :10 , :11 , :12 , :13 , :14 ) on duplicate key update sales_date = :15 , member_erp_id = :16 , employee_erp_id = :17 , employee_name = :18 , dept_erp_id = :19 , amount = 1556.92 , sales_remark = :20 , receipts = :21 , sales_status = :22 , is_sales = :23 , busi_date = :24|1|18|18||0|0|0|0|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_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|5|5||0|0|428525|428525|136|136|
|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|3|2||0|0|292054|146038|0|0|
|account|select tu.id , tu.user_id userid , tu.tenant_id tenantid , tu.tenant_app_id tenantappid , ifnull ( tw.dept_erp_id , tu.shop_id ) shopid , tu.erp_member_id memberuserid , tu.user_name username , tu.mobile_no mobileno , ifnull ( tu.sex , 0 ) sex , tu.birthday , tu.birthday_is_lunar birthdayislunar , tu.memorial_name memorialname , tu.memorial_day memorialday , tu.memorial_day_is_lunar memorialdayislunar , 'unknow' sourcetype , tu.create_time createtime , '2019-08-0709:59:59.0' updatetime , if ( tu.bind_time is null , 0 , 1 ) bindflag , if ( tu.mobile_no is null , 0 , 1 ) fullflag , em.grade_erp_id gradeerpid , tu.bind_time bindtime , if ( ifnull ( tu.is_subscribe , 0 ) = 1 , 1 , 0 ) subscribeflag , if ( tu.is_subscribe = 1 , null , tu.subscribe_time ) canceltime , tu.subscribe_time , if ( ifnull ( tu.is_subscribe , 0 ) = 1 , '粉丝' , '游客' ) identity , tu.tenant_app_open_id tenantappopenid , if ( tu.mobile_no is null , 0 , 1 ) register_flag from user_service.tenant_user tu left join user_service.erp_member em on tu.tenant_app_id = em.tenant_wechatapp_id and tu.erp_member_id = em.member_erp_id left join tenant.tenant_wechatapp_shop tw on tu.shop_id = tw.id where tu.tenant_app_id = :1 and tu.create_time <= :2 order by tu.id limit :3 offset :4|2|4|2||0|0|733515|499211|10000|5000|
|employee|commit|2|33|27||0|0|0|0|0|0|
|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|20|14||0|0|1134894|567472|0|0|
|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|13|7||0|0|583066|291548|0|0|
|tag_service|delete from tag_service.label_vip_match_471320523331211264_471366425118904320 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_471320523331211264_471366425118904320 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|7|4||0|0|222371|111191|0|0|
|activity_service|select count ( 0 ) from activity_service.user_trace t1 join activity_service.activity t2 on t1.activity_id = t2.id where t1.status = :1 and t2.tenant_wechatapp_id = :2 and t2.activity_type = :3 and t1.step = :4|2|18|11||0|0|2504312|1623195|2|1|
|tag_service|delete from tag_service.label_vip_match_821229068421742592_821504909596737536 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_821229068421742592_821504909596737536 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|16|11||0|0|818296|409164|0|0|
|tag_service|delete from tag_service.label_vip_match_819000302970638336_819053378054164480 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_819000302970638336_819053378054164480 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|4|3||0|0|204024|102012|0|0|
|wx_gateway|update wx_token set appid = :1 , app_secret = null , refresh_token = :2 , access_token = :3 , access_token_expire = :4 , jsapi_ticket = :5 , jsapi_ticket_expire = :6 , refresh_type = :7 , create_time = :8 , update_time = :9 where id = :10|2|52|26||0|0|2|1|0|0|
|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|4|3||0|0|284130|142068|0|0|
|tag_service|insert into tag_service.label_vip_match_836363095600320512_836442940199964672 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_836363095600320512_836442940199964672 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|3|2||0|0|656909|329535|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|2|3|2||0|0|410150|205584|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_821229068421742592_821504909596737536 where vip_id = :1|2|11|7||0|0|409768|204884|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 )|2|6|3||0|0|77045|38523|0|0|
|tag_service|delete from tag_service.label_vip_match_480726380749918208_480728003618410496 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_480726380749918208_480728003618410496 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|17|13||0|0|769972|385002|0|0|
|wx_gateway|insert into wx_user ( id , tenant_id , tenant_app_id , union_id , open_id , wx_app_id , cm_union_id , cm_open_id , user_id , status ) values ( :1 , :2 , :3 , null , :4 , :5 , null , :6 , :7 , :8 ) on duplicate key update wx_app_id = :9 , open_id = :10 , cm_open_id = :11 , status = :12 , create_time = create_time|2|23|22||0|0|0|0|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_826954007829331968_826973052054052864 where vip_id = :1|2|8|5||0|0|536602|268301|1|1|
|tag_service|delete from tag_service.label_vip_match_899878776672923648_902701957964152832 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_899878776672923648_902701957964152832 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|2|1||0|0|197001|98507|0|0|
|tag_service|delete from tag_service.label_vip_match_814019237554196480_814024519298617344 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_814019237554196480_814024519298617344 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|4|3||0|0|191634|95820|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|5|4||0|0|225348|112674|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|7|4||0|0|141038|121713|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|14|13||0|0|1023116|926708|75|72|
|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|4|3||0|0|281051|140527|0|0|
|tag_service|select id , tenant_app_id , shop_id , vip_id , vip_source , member_grade , sex , new_or_old , lifecycle , animal_born , constellation , month_birth , age_group , months_initiation , month_lately_consume , frequency_total_consume , amount_total_consume , total_integral , usable_integral , member_identity , member_source , year_initiation , lately_month_birth , subscribe_state , bind_state , perfect_data_state , memorial_day , member_anniversary , member_shop , last_product_category , last_sale_balance , last_stone_weight , last_gold_weight , customer_type , customer_character , shape , skin_color , face_type , affective_state , preference , accepted_info_type , estimated_consumption_capacity , maintain_level , buy_purpose , intent_product , price_area , enter_shop_need from tag_service.label_vip_match_476787156229165056_476788488201703424 where vip_id = :1|2|12|8||0|0|667536|333768|2|1|
|tag_service|delete from tag_service.label_vip_match_836363095600320512_836442940199964672 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_836363095600320512_836442940199964672 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|18|10||0|0|1309561|654813|0|0|
|account|select em.id , em.tenant_wechatapp_id tenant_app_id , em.create_time from user_service.tenant_user ut left join user_service.erp_member em on ut.tenant_app_id = em.tenant_wechatapp_id and ut.erp_member_id = em.member_erp_id where ut.tenant_app_id = :1 and ut.bind_time <= :2 and em.id > :3 order by em.id limit :4 offset :5|2|12|9||0|0|250020|186498|10000|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_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|2||0|0|73057|48541|0|0|
|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|8|6||0|0|454813|227431|0|0|
|coupon_service|select count ( 0 ) from coupon_service.coupon_user cu left join coupon_service.write_off_log wol on wol.coupon_user_id = cu.id left join coupon_service.reservation r on r.coupon_user_id = cu.id and state = :1 left join coupon_service.grant_info gi on gi.coupon_user_id = cu.id where cu.tenant_wechatapp_id = :2 and cu.coupon_state = :3|2|30|15||0|0|134587|73813|1|1|
|statistic|select tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.source_type , sum ( tmp.amount ) amount from ( select t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , t.source_type , t.amount from ( select mb.tenant_id , mb.tenant_app_id , mb.shop_id , mb.source_type , count ( 1 ) amount from statistic.member mb where mb.tenant_app_id = :1 and mb.create_time between :2 and :3 and mb.register_flag = :4 group by mb.tenant_id , mb.tenant_app_id , mb.shop_id , mb.source_type ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and ( t.shop_id = os.dept_erp_id or t.shop_id = os.shop_id ) ) tmp group by tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.source_type|2|2|1||0|0|660210|355006|77|56|
|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|7|5||0|0|327528|163770|0|0|
|tag_service|delete from tag_service.label_vip_match_826954007829331968_826973052054052864 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_826954007829331968_826973052054052864 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|20|14||0|0|1073205|536603|0|0|
|tag_service|insert into tag_service.label_vip_match_488003299602206720_488032253511864320 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_488003299602206720_488032253511864320 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|3|2||0|0|415432|207952|0|0|
|statistic|select eu.tenant_id , eu.tenant_wechatapp_id , eu.employee_erp_id , eu.user_id , ifnull ( ee.employee_name , tu.user_name ) user_name from tenant.employee_user eu left join tenant.erp_employee ee on eu.tenant_id = ee.tenant_id and eu.employee_erp_id = ee.employee_erp_id left join user_service.tenant_user tu on eu.tenant_wechatapp_id = tu.tenant_app_id and eu.user_id = tu.user_id limit :1 offset :2|2|7|5||0|0|49182|29314|7377|5000|
|tag_service|insert into tag_service.label_vip_match_822257848045047808_822262919524818944 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_822257848045047808_822262919524818944 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|6|4||0|0|698951|349630|0|0|
|user_service|insert into erp_member ( id , tenant_id , tenant_wechatapp_id , member_erp_id , employee_erp_id , grade_erp_id , card_no , dept_erp_id , mobile_no , consumption_integral , user_name , status ) values ( null , :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , 0.00 , :9 , null ) on duplicate key update member_erp_id = :10 , employee_erp_id = :11 , grade_erp_id = :12 , card_no = :13 , dept_erp_id = :14 , mobile_no = :15 , consumption_integral = 0.00 , user_name = :16 , create_time = create_time|2|14|11||0|0|0|0|0|0|
|account|insert into account ( id , tenant_id , tenant_app_id , account_type , owner_type , owner_id , balance , platform_balance , cumulation , status , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 )|2|10|8||0|0|0|0|0|0|
|tag_service|delete from tag_service.label_vip_match_487569764496052224_487577238854832128 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_487569764496052224_487577238854832128 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|9|7||0|0|519528|259768|0|0|
|tag_service|delete from tag_service.label_vip_match_914339923195113472_914647604141285376 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_914339923195113472_914647604141285376 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|2|1||0|0|200994|100526|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|26|18||0|0|1397290|698648|0|0|
|tag_service|insert into tag_service.label_vip_match_476787156229165056_476788488201703424 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_476787156229165056_476788488201703424 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|6|4||0|0|667897|334366|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|19|13||0|0|1204143|602079|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|10|8||0|0|722654|362002|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_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|2|4|2||0|0|72650|63016|0|0|
|tag_service|insert into tag_service.label_vip_match_480726380749918208_480728003618410496 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_480726380749918208_480728003618410496 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|3|2||0|0|387788|195303|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_823709122435256320 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|2|2|1||0|0|42280|39367|0|0|
|tag_service|insert into tag_service.label_vip_match_826954007829331968_826973052054052864 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_826954007829331968_826973052054052864 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|3|2||0|0|536652|268351|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|23|15||0|0|1334186|667124|0|0|
|tag_service|delete from tag_service.label_vip_match_922378989354409984_922381553475047424 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_922378989354409984_922381553475047424 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|396560|198286|0|0|
|tag_service|delete from tag_service.label_vip_match_907400816212623360_907482231063232512 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_907400816212623360_907482231063232512 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|10|7||0|0|602013|301009|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-08-0623: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|4|2||0|0|93547|46792|183|97|
|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|6|4||0|0|603354|302322|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|56889|43290|63|41|
|tag_service|delete from tag_service.label_vip_match_817878088380628992_817882331640545280 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_817878088380628992_817882331640545280 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|3|2||0|0|228739|114371|0|0|
|sms|insert into sms_report ( id , phone_number , success , biz_id , out_id , send_time , report_time , err_code , err_msg , sms_size , create_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , null )|2|59|30||0|0|0|0|0|0|
|tag_service|delete from tag_service.label_vip_match_488003299602206720_488032253511864320 where id in ( select id from ( select lvm.id from tag_service.label_vip_match_488003299602206720_488032253511864320 lvm left join statistic.member t1 on t1.id = lvm.id where :1 = :2 and t1.id is null ) a )|2|15|11||0|0|829985|415025|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|16|11||0|0|1054183|527107|0|0|
|account|commit|2|53|28||0|0|0|0|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|6|4||0|0|316136|158072|0|0|
|tag_service|insert into tag_service.label_vip_match_823844580729339904_823856782299402240 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_823844580729339904_823856782299402240 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|7|5||0|0|568284|284573|0|0|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_816440425157005312 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|2|3|2||0|0|101541|69381|0|0|
|tag_service|insert into tag_service.label_vip_match_490810080325931008_490828878219186176 ( id , tenant_app_id , vip_id , vip_source ) select t1.id , t1.tenant_app_id as tenantappid , ifnull ( t1.user_id , t1.member_user_id ) as vipid , if ( t1.user_id is null , 'offline' , 'online' ) as vipsource from statistic.member t1 left join tag_service.label_vip_match_490810080325931008_490828878219186176 lvm on t1.id = lvm.id where t1.tenant_id = :1 and t1.tenant_app_id = :2 and lvm.id is null|2|3|2||0|0|283739|142036|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|7|4||0|0|243797|121921|0|0|
|platform|insert into `wetplsend` ( `vendorid` , `uid` , `templateid` , `data` , `sendtime` , `linkurl` ) values ( :1 , :2 , :3 , ... , 您有新的待办事项。\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"会员纪念日回访\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"2019-08-07\",\"color\":\"#173177\"},\"remark\":{\"value\":\"请点击详情进行处理！\",\"color\":\"#173177\"}}' , :4 , :5 )|2|17|13||0|0|0|0|0|0|
|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|5|3||0|0|397636|198818|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|24|17||0|0|1442692|721388|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 )|2|5|3||0|0|59589|29795|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|14|9||0|0|566815|283409|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-08-0623: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.create_time >= :2 and od.create_time <= :3 limit :4 offset :5|2|2|1||0|0|93208|46609|105|54|
|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|5|4||0|0|527843|264305|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_817878088380628992 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_817878088380628992 where tenant_app_id = :6 and create_time >= :7 and create_time <= :8 ) es on sd.tenant_app_id = es.tenant_app_id and sd.sales_erp_id = es.sales_erp_id limit :9 offset :10|2|3|1||0|0|77090|54191|0|0|
|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|2|2|1||0|0|96283|48239|2|1|
|wx_gateway|select id , tenant_id , tenant_app_id , union_id , open_id , wx_app_id , cm_open_id , user_id , status from wx_user where wx_app_id = :1 and cm_open_id = :2|2|10|8||0|0|0|0|0|0|
|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|3|11|6||0|0|2067440|689874|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_823844580729339904_823856782299402240 where vip_id = :1|3|15|6||0|0|851895|283965|3|1|
|user_service|select ue.user_id as id , tu.user_name as username , u.head_img_url as headimgurl , u.nick_name as nickname , tu.mobile_no as mobile , tu.sex from user_employee ue join tenant_user tu on ue.user_id = tu.user_id and tu.tenant_id = :1 and tu.tenant_app_id = :2 join user u on tu.user_id = u.id where ue.employee_user_id = :3 and ue.tenant_id = :4 and tenant_app_id = :5 order by tu.bind_time desc|3|4|2||0|0|120135|50575|24027|10115|
|message_push|insert into message_log ( id , tenant_id , tenant_app_id , user_id , scene_type , post_data , create_time , update_time ) values ( :1 , :2 , :3 , :4 , :5 , ... , \\"tenant_wechatapp_id\\":\\"817882952124895232\\"}"}' , :6 , :7 )|3|40|20||0|0|0|0|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 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 ) )|3|4|1||0|0|24478|8574|3|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_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|3|4|2||0|0|129004|53967|82|36|
|authorization_service|insert low_priority ignore into `authorization_service`.`_user_login_token_new` ( `id` , `user_id` , `tenant_id` , `tenant_wx_app_id` , `account_id` , `login_way` , `login_code` , `login_token` , `roles` , `status` , `expire_time` , `create_time` , `update_time` , `login_ip` , `login_time` , `login_data` ) select `id` , `user_id` , `tenant_id` , `tenant_wx_app_id` , `account_id` , `login_way` , `login_code` , `login_token` , `roles` , `status` , `expire_time` , `create_time` , `update_time` , `login_ip` , `login_time` , `login_data` from `authorization_service`.`user_login_token` force index ( `primary` ) where ( ( `id` >= :1 ) ) and ( ( `id` <= :2 ) ) lock in share mode /*pt-online-schema-change :3 copy nibble*/|3|3|1||0|0|22321|9903|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_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|11|4||0|0|268445|112283|0|0|
|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|7|3||0|0|90329|62548|67|53|
|account|select u.tenant_wechatapp_id tenantappid , u.erp_member_id memberuserid , if ( '男' = u.sex , 1 , if ( '女' = u.sex , 2 , 0 ) ) sex , u.birthday tempbirthday , u.birthday_is_lunar birthdayislunar , u.memorialday_name memorialname , u.memorialday tempmemorialday , u.memorialday_is_lunar memorialdayislunar from user_service.erp_member_info u where u.tenant_wechatapp_id = :1 and u.update_time <= :2 limit :3 offset :4|3|4|2||0|0|535123|240000|15000|5000|
|statistic|delete from base_backlog_member where tenant_app_id = :1|3|6|4||3|3|2736199|960670|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|5|2||0|0|25687|11920|45|21|
|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|3|19|8||0|0|196669|95600|3|1|
|activity_service|select assist_task_activity_id as id , count ( distinct user_id ) as partakenum , sum ( if ( partake_type = 'appoint' and status = :1 , :2 , :3 ) ) as appointnum , sum ( if ( partake_type = :4 , :5 , :6 ) ) as applynum , sum ( if ( partake_type = :7 and status >= :8 , :9 , :10 ) ) as finishnum from assist_task_user where assist_task_activity_id in ( :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 ) group by assist_task_activity_id|3|6|2||0|0|1107412|369145|51|17|
|statistic|select bm.id , ifnull ( sum ( es.amount ) , 0 ) salesbalance , count ( 1 ) salesamount 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 where bu.tenant_app_id = :1 and es.sales_status = :2 group by bm.id order by bm.id limit :3 offset :4|3|5|2||0|0|166662|74525|275|114|
|timer|update task_info set name = :1 , params = :2 , cron = :3 , delay = null , next_time = null , status = :4 , create_time = :5 , update_time = :6 where id = :7|3|73|26||0|0|3|1|0|0|
|account|select distinct tenant_wechatapp_id tenant_app_id , date_format ( create_time , '%y-%m-%d%h' ) statistic_date from warranty_service.warranty where tenant_wechatapp_id = :1 and update_time >= :2 and update_time <= :3 and is_disable = :4|4|9|3||0|0|29331|11714|0|0|
|wx_gateway|select user_id from wx_user where cm_open_id = :1 limit :2|4|17|7||0|0|4|1|4|1|
|statistic|select sd.tenant_id , sd.tenant_app_id , sd.sales_date , ifnull ( os.shop_id , '-1' ) depterpid , ifnull ( oe.employee_user_id , '-1' ) erp_employee_id , ifnull ( sd.value_add_amount , 0 ) value_add_amount from statistic.erp_sales_detail_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|4|7|2||0|0|100815|46570|0|0|
|activity_service|select count ( * ) from user_trace where tenant_app_id = :1 and activity_id = :2 and step = :3 and status != :4|4|7|2||0|0|26854|18139|4|1|
|sjfxjira|insert into rundetails ( id , job_id , start_time , run_duration , run_outcome , info_message ) values ( :1 , :2 , :3 , :4 , :5 , :6 )|4|108|29||0|0|0|0|0|0|
|activity_service|update vote_base set tenant_id = :1 , tenant_app_id = :2 , title = :3 , img_url = :4 , signup_begin = :5 , signup_end = :6 , vote_begin = :7 , vote_end = :8 , join_count = :9 , add_up_count = :10 , visit_count = :11 , enable_daily = :12 , unquie_daily = :13 , max_count = :14 , is_auth = :15 , status = :16 where id = :17|4|61|19||0|0|4|1|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_817517269994225664 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|4|11|4||0|0|184300|88321|10|5|
|payment|select id , tenant_id , tenant_app_id , goods_order_source , goods_order_no , goods_name , goods_amount , fee_type , request_ip , user_id , user_identify , user_sub_identify , pay_way , trade_type , order_start_time , order_expire_time , prepay_id , transaction_id , pay_amount , pay_finish_time , pay_status , pay_status_desc , error_msg , wxappid , sub_wxappid , mch_id , sub_mch_id , callback_tag , callback_result , create_time , update_time from pay_order where callback_result in ( :1 , :2 ) and pay_status in ( :3 , :4 ) order by id asc limit :5|4|6|2||0|0|198755|49689|0|0|
|statistic|select bu.tenant_app_id , bu.user_id , count ( 1 ) order_amount from statistic.base_order_user bu left join statistic.order_info od on bu.tenant_app_id = od.tenant_app_id and bu.user_id = od.user_id where bu.tenant_app_id = :1 and od.status in ( :2 , :3 , :4 , :5 , :6 , :7 , :8 ) group by bu.tenant_app_id , bu.user_id|4|8|4||0|0|175523|43971|59|26|
|timer|insert into task_execute_log ( id , task_id , task_name , task_params , success , error_msg , create_time ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 )|4|94|26||0|0|0|0|0|0|
|wx_gateway|select id , tenant_id , tenant_app_id , union_id , open_id , wx_app_id , cm_open_id , user_id , status from wx_user where tenant_app_id = :1 and open_id = :2 limit :3|4|16|8||0|0|2|1|2|1|
|account|select ac.tenant_app_id , ac.owner_id user_id , ifnull ( ac.cumulation , 0 ) cumulation , ifnull ( ac.balance , 0 ) balance , if ( cumulation-balance < 0 , 0 , cumulation-balance ) consumption_integral , ac.update_time lastscoretime from account.account ac where ac.tenant_app_id = :1 and ac.owner_type = :2 and ac.account_type = :3 and ac.create_time <= :4 limit :5 offset :6|5|7|2||0|0|258843|85001|23808|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_469175049962786816 sd left join statistic.off_shop os on sd.tenant_app_id = os.tenant_app_id and sd.dept_erp_id = os.dept_erp_id left join statistic.off_employee oe on sd.tenant_app_id = oe.tenant_app_id and sd.erp_employee_id = oe.employee_erp_id where sd.tenant_app_id = :1 and sd.value_add_date = date_format ( :2 , :3 ) and os.shop_id != :4 and oe.employee_user_id != :5 limit :6 offset :7|5|11|4||0|0|123344|38117|0|0|
|statistic|select max ( statistic_date ) enddate from result_shop_source where tenant_id = :1 and tenant_app_id = :2 group by tenant_id|5|17|4||0|0|2529480|505896|5|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_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|5|15|6||0|0|418792|313544|33|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_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|5|12|4||0|0|307054|110732|0|0|
|erp_sync|insert into `job_status_trace_log` ( `id` , `job_name` , `original_task_id` , `task_id` , `slave_id` , `source` , `execution_type` , `sharding_item` , `state` , `message` , `creation_time` ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 )|5|126|25||0|0|0|0|0|0|
|facepass_sync|insert into `job_status_trace_log` ( `id` , `job_name` , `original_task_id` , `task_id` , `slave_id` , `source` , `execution_type` , `sharding_item` , `state` , `message` , `creation_time` ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 )|5|126|25||0|0|0|0|0|0|
|statistic|select max ( statistic_date ) enddate from result_shop_grade where tenant_id = :1 and tenant_app_id = :2 group by tenant_id|5|18|4||0|0|3044905|608981|5|1|
|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|5|11|4||0|0|38902|13403|2536|807|
|platform|insert into `wetplsend` ( `vendorid` , `uid` , `templateid` , `data` , `sendtime` , `linkurl` ) values ( :1 , :2 , :3 , ... , 您有新的待办事项。\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"会员生日回访\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"2019-08-07\",\"color\":\"#173177\"},\"remark\":{\"value\":\"请点击详情进行处理！\",\"color\":\"#173177\"}}' , :4 , :5 )|5|32|11||0|0|0|0|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|5|8|3||0|0|234435|55152|0|0|
|activity_service|select count ( distinct ( user_id ) ) from user_trace where tenant_app_id = :1 and activity_id = :2 and status != :3|5|9|3||0|0|108001|22232|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|57|25||0|0|1367871|1014366|1|1|
|statistic|select ue.tenant_wechatapp_id , ue.user_id , ifnull ( eu.user_id , ue.employee_erp_id ) employee_user_id , '2019-08-0623: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|5|9|4||0|0|184742|76633|967|300|
|payment|insert into `job_execution_log` ( `id` , `job_name` , `task_id` , `hostname` , `ip` , `sharding_item` , `execution_source` , `is_success` , `start_time` ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 )|5|86|25||0|0|0|0|0|0|
|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 )|6|16|6||0|0|15550818|2591959|6|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_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|6|17|4||0|0|216552|78388|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|6|37|12||0|0|523266|151189|391|113|
|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|6|9|2||0|0|85203|30345|6|1|
|user_service|select tu.user_id as userid , tu.mobile_no as mobileno , tu.user_name as username , u.nick_name as nickname , u.head_img_url as headimgurl from tenant_user tu join `user` u on tu.user_id = u.id where tu.tenant_app_id = :1 and ( tu.mobile_no = :2 or u.nick_name like concat ( :3 , :4 ) or tu.user_name like concat ( :5 , :6 ) )|6|16|5||0|0|137294|46636|9|7|
|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|6|14|3||0|0|15550822|2591959|6|1|
|sjfxjira|update cwd_user_attributes set user_id = :1 , directory_id = :2 , attribute_name = :3 , attribute_value = :4 , lower_attribute_value = :5 where id = :6|7|107|30||0|0|7|1|0|0|
|gift_mail|select t.* , tt.can_take_date , tt.shop_name , tt.take_shop_name , tt.take_employee_name , ta.recipients , ta.user_tel , concat ( ta.area , ta.address ) address , if ( t.trade_type = 3 , pl.id , it.barcode ) as barcode , if ( t.trade_type = 3 , pl.default_image_url , p.default_image_url ) as defaultimageurl from trade t left outer join trade_take tt on tt.trade_id = t.id left outer join trade_addr ta on ta.trade_id = t.id left outer join product p on p.id = t.product_id left outer join platform_product pl on pl.id = t.product_id left outer join inventory it on it.product_id = t.product_id and it.specification = t.specification where ( t.tenant_wechatapp_id = :1 ) order by create_time desc limit :2|7|18|4||0|0|98334|14721|140|20|
|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|7|13|3||0|0|93161|13854|7|1|
|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|8|18|4||0|0|53069|10975|2898|807|
|bespoke|select count ( * ) from bespoke.bespoke_trade where user_id = :1 and tenant_app_id = :2 and status <> :3|9|12|2||0|0|270324|30036|9|1|
|employee|select * from backlog where tenant_app_id = :1 and user_id = :2 and status in ( :3 , :4 ) and scene = :5 and expire_time >= :6 order by create_time desc limit :7|9|29|4||0|0|926847|102986|26|9|
|account|insert into `job_status_trace_log` ( `id` , `job_name` , `original_task_id` , `task_id` , `slave_id` , `source` , `execution_type` , `sharding_item` , `state` , `message` , `creation_time` ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 )|9|225|25||0|0|0|0|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_885278795660111872_885279553956712448 where vip_id = :1|9|46|6||0|0|3248626|361046|9|1|
|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|10|16|2||0|0|5530497|683891|824|137|
|erp_to_platform|insert into sync_log ( id , row_id , msg_id , tenant_id , tenant_app_id , busi_type , status , create_time , xml_data , remark ) values ( :1 , :2 , null , :3 , :4 , :5 , null , :6 , null , null )|10|252|29||0|0|0|0|0|0|
|user_service|select count ( * ) from tenant_user where tenant_app_id = :1 and shop_id = :2 and mobile_no is not null and mobile_no != :3|11|47|8||0|0|912661|146146|11|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|11|18|2||0|0|5746054|670816|249|46|
|platform|select `noteid` , `vendorid` , `detailindex` , `productname` , `productbarcode` , `category` , `salestype` , `quantity` , `amount` , `integral` , `productdesc` , `slid` , `paidamount` , `id` from `salesdetaillog` where `noteid` = :1 and `vendorid` = :2|11|27|6||0|0|718275|106815|30|5|
|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|11|41|11||0|0|337960|65252|4166|806|
|platform|select count ( 1 ) from coupondetail cd where getuid = :1 and ( couponstate = :2 or couponstate = :3 ) and date_format ( expirytime , :4 ) >= curdate ( )|11|28|5||0|0|3506481|318771|11|1|
|platform|update vendormember vm inner join ( select sum ( integral ) as integral , sum ( if ( integral > 0 , integral , 0 ) ) as hisintegral from integrallog where vendorid = :1 and memberid = :2 and isdeleted = :3 ) s on :4 = :5 set vm.integral = ifnull ( s.integral , :6 ) , vm.hisintegral = ifnull ( s.hisintegral , :7 ) , vm.updatetime = now ( ) where vendorid = :8 and memberid = :9|12|18|2||0|0|1402|1289|0|0|
|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.update_time >= :2 and cu.update_time <= :3 limit :4 offset :5|12|30|9||0|0|500101|303319|14929|4784|
|statistic|select tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.employee_user_id , tmp.employee_user_name , sum ( tmp.amount ) amount from ( select t.tenant_id , t.tenant_app_id , ifnull ( os.shop_id , '-1' ) shop_id , ifnull ( os.shop_name , '未知' ) shop_name , ifnull ( oe.employee_user_id , '-1' ) employee_user_id , if ( oe.employee_user_id = '-1' or oe.employee_user_id is null , :1 , oe.employee_user_name ) employee_user_name , t.amount from ( select mt.tenant_id , mt.tenant_app_id , mt.shop_id , mt.employee_user_id , count ( * ) amount from statistic.member mb left join statistic.member_extra mt on mb.id = mt.id where mb.tenant_app_id = :2 and mb.create_time <= :3 and mb.register_flag = :4 group by mt.tenant_id , mt.tenant_app_id , mt.shop_id , mt.employee_user_id ) t left join statistic.off_shop os on t.tenant_app_id = os.tenant_app_id and ( t.shop_id = os.dept_erp_id or t.shop_id = os.shop_id ) left join statistic.off_employee oe on t.tenant_app_id = oe.tenant_app_id and ( t.employee_user_id = oe.employee_erp_id or t.employee_user_id = oe.employee_user_id ) ) tmp group by tmp.tenant_id , tmp.tenant_app_id , tmp.shop_id , tmp.shop_name , tmp.employee_user_id , tmp.employee_user_name|12|35|5||0|0|18050332|3424714|8233|1398|
|qrcode_service|insert into qrcode_scan_log ( id , tenant_id , tenant_app_id , qrcode_id , from_id , from_type , open_id ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 )|13|148|27||0|0|0|0|0|0|
|account|select es.tenant_id , es.tenant_wechatapp_id tenant_app_id , es.sales_date , es.dept_erp_id , es.employee_erp_id erpemployeeid , sd.category_erp_id from tenant.erp_sales es left 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 es.tenant_wechatapp_id = :1 and es.create_time <= :2 and es.sales_status = :3 and es.is_sales = :4 and sd.sales_type = :5 order by es.id limit :6 offset :7|13|15|1||0|0|5490112|484274|61105|5000|
|account|select t.tenant_id , t.tenant_app_id , t.shop_id , ifnull ( t.user_id , -1 ) user_id , t.scene , t.busi_date , t.statistic_date , sum ( if ( t.status = 'expire_stopped' , 1 , 0 ) ) un_finish_amount , sum ( if ( t.status = 'finished' or t.status = :1 , :2 , :3 ) ) finish_amount from ( select bg.tenant_id , bg.tenant_app_id , ifnull ( em.shop_id , -1 ) shop_id , bg.user_id , bg.scene , date_format ( bg.expire_time , '%y-%m-%d' ) busi_date , date_format ( bg.finish_time , '%y-%m-%d%h' ) statistic_date , bg.status from employee.backlog bg left join employee.employee em on bg.tenant_app_id = em.tenant_app_id and bg.employee_id = em.employee_id where bg.tenant_app_id = :4 and bg.finish_time >= :5 and bg.finish_time <= :6 ) t group by t.tenant_id , t.tenant_app_id , t.shop_id , t.user_id , t.scene , t.busi_date , t.statistic_date limit :7 offset :8|14|479|46||0|0|431588118|35732346|64260|5000|
|payment|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|14|42|7||0|0|357702|25849|357702|25849|
|account|select id , tenant_id , tenant_app_id , account_type , owner_type , owner_id , balance , platform_balance , cumulation , status , create_time , update_time from account where tenant_app_id = :1 and account_type = :2 and owner_type = :3 and owner_id = :4|14|64|11||0|0|12|1|12|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 , is_give , writeoff_time from coupon_user where coupon_template_id = :1 and owner_id = :2|14|19|6||0|0|6562392|470108|4|4|
|account|select es.tenant_id , es.tenant_wechatapp_id tenant_app_id , es.sales_date , es.dept_erp_id , es.employee_erp_id erpemployeeid , sd.category_erp_id from tenant.erp_sales es left 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 es.tenant_wechatapp_id = :1 and es.create_time <= :2 and es.sales_status in ( :3 , :4 ) and es.is_sales = :5 and sd.sales_type = :6 order by es.id limit :7 offset :8|15|19|2||0|0|5765804|484271|71105|5000|
|sjfxjira|update clusteredjob set version = :1 , next_run = :2 where job_id = :3 and version = :4|16|353|29||0|0|16|1|0|0|
|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|16|31|4||0|0|1602948|519777|2487|822|
|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|16|90|8||0|0|920050|57553|0|0|
|tenant|select count ( 0 ) from erp_sales where tenant_id = :1 and tenant_wechatapp_id = :2 and sales_date >= :3 and employee_erp_id = :4 and sales_status = :5|17|32|3||0|0|3251653|191900|17|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|17|22|2||0|0|224949|13237|0|0|
|customer|commit|17|387|31||0|0|0|0|0|0|
|statistic|select bb.id , bb.user_id , mb.user_name , mb.mobile_no from statistic.base_backlog_member bb left join statistic.member mb on bb.tenant_app_id = mb.tenant_app_id and bb.user_id = mb.user_id where bb.tenant_app_id = :1 and bb.user_id > :2 order by bb.id limit :3 offset :4|17|22|2||0|0|7927218|879765|75602|5000|
|platform|select `typefullname` , `methodname` , `arguments` , `partition` , `offset` , `createtime` , `updatetime` , `retried` , `errormsg` , `id` from `pushlog` where `typefullname` = :1 and `methodname` = :2 and `arguments` = :3|18|26|3||0|0|4073665|242301|1|1|
|platform|select count ( 1 ) from `integrallog` where `vendorid` = :1 and `changefrom` = :2 and `changeid` = :3|18|30|3||0|0|469567|37721|18|1|
|order|select tenant_wechatapp_id from order_info where status = :1 and child_status is null group by tenant_wechatapp_id|19|69|5||0|0|850066|44800|81|6|
|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 )|20|180|15||0|0|2043977|167713|18|1|
|activity_service|select id , tenant_id , tenant_app_id , activity_id , user_id , tenant_app_open_id , customize_page_id , qualitied_id , status , remark , create_time , update_time from intelligent_marketing_activity_gift where `status` = :1 limit :2 , :3|21|34|4||0|0|2500239|119059|0|0|
|payment|insert into `job_status_trace_log` ( `id` , `job_name` , `original_task_id` , `task_id` , `slave_id` , `source` , `execution_type` , `sharding_item` , `state` , `message` , `creation_time` ) values ( :1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 )|23|354|25||0|0|0|0|0|0|
|facepass_sync|commit|24|495|30||0|0|0|0|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|27|72|12||0|0|7668516|751983|1480|155|
|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|29|73|10||0|0|13472147|470046|15|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 )|31|44|2||0|0|19492806|628803|17|5|
|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|32|140|8||0|0|2157165|69673|32|1|
|authorization_service|commit|35|605|30||0|0|0|0|0|0|
|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|35|75|7||0|0|2359515|199692|172382|5000|
|statistic|select id , timestampdiff ( year , solar_birthday , '2019-08-0523:59:59.001' ) age from member where tenant_app_id = :1 and birthday_month_day = :2 limit :3 offset :4|38|95|16||0|0|4665791|361046|3835|720|
|qrcode_service|select *from qrcode_service.qrcode_scan_log where open_id = :1 and tenant_app_id = :2 order by create_time desc limit :3|46|64|5||0|0|42962245|939016|34|1|
|platform|select count ( 1 ) from `salesdetaillog` where `vendorid` = :1 and `noteid` = :2|47|87|5||0|0|2621716|106879|47|1|
|user_service|commit|48|719|30||0|0|0|0|0|0|
|erp_sync|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|50|96|3||0|0|256716|5214|256716|5214|
|account|select tu.id , tu.tenant_id tenantid , tu.tenant_wechatapp_id tenantappid , tu.member_erp_id memberuserid , tu.user_name username , tu.mobile_no mobileno , tu.create_time tempcreatetime , '2019-08-0709:59:59.0' updatetime , tu.dept_erp_id shopid , ifnull ( tu.consumption_integral , 0 ) consumptionintegral , tu.grade_erp_id gradeerpid , tu.employee_erp_id employeeuserid , 'unknow' sourcetype from user_service.erp_member tu left join user_service.tenant_user us on tu.tenant_wechatapp_id = us.tenant_app_id and tu.member_erp_id = us.erp_member_id where tu.tenant_wechatapp_id = :1 and tu.create_time <= :2 and us.id is null order by tu.id limit :3 offset :4|58|79|6||0|0|30728403|803024|283098|5000|
|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|59|227|20||0|0|9476283|1436305|7644|919|
|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|65|127|18||0|0|100496916|1549713|1595|317|
|position|commit|70|1192|30||0|0|0|0|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 ( 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|87|111|2||0|0|134513989|1549723|994|258|
|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|113|337|15||0|0|20319|608|0|0|
|facepass_sync|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|117|331|4||0|0|600798|5259|600798|5259|
|account|select original_task_id from job_status_trace_log where task_id = :1 and state = :2|140|409|5||0|0|719102|5214|719102|5214|
