mysql ifnull并且同时判断空字符

SELECT
ifnull(if(length(trim(字段))>0,字段,null),'1') num
FROM `tableName`
WHERE 1 = 1
and `id` = 'id'