标签:pen lin activity 投资 begin fas count call maker
5.ELF上市活动
delimiter $$
DROP PROCEDURE IF EXISTS pro_act_fee_18 ;
CREATE PROCEDURE pro_act_fee_18()
begin
DECLARE var_fcounter_id varchar(50);
DECLARE var_fid varchar(50);
DECLARE var_fcoin_id varchar(50);
DECLARE var_fcount decimal(60,30);
DECLARE var_fassert_id varchar(50);
declare cur_fee select fcounter_id,fid,fcoin_id
from ac_asset_change_bb_centre where ftype=‘deal_acquire‘
and fid in ( select fid from ac_exchange_bb_center
where fmaker_user_id !=ftaker_user_id
and ftime>=‘2018-12-18 00:00:00‘ and ftime<=‘2018-12-18 23:59:59‘ );
open cur_fee;
FETCH cur_fee INTO var_fcounter_id,var_fid,var_fcoin_id ;
update ac_asset_bb_centre set fcount=fcount*1.2
where fcounter_id=var_fcounter_id and fuser_id=var_fid and fcoin_id=var_fcoin_id;
declare cur_fee_sub select fcount,fid from ac_asset_bb_centre
where fcounter_id=var_fcounter_id and fuser_id=var_fid and fcoin_id=var_fcoin_id;
open cur_fee_sub:
FETCH cur_fee_sub INTO var_fcount,var_fassert_id ;
INSERT INTO `assets_core`.`ac_asset_change_bb_centre`
(`fid`, `fassert_id`, `fcounter_id`, `fuser_id`, `fcoin_id`, `fcount`, `ftype`, `fside`,
`ftime`, `flabel`, `fee`, `fstate`, `flock_count`, `fasset_change_id`)
VALUES (CEILING(RAND()*8888888888888+88888888888888888), var_fassert_id, ‘2‘, var_fid, var_fcoin_id, var_fcount,
‘2018-12-18 activity‘, 0, now(), ‘空投资产‘, 0.000000000000000000000000000000, ‘1‘, 0, NULL);
insert into mypro.pro_act_fee_18 select var_fid,var_fcounter_id,var_fcoin_id ;
end;
$$
DELIMITER ;
call pro_act_fee_18();
update ac_asset_bb_centre set fcount=100.000000000000000000000000000000 where fuser_id in (‘8.888895959301134e16‘,‘8.888910392747178e16‘,‘8.888915328173198e16‘,‘8.888955456709758e16‘)
select * from ac_asset_bb_centre where fuser_id in (‘8.888895959301134e16‘,‘8.888910392747178e16‘,‘8.888915328173198e16‘,‘8.888955456709758e16‘)
select * from `assets_core`.`ac_asset_change_bb_centre` where fid in (‘8.888895959301134e16‘,‘8.888910392747178e16‘,‘8.888915328173198e16‘,‘8.888955456709758e16‘)
delete from `assets_core`.`ac_asset_change_bb_centre` where fid in (‘8.888895959301134e16‘,‘8.888910392747178e16‘,‘8.888915328173198e16‘,‘8.888955456709758e16‘)
select * from mypro.pro_act_fee_18
delete from mypro.pro_act_fee_18
标签:pen lin activity 投资 begin fas count call maker
原文地址:https://www.cnblogs.com/liang545621/p/10122692.html