msyql 触发器语法问题 ,下面语法报错了,问题出在if语句上

create trigger i_daily
before insert on  Daily_record
for each row begin
 select 
cooperation_mode_id,income_ratio into @cooperation_mode_id,@income_ratio
from 
Promotion_package where promotion_package_id=new.promotion_package_id;
end

if @cooperation_mode_id = 1 then
    set new.income=new.pay_all*@income_ratio;
elseif @cooperation_mode_id = 2 then
    set new.income=new.added_number*@income_ratio;
end if;
end

想问问到大佬们怎么改这个语法

create trigger i_daily on Daily_record for insert
as
begin
select cooperation_mode_id,income_ratio into @cooperation_mode_id,@income_ratio from Promotion_package where promotion_package_id=new.promotion_package_id;
end