CREATE DEFINER=`root`@`localhost` FUNCTION `f1`(`salary` decimal) RETURNS decimal(10,2)
BEGIN
#Routine body goes here...
DECLARE temp DECIMAL;
DECLARE tax DECIMAL;
SET temp=salary-3500;
case
WHEN temp<=0 THEN set tax=0;
WHEN temp<=1500 AND temp>0 then SET tax=temp*0.03-0;
WHEN temp<=4500 AND temp>1500 then SET tax=temp*0.1-105;
WHEN temp<=9000 AND temp>4500 then SET tax=temp*0.2-550;
WHEN temp<=35000 AND temp>9000 then SET tax=temp*0.25-1005;
WHEN temp<=55000 AND temp>35000 then SET tax=temp*0.3-2755;
WHEN temp<=80000 AND temp>550000 then SET tax=temp*0.35-5505;
ELSE
set tax=temp*0.45-13505;
END case;
return tax;
END
JAVA实现个人所得税
最新推荐文章于 2022-11-14 19:40:27 发布