select
(case when price_input is null then price else price_input end) price
from coin_price
where date = #{date}
当price_input为空的话,将price的值给price_input
SELECT a, b, c, d, ( CASE WHEN (#{realLevel} = 1) THEN c.`max_withdraw_kyc1` WHEN (#{realLevel} = 2) THEN c.`max_withdraw_kyc2` WHEN (#{realLevel} = 3) THEN c.`max_withdraw_kyc3` ELSE 0 END ) e FROM table