函数中不能用动态SQL语句,只能用if else 或case when 判断了。